Tracing now works for upto 4 threads. Easy change to get it to work for more, but I don't have any test handy to test it.
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
This commit is contained in:
parent
5f4297e865
commit
e7c7c92184
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue