summaryrefslogtreecommitdiff
path: root/configs/common
diff options
context:
space:
mode:
Diffstat (limited to 'configs/common')
-rw-r--r--configs/common/MemConfig.py12
-rw-r--r--configs/common/Options.py2
2 files changed, 11 insertions, 3 deletions
diff --git a/configs/common/MemConfig.py b/configs/common/MemConfig.py
index 57066426f..4692c2d0e 100644
--- a/configs/common/MemConfig.py
+++ b/configs/common/MemConfig.py
@@ -197,9 +197,15 @@ def config_mem(options, system):
# address mapping in the case of a DRAM
for r in system.mem_ranges:
for i in xrange(nbr_mem_ctrls):
- mem_ctrls.append(create_mem_ctrl(cls, r, i, nbr_mem_ctrls,
- intlv_bits,
- system.cache_line_size.value))
+ mem_ctrl = create_mem_ctrl(cls, r, i, nbr_mem_ctrls, intlv_bits,
+ system.cache_line_size.value)
+ # Set the number of ranks based on the command-line
+ # options if it was explicitly set
+ if issubclass(cls, m5.objects.DRAMCtrl) and \
+ options.mem_ranks:
+ mem_ctrl.ranks_per_channel = options.mem_ranks
+
+ mem_ctrls.append(mem_ctrl)
system.mem_ctrls = mem_ctrls
diff --git a/configs/common/Options.py b/configs/common/Options.py
index f81e69a61..ea3de8691 100644
--- a/configs/common/Options.py
+++ b/configs/common/Options.py
@@ -90,6 +90,8 @@ def addCommonOptions(parser):
help = "type of memory to use")
parser.add_option("--mem-channels", type="int", default=1,
help = "number of memory channels")
+ parser.add_option("--mem-ranks", type="int", default=None,
+ help = "number of memory ranks per channel")
parser.add_option("--mem-size", action="store", type="string",
default="512MB",
help="Specify the physical memory size (single memory)")