Simple CPU: Don't trace instructions that fault. Otherwise they show up twice.

--HG--
extra : convert_revision : 4446d9544d58bdadbd24d8322bb63016a32aa2b8
This commit is contained in:
Gabe Black 2007-08-26 20:29:09 -07:00
parent a51e2fd8bd
commit 24bfda0fdf
2 changed files with 20 additions and 2 deletions

View file

@ -618,13 +618,17 @@ AtomicSimpleCPU::tick()
preExecute();
if(curStaticInst)
{
if (curStaticInst) {
fault = curStaticInst->execute(this, traceData);
// keep an instruction count
if (fault == NoFault)
countInst();
else if (traceData) {
// If there was a fault, we should trace this instruction.
delete traceData;
traceData = NULL;
}
postExecute();
}

View file

@ -544,6 +544,10 @@ TimingSimpleCPU::completeIfetch(PacketPtr pkt)
// keep an instruction count
if (fault == NoFault)
countInst();
} else if (traceData) {
// If there was a fault, we shouldn't trace this instruction.
delete traceData;
traceData = NULL;
}
postExecute();
@ -556,6 +560,11 @@ TimingSimpleCPU::completeIfetch(PacketPtr pkt)
// keep an instruction count
if (fault == NoFault)
countInst();
else if (traceData) {
// If there was a fault, we shouldn't trace this instruction.
delete traceData;
traceData = NULL;
}
postExecute();
advanceInst(fault);
@ -628,6 +637,11 @@ TimingSimpleCPU::completeDataAccess(PacketPtr pkt)
// keep an instruction count
if (fault == NoFault)
countInst();
else if (traceData) {
// If there was a fault, we shouldn't trace this instruction.
delete traceData;
traceData = NULL;
}
if (pkt->isRead() && pkt->isLocked()) {
TheISA::handleLockedRead(thread, pkt->req);