diff options
author | bd <bdunaisky@umass.edu> | 2025-04-01 02:12:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-01 02:12:15 +0000 |
commit | 6f536bd1bd1abab307c79d688c993e930cf7c250 (patch) | |
tree | 6132673f5aa85f2488d6f7de77fb33538b7320d3 /src/sim/stage.cc | |
parent | 44cb9d396b909c84ef7ad3338e0a12cfcc082748 (diff) | |
parent | 574212dafcf1c4bdb7d5e6aaa577b74345988d67 (diff) |
Merge pull request #45 from bdunahu/dev-sid
MEM WB stage
Diffstat (limited to 'src/sim/stage.cc')
-rw-r--r-- | src/sim/stage.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sim/stage.cc b/src/sim/stage.cc index 5b81e4c..be69d77 100644 --- a/src/sim/stage.cc +++ b/src/sim/stage.cc @@ -35,7 +35,7 @@ InstrDTO *Stage::advance(Response p) Response n; this->advance_helper(); - if (this->curr_instr != nullptr && p == OK) { + if (this->status == OK && this->curr_instr != nullptr && p == OK) { // mutual consent this->curr_instr->set_time_of(this->id, this->clock_cycle); r = new InstrDTO(*this->curr_instr); @@ -78,3 +78,11 @@ bool Stage::is_checked_out(signed int r) return std::find(this->checked_out.begin(), this->checked_out.end(), r) != this->checked_out.end(); } + +void Stage::squash(){ + this->curr_instr->set_mnemonic(NOP); + this->status = OK; + if(this->next){ + this->next->squash(); + } +} |