summaryrefslogtreecommitdiff
path: root/cpu/simple_cpu
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-12-09 14:21:38 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2003-12-09 14:21:38 -0800
commit5e360051cff91763b71a214e820d24ac22146988 (patch)
treea1e3a765ee793f9235c3e4cc0313ef225c688883 /cpu/simple_cpu
parentf13509e96803ab87e33c2c4f6277a29528012b9e (diff)
downloadgem5-5e360051cff91763b71a214e820d24ac22146988.tar.xz
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
Diffstat (limited to 'cpu/simple_cpu')
-rw-r--r--cpu/simple_cpu/simple_cpu.cc7
1 files changed, 6 insertions, 1 deletions
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)
+