From a3aae21d031c93ab1b9a90d435d9590dad2482c4 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Thu, 9 Mar 2006 03:27:51 -0500 Subject: last changes before big merge arch/alpha/isa_traits.hh: arch/sparc/isa_traits.hh: add nnpc for compiling purposes in exec_context setNextNPC function cpu/exec_context.hh: set NNPC function cpu/simple/cpu.cc: use NNPC in determining what PC we are using --HG-- extra : convert_revision : e810cfbc5dc31879b20d2cc40bf9871613203532 --- cpu/exec_context.hh | 6 ++++++ cpu/simple/cpu.cc | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'cpu') diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh index bc3551b4f..550a1ca23 100644 --- a/cpu/exec_context.hh +++ b/cpu/exec_context.hh @@ -422,6 +422,12 @@ class ExecContext regs.npc = val; } + 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 51d679a63..f1a3ebd0b 100644 --- a/cpu/simple/cpu.cc +++ b/cpu/simple/cpu.cc @@ -818,9 +818,17 @@ SimpleCPU::tick() #endif // FULL_SYSTEM } else { +#if THE_ISA != MIPS_ISA // go to the next instruction xc->regs.pc = xc->regs.npc; xc->regs.npc += sizeof(MachInst); +#else + // go to the next instruction + xc->regs.pc = xc->regs.npc; + xc->regs.npc = xc->regs.nnpc; + xc->regs.nnpc += sizeof(MachInst); +#endif + } #if FULL_SYSTEM -- cgit v1.2.3 From e30bce8f8e4fdb3dbf4f8161f496c94c85d3d8cf Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Thu, 9 Mar 2006 15:10:55 -0500 Subject: Use functions to access XC. cpu/exec_context.hh: Include readNextNPC function. cpu/simple/cpu.cc: Use functions to set and access nextPC, nextNPC. --HG-- extra : convert_revision : 22622b9c110e1d99cc9106a2a27c479579d7e1ad --- cpu/exec_context.hh | 5 +++++ cpu/simple/cpu.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'cpu') diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh index 550a1ca23..d6a3fef8b 100644 --- a/cpu/exec_context.hh +++ b/cpu/exec_context.hh @@ -422,6 +422,11 @@ class ExecContext regs.npc = val; } + uint64_t readNextNPC() + { + return regs.nnpc; + } + void setNextNPC(uint64_t val) { regs.nnpc = val; diff --git a/cpu/simple/cpu.cc b/cpu/simple/cpu.cc index f1a3ebd0b..c85154521 100644 --- a/cpu/simple/cpu.cc +++ b/cpu/simple/cpu.cc @@ -825,8 +825,8 @@ SimpleCPU::tick() #else // go to the next instruction xc->regs.pc = xc->regs.npc; - xc->regs.npc = xc->regs.nnpc; - xc->regs.nnpc += sizeof(MachInst); + xc->setNextPC(xc->readNextNPC()); + xc->setNextNPC(xc->readNextNPC() + sizeof(MachInst)); #endif } -- cgit v1.2.3