summaryrefslogtreecommitdiff
path: root/configs/common
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-08-21 05:48:52 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-08-21 05:48:52 -0400
commit4ebefc145adf818f8695c36a36daacca99f59eb8 (patch)
tree6bf38b00c997fc468d4d232f295233e086da64ae /configs/common
parent0160d51483b08494c6062e12da15f763d6a8b06f (diff)
downloadgem5-4ebefc145adf818f8695c36a36daacca99f59eb8.tar.xz
Checkpoint: Fix broken checkpointing functionality
This patch fixes the checkpointing by ensuring that the directory is passer to the scriptCheckpoints function, and that the num_checkpoints is not used before it is initialised.
Diffstat (limited to 'configs/common')
-rw-r--r--configs/common/Simulation.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py
index 0c399e9b7..568b78322 100644
--- a/configs/common/Simulation.py
+++ b/configs/common/Simulation.py
@@ -153,7 +153,7 @@ def findCptDir(options, maxtick, cptdir, testsys):
return maxtick, checkpoint_dir
-def scriptCheckpoints(options):
+def scriptCheckpoints(options, cptdir):
if options.at_instruction or options.simpoint:
checkpoint_inst = int(options.take_checkpoints)
@@ -180,6 +180,7 @@ def scriptCheckpoints(options):
when, period = options.take_checkpoints.split(",", 1)
when = int(when)
period = int(period)
+ num_checkpoints = 0
exit_event = m5.simulate(when)
exit_cause = exit_event.getCause()
@@ -192,7 +193,6 @@ def scriptCheckpoints(options):
num_checkpoints += 1
sim_ticks = when
- num_checkpoints = 0
max_checkpoints = options.max_checkpoints
while num_checkpoints < max_checkpoints and \
@@ -488,7 +488,7 @@ def run(options, root, testsys, cpu_class):
# subsequent periods of <period>. Checkpoint instructions
# received from the benchmark running are ignored and skipped in
# favor of command line checkpoint instructions.
- exit_cause = scriptCheckpoints(options)
+ exit_cause = scriptCheckpoints(options, cptdir)
else:
if options.fast_forward:
m5.stats.reset()