changeset 82a4fa2d19a0 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=82a4fa2d19a0
description:
        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).

diffstat:

 src/sim/ticked_object.cc |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 4207f9bfcceb -r 82a4fa2d19a0 src/sim/ticked_object.cc
--- a/src/sim/ticked_object.cc  Wed Sep 03 07:42:22 2014 -0400
+++ b/src/sim/ticked_object.cc  Wed Sep 03 07:42:25 2014 -0400
@@ -82,9 +82,15 @@
 void
 Ticked::unserialize(Checkpoint *cp, const std::string &section)
 {
-    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);
 }
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to