This patch cleans up the CPU switching functionality by making sure
that CPU models consistently call the parent on switchOut() and
takeOverFrom(). This has the following implications that might alter
current functionality:
* The call to BaseCPU::switchout() in the O3 CPU is moved from
signalDrained() (!) to switchOut().
* A call to BaseSimpleCPU::switchOut() is introduced in the simple
CPUs.
setDrainState(Drainable::Drained);
- BaseCPU::switchOut();
-
if (drainManager) {
DPRINTF(Drain, "CPU done draining, processing drain event\n");
drainManager->signalDrainDone();
void
FullO3CPU<Impl>::switchOut()
{
+ BaseCPU::switchOut();
+
fetch.switchOut();
rename.switchOut();
iew.switchOut();
void
AtomicSimpleCPU::switchOut()
{
+ BaseSimpleCPU::switchOut();
+
assert(_status == BaseSimpleCPU::Running || _status == Idle);
_status = SwitchedOut;
void
AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
{
- BaseCPU::takeOverFrom(oldCPU);
+ BaseSimpleCPU::takeOverFrom(oldCPU);
assert(!tickEvent.scheduled());
void
TimingSimpleCPU::switchOut()
{
+ BaseSimpleCPU::switchOut();
+
assert(_status == BaseSimpleCPU::Running || _status == Idle);
_status = SwitchedOut;
numCycles += curCycle() - previousCycle;
void
TimingSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
{
- BaseCPU::takeOverFrom(oldCPU);
+ BaseSimpleCPU::takeOverFrom(oldCPU);
// if any of this CPU's ThreadContexts are active, mark the CPU as
// running and schedule its tick event.