summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/cpu_exec_context.hh11
-rw-r--r--cpu/simple/cpu.cc8
2 files changed, 19 insertions, 0 deletions
diff --git a/cpu/cpu_exec_context.hh b/cpu/cpu_exec_context.hh
index e2fbb2368..a5153e618 100644
--- a/cpu/cpu_exec_context.hh
+++ b/cpu/cpu_exec_context.hh
@@ -445,6 +445,17 @@ class CPUExecContext
regs.npc = val;
}
+ uint64_t readNextNPC()
+ {
+ return regs.nnpc;
+ }
+
+ void setNextNPC(uint64_t val)
+ {
+ regs.nnpc = val;
+ }
+
+
MiscReg readMiscReg(int misc_reg)
{
return regs.miscRegs.readReg(misc_reg);
diff --git a/cpu/simple/cpu.cc b/cpu/simple/cpu.cc
index fd0163677..8db72b77e 100644
--- a/cpu/simple/cpu.cc
+++ b/cpu/simple/cpu.cc
@@ -823,9 +823,17 @@ SimpleCPU::tick()
#endif // FULL_SYSTEM
}
else {
+#if THE_ISA != MIPS_ISA
// go to the next instruction
cpuXC->setPC(cpuXC->readNextPC());
cpuXC->setNextPC(cpuXC->readNextPC() + sizeof(MachInst));
+#else
+ // go to the next instruction
+ cpuXC->setPC(cpuXC->readNextPC());
+ cpuXC->setNextPC(cpuXC->readNextNPC());
+ cpuXC->setNextNPC(cpuXC->readNextNPC() + sizeof(MachInst));
+#endif
+
}
#if FULL_SYSTEM