summaryrefslogtreecommitdiff
path: root/src/sim/if.cc
diff options
context:
space:
mode:
authorbd <bdunaisky@umass.edu>2025-04-18 00:58:40 +0000
committerGitHub <noreply@github.com>2025-04-18 00:58:40 +0000
commit480181957b3f3dbcf7731023504c2cacc8d181ea (patch)
treee936781b52c6846d87c98381ed47bc7da7c43bff /src/sim/if.cc
parent62b9e280d5d0222710e491dcd28fe26bea915dcd (diff)
parent984ce6eef2e439955ff991f90c2b654be7c6c3f3 (diff)
Merge pull request #54 from bdunahu/bdunahu
The pipeline says some things and there are numbers
Diffstat (limited to 'src/sim/if.cc')
-rw-r--r--src/sim/if.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sim/if.cc b/src/sim/if.cc
index 1223149..bab2608 100644
--- a/src/sim/if.cc
+++ b/src/sim/if.cc
@@ -37,13 +37,14 @@ void IF::advance_helper()
int i;
signed int bits;
- if (this->curr_instr == nullptr) {
+ if (this->curr_instr == nullptr && (this->is_pipelined || this->is_empty)) {
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);
this->curr_instr->set_pc(this->pc);
+ this->is_empty = false;
}
}
}