summaryrefslogtreecommitdiff
path: root/src/if.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-22 23:39:14 -0400
committerbd <bdunahu@operationnull.com>2025-04-22 23:39:14 -0400
commit302bbdc7ac18cd355f9f081cae202f5434427262 (patch)
treea80693956999a39deece3130bbdee9a553babbb1 /src/if.cc
parent74b24d15eb1fe48a8e221a0bc061107d6b85d659 (diff)
Use a struct for InstrDTO
Diffstat (limited to 'src/if.cc')
-rw-r--r--src/if.cc14
1 files changed, 9 insertions, 5 deletions
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<int> IF::stage_info() {
std::vector<int> 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;
}
}