summaryrefslogtreecommitdiff
path: root/src/cpu/base_dyn_inst_impl.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2007-06-22 16:13:53 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2007-06-22 16:13:53 -0700
commited1db23b414a372a012d406d5a684775f00baa11 (patch)
tree1c706f022e2b84be0a01e5bc577075ba30276011 /src/cpu/base_dyn_inst_impl.hh
parent4d1bcbcd36e5735e76b38abb151de716c31a2272 (diff)
parent16c1b5484f576b6aebea9ab5ffab4ea64f080de0 (diff)
downloadgem5-ed1db23b414a372a012d406d5a684775f00baa11.tar.xz
Merge vm1.(none):/home/stever/bk/newmem-head
into vm1.(none):/home/stever/bk/newmem-cache2 --HG-- extra : convert_revision : aa50af3094f5d459f75b514179b6e3ec5e0bf1df
Diffstat (limited to 'src/cpu/base_dyn_inst_impl.hh')
-rw-r--r--src/cpu/base_dyn_inst_impl.hh55
1 files changed, 51 insertions, 4 deletions
diff --git a/src/cpu/base_dyn_inst_impl.hh b/src/cpu/base_dyn_inst_impl.hh
index 216cc08ea..5c18ae694 100644
--- a/src/cpu/base_dyn_inst_impl.hh
+++ b/src/cpu/base_dyn_inst_impl.hh
@@ -62,19 +62,66 @@ my_hash_t thishash;
#endif
template <class Impl>
-BaseDynInst<Impl>::BaseDynInst(TheISA::ExtMachInst machInst,
+BaseDynInst<Impl>::BaseDynInst(StaticInstPtr _staticInst,
Addr inst_PC, Addr inst_NPC,
+ Addr inst_MicroPC,
Addr pred_PC, Addr pred_NPC,
+ Addr pred_MicroPC,
InstSeqNum seq_num, ImplCPU *cpu)
- : staticInst(machInst, inst_PC), traceData(NULL), cpu(cpu)
+ : staticInst(_staticInst), traceData(NULL), cpu(cpu)
{
seqNum = seq_num;
+ bool nextIsMicro =
+ staticInst->isMicroop() && !staticInst->isLastMicroop();
+
PC = inst_PC;
- nextPC = inst_NPC;
- nextNPC = nextPC + sizeof(TheISA::MachInst);
+ microPC = inst_MicroPC;
+ if (nextIsMicro) {
+ nextPC = inst_PC;
+ nextNPC = inst_NPC;
+ nextMicroPC = microPC + 1;
+ } else {
+ nextPC = inst_NPC;
+ nextNPC = nextPC + sizeof(TheISA::MachInst);
+ nextMicroPC = 0;
+ }
+ predPC = pred_PC;
+ predNPC = pred_NPC;
+ predMicroPC = pred_MicroPC;
+ predTaken = false;
+
+ initVars();
+}
+
+template <class Impl>
+BaseDynInst<Impl>::BaseDynInst(TheISA::ExtMachInst inst,
+ Addr inst_PC, Addr inst_NPC,
+ Addr inst_MicroPC,
+ Addr pred_PC, Addr pred_NPC,
+ Addr pred_MicroPC,
+ InstSeqNum seq_num, ImplCPU *cpu)
+ : staticInst(inst, inst_PC), traceData(NULL), cpu(cpu)
+{
+ seqNum = seq_num;
+
+ bool nextIsMicro =
+ staticInst->isMicroop() && !staticInst->isLastMicroop();
+
+ PC = inst_PC;
+ microPC = inst_MicroPC;
+ if (nextIsMicro) {
+ nextPC = inst_PC;
+ nextNPC = inst_NPC;
+ nextMicroPC = microPC + 1;
+ } else {
+ nextPC = inst_NPC;
+ nextNPC = nextPC + sizeof(TheISA::MachInst);
+ nextMicroPC = 0;
+ }
predPC = pred_PC;
predNPC = pred_NPC;
+ predMicroPC = pred_MicroPC;
predTaken = false;
initVars();