# Node ID df69dd6ec6fce27f286ca9ecac02150736c219d8 # Parent 9be8a40026dfa419c3daf572407f9391ad48e1ed diff --git a/configs/common/MemConfig.py b/configs/common/MemConfig.py --- a/configs/common/MemConfig.py +++ b/configs/common/MemConfig.py @@ -41,6 +41,7 @@ import sys import HMC from textwrap import TextWrapper +from m5.util import warn # Dictionary of mapping names of real memory controller models to # classes. @@ -211,6 +212,20 @@ options.mem_ranks: mem_ctrl.ranks_per_channel = options.mem_ranks + # Only do this for SimpleMemory derivatives + if issubclass(cls, m5.objects.SimpleMemory): + if options.mem_latency: + mem_ctrl.latency = \ + m5.objects.Latency(options.mem_latency) + if options.mem_bandwidth: + mem_ctrl.bandwidth = \ + m5.objects.MemoryBandwidth(options.mem_bandwidth) + else: + if options.mem_latency or options.mem_bandwidth: + warn("--mem-latency and --mem-bandwidth are only used" \ + " with SimpleMemory. Specified --mem-type is %s." \ + % options.mem_type) + if options.elastic_trace_en: mem_ctrl.latency = '1ns' print "For elastic trace, over-riding Simple Memory " \ diff --git a/configs/common/Options.py b/configs/common/Options.py --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -108,6 +108,10 @@ parser.add_option("--mem-type", type="choice", default="DDR3_1600_x64", choices=MemConfig.mem_names(), help = "type of memory to use") + parser.add_option("--mem-latency", type="string", + help="Memory latency (for SimpleMemory only)") + parser.add_option("--mem-bandwidth", type="string", + help="Memory bandwidth (for SimpleMemory only)") parser.add_option("--mem-channels", type="int", default=1, help = "number of memory channels") parser.add_option("--mem-ranks", type="int", default=None, diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -43,7 +43,7 @@ import m5 from m5.objects import * from m5.defines import buildEnv -from m5.util import addToPath, fatal +from m5.util import addToPath, fatal, warn import MemConfig addToPath('../topologies') @@ -122,6 +122,19 @@ MemConfig.get(options.mem_type), r, index, options.num_dirs, int(math.log(options.num_dirs, 2)), options.cacheline_size) + # Only do this for SimpleMemory derivatives + if isinstance(mem_ctrl, m5.objects.SimpleMemory): + if options.mem_latency: + mem_ctrl.latency = Latency(options.mem_latency) + if options.mem_bandwidth: + mem_ctrl.bandwidth = \ + MemoryBandwidth(options.mem_bandwidth) + else: + if options.mem_latency or options.mem_bandwidth: + warn("--mem-latency and --mem-bandwidth are only used" \ + " with SimpleMemory. Specified --mem-type is %s." \ + % options.mem_type) + mem_ctrls.append(mem_ctrl) if crossbar != None: