summaryrefslogtreecommitdiff
path: root/src/sim/root.cc
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2011-02-11 18:29:35 -0600
committerAli Saidi <Ali.Saidi@ARM.com>2011-02-11 18:29:35 -0600
commit59bf0e7eb41494b7de033aa4737da026adddc215 (patch)
treec87dde58ae9d7511d1d33935129e231f5d5d6aeb /src/sim/root.cc
parentb7457fc11e9c7433273f6a73785218f46fcbba3d (diff)
downloadgem5-59bf0e7eb41494b7de033aa4737da026adddc215.tar.xz
Timesync: Make sure timesync event is setup after curTick is unserialized
Setup initial timesync event in initState or loadState so that curTick has been updated to the new value, otherwise the event is scheduled in the past.
Diffstat (limited to 'src/sim/root.cc')
-rw-r--r--src/sim/root.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/sim/root.cc b/src/sim/root.cc
index 1dc9b6058..d51fcbda6 100644
--- a/src/sim/root.cc
+++ b/src/sim/root.cc
@@ -108,7 +108,18 @@ Root::Root(RootParams *p) : SimObject(p), _enabled(false),
assert(_root == NULL);
_root = this;
lastTime.setTimer();
- timeSyncEnable(p->time_sync_enable);
+}
+
+void
+Root::initState()
+{
+ timeSyncEnable(params()->time_sync_enable);
+}
+
+void
+Root::loadState(Checkpoint *cp)
+{
+ timeSyncEnable(params()->time_sync_enable);
}
Root *