inorder: user per-thread dummy insts/reqs
authorKorey Sewell <ksewell@umich.edu>
Sun, 31 Jan 2010 23:29:59 +0000 (18:29 -0500)
committerKorey Sewell <ksewell@umich.edu>
Sun, 31 Jan 2010 23:29:59 +0000 (18:29 -0500)
src/cpu/inorder/cpu.cc
src/cpu/inorder/cpu.hh
src/cpu/inorder/resource_pool.cc
src/cpu/inorder/resource_pool.hh

index b69fe2e3b3914e6dee9c6a78a374a161dbbc7dbf..4723173622dbc6ac9a105981a445c4014aa8c60c 100644 (file)
@@ -211,6 +211,7 @@ InOrderCPU::InOrderCPU(Params *params)
               "edit your workload size.");
     }
 
+    
     if (active_threads > 1) {
         threadModel = (InOrderCPU::ThreadModel) params->threadModel;
 
@@ -257,6 +258,9 @@ InOrderCPU::InOrderCPU(Params *params)
             Process* dummy_proc = params->workload[0];
             thread[tid] = new Thread(this, tid, dummy_proc);
         }
+        
+        // Eventually set this with parameters...
+        asid[tid] = tid;
 #endif
 
         // Setup the TC that will serve as the interface to the threads/CPU.
@@ -313,14 +317,24 @@ InOrderCPU::InOrderCPU(Params *params)
         isa[tid].clear();
 
         isa[tid].expandForMultithreading(numThreads, 1/*numVirtProcs*/);
+
+        // Define dummy instructions and resource requests to be used.
+        dummyInst[tid] = new InOrderDynInst(this, 
+                                            thread[tid], 
+                                            0, 
+                                            tid, 
+                                            asid[tid]);
+
+        dummyReq[tid] = new ResourceRequest(resPool->getResource(0), 
+                                            dummyInst[tid], 
+                                            0, 
+                                            0, 
+                                            0, 
+                                            0);        
     }
 
     lastRunningCycle = curTick;
 
-    // Define dummy instructions and resource requests to be used.
-    dummyInst = new InOrderDynInst(this, NULL, 0, 0);
-    dummyReq = new ResourceRequest(resPool->getResource(0), NULL, 0, 0, 0, 0);
-
     // Reset CPU to reset state.
 #if FULL_SYSTEM
     Fault resetFault = new ResetFault();
@@ -585,7 +599,7 @@ void
 InOrderCPU::trap(Fault fault, ThreadID tid, int delay)
 {
     //@ Squash Pipeline during TRAP
-    scheduleCpuEvent(Trap, fault, tid, dummyInst, delay);
+    scheduleCpuEvent(Trap, fault, tid, dummyInst[tid], delay);
 }
 
 void
@@ -747,7 +761,7 @@ InOrderCPU::deactivateContext(ThreadID tid, int delay)
 {
     DPRINTF(InOrderCPU,"[tid:%i]: Deactivating ...\n", tid);
 
-    scheduleCpuEvent(DeactivateThread, NoFault, tid, dummyInst, delay);
+    scheduleCpuEvent(DeactivateThread, NoFault, tid, dummyInst[tid], delay);
 
     // Be sure to signal that there's some activity so the CPU doesn't
     // deschedule itself.
@@ -830,7 +844,8 @@ InOrderCPU::activateContext(ThreadID tid, int delay)
 {
     DPRINTF(InOrderCPU,"[tid:%i]: Activating ...\n", tid);
 
-    scheduleCpuEvent(ActivateThread, NoFault, tid, dummyInst, delay);
+    
+    scheduleCpuEvent(ActivateThread, NoFault, tid, dummyInst[tid], delay);
 
     // Be sure to signal that there's some activity so the CPU doesn't
     // deschedule itself.
@@ -847,7 +862,7 @@ InOrderCPU::activateNextReadyContext(int delay)
     // NOTE: Add 5 to the event priority so that we always activate
     // threads after we've finished deactivating, squashing,etc.
     // other threads
-    scheduleCpuEvent(ActivateNextReadyThread, NoFault, 0/*tid*/, dummyInst, 
+    scheduleCpuEvent(ActivateNextReadyThread, NoFault, 0/*tid*/, dummyInst[0]
                      delay, 5);
 
     // Be sure to signal that there's some activity so the CPU doesn't
@@ -862,7 +877,7 @@ InOrderCPU::haltContext(ThreadID tid, int delay)
 {
     DPRINTF(InOrderCPU, "[tid:%i]: Calling Halt Context...\n", tid);
 
-    scheduleCpuEvent(HaltThread, NoFault, tid, dummyInst, delay);
+    scheduleCpuEvent(HaltThread, NoFault, tid, dummyInst[tid], delay);
 
     activityRec.activity();
 }
@@ -885,7 +900,7 @@ InOrderCPU::haltThread(ThreadID tid)
 void
 InOrderCPU::suspendContext(ThreadID tid, int delay)
 {
-    scheduleCpuEvent(SuspendThread, NoFault, tid, dummyInst, delay);
+    scheduleCpuEvent(SuspendThread, NoFault, tid, dummyInst[tid], delay);
 }
 
 void
index 6f1f3ee3f3fd15e47900b78b1e5817f21c3870ce..dc0164d8fbf36d46b0c079c78e08fb36a7eb5832 100644 (file)
@@ -97,6 +97,9 @@ class InOrderCPU : public BaseCPU
     /** CPU ID */
     int cpu_id;
 
+    // SE Mode ASIDs
+    ThreadID asid[ThePipeline::MaxThreads];
+
     /** Type of core that this is */
     std::string coreType;
 
@@ -241,10 +244,10 @@ class InOrderCPU : public BaseCPU
 
     /** Instruction used to signify that there is no *real* instruction in 
         buffer slot */
-    DynInstPtr dummyInst;
+    DynInstPtr dummyInst[ThePipeline::MaxThreads];
 
     /** Used by resources to signify a denied access to a resource. */
-    ResourceRequest *dummyReq;
+    ResourceRequest *dummyReq[ThePipeline::MaxThreads];
 
     /** Identifies the resource id that identifies a fetch
      * access unit.
index 3750d18d67f152e4ae1a90f2d406fd979fb97c8a..dd51242a3eacd60d209ac8634c52c6b83a2cfc48 100644 (file)
@@ -448,11 +448,6 @@ ResourcePool::updateAfterContextSwitch(DynInstPtr inst, ThreadID tid)
     }
 }
 
-ResourcePool::ResPoolEvent::ResPoolEvent(ResourcePool *_resPool)
-    : Event((Event::Priority)((unsigned)CPU_Tick_Pri+5)), resPool(_resPool),
-      eventType((InOrderCPU::CPUEventType) Default)
-{ }
-
 ResourcePool::ResPoolEvent::ResPoolEvent(ResourcePool *_resPool,
                                          InOrderCPU::CPUEventType e_type,
                                          DynInstPtr _inst,
index 3f62d2caafc333b0365a45b3991e63fb6155ccbd..f61fae4c82cb7eb1fed9e099a22ea22ce3b5f81f 100644 (file)
@@ -85,9 +85,6 @@ class ResourcePool {
         ThreadID tid;
 
       public:
-        /** Constructs a resource event. */
-        ResPoolEvent(ResourcePool *_resPool);
-
         /** Constructs a resource event. */
         ResPoolEvent(ResourcePool *_resPool,
                      InOrderCPU::CPUEventType e_type,