changeset c122a3e1b204 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=c122a3e1b204
description:
        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:

 src/sim/root.cc |  13 ++++++++++++-
 src/sim/root.hh |  17 ++++++++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r 9aab11bcd84c -r c122a3e1b204 src/sim/root.cc
--- a/src/sim/root.cc   Wed Feb 09 22:27:37 2011 -0600
+++ b/src/sim/root.cc   Fri Feb 11 18:29:35 2011 -0600
@@ -108,7 +108,18 @@
     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 *
diff -r 9aab11bcd84c -r c122a3e1b204 src/sim/root.hh
--- a/src/sim/root.hh   Wed Feb 09 22:27:37 2011 -0600
+++ b/src/sim/root.hh   Fri Feb 11 18:29:35 2011 -0600
@@ -95,7 +95,22 @@
     /// 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__
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to