Give TimeBuffer an ID that can be set. Necessary because InOrder uses generic stages...
authorKorey Sewell <ksewell@umich.edu>
Wed, 4 Mar 2009 18:16:49 +0000 (13:16 -0500)
committerKorey Sewell <ksewell@umich.edu>
Wed, 4 Mar 2009 18:16:49 +0000 (13:16 -0500)
src/base/timebuf.hh
src/cpu/inorder/cpu.cc
src/cpu/inorder/pipeline_stage.cc

index 348f7a673d410dcfbd4c69322f570809ad496b13..9f9fc32b587ac892337477d77b3a447085f76f7a 100644 (file)
@@ -43,6 +43,7 @@ class TimeBuffer
     int past;
     int future;
     int size;
+    int _id;
 
     char *data;
     std::vector<char *> index;
@@ -148,6 +149,8 @@ class TimeBuffer
             new (ptr) T;
             ptr += sizeof(T);
         }
+
+        _id = -1;
     }
 
     TimeBuffer()
@@ -162,6 +165,16 @@ class TimeBuffer
         delete [] data;
     }
 
+    void id(int id)
+    {
+        _id = id;
+    }
+
+    int id()
+    {
+        return _id;
+    }
+
     void
     advance()
     {
index 94a6efce90555df7490df20cceea6525d835da43..1836989af92c8ee0a4c344817d81b22e7a83f5c2 100644 (file)
@@ -230,11 +230,9 @@ InOrderCPU::InOrderCPU(Params *params)
     }
 
     // Initialize TimeBuffer Stage Queues
-    // For now just have these time buffers be pretty big.
-    // @note: This could be statically allocated but changes
-    // would have to be made to the standard time buffer class.
     for (int stNum=0; stNum < NumStages - 1; stNum++) {
         stageQueue[stNum] = new StageQueue(NumStages, NumStages);
+        stageQueue[stNum]->id(stNum);
     }
 
 
index 547b42537e72252cfcd1fb8c455ce6585beeaf08..f356c0e1ac131b3009067deb8eac5295e08d8517 100644 (file)
@@ -556,8 +556,8 @@ PipelineStage::sortInsts()
     if (prevStageValid) {
         int insts_from_prev_stage = prevStage->size;
 
-        DPRINTF(InOrderStage, "%i insts available from previous stage.\n",
-                insts_from_prev_stage);
+        DPRINTF(InOrderStage, "%i insts available from stage buffer %i.\n",
+                insts_from_prev_stage, prevStageQueue->id());
 
         for (int i = 0; i < insts_from_prev_stage; ++i) {
 
@@ -985,8 +985,9 @@ PipelineStage::sendInstToNextStage(DynInstPtr inst)
                     tid, cpu->pipelineStage[next_stage]->stageBufferAvail());
 
             DPRINTF(InOrderStage, "[tid:%u]: [sn:%i]: being placed into  "
-                    "index %i stage %i queue.\n",
-                    tid, inst->seqNum, toNextStageIndex, inst->nextStage);
+                    "index %i of stage buffer %i queue.\n",
+                    tid, inst->seqNum, toNextStageIndex,
+                    cpu->pipelineStage[prev_stage]->nextStageQueue->id());
 
             int next_stage_idx = cpu->pipelineStage[prev_stage]->nextStage->size;