summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/trace/reader/m5_reader.cc2
-rw-r--r--cpu/trace/trace_cpu.cc7
2 files changed, 5 insertions, 4 deletions
diff --git a/cpu/trace/reader/m5_reader.cc b/cpu/trace/reader/m5_reader.cc
index d6ec7be50..a1ada38a2 100644
--- a/cpu/trace/reader/m5_reader.cc
+++ b/cpu/trace/reader/m5_reader.cc
@@ -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;
diff --git a/cpu/trace/trace_cpu.cc b/cpu/trace/trace_cpu.cc
index 6fdc32034..6122fc786 100644
--- a/cpu/trace/trace_cpu.cc
+++ b/cpu/trace/trace_cpu.cc
@@ -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