sim-se: Add default to SyscallDesc constructor
[gem5.git] / src / sim / root.cc
index b8fadf19061348e160f7013856d0a77c31b37b4d..41adf1cf027b287bdba1138411d8fc8742637590 100644 (file)
  */
 
 #include "base/misc.hh"
+#include "base/trace.hh"
 #include "config/the_isa.hh"
 #include "debug/TimeSync.hh"
+#include "sim/eventq_impl.hh"
 #include "sim/full_system.hh"
 #include "sim/root.hh"
 
@@ -102,8 +104,9 @@ Root::timeSyncSpinThreshold(Time newThreshold)
     timeSyncEnable(en);
 }
 
-Root::Root(RootParams *p) : SimObject(p), _enabled(false),
-    _periodTick(p->time_sync_period), syncEvent(this)
+Root::Root(RootParams *p)
+    : SimObject(p), _enabled(false), _periodTick(p->time_sync_period),
+      syncEvent([this]{ timeSync(); }, name())
 {
     _period.setTick(p->time_sync_period);
     _spinThreshold.setTick(p->time_sync_spin_threshold);
@@ -111,55 +114,24 @@ Root::Root(RootParams *p) : SimObject(p), _enabled(false),
     assert(_root == NULL);
     _root = this;
     lastTime.setTimer();
-}
 
-void
-Root::initState()
-{
-    timeSyncEnable(params()->time_sync_enable);
+    simQuantum = p->sim_quantum;
 }
 
 void
-Root::loadState(Checkpoint *cp)
+Root::startup()
 {
-    SimObject::loadState(cp);
     timeSyncEnable(params()->time_sync_enable);
 }
 
 void
-Root::serialize(std::ostream &os)
+Root::serialize(CheckpointOut &cp) const
 {
-    uint64_t cpt_ver = gem5CheckpointVersion;
-    SERIALIZE_SCALAR(cpt_ver);
     SERIALIZE_SCALAR(FullSystem);
     std::string isa = THE_ISA_STR;
     SERIALIZE_SCALAR(isa);
 }
 
-void
-Root::unserialize(Checkpoint *cp, const std::string &section)
-{
-    uint64_t cpt_ver = 0;
-    UNSERIALIZE_OPT_SCALAR(cpt_ver);
-    if (cpt_ver < gem5CheckpointVersion) {
-        warn("**********************************************************\n");
-        warn("!!!! Checkpoint ver %#x is older than current ver %#x !!!!\n",
-                cpt_ver, gem5CheckpointVersion);
-        warn("You might experience some issues when restoring and should run "
-             "the checkpoint upgrader (util/cpt_upgrader.py) on your "
-             "checkpoint\n");
-        warn("**********************************************************\n");
-    } else if (cpt_ver > gem5CheckpointVersion) {
-        warn("**********************************************************\n");
-        warn("!!!! Checkpoint ver %#x is newer than current ver %#x !!!!\n",
-                cpt_ver, gem5CheckpointVersion);
-        warn("Running a new checkpoint with an older version of gem5 is not "
-             "supported. While it might work, you may experience incorrect "
-             "behavior or crashes.\n");
-        warn("**********************************************************\n");
-     }
-}
-
 
 bool FullSystem;
 unsigned int FullSystemInt;