Fault
SimpleCPU::read(Addr addr, T &data, unsigned flags)
{
- if (status() == DcacheMissStall) {
+ if (status() == DcacheMissStall || status() == DcacheMissSwitch) {
Fault fault = xc->read(memReq,data);
if (traceData) {
traceData->setAddr(addr);
- if (fault == No_Fault)
- traceData->setData(data);
}
return fault;
}
// do functional access
fault = xc->read(memReq, data);
- if (traceData) {
- traceData->setAddr(addr);
- if (fault == No_Fault)
- traceData->setData(data);
- }
}
} else if(fault == No_Fault) {
// do functional access
fault = xc->read(memReq, data);
- if (traceData) {
- traceData->setAddr(addr);
- if (fault == No_Fault)
- traceData->setData(data);
- }
}
if (!dcacheInterface && (memReq->flags & UNCACHEABLE))
Fault
SimpleCPU::write(T data, Addr addr, unsigned flags, uint64_t *res)
{
- if (traceData) {
- traceData->setAddr(addr);
- traceData->setData(data);
- }
-
memReq->reset(addr, sizeof(T), flags);
// translate to physical address
case DcacheMissStall:
if (memReq->cmd.isRead()) {
curStaticInst->execute(this,traceData);
+ if (traceData)
+ traceData->finalize();
}
dcacheStallCycles += curTick - lastDcacheStall;
_status = Running;
case DcacheMissSwitch:
if (memReq->cmd.isRead()) {
curStaticInst->execute(this,traceData);
+ if (traceData)
+ traceData->finalize();
}
_status = SwitchedOut;
sampler->signalSwitched();
comLoadEventQueue[0]->serviceEvents(numLoad);
}
- if (traceData)
+ // If we have a dcache miss, then we can't finialize the instruction
+ // trace yet because we want to populate it with the data later
+ if (traceData &&
+ !(status() == DcacheMissStall && memReq->cmd.isRead())) {
traceData->finalize();
+ }
traceFunctions(xc->regs.pc);