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.
This commit is contained in:
Ali Saidi
2011-02-11 18:29:35 -06:00
parent b7457fc11e
commit 59bf0e7eb4
2 changed files with 28 additions and 2 deletions

View File

@@ -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 *