summaryrefslogtreecommitdiff
path: root/src/sim/if.cc
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-04-12 13:04:10 -0400
committerGitHub <noreply@github.com>2025-04-12 13:04:10 -0400
commit561f7a6e6c24b05383b6db86b48125ee80a8355f (patch)
tree6acbfd27652c2b83686df93c21918a877a0451e8 /src/sim/if.cc
parentc9e35a8f3aa2047701e87a50f12b4bed23d5e7db (diff)
parent3ae113c7d6f1b6f46d8960b284837a44fbeb2e77 (diff)
Merge pull request #50 from bdunahu/bdunahu
Move storage to a separate git repository.
Diffstat (limited to 'src/sim/if.cc')
-rw-r--r--src/sim/if.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sim/if.cc b/src/sim/if.cc
index 85fb27f..4ab7f3e 100644
--- a/src/sim/if.cc
+++ b/src/sim/if.cc
@@ -26,10 +26,12 @@ InstrDTO *IF::advance(Response p)
void IF::advance_helper()
{
Response r;
+ int i;
signed int bits;
if (this->curr_instr == nullptr) {
- r = this->storage->read_word(this->id, this->pc, bits);
+ i = this->storage->read_word(this, this->pc, bits);
+ r = i ? OK : STALLED;
if (r == OK) {
this->curr_instr = new InstrDTO();
this->curr_instr->set_instr_bits(bits);