Configs: Fix handling of maxtick and take_checkpoints
authorJoel Hestness <jthestness@gmail.com>
Tue, 9 Apr 2013 21:25:30 +0000 (16:25 -0500)
committerJoel Hestness <jthestness@gmail.com>
Tue, 9 Apr 2013 21:25:30 +0000 (16:25 -0500)
In Simulation.py, calls to m5.simulate(num_ticks) will run the simulated system
for num_ticks after the current tick. Fix calls to m5.simulate in
scriptCheckpoints() and benchCheckpoints() to appropriately handle the maxticks
variable.

configs/common/Simulation.py

index fc6ae0f5f03c2cfe906d7d8afc61fde510e9da5e..cecf030adcb521aa6445ef0106b1bf2d32970194 100644 (file)
@@ -183,7 +183,7 @@ def scriptCheckpoints(options, maxtick, cptdir):
         period = int(period)
         num_checkpoints = 0
 
-        exit_event = m5.simulate(when)
+        exit_event = m5.simulate(when - m5.curTick())
         exit_cause = exit_event.getCause()
         while exit_cause == "checkpoint":
             exit_event = m5.simulate(when - m5.curTick())
@@ -215,7 +215,7 @@ def scriptCheckpoints(options, maxtick, cptdir):
     return exit_event
 
 def benchCheckpoints(options, maxtick, cptdir):
-    exit_event = m5.simulate(maxtick)
+    exit_event = m5.simulate(maxtick - m5.curTick())
     exit_cause = exit_event.getCause()
 
     num_checkpoints = 0