summaryrefslogtreecommitdiff
path: root/configs/common/Options.py
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-04-22 13:20:33 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2013-04-22 13:20:33 -0400
commit3477d60d5c2f20644e301378ca2923766d765f8e (patch)
tree3ebea4940bab8c9c347bf56f1cef9db8b170ab0d /configs/common/Options.py
parenta35d3ff167a50bcbaeffbefc46bde5f640a475f5 (diff)
downloadgem5-3477d60d5c2f20644e301378ca2923766d765f8e.tar.xz
config: Add a mem-type config option to se/fs scripts
This patch enables selection of the memory controller class through a mem-type command-line option. Behind the scenes, this option is treated much like the cpu-type, and a similar framework is used to resolve the valid options, and translate the short-hand description to a valid class. The regression scripts are updated with a hardcoded memory class for the moment. The best solution going forward is probably to get the memory out of the makeSystem functions, but Ruby complicates things as it does not connect the memory controller to the membus. --HG-- rename : configs/common/CpuConfig.py => configs/common/MemConfig.py
Diffstat (limited to 'configs/common/Options.py')
-rw-r--r--configs/common/Options.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/configs/common/Options.py b/configs/common/Options.py
index 474da94f4..e651e96ec 100644
--- a/configs/common/Options.py
+++ b/configs/common/Options.py
@@ -1,3 +1,15 @@
+# Copyright (c) 2013 ARM Limited
+# All rights reserved.
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder. You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
# Copyright (c) 2006-2008 The Regents of The University of Michigan
# All rights reserved.
#
@@ -32,11 +44,16 @@ from m5.objects import *
from Benchmarks import *
import CpuConfig
+import MemConfig
def _listCpuTypes(option, opt, value, parser):
CpuConfig.print_cpu_list()
sys.exit(0)
+def _listMemTypes(option, opt, value, parser):
+ MemConfig.print_mem_list()
+ sys.exit(0)
+
def addCommonOptions(parser):
# system options
parser.add_option("--list-cpu-types",
@@ -45,6 +62,12 @@ def addCommonOptions(parser):
parser.add_option("--cpu-type", type="choice", default="atomic",
choices=CpuConfig.cpu_names(),
help = "type of cpu to run with")
+ parser.add_option("--list-mem-types",
+ action="callback", callback=_listMemTypes,
+ help="List available memory types")
+ parser.add_option("--mem-type", type="choice", default="simple_mem",
+ choices=MemConfig.mem_names(),
+ help = "type of memory to use")
parser.add_option("--checker", action="store_true");
parser.add_option("-n", "--num-cpus", type="int", default=1)
parser.add_option("--caches", action="store_true")