An attempt to serialize the state of the micro code mechanism in the simple cpu.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 29 Oct 2006 09:04:50 +0000 (04:04 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 29 Oct 2006 09:04:50 +0000 (04:04 -0500)
src/cpu/simple/base.cc:
    Make a microcoded op start at the current micropc, rather than starting at 0.
src/cpu/thread_state.cc:
    Serialize the microPC and nextMicroPC

--HG--
extra : convert_revision : 5302215f17312ecef3ff4c6548acb05297ee4ff6

src/cpu/simple/base.cc
src/cpu/thread_state.cc

index cbb3980cbbf0c76e07969fe041153fd60be88f07..253d332432b9aeee4a61971a97d6ed098a6fdfc5 100644 (file)
@@ -401,13 +401,15 @@ BaseSimpleCPU::preExecute()
         StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->getTC()));
         if (instPtr->isMacroOp()) {
             curMacroStaticInst = instPtr;
-            curStaticInst = curMacroStaticInst->fetchMicroOp(0);
+            curStaticInst = curMacroStaticInst->
+                fetchMicroOp(thread->readMicroPC());
         } else {
             curStaticInst = instPtr;
         }
     } else {
         //Read the next micro op from the macro op
-        curStaticInst = curMacroStaticInst->fetchMicroOp(thread->readMicroPC());
+        curStaticInst = curMacroStaticInst->
+            fetchMicroOp(thread->readMicroPC());
     }
 
 
index c644ae8d75025d39900adfaadf729c19e92a6a7c..e6ebcc525eee0437de27f58c182df94f9bb84310 100644 (file)
@@ -62,6 +62,8 @@ ThreadState::serialize(std::ostream &os)
     // thread_num and cpu_id are deterministic from the config
     SERIALIZE_SCALAR(funcExeInst);
     SERIALIZE_SCALAR(inst);
+    SERIALIZE_SCALAR(microPC);
+    SERIALIZE_SCALAR(nextMicroPC);
 
 #if FULL_SYSTEM
     Tick quiesceEndTick = 0;
@@ -81,6 +83,8 @@ ThreadState::unserialize(Checkpoint *cp, const std::string &section)
     // thread_num and cpu_id are deterministic from the config
     UNSERIALIZE_SCALAR(funcExeInst);
     UNSERIALIZE_SCALAR(inst);
+    UNSERIALIZE_SCALAR(microPC);
+    UNSERIALIZE_SCALAR(nextMicroPC);
 
 #if FULL_SYSTEM
     Tick quiesceEndTick;