Tracing now works for upto 4 threads. Easy change to get it to work for more, but...
authorErik Hallnor <ehallnor@umich.edu>
Tue, 8 Jun 2004 23:52:49 +0000 (19:52 -0400)
committerErik Hallnor <ehallnor@umich.edu>
Tue, 8 Jun 2004 23:52:49 +0000 (19:52 -0400)
cpu/trace/reader/m5_reader.cc:
    Add thread num.
cpu/trace/trace_cpu.cc:
    Increase thread count to 4, might want to make this a parameter (but it only really costs us storage).

--HG--
extra : convert_revision : 97cd7843668a3ef85aad06e3180dc04d2ca30ac1

cpu/trace/reader/m5_reader.cc
cpu/trace/trace_cpu.cc

index d6ec7be50527feeb883b276b9c4ef4eb081bda23..a1ada38a2b4852df989fbc5147e1a047636f6021 100644 (file)
@@ -61,6 +61,8 @@ M5Reader::getNextReq(MemReqPtr &req)
         tmp_req = new MemReq();
         tmp_req->paddr = ref.paddr;
         tmp_req->asid = ref.asid;
+        // Assume asid == thread_num
+        tmp_req->thread_num = ref.asid;
         tmp_req->cmd = (MemCmdEnum)ref.cmd;
         tmp_req->size = ref.size;
         tmp_req->dest = ref.dest;
index 6fdc3203474a7267060409b1860ed661f32ae835..6122fc78666cfe851ebe8a5d3f6c303a4badfd38 100644 (file)
@@ -50,7 +50,7 @@ TraceCPU::TraceCPU(const string &name,
                    MemTraceReader *data_trace,
                    int icache_ports,
                    int dcache_ports)
-    : BaseCPU(name, 1), icacheInterface(icache_interface),
+    : BaseCPU(name, 4), icacheInterface(icache_interface),
       dcacheInterface(dcache_interface), instTrace(inst_trace),
       dataTrace(data_trace), icachePorts(icache_ports),
       dcachePorts(dcache_ports), outstandingRequests(0), tickEvent(this)
@@ -78,10 +78,10 @@ TraceCPU::tick()
 
     while (nextDataReq && (dataReqs < dcachePorts) &&
            curTick >= nextDataCycle) {
+        assert(nextDataReq->thread_num < 4 && "Not enough threads");
         if (dcacheInterface->isBlocked())
             break;
 
-        ++outstandingRequests;
         ++dataReqs;
         nextDataReq->time = curTick;
         nextDataReq->completionEvent =
@@ -92,6 +92,7 @@ TraceCPU::tick()
 
     while (nextInstReq && (instReqs < icachePorts) &&
            curTick >= nextInstCycle) {
+        assert(nextInstReq->thread_num < 4 && "Not enough threads");
         if (icacheInterface->isBlocked())
             break;
 
@@ -99,7 +100,6 @@ TraceCPU::tick()
         if (nextInstReq->cmd == Squash) {
             icacheInterface->squash(nextInstReq->asid);
         } else {
-            ++outstandingRequests;
             ++instReqs;
             nextInstReq->completionEvent =
                 new TraceCompleteEvent(nextInstReq, this);
@@ -124,7 +124,6 @@ TraceCPU::tick()
 void
 TraceCPU::completeRequest(MemReqPtr& req)
 {
-    --outstandingRequests;
 }
 
 void