Changed makeExtMI to take a ThreadContext instead of a pc.
authorGabe Black <gblack@eecs.umich.edu>
Sat, 30 Sep 2006 06:55:21 +0000 (02:55 -0400)
committerGabe Black <gblack@eecs.umich.edu>
Sat, 30 Sep 2006 06:55:21 +0000 (02:55 -0400)
--HG--
extra : convert_revision : e5b200e4e053702fc703f44149d18ce48ac4eaa6

src/arch/alpha/utility.hh
src/arch/mips/utility.hh
src/cpu/checker/cpu_impl.hh
src/cpu/o3/fetch_impl.hh
src/cpu/ozone/front_end_impl.hh
src/cpu/simple/base.cc

index d3ccc04442df5767d8c9d22f514c73839be4a3c9..0304d1c3a382718a0f98b0c0cf55bb869bb57aa8 100644 (file)
 #include "arch/alpha/isa_traits.hh"
 #include "arch/alpha/regfile.hh"
 #include "base/misc.hh"
+#include "cpu/thread_context.hh"
 
 namespace AlphaISA
 {
 
     static inline ExtMachInst
-    makeExtMI(MachInst inst, const uint64_t &pc) {
+    makeExtMI(MachInst inst, ThreadContext * xc) {
 #if FULL_SYSTEM
         ExtMachInst ext_inst = inst;
-        if (pc && 0x1)
-            return ext_inst|=(static_cast<ExtMachInst>(pc & 0x1) << 32);
+        if (xc->readPC() && 0x1)
+            return ext_inst|=(static_cast<ExtMachInst>(xc->readPC() & 0x1) << 32);
         else
             return ext_inst;
 #else
index ae2fe1aea56ac73bc0efe378115320dbbced70ef..56689ba4d42bc821d966b7df12d13fd3b0e2099e 100644 (file)
@@ -35,6 +35,7 @@
 #include "arch/mips/types.hh"
 #include "base/misc.hh"
 #include "config/full_system.hh"
+#include "cpu/thread_context.hh"
 //XXX This is needed for size_t. We should use something other than size_t
 //#include "kern/linux/linux.hh"
 #include "sim/host.hh"
@@ -86,11 +87,11 @@ namespace MipsISA {
     }
 
     static inline ExtMachInst
-    makeExtMI(MachInst inst, const uint64_t &pc) {
+    makeExtMI(MachInst inst, ThreadContext * xc) {
 #if FULL_SYSTEM
         ExtMachInst ext_inst = inst;
-        if (pc && 0x1)
-            return ext_inst|=(static_cast<ExtMachInst>(pc & 0x1) << 32);
+        if (xc->readPC() && 0x1)
+            return ext_inst|=(static_cast<ExtMachInst>(xc->readPC() & 0x1) << 32);
         else
             return ext_inst;
 #else
index 81f97726c5c4bb5ebc20c34ae3fb5e3806046add..48458bb1aa32abfcdb1542dc6d9d035fe1269828 100644 (file)
@@ -200,7 +200,7 @@ Checker<DynInstPtr>::verify(DynInstPtr &completed_inst)
             validateInst(inst);
 
             curStaticInst = StaticInst::decode(makeExtMI(machInst,
-                                                         thread->readPC()));
+                                                         thread->getTC()));
 
 #if FULL_SYSTEM
             thread->setInst(machInst);
index 1e080181c72401dfd3df8f7036eeede64d913927..80e429ae9db9906165be6672506f2f9e3368297d 100644 (file)
@@ -1109,7 +1109,7 @@ DefaultFetch<Impl>::fetch(bool &status_change)
             inst = TheISA::gtoh(*reinterpret_cast<TheISA::MachInst *>
                         (&cacheData[tid][offset]));
 
-            ext_inst = TheISA::makeExtMI(inst, fetch_PC);
+            ext_inst = TheISA::makeExtMI(inst, cpu->tcBase(tid));
 
             // Create a new DynInst from the instruction fetched.
             DynInstPtr instruction = new DynInst(ext_inst, fetch_PC,
index 1b120460a24f274d8c41140dfdfdb82215f023a3..8a15378a76ca49a97cd35ca847a7be21d0ccb0b2 100644 (file)
@@ -842,7 +842,7 @@ FrontEnd<Impl>::getInstFromCacheline()
     // Get the instruction from the array of the cache line.
     inst = htog(*reinterpret_cast<MachInst *>(&cacheData[offset]));
 
-    ExtMachInst decode_inst = TheISA::makeExtMI(inst, PC);
+    ExtMachInst decode_inst = TheISA::makeExtMI(inst, tc);
 
     // Create a new DynInst from the instruction fetched.
     DynInstPtr instruction = new DynInst(decode_inst, PC, PC+sizeof(MachInst),
index f801b93fa164f83e288cc6ec2cbb9c7ddbacc40b..025314fcbaed9842b14927d8669c4a8c11852470 100644 (file)
@@ -396,7 +396,7 @@ BaseSimpleCPU::preExecute()
 
     // decode the instruction
     inst = gtoh(inst);
-    curStaticInst = StaticInst::decode(makeExtMI(inst, thread->readPC()));
+    curStaticInst = StaticInst::decode(makeExtMI(inst, thread->getTC()));
 
     traceData = Trace::getInstRecord(curTick, tc, curStaticInst,
                                      thread->readPC());