summaryrefslogtreecommitdiff
path: root/configs/common
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2008-02-28 20:39:01 -0500
committerAli Saidi <saidi@eecs.umich.edu>2008-02-28 20:39:01 -0500
commit3cb7df428cb303a043a535484b1a107b69ffbf44 (patch)
treedd719d95b8147a60409f2c4ffe8cc21fe2e96bb8 /configs/common
parent19dfde231764855df58c2ac183c012953daa32c6 (diff)
downloadgem5-3cb7df428cb303a043a535484b1a107b69ffbf44.tar.xz
Configs: Fix some bugs we introduced in the simpoints code
--HG-- extra : convert_revision : ef22c11cb3242903a484fc05dc0f96d3e5f9af72
Diffstat (limited to 'configs/common')
-rw-r--r--configs/common/Simulation.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py
index 9f3bf0cd9..8ed6d6def 100644
--- a/configs/common/Simulation.py
+++ b/configs/common/Simulation.py
@@ -51,7 +51,7 @@ def setCPUClass(options):
test_mem_mode = 'atomic'
if not atomic:
- if options.checkpoint_restore or options.fast_forward:
+ if options.checkpoint_restore != None or options.fast_forward:
CPUClass = TmpClass
class TmpClass(AtomicSimpleCPU): pass
else:
@@ -87,11 +87,14 @@ def run(options, root, testsys, cpu_class):
for i in xrange(np):
if options.fast_forward:
- testsys.cpu[i].max_insts_any_thread = options.fast_forward
+ testsys.cpu[i].max_insts_any_thread = int(options.fast_forward)
switch_cpus[i].system = testsys
if not m5.build_env['FULL_SYSTEM']:
switch_cpus[i].workload = testsys.cpu[i].workload
switch_cpus[i].clock = testsys.cpu[0].clock
+ # simulation period
+ if options.max_inst:
+ switch_cpus[i].max_insts_any_thread = options.max_inst
testsys.switch_cpus = switch_cpus
switch_cpu_list = [(testsys.cpu[i], switch_cpus[i]) for i in xrange(np)]
@@ -112,11 +115,11 @@ def run(options, root, testsys, cpu_class):
switch_cpus_1[i].clock = testsys.cpu[0].clock
# if restoring, make atomic cpu simulate only a few instructions
- if options.checkpoint_restore:
+ if options.checkpoint_restore != None:
testsys.cpu[i].max_insts_any_thread = 1
# Fast forward to specified location if we are not restoring
elif options.fast_forward:
- testsys.cpu[i].max_insts_any_thread = options.fast_forward
+ testsys.cpu[i].max_insts_any_thread = int(options.fast_forward)
# Fast forward to a simpoint (warning: time consuming)
elif options.simpoint:
if testsys.cpu[i].workload[0].simpoint == None:
@@ -147,7 +150,7 @@ def run(options, root, testsys, cpu_class):
switch_cpu_list1 = [(switch_cpus[i], switch_cpus_1[i]) for i in xrange(np)]
# set the checkpoint in the cpu before m5.instantiate is called
- if options.take_checkpoints and \
+ if options.take_checkpoints != None and \
(options.simpoint or options.at_instruction):
offset = int(options.take_checkpoints)
# Set an instruction break point
@@ -155,7 +158,7 @@ def run(options, root, testsys, cpu_class):
for i in xrange(np):
if testsys.cpu[i].workload[0].simpoint == None:
m5.panic('no simpoint for testsys.cpu[%d].workload[0]' % i)
- checkpoint_inst = testsys.cpu[i].workload[0].simpoint + offset
+ checkpoint_inst = int(testsys.cpu[i].workload[0].simpoint) + offset
testsys.cpu[i].max_insts_any_thread = checkpoint_inst
# used for output below
options.take_checkpoints = checkpoint_inst
@@ -166,11 +169,9 @@ def run(options, root, testsys, cpu_class):
for i in xrange(np):
testsys.cpu[i].max_insts_any_thread = offset
- testsys.cpu_switch_list = cpu_switch_list
-
m5.instantiate(root)
- if options.checkpoint_restore:
+ if options.checkpoint_restore != None:
from os.path import isdir, exists
from os import listdir
import re
@@ -190,11 +191,11 @@ def run(options, root, testsys, cpu_class):
print "Done."
elif options.simpoint:
# assume workload 0 has the simpoint
- if testsys.cpu[i].workload[0].simpoint == None:
+ if testsys.cpu[0].workload[0].simpoint == None:
m5.panic('Unable to find simpoint')
options.checkpoint_restore += \
- testsys.cpu[0].workload[0].simpoint
+ int(testsys.cpu[0].workload[0].simpoint)
checkpoint_dir = joinpath(cptdir, "cpt.%s.%d" % \
(options.bench, options.checkpoint_restore))
@@ -275,16 +276,12 @@ 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.
- if options.take_checkpoints:
- when, period = options.take_checkpoints.split(",", 1)
- when = int(when)
- period = int(period)
-
+ if options.take_checkpoints != None :
if options.at_instruction or options.simpoint:
- checkpoint_inst = when
+ checkpoint_inst = int(options.take_checkpoints)
# maintain correct offset if we restored from some instruction
- if options.checkpoint_restore:
+ if options.checkpoint_restore != None:
checkpoint_inst += options.checkpoint_restore
print "Creating checkpoint at inst:%d" % (checkpoint_inst)
@@ -305,6 +302,10 @@ def run(options, root, testsys, cpu_class):
if exit_event.getCause() == "user interrupt received":
exit_cause = exit_event.getCause();
else:
+ when, period = options.take_checkpoints.split(",", 1)
+ when = int(when)
+ period = int(period)
+
exit_event = m5.simulate(when)
while exit_event.getCause() == "checkpoint":
exit_event = m5.simulate(when - m5.curTick())