From: Andrew Bardsley Date: Wed, 3 Sep 2014 11:42:25 +0000 (-0400) Subject: sim: Fix checkpoint restore for Ticked X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87f6034462d06c7921ebe7f8e4ab78db5a09d319;p=gem5.git sim: Fix checkpoint restore for Ticked This patch makes restoring the 'lastStopped' value for Ticked-containing objects (including MinorCPU) optional so that Ticked-containing objects can be restored from non-Ticked-containing objects (such as AtomicSimpleCPU). --- diff --git a/src/sim/ticked_object.cc b/src/sim/ticked_object.cc index 22a149388..ef6ee1c20 100644 --- a/src/sim/ticked_object.cc +++ b/src/sim/ticked_object.cc @@ -82,9 +82,15 @@ Ticked::serialize(std::ostream &os) void Ticked::unserialize(Checkpoint *cp, const std::string §ion) { - uint64_t lastStoppedUint; + uint64_t lastStoppedUint = 0; - paramIn(cp, section, "lastStopped", lastStoppedUint); + /* lastStopped is optional on checkpoint restore as this object may be + * being restored from one which has a common base (and so possibly + * many common checkpointed values) but where Ticked is used in the + * checkpointed object but not this one. + * An example would be a CPU model using Ticked restores from a + * simple CPU without without Ticked */ + optParamIn(cp, section, "lastStopped", lastStoppedUint); lastStopped = Cycles(lastStoppedUint); }