Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/4740

Change subject: sim: Stop using loadState in the Root SimObject.
......................................................................

sim: Stop using loadState in the Root SimObject.

The primary difference between using loadState and letting the default
implementation of loadState call unserialize is that whether or not that code
is called is dependent on that object being associated with a section in the
checkpoint file being unserialized. Since there's always a "root" object,
there should always be a section for it in the checkpoint and those should be
equivalent.

This removes one custom implementation of the loadState function.

Change-Id: Ia674ccc18e141f38746e22ccfddc21475b1a0731
---
M src/sim/root.cc
M src/sim/root.hh
2 files changed, 6 insertions(+), 12 deletions(-)



diff --git a/src/sim/root.cc b/src/sim/root.cc
index f4aabad..c56029f 100644
--- a/src/sim/root.cc
+++ b/src/sim/root.cc
@@ -125,13 +125,6 @@
 }

 void
-Root::loadState(CheckpointIn &cp)
-{
-    SimObject::loadState(cp);
-    timeSyncEnable(params()->time_sync_enable);
-}
-
-void
 Root::serialize(CheckpointOut &cp) const
 {
     SERIALIZE_SCALAR(FullSystem);
@@ -141,7 +134,10 @@

 void
 Root::unserialize(CheckpointIn &cp)
-{}
+{
+    SimObject::unserialize(cp);
+    timeSyncEnable(params()->time_sync_enable);
+}


 bool FullSystem;
diff --git a/src/sim/root.hh b/src/sim/root.hh
index db207a7..f9cc6a7 100644
--- a/src/sim/root.hh
+++ b/src/sim/root.hh
@@ -103,15 +103,13 @@

     Root(Params *p);

- /** Schedule the timesync event at loadState() so that curTick is correct
-     */
-    void loadState(CheckpointIn &cp) override;
-
     /** Schedule the timesync event at initState() when not unserializing
      */
     void initState() override;

     void serialize(CheckpointOut &cp) const override;
+ /** Schedule the timesync event at unserialize() so that curTick is correct
+     */
     void unserialize(CheckpointIn &cp) override;
 };


--
To view, visit https://gem5-review.googlesource.com/4740
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia674ccc18e141f38746e22ccfddc21475b1a0731
Gerrit-Change-Number: 4740
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to