From 302bbdc7ac18cd355f9f081cae202f5434427262 Mon Sep 17 00:00:00 2001 From: bd Date: Tue, 22 Apr 2025 23:39:14 -0400 Subject: Use a struct for InstrDTO --- src/if.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/if.cc') diff --git a/src/if.cc b/src/if.cc index 054c77c..fd795c7 100644 --- a/src/if.cc +++ b/src/if.cc @@ -27,7 +27,7 @@ InstrDTO *IF::advance(Response p) this->advance_helper(); if (this->curr_instr != nullptr && p == WAIT) { // don't increment PC if the PC was just set by wb - if (this->curr_instr->is_squashed() != 1) + if (this->curr_instr->is_squashed != 1) ++this->pc; r = new InstrDTO(*this->curr_instr); delete curr_instr; @@ -40,8 +40,8 @@ InstrDTO *IF::advance(Response p) std::vector IF::stage_info() { std::vector info; if(this->curr_instr){ - info.push_back(this->curr_instr->is_squashed()); - info.push_back(this->curr_instr->get_instr_bits()); + info.push_back(this->curr_instr->is_squashed); + info.push_back(this->curr_instr->slot_A); } return info; } @@ -57,8 +57,12 @@ void IF::advance_helper() r = i ? OK : STALLED; if (r == OK) { this->curr_instr = new InstrDTO(); - this->curr_instr->set_instr_bits(bits); - this->curr_instr->set_pc(this->pc); + this->curr_instr->slot_A = bits; + this->curr_instr->slot_B = this->pc; + this->curr_instr->type = INV; + this->curr_instr->is_squashed = 0; + this->curr_instr->checked_out = -1; + this->curr_instr->mnemonic = ADD; this->is_empty = false; } } -- cgit v1.2.3