summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-05-03 15:54:36 -0400
committerKevin Lim <ktlim@umich.edu>2006-05-03 15:54:36 -0400
commit4601230d35de7bbda5906d04a28e2387f0e5177b (patch)
tree4c63ef05d4cfb8ce46505964127445e7dfa749ed
parent32a52949834a5524c67a5a8d697b7e769138dc0f (diff)
downloadgem5-4601230d35de7bbda5906d04a28e2387f0e5177b.tar.xz
Fixes for the sampler.
cpu/simple/cpu.cc: Sampler fixes. The status may be switched out when calling activate or suspend if there is a switchover during a quiesce. --HG-- extra : convert_revision : da026e75dfb86289484cf01c5b1ecd9b03a72bd3
-rw-r--r--cpu/simple/cpu.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpu/simple/cpu.cc b/cpu/simple/cpu.cc
index 8db72b77e..07f9d0dad 100644
--- a/cpu/simple/cpu.cc
+++ b/cpu/simple/cpu.cc
@@ -144,6 +144,7 @@ SimpleCPU::SimpleCPU(Params *p)
cpuXC = new CPUExecContext(this, /* thread_num */ 0, p->process,
/* asid */ 0);
#endif // !FULL_SYSTEM
+ cpuXC->setStatus(ExecContext::Suspended);
xcProxy = cpuXC->getProxy();
icacheInterface = p->icache_interface;
@@ -212,7 +213,7 @@ SimpleCPU::activateContext(int thread_num, int delay)
assert(thread_num == 0);
assert(cpuXC);
- assert(_status == Idle);
+ assert(_status == Idle || _status == SwitchedOut);
notIdleFraction++;
scheduleTickEvent(delay);
_status = Running;
@@ -225,7 +226,7 @@ SimpleCPU::suspendContext(int thread_num)
assert(thread_num == 0);
assert(cpuXC);
- assert(_status == Running);
+ assert(_status == Running || _status == SwitchedOut);
notIdleFraction--;
unscheduleTickEvent();
_status = Idle;
@@ -418,7 +419,7 @@ SimpleCPU::read(Addr addr, T &data, unsigned flags)
Fault fault = cpuXC->read(memReq,data);
if (traceData) {
- traceData->setAddr(addr);
+ traceData->setAddr(memReq->vaddr);
}
return fault;
}