From 8e56373a5436852fe9c7934e03d7b57493625003 Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 30 Mar 2025 00:28:55 -0400 Subject: Minor simplification to API between pipeline components --- src/sim/if.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/sim/if.cc') 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() -- cgit v1.2.3