From 4601230d35de7bbda5906d04a28e2387f0e5177b Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Wed, 3 May 2006 15:54:36 -0400 Subject: [PATCH] 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 --- cpu/simple/cpu.cc | 7 ++++--- 1 file 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; } -- 2.30.2