summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorGeoffrey Blake <geoffrey.blake@arm.com>2012-03-09 09:59:27 -0500
committerGeoffrey Blake <geoffrey.blake@arm.com>2012-03-09 09:59:27 -0500
commit043709fdfab3b6c46f6ef95d1f642cd3c06ee20a (patch)
treeef8bab03f4260b67b57b00844d0245ca1e849ea0 /configs
parentdf05ffab1289b26aab2a0eb71ee55dcb7f42e5e9 (diff)
downloadgem5-043709fdfab3b6c46f6ef95d1f642cd3c06ee20a.tar.xz
CheckerCPU: Make CheckerCPU runtime selectable instead of compile selectable
Enables the CheckerCPU to be selected at runtime with the --checker option from the configs/example/fs.py and configs/example/se.py configuration files. Also merges with the SE/FS changes.
Diffstat (limited to 'configs')
-rw-r--r--configs/common/Options.py1
-rw-r--r--configs/common/Simulation.py8
-rw-r--r--configs/example/fs.py6
-rw-r--r--configs/example/se.py21
4 files changed, 25 insertions, 11 deletions
diff --git a/configs/common/Options.py b/configs/common/Options.py
index 5fd6177c9..f7514d086 100644
--- a/configs/common/Options.py
+++ b/configs/common/Options.py
@@ -31,6 +31,7 @@ parser.add_option("--cpu-type", type="choice", default="atomic",
choices = ["atomic", "timing", "detailed", "inorder",
"arm_detailed"],
help = "type of cpu to run with")
+parser.add_option("--checker", action="store_true");
parser.add_option("-n", "--num-cpus", type="int", default=1)
parser.add_option("--caches", action="store_true")
parser.add_option("--l2cache", action="store_true")
diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py
index 0ae287e77..b7c2c0fc0 100644
--- a/configs/common/Simulation.py
+++ b/configs/common/Simulation.py
@@ -129,6 +129,9 @@ def run(options, root, testsys, cpu_class):
# simulation period
if options.maxinsts:
switch_cpus[i].max_insts_any_thread = options.maxinsts
+ # Add checker cpu if selected
+ if options.checker:
+ switch_cpus[i].addCheckerCpu()
testsys.switch_cpus = switch_cpus
switch_cpu_list = [(testsys.cpu[i], switch_cpus[i]) for i in xrange(np)]
@@ -176,6 +179,11 @@ def run(options, root, testsys, cpu_class):
if options.maxinsts:
switch_cpus_1[i].max_insts_any_thread = options.maxinsts
+ # attach the checker cpu if selected
+ if options.checker:
+ switch_cpus[i].addCheckerCpu()
+ switch_cpus_1[i].addCheckerCpu()
+
testsys.switch_cpus = switch_cpus
testsys.switch_cpus_1 = switch_cpus_1
switch_cpu_list = [(testsys.cpu[i], switch_cpus[i]) for i in xrange(np)]
diff --git a/configs/example/fs.py b/configs/example/fs.py
index 19c1bd81f..b3d607a1b 100644
--- a/configs/example/fs.py
+++ b/configs/example/fs.py
@@ -152,8 +152,6 @@ test_sys.init_param = options.init_param
test_sys.cpu = [TestCPUClass(cpu_id=i) for i in xrange(np)]
-CacheConfig.config_cache(options, test_sys)
-
if bm[0]:
mem_size = bm[0].mem()
else:
@@ -171,6 +169,10 @@ else:
for i in xrange(np):
if options.fastmem:
test_sys.cpu[i].physmem_port = test_sys.physmem.port
+ if options.checker:
+ test_sys.cpu[i].addCheckerCpu()
+
+CacheConfig.config_cache(options, test_sys)
if buildEnv['TARGET_ISA'] == 'mips':
setMipsOptions(TestCPUClass)
diff --git a/configs/example/se.py b/configs/example/se.py
index f2a26709e..09e3d69fa 100644
--- a/configs/example/se.py
+++ b/configs/example/se.py
@@ -175,15 +175,6 @@ system = System(cpu = [CPUClass(cpu_id=i) for i in xrange(np)],
physmem = PhysicalMemory(range=AddrRange("512MB")),
membus = Bus(), mem_mode = test_mem_mode)
-if options.ruby:
- options.use_map = True
- Ruby.create_system(options, system)
- assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))
-else:
- system.system_port = system.membus.slave
- system.physmem.port = system.membus.master
- CacheConfig.config_cache(options, system)
-
for i in xrange(np):
system.cpu[i].workload = multiprocesses[i]
@@ -194,6 +185,18 @@ for i in xrange(np):
if options.fastmem:
system.cpu[0].physmem_port = system.physmem.port
+ if options.checker:
+ system.cpu[i].addCheckerCpu()
+
+if options.ruby:
+ options.use_map = True
+ Ruby.create_system(options, system)
+ assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))
+else:
+ system.system_port = system.membus.slave
+ system.physmem.port = system.membus.master
+ CacheConfig.config_cache(options, system)
+
root = Root(full_system = False, system = system)
Simulation.run(options, root, system, FutureClass)