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/id.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/sim/id.cc') diff --git a/src/sim/id.cc b/src/sim/id.cc index da7b55c..969cb9d 100644 --- a/src/sim/id.cc +++ b/src/sim/id.cc @@ -8,22 +8,24 @@ ID::ID(Stage *stage) : Stage(stage) { this->id = DCDE; } -Response ID::advance(InstrDTO &next_instr, Response p) +InstrDTO *ID::advance(Response p) { + InstrDTO *r = nullptr; Response n; this->advance_helper(); if (this->status == OK && p == OK) { - // mutual consent + // mutual consent 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; } n = (p != OK || this->status != OK) ? BLOCKED : OK; // the power of consent - n = this->next->advance(*curr_instr, n); - return this->status; + this->curr_instr = this->next->advance(n); + return r; } void ID::get_instr_fields( -- cgit v1.2.3