summaryrefslogtreecommitdiff
path: root/src/sim/if.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-30 00:28:55 -0400
committerbd <bdunahu@operationnull.com>2025-03-30 00:28:55 -0400
commit8e56373a5436852fe9c7934e03d7b57493625003 (patch)
treefd61e2ed0419fea1d531c39d95df1986cd1c8bb5 /src/sim/if.cc
parentdf747f79abecc53e7ff696e020caf856746bad0d (diff)
Minor simplification to API between pipeline components
Diffstat (limited to 'src/sim/if.cc')
-rw-r--r--src/sim/if.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sim/if.cc b/src/sim/if.cc
index 3d53ad3..43132ed 100644
--- a/src/sim/if.cc
+++ b/src/sim/if.cc
@@ -6,17 +6,21 @@
IF::IF(Stage *stage) : Stage(stage) { this->id = FETCH; }
-Response IF::advance(InstrDTO &next_instr, Response p)
+InstrDTO *IF::advance(Response p)
{
+ InstrDTO *r = nullptr;
+
this->advance_helper();
if (this->status == OK && p == OK) {
// mutual consent
++this->pc;
this->curr_instr->set_time_of(this->id, this->clock_cycle);
- next_instr = *this->curr_instr;
+ r = new InstrDTO(*this->curr_instr);
+ delete curr_instr;
curr_instr = nullptr;
}
- return this->status;
+
+ return r;
}
void IF::advance_helper()