projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3aae21
)
Use functions to access XC.
author
Kevin Lim
<ktlim@umich.edu>
Thu, 9 Mar 2006 20:10:55 +0000
(15:10 -0500)
committer
Kevin Lim
<ktlim@umich.edu>
Thu, 9 Mar 2006 20:10:55 +0000
(15:10 -0500)
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
patch
|
blob
|
history
cpu/simple/cpu.cc
patch
|
blob
|
history
diff --git
a/cpu/exec_context.hh
b/cpu/exec_context.hh
index 550a1ca23592c23faf831e86cc29a05d12860f81..d6a3fef8b304745cce3d2bbba372698f259fb3aa 100644
(file)
--- 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 f1a3ebd0be66f30f6de4eb183e0d392710d5c4a3..c85154521efbf931526350b1604fbe5cc6b97ed9 100644
(file)
--- 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
}