diff options
author | Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> | 2025-03-31 13:45:56 -0400 |
---|---|---|
committer | Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> | 2025-03-31 13:45:56 -0400 |
commit | 598da346f59503442ba0b4badfd9ac8b58af4a89 (patch) | |
tree | 6f850061b9e89a93c30c8a6d7a699ffdc291e2ab /src/sim/stage.cc | |
parent | 44cb9d396b909c84ef7ad3338e0a12cfcc082748 (diff) |
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..26b6ee6 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 = nullptr; + this->status = OK; + if(this->next){ + this->next->squash(); + } +} |