summaryrefslogtreecommitdiff
path: root/src/sim/stage.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/stage.cc')
-rw-r--r--src/sim/stage.cc10
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();
+ }
+}