summaryrefslogtreecommitdiff
path: root/src/sim/dum.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-01 00:49:52 -0400
committerbd <bdunahu@operationnull.com>2025-04-01 00:49:52 -0400
commit6579f7272905d1e25b43ef051da6c2180e60ca2b (patch)
treea4b217aa56126f7d05304ab93f6c36b66fd6b694 /src/sim/dum.cc
parenta4e0e5ff6208205f6ebd980f9ed1eca91dcc4311 (diff)
Ensure all stages only do work if they are not 'OK'
Diffstat (limited to 'src/sim/dum.cc')
-rw-r--r--src/sim/dum.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/sim/dum.cc b/src/sim/dum.cc
index dd16660..76d4acd 100644
--- a/src/sim/dum.cc
+++ b/src/sim/dum.cc
@@ -9,13 +9,12 @@ DUM::DUM(Stage *stage) : Stage(stage) { this->id = IDLE; }
InstrDTO *DUM::advance(Response p)
{
- InstrDTO *r = curr_instr;
+ InstrDTO *r = nullptr;
- this->advance_helper();
- if (this->status == OK && p == OK) {
+ if (this->curr_instr && p == WAIT) {
this->curr_instr->set_time_of(this->id, this->clock_cycle);
r = new InstrDTO(*this->curr_instr);
- delete curr_instr;
+ delete this->curr_instr;
curr_instr = nullptr;
}
@@ -27,5 +26,4 @@ void DUM::advance_helper() {}
void DUM::set_curr_instr(InstrDTO *d)
{
this->curr_instr = d;
- this->status = OK;
}