aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/simulator.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/simulator.rs b/src/simulator.rs
index 503f902..dd851e5 100644
--- a/src/simulator.rs
+++ b/src/simulator.rs
@@ -281,7 +281,7 @@ impl<'a> Core<'a> {
match result {
Ok(value) => self.registers.write_word(inst.rd(), value),
Err(MemoryError::CacheMiss { stall_cycles }) => {
- self.stall = stall_cycles;
+ self.stall = stall_cycles - 1;
return; // don't increment PC
},
Err(MemoryError::InvalidAddress) => {
@@ -316,7 +316,7 @@ impl<'a> Core<'a> {
match result {
Ok(()) => (),
Err(MemoryError::CacheMiss { stall_cycles }) => {
- self.stall = stall_cycles;
+ self.stall = stall_cycles - 1;
return; // don't increment PC
},
Err(MemoryError::InvalidAddress) => {