diff options
author | bd <bdunahu@operationnull.com> | 2025-04-01 00:49:52 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-01 00:49:52 -0400 |
commit | 6579f7272905d1e25b43ef051da6c2180e60ca2b (patch) | |
tree | a4b217aa56126f7d05304ab93f6c36b66fd6b694 /src/sim/if.cc | |
parent | a4e0e5ff6208205f6ebd980f9ed1eca91dcc4311 (diff) |
Ensure all stages only do work if they are not 'OK'
Diffstat (limited to 'src/sim/if.cc')
-rw-r--r-- | src/sim/if.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/sim/if.cc b/src/sim/if.cc index fa8f6c2..bc40688 100644 --- a/src/sim/if.cc +++ b/src/sim/if.cc @@ -11,14 +11,13 @@ InstrDTO *IF::advance(Response p) InstrDTO *r = nullptr; this->advance_helper(); - if (this->curr_instr != nullptr && p == OK) { + if (this->curr_instr != nullptr && p == WAIT) { // mutual consent ++this->pc; this->curr_instr->set_time_of(this->id, this->clock_cycle); r = new InstrDTO(*this->curr_instr); delete curr_instr; curr_instr = nullptr; - this->status = STALLED; } return r; @@ -32,7 +31,6 @@ void IF::advance_helper() if (this->curr_instr == nullptr) { r = this->storage->read_word(this->id, this->pc, bits); if (r == OK) { - this->status = r; this->curr_instr = new InstrDTO(); this->curr_instr->set_instr_bits(bits); } |