Minor tweaks to make a switchover at tick N match
restarting from a checkpoint at tick N. cpu/simple_cpu/simple_cpu.cc: On a CPU switchover, schedule the new CPU's first tick event for curTick+1 instead of curTick. --HG-- extra : convert_revision : f0757d6f028214d36c1cff992db688fd6e8a6fdc
This commit is contained in:
parent
f13509e968
commit
5e360051cf
1 changed files with 6 additions and 1 deletions
|
@ -193,7 +193,11 @@ SimpleCPU::takeOverFrom(BaseCPU *oldCPU)
|
||||||
ExecContext *xc = execContexts[i];
|
ExecContext *xc = execContexts[i];
|
||||||
if (xc->status() == ExecContext::Active && _status != Running) {
|
if (xc->status() == ExecContext::Active && _status != Running) {
|
||||||
_status = Running;
|
_status = Running;
|
||||||
tickEvent.schedule(curTick);
|
// the CpuSwitchEvent has a low priority, so it's
|
||||||
|
// scheduled *after* the current cycle's tick event. Thus
|
||||||
|
// the first tick event for the new context should take
|
||||||
|
// place on the *next* cycle.
|
||||||
|
tickEvent.schedule(curTick+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -790,3 +794,4 @@ CREATE_SIM_OBJECT(SimpleCPU)
|
||||||
}
|
}
|
||||||
|
|
||||||
REGISTER_SIM_OBJECT("SimpleCPU", SimpleCPU)
|
REGISTER_SIM_OBJECT("SimpleCPU", SimpleCPU)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue