diff options
author | bd <bdunahu@operationnull.com> | 2025-03-31 23:51:08 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-31 23:51:08 -0400 |
commit | a4e0e5ff6208205f6ebd980f9ed1eca91dcc4311 (patch) | |
tree | b9530876cabcb9041b925d795778237757bc797f /src/sim/stage.cc | |
parent | 2235e18ad81be4ed7097cd9cab93e35a990ec327 (diff) | |
parent | 574212dafcf1c4bdb7d5e6aaa577b74345988d67 (diff) |
Merge remote-tracking branch 'origin/dev-sid' into bdunahu
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 11eb822..0f13d65 100644 --- a/src/sim/stage.cc +++ b/src/sim/stage.cc @@ -36,7 +36,7 @@ InstrDTO *Stage::advance(Response p) if (this->curr_instr && this->status != OK) this->advance_helper(); - if (this->curr_instr && p == OK) { + if (this->status == OK && p == OK && this->curr_instr) { // mutual consent this->curr_instr->set_time_of(this->id, this->clock_cycle); r = new InstrDTO(*this->curr_instr); @@ -79,3 +79,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(); + } +} |