summaryrefslogtreecommitdiff
path: root/src/sim/if.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/if.cc')
-rw-r--r--src/sim/if.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sim/if.cc b/src/sim/if.cc
index bab2608..6494912 100644
--- a/src/sim/if.cc
+++ b/src/sim/if.cc
@@ -12,8 +12,9 @@ InstrDTO *IF::advance(Response p)
this->advance_helper();
if (this->curr_instr != nullptr && p == WAIT) {
- // mutual consent
- ++this->pc;
+ // don't increment PC if the PC was just set by wb
+ if (this->curr_instr->is_squashed() != 1)
+ ++this->pc;
r = new InstrDTO(*this->curr_instr);
delete curr_instr;
curr_instr = nullptr;