summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2010-08-17 05:17:06 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2010-08-17 05:17:06 -0700
commitcfaddd5fd348bfa6fb8e575d87ca75a05e04b3b0 (patch)
treef212a34f4a3e46c2412ed84a848e304c8d09931e /configs
parent5577048bcf1da7f569f055a323efe12535919313 (diff)
downloadgem5-cfaddd5fd348bfa6fb8e575d87ca75a05e04b3b0.tar.xz
configs: clean up checkpoint code in Simulation.py
Small change to clean up some redundant code. Should not have any functional impact.
Diffstat (limited to 'configs')
-rw-r--r--configs/common/Simulation.py30
1 files changed, 10 insertions, 20 deletions
diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py
index 0393b0dfa..8e1f84cdf 100644
--- a/configs/common/Simulation.py
+++ b/configs/common/Simulation.py
@@ -200,32 +200,22 @@ def run(options, root, testsys, cpu_class):
if not isdir(cptdir):
fatal("checkpoint dir %s does not exist!", cptdir)
- if options.at_instruction:
- checkpoint_dir = joinpath(cptdir, "cpt.%s.%s" % \
- (options.bench, options.checkpoint_restore))
+ if options.at_instruction or options.simpoint:
+ inst = options.checkpoint_restore
+ if options.simpoint:
+ # assume workload 0 has the simpoint
+ if testsys.cpu[0].workload[0].simpoint == 0:
+ fatal('Unable to find simpoint')
+ inst += int(testsys.cpu[0].workload[0].simpoint)
+
+ checkpoint_dir = joinpath(cptdir,
+ "cpt.%s.%s" % (options.bench, inst))
if not exists(checkpoint_dir):
fatal("Unable to find checkpoint directory %s", checkpoint_dir)
print "Restoring checkpoint ..."
m5.restoreCheckpoint(checkpoint_dir)
print "Done."
- elif options.simpoint:
- # assume workload 0 has the simpoint
- if testsys.cpu[0].workload[0].simpoint == 0:
- fatal('Unable to find simpoint')
-
- options.checkpoint_restore += \
- int(testsys.cpu[0].workload[0].simpoint)
-
- checkpoint_dir = joinpath(cptdir, "cpt.%s.%d" % \
- (options.bench, options.checkpoint_restore))
- if not exists(checkpoint_dir):
- fatal("Unable to find checkpoint directory %s.%s",
- options.bench, options.checkpoint_restore)
-
- print "Restoring checkpoint ..."
- m5.restoreCheckpoint(checkpoint_dir)
- print "Done."
else:
dirs = listdir(cptdir)
expr = re.compile('cpt\.([0-9]*)')