configs: clean up checkpoint code in Simulation.py

Small change to clean up some redundant code.
Should not have any functional impact.
This commit is contained in:
Steve Reinhardt 2010-08-17 05:17:06 -07:00
parent 5577048bcf
commit cfaddd5fd3

View file

@ -200,28 +200,18 @@ def run(options, root, testsys, cpu_class):
if not isdir(cptdir): if not isdir(cptdir):
fatal("checkpoint dir %s does not exist!", cptdir) fatal("checkpoint dir %s does not exist!", cptdir)
if options.at_instruction: if options.at_instruction or options.simpoint:
checkpoint_dir = joinpath(cptdir, "cpt.%s.%s" % \ inst = options.checkpoint_restore
(options.bench, options.checkpoint_restore)) if options.simpoint:
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 # assume workload 0 has the simpoint
if testsys.cpu[0].workload[0].simpoint == 0: if testsys.cpu[0].workload[0].simpoint == 0:
fatal('Unable to find simpoint') fatal('Unable to find simpoint')
inst += int(testsys.cpu[0].workload[0].simpoint)
options.checkpoint_restore += \ checkpoint_dir = joinpath(cptdir,
int(testsys.cpu[0].workload[0].simpoint) "cpt.%s.%s" % (options.bench, inst))
checkpoint_dir = joinpath(cptdir, "cpt.%s.%d" % \
(options.bench, options.checkpoint_restore))
if not exists(checkpoint_dir): if not exists(checkpoint_dir):
fatal("Unable to find checkpoint directory %s.%s", fatal("Unable to find checkpoint directory %s", checkpoint_dir)
options.bench, options.checkpoint_restore)
print "Restoring checkpoint ..." print "Restoring checkpoint ..."
m5.restoreCheckpoint(checkpoint_dir) m5.restoreCheckpoint(checkpoint_dir)