From: Steve Reinhardt Date: Tue, 9 Dec 2003 22:21:38 +0000 (-0800) Subject: Minor tweaks to make a switchover at tick N match X-Git-Tag: m5_1.0_beta2~244 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e360051cff91763b71a214e820d24ac22146988;p=gem5.git 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 --- diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index 476f28ea0..8b99a0105 100644 --- a/cpu/simple_cpu/simple_cpu.cc +++ b/cpu/simple_cpu/simple_cpu.cc @@ -193,7 +193,11 @@ SimpleCPU::takeOverFrom(BaseCPU *oldCPU) ExecContext *xc = execContexts[i]; if (xc->status() == ExecContext::Active && _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) +