summaryrefslogtreecommitdiff
path: root/src/sim/root.hh
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.hh
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.hh')
-rw-r--r--src/sim/root.hh17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/sim/root.hh b/src/sim/root.hh
index 2beced9d4..76a508c19 100644
--- a/src/sim/root.hh
+++ b/src/sim/root.hh
@@ -95,7 +95,22 @@ class Root : public SimObject
/// Set the threshold for time remaining to spin wait.
void timeSyncSpinThreshold(Time newThreshold);
- Root(RootParams *p);
+ typedef RootParams Params;
+ const Params *
+ params() const
+ {
+ return dynamic_cast<const Params *>(_params);
+ }
+
+ Root(Params *p);
+
+ /** Schedule the timesync event at loadState() so that curTick is correct
+ */
+ void loadState(Checkpoint *cp);
+
+ /** Schedule the timesync event at initState() when not unserializing
+ */
+ void initState();
};
#endif // __SIM_ROOT_HH__