summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2005-03-18 15:32:53 -0500
committerKevin Lim <ktlim@umich.edu>2005-03-18 15:32:53 -0500
commitcfa4221e19459d2179ba5601cf71a7a53753a3b1 (patch)
tree108c984e4fb9ef421557f610c210aa76c4dd70ed /cpu
parent363f02a1fd0a8ae8c91152ccde4453b934d7d3d4 (diff)
parent3efabb657948e53462bfe60ca93a2ac147074ea1 (diff)
downloadgem5-cfa4221e19459d2179ba5601cf71a7a53753a3b1.tar.xz
Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5 --HG-- extra : convert_revision : cbf8da2fe5c4155d9ed8318597d543ff105449d3
Diffstat (limited to 'cpu')
-rw-r--r--cpu/simple_cpu/simple_cpu.cc29
1 files changed, 10 insertions, 19 deletions
diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc
index 254c21b15..62bbb2fa8 100644
--- a/cpu/simple_cpu/simple_cpu.cc
+++ b/cpu/simple_cpu/simple_cpu.cc
@@ -393,13 +393,11 @@ template <class T>
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;
}
@@ -428,21 +426,11 @@ SimpleCPU::read(Addr addr, T &data, unsigned flags)
// 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))
@@ -498,11 +486,6 @@ template <class T>
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
@@ -602,6 +585,8 @@ SimpleCPU::processCacheCompletion()
case DcacheMissStall:
if (memReq->cmd.isRead()) {
curStaticInst->execute(this,traceData);
+ if (traceData)
+ traceData->finalize();
}
dcacheStallCycles += curTick - lastDcacheStall;
_status = Running;
@@ -610,6 +595,8 @@ SimpleCPU::processCacheCompletion()
case DcacheMissSwitch:
if (memReq->cmd.isRead()) {
curStaticInst->execute(this,traceData);
+ if (traceData)
+ traceData->finalize();
}
_status = SwitchedOut;
sampler->signalSwitched();
@@ -782,8 +769,12 @@ SimpleCPU::tick()
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);