O3: Add a pointer to the macroop for a microop in the dyninst.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 14 Aug 2011 11:08:14 +0000 (04:08 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 14 Aug 2011 11:08:14 +0000 (04:08 -0700)
src/cpu/base_dyn_inst.hh
src/cpu/base_dyn_inst_impl.hh
src/cpu/o3/dyn_inst.hh
src/cpu/o3/dyn_inst_impl.hh
src/cpu/o3/fetch_impl.hh

index cb9294481fb3950fb19dbe8e6cfae47dbd788325..a3d18bb248eecb2982cef8e2670c6174a1279ea2 100644 (file)
@@ -103,6 +103,7 @@ class BaseDynInst : public FastAlloc, public RefCounted
 
     /** The StaticInst used by this BaseDynInst. */
     StaticInstPtr staticInst;
+    StaticInstPtr macroop;
 
     ////////////////////////////////////////////
     //
@@ -378,13 +379,14 @@ class BaseDynInst : public FastAlloc, public RefCounted
      *  @param seq_num The sequence number of the instruction.
      *  @param cpu Pointer to the instruction's CPU.
      */
-    BaseDynInst(StaticInstPtr staticInst, TheISA::PCState pc,
-                TheISA::PCState predPC, InstSeqNum seq_num, ImplCPU *cpu);
+    BaseDynInst(StaticInstPtr staticInst, StaticInstPtr macroop,
+                TheISA::PCState pc, TheISA::PCState predPC,
+                InstSeqNum seq_num, ImplCPU *cpu);
 
     /** BaseDynInst constructor given a StaticInst pointer.
      *  @param _staticInst The StaticInst for this BaseDynInst.
      */
-    BaseDynInst(StaticInstPtr &_staticInst);
+    BaseDynInst(StaticInstPtr staticInst, StaticInstPtr macroop);
 
     /** BaseDynInst destructor. */
     ~BaseDynInst();
index bae0479124b56e732af260957fef20ef60d77da7..b2819bb26881a9c940a9fd47ffde3e28718714fb 100644 (file)
@@ -76,9 +76,10 @@ my_hash_t thishash;
 
 template <class Impl>
 BaseDynInst<Impl>::BaseDynInst(StaticInstPtr _staticInst,
+                               StaticInstPtr _macroop,
                                TheISA::PCState _pc, TheISA::PCState _predPC,
                                InstSeqNum seq_num, ImplCPU *cpu)
-  : staticInst(_staticInst), traceData(NULL), cpu(cpu)
+  : staticInst(_staticInst), macroop(_macroop), traceData(NULL), cpu(cpu)
 {
     seqNum = seq_num;
 
@@ -90,8 +91,9 @@ BaseDynInst<Impl>::BaseDynInst(StaticInstPtr _staticInst,
 }
 
 template <class Impl>
-BaseDynInst<Impl>::BaseDynInst(StaticInstPtr &_staticInst)
-    : staticInst(_staticInst), traceData(NULL)
+BaseDynInst<Impl>::BaseDynInst(StaticInstPtr _staticInst,
+                               StaticInstPtr _macroop)
+    : staticInst(_staticInst), macroop(_macroop), traceData(NULL)
 {
     seqNum = 0;
     initVars();
index dc2d32eac2ce3ba417f3cdbd3fa6fe7771c5d6d5..399240d69ad8bebc89a7deac5eb6a48953b859aa 100644 (file)
@@ -86,12 +86,12 @@ class BaseO3DynInst : public BaseDynInst<Impl>
 
   public:
     /** BaseDynInst constructor given a binary instruction. */
-    BaseO3DynInst(StaticInstPtr staticInst,
+    BaseO3DynInst(StaticInstPtr staticInst, StaticInstPtr macroop,
                   TheISA::PCState pc, TheISA::PCState predPC,
                   InstSeqNum seq_num, O3CPU *cpu);
 
     /** BaseDynInst constructor given a static inst pointer. */
-    BaseO3DynInst(StaticInstPtr &_staticInst);
+    BaseO3DynInst(StaticInstPtr _staticInst, StaticInstPtr _macroop);
 
     /** Executes the instruction.*/
     Fault execute();
index 44b35325369c4b6bd68e4e0aa6879b4819845560..eceb0b49f99565da1f794ab614b834771952f9f5 100644 (file)
 
 template <class Impl>
 BaseO3DynInst<Impl>::BaseO3DynInst(StaticInstPtr staticInst,
+                                   StaticInstPtr macroop,
                                    TheISA::PCState pc, TheISA::PCState predPC,
                                    InstSeqNum seq_num, O3CPU *cpu)
-    : BaseDynInst<Impl>(staticInst, pc, predPC, seq_num, cpu)
+    : BaseDynInst<Impl>(staticInst, macroop, pc, predPC, seq_num, cpu)
 {
     initVars();
 }
 
 template <class Impl>
-BaseO3DynInst<Impl>::BaseO3DynInst(StaticInstPtr &_staticInst)
-    : BaseDynInst<Impl>(_staticInst)
+BaseO3DynInst<Impl>::BaseO3DynInst(StaticInstPtr _staticInst,
+                                   StaticInstPtr _macroop)
+    : BaseDynInst<Impl>(_staticInst, _macroop)
 {
     initVars();
 }
index d186768d85e9fe96d396f82c40becc24165ad3ec..c635a1b305f74bbb212dcf8e1784b84b53f057e5 100644 (file)
@@ -1097,7 +1097,7 @@ DefaultFetch<Impl>::buildInst(ThreadID tid, StaticInstPtr staticInst,
 
     // Create a new DynInst from the instruction fetched.
     DynInstPtr instruction =
-        new DynInst(staticInst, thisPC, nextPC, seq, cpu);
+        new DynInst(staticInst, curMacroop, thisPC, nextPC, seq, cpu);
     instruction->setTid(tid);
 
     instruction->setASID(tid);