sim: Stop using loadState in the Root SimObject.
authorGabe Black <gabeblack@google.com>
Tue, 19 Sep 2017 00:35:00 +0000 (17:35 -0700)
committerGabe Black <gabeblack@google.com>
Thu, 21 Sep 2017 17:34:59 +0000 (17:34 +0000)
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
Reviewed-on: https://gem5-review.googlesource.com/4740
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/sim/root.cc
src/sim/root.hh

index f4aabad2e5151b23a98978fdb1973bfe8d64373d..41adf1cf027b287bdba1138411d8fc8742637590 100644 (file)
@@ -119,18 +119,11 @@ Root::Root(RootParams *p)
 }
 
 void
-Root::initState()
+Root::startup()
 {
     timeSyncEnable(params()->time_sync_enable);
 }
 
-void
-Root::loadState(CheckpointIn &cp)
-{
-    SimObject::loadState(cp);
-    timeSyncEnable(params()->time_sync_enable);
-}
-
 void
 Root::serialize(CheckpointOut &cp) const
 {
@@ -139,10 +132,6 @@ Root::serialize(CheckpointOut &cp) const
     SERIALIZE_SCALAR(isa);
 }
 
-void
-Root::unserialize(CheckpointIn &cp)
-{}
-
 
 bool FullSystem;
 unsigned int FullSystemInt;
index db207a77b87edb4072e87f8a699ab3a3cf5ea581..c5f42b807616acbe5fb93a2cf6dda326cc874993 100644 (file)
@@ -103,16 +103,11 @@ class Root : public SimObject
 
     Root(Params *p);
 
-    /** Schedule the timesync event at loadState() so that curTick is correct
+    /** Schedule the timesync event at startup().
      */
-    void loadState(CheckpointIn &cp) override;
-
-    /** Schedule the timesync event at initState() when not unserializing
-     */
-    void initState() override;
+    void startup() override;
 
     void serialize(CheckpointOut &cp) const override;
-    void unserialize(CheckpointIn &cp) override;
 };
 
 #endif // __SIM_ROOT_HH__