summaryrefslogtreecommitdiff
path: root/cpu/simple_cpu/simple_cpu.cc
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-10-23 21:52:46 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2003-10-23 21:52:46 -0700
commitcd6b6df581f554805a5a1388ccd78044d91a2663 (patch)
treef79d8fafd5373626635b7f81d4215b81bff5aec0 /cpu/simple_cpu/simple_cpu.cc
parentcc9a838f4c5a5bf5e8951bdb351fc7d4b74661fb (diff)
downloadgem5-cd6b6df581f554805a5a1388ccd78044d91a2663.tar.xz
A few minor fixes to sampling... seems to work now for the base case
of two CPUs and one switch-over event. Still some stats glitches though. cpu/simple_cpu/simple_cpu.cc: Schedule switched-to CPU right on curTick so we don't lose a cycle. Remember to switch out old CPU. --HG-- extra : convert_revision : f1bf21cac054c74f59770d8b20b30118f46be6f1
Diffstat (limited to 'cpu/simple_cpu/simple_cpu.cc')
-rw-r--r--cpu/simple_cpu/simple_cpu.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc
index c96e31cb0..41e3de24e 100644
--- a/cpu/simple_cpu/simple_cpu.cc
+++ b/cpu/simple_cpu/simple_cpu.cc
@@ -204,9 +204,11 @@ SimpleCPU::takeOverFrom(BaseCPU *oldCPU)
ExecContext *xc = execContexts[i];
if (xc->status() == ExecContext::Active && _status != Running) {
_status = Running;
- tickEvent.schedule(curTick + 1);
+ tickEvent.schedule(curTick);
}
}
+
+ oldCPU->switchOut();
}
@@ -772,7 +774,8 @@ CREATE_SIM_OBJECT(SimpleCPU)
cpu = new SimpleCPU(getInstanceName(), workload,
max_insts_any_thread, max_insts_all_threads,
max_loads_any_thread, max_loads_all_threads,
- icache->getInterface(), dcache->getInterface());
+ (icache) ? icache->getInterface() : NULL,
+ (dcache) ? dcache->getInterface() : NULL);
#endif // FULL_SYSTEM