changeset 58885e2e8a88 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=58885e2e8a88
description:
Config: Add an option of type 'choice' for cpu type
This patch adds a new option for cpu type. This option is of type
'choice'
which is similar to a C++ enum, except that it takes string values as
possible choices. Following options are being removed -- detailed,
timing,
inorder.
diffstat:
configs/common/Options.py | 6 +++---
configs/common/Simulation.py | 6 +++---
configs/example/se.py | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diffs (62 lines):
diff -r ed6e2905720b -r 58885e2e8a88 configs/common/Options.py
--- a/configs/common/Options.py Thu Jan 05 11:02:56 2012 -0600
+++ b/configs/common/Options.py Thu Jan 05 11:04:25 2012 -0600
@@ -27,9 +27,9 @@
# Authors: Lisa Hsu
# system options
-parser.add_option("-d", "--detailed", action="store_true")
-parser.add_option("-t", "--timing", action="store_true")
-parser.add_option("--inorder", action="store_true")
+parser.add_option("-c", "--cpu-type", type="choice", default="atomic",
+ choices = ["atomic", "timing", "detailed", "inorder"],
+ help = "type of cpu to run with")
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 -r ed6e2905720b -r 58885e2e8a88 configs/common/Simulation.py
--- a/configs/common/Simulation.py Thu Jan 05 11:02:56 2012 -0600
+++ b/configs/common/Simulation.py Thu Jan 05 11:04:25 2012 -0600
@@ -40,14 +40,14 @@
def setCPUClass(options):
atomic = False
- if options.timing:
+ if options.cpu_type == "timing":
class TmpClass(TimingSimpleCPU): pass
- elif options.detailed:
+ elif options.cpu_type == "detailed":
if not options.caches:
print "O3 CPU must be used with caches"
sys.exit(1)
class TmpClass(DerivO3CPU): pass
- elif options.inorder:
+ elif options.cpu_type == "inorder":
if not options.caches:
print "InOrder CPU must be used with caches"
sys.exit(1)
diff -r ed6e2905720b -r 58885e2e8a88 configs/example/se.py
--- a/configs/example/se.py Thu Jan 05 11:02:56 2012 -0600
+++ b/configs/example/se.py Thu Jan 05 11:04:25 2012 -0600
@@ -122,7 +122,7 @@
workloads = options.cmd
numThreads = 1
-if options.detailed or options.inorder:
+if options.cpu_type == "detailed" or options.cpu_type == "inorder":
#check for SMT workload
workloads = options.cmd.split(';')
if len(workloads) > 1:
@@ -154,10 +154,10 @@
numThreads = len(workloads)
if options.ruby:
- if options.detailed:
+ if options.cpu_type == "detailed":
print >> sys.stderr, "Ruby only works with TimingSimpleCPU!!"
sys.exit(1)
- elif not options.timing:
+ elif not options.cpu_type == "timing":
print >> sys.stderr, "****WARN: using Timing CPU since it's needed by
Ruby"
class CPUClass(TimingSimpleCPU): pass
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev