From 598da346f59503442ba0b4badfd9ac8b58af4a89 Mon Sep 17 00:00:00 2001 From: Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> Date: Mon, 31 Mar 2025 13:45:56 -0400 Subject: MEM WB stage --- src/sim/stage.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/sim/stage.cc') 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(); + } +} -- cgit v1.2.3