config: reorganized how ruby specifies command-line options
This commit is contained in:
parent
eb1e5636e3
commit
5c801090a3
11 changed files with 84 additions and 46 deletions
|
@ -37,18 +37,15 @@ parser.add_option("--fastmem", action="store_true")
|
|||
parser.add_option("--clock", action="store", type="string", default='1GHz')
|
||||
parser.add_option("--num-dirs", type="int", default=1)
|
||||
parser.add_option("--num-l2caches", type="int", default=1)
|
||||
parser.add_option("--topology", type="string", default="Crossbar",
|
||||
help="check src/mem/ruby/network/topologies for complete set")
|
||||
parser.add_option("--mesh-rows", type="int", default=1,
|
||||
help="the number of rows in the mesh topology")
|
||||
parser.add_option("--garnet-network", type="string", default=None,
|
||||
help="'fixed'|'flexible'")
|
||||
parser.add_option("--numa-high-bit", type="int", default=None,
|
||||
help="high order address bit to use for numa mapping")
|
||||
|
||||
# ruby sparse memory options
|
||||
parser.add_option("--use-map", action="store_true", default=False)
|
||||
parser.add_option("--map-levels", type="int", default=4)
|
||||
parser.add_option("--num-l3caches", type="int", default=1)
|
||||
parser.add_option("--l1d_size", type="string", default="32kB")
|
||||
parser.add_option("--l1i_size", type="string", default="32kB")
|
||||
parser.add_option("--l2_size", type="string", default="2MB")
|
||||
parser.add_option("--l3_size", type="string", default="16MB")
|
||||
parser.add_option("--l1d_assoc", type="int", default=2)
|
||||
parser.add_option("--l1i_assoc", type="int", default=2)
|
||||
parser.add_option("--l2_assoc", type="int", default=16)
|
||||
parser.add_option("--l3_assoc", type="int", default=16)
|
||||
|
||||
# Run duration options
|
||||
parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick,
|
||||
|
|
|
@ -69,20 +69,27 @@ parser.add_option("--progress", type="int", default=1000,
|
|||
"[default: %default]")
|
||||
|
||||
#
|
||||
# Set the default cache size and associativity to be very small to encourage
|
||||
# races between requests and writebacks.
|
||||
# Add the ruby specific and protocol specific options
|
||||
#
|
||||
parser.add_option("--l1d_size", type="string", default="256B")
|
||||
parser.add_option("--l1i_size", type="string", default="256B")
|
||||
parser.add_option("--l2_size", type="string", default="512B")
|
||||
parser.add_option("--l1d_assoc", type="int", default=2)
|
||||
parser.add_option("--l1i_assoc", type="int", default=2)
|
||||
parser.add_option("--l2_assoc", type="int", default=2)
|
||||
Ruby.define_options(parser)
|
||||
|
||||
execfile(os.path.join(config_root, "common", "Options.py"))
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
#
|
||||
# Set the default cache size and associativity to be very small to encourage
|
||||
# races between requests and writebacks.
|
||||
#
|
||||
options.l1d_size="256B"
|
||||
options.l1i_size="256B"
|
||||
options.l2_size="512B"
|
||||
options.l3_size="1kB"
|
||||
options.l1d_assoc=2
|
||||
options.l1i_assoc=2
|
||||
options.l2_assoc=2
|
||||
options.l3_assoc=2
|
||||
|
||||
if args:
|
||||
print "Error: script doesn't take any positional arguments"
|
||||
sys.exit(1)
|
||||
|
|
|
@ -72,16 +72,10 @@ parser.add_option("-i", "--input", default="", help="Read stdin from a file.")
|
|||
parser.add_option("--output", default="", help="Redirect stdout to a file.")
|
||||
parser.add_option("--errout", default="", help="Redirect stderr to a file.")
|
||||
|
||||
# cache parameters
|
||||
parser.add_option("--l1d_size", type="string", default="32kB")
|
||||
parser.add_option("--l1i_size", type="string", default="32kB")
|
||||
parser.add_option("--l2_size", type="string", default="1MB")
|
||||
parser.add_option("--l1d_assoc", type="int", default=2)
|
||||
parser.add_option("--l1i_assoc", type="int", default=2)
|
||||
parser.add_option("--l2_assoc", type="int", default=16)
|
||||
|
||||
# ruby host memory experimentation
|
||||
parser.add_option("--map_levels", type="int")
|
||||
#
|
||||
# Add the ruby specific and protocol specific options
|
||||
#
|
||||
Ruby.define_options(parser)
|
||||
|
||||
execfile(os.path.join(config_root, "common", "Options.py"))
|
||||
|
||||
|
|
|
@ -68,14 +68,11 @@ parser.add_option("-i", "--input", default="", help="Read stdin from a file.")
|
|||
parser.add_option("--output", default="", help="Redirect stdout to a file.")
|
||||
parser.add_option("--errout", default="", help="Redirect stderr to a file.")
|
||||
|
||||
# cache parameters
|
||||
parser.add_option("--l1d_size", type="string", default="32kB")
|
||||
parser.add_option("--l1i_size", type="string", default="32kB")
|
||||
parser.add_option("--l2_size", type="string", default="1MB")
|
||||
parser.add_option("--l1d_assoc", type="int", default=2)
|
||||
parser.add_option("--l1i_assoc", type="int", default=2)
|
||||
parser.add_option("--l2_assoc", type="int", default=16)
|
||||
|
||||
#
|
||||
# Add the ruby specific and protocol specific options
|
||||
#
|
||||
Ruby.define_options(parser)
|
||||
|
||||
execfile(os.path.join(config_root, "common", "Options.py"))
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
|
|
@ -54,20 +54,27 @@ parser.add_option("-f", "--wakeup_freq", metavar="N", default=10,
|
|||
help="Wakeup every N cycles")
|
||||
|
||||
#
|
||||
# Set the default cache size and associativity to be very small to encourage
|
||||
# races between requests and writebacks.
|
||||
# Add the ruby specific and protocol specific options
|
||||
#
|
||||
parser.add_option("--l1d_size", type="string", default="256B")
|
||||
parser.add_option("--l1i_size", type="string", default="256B")
|
||||
parser.add_option("--l2_size", type="string", default="512B")
|
||||
parser.add_option("--l1d_assoc", type="int", default=2)
|
||||
parser.add_option("--l1i_assoc", type="int", default=2)
|
||||
parser.add_option("--l2_assoc", type="int", default=2)
|
||||
Ruby.define_options(parser)
|
||||
|
||||
execfile(os.path.join(config_root, "common", "Options.py"))
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
#
|
||||
# Set the default cache size and associativity to be very small to encourage
|
||||
# races between requests and writebacks.
|
||||
#
|
||||
options.l1d_size="256B"
|
||||
options.l1i_size="256B"
|
||||
options.l2_size="512B"
|
||||
options.l3_size="1kB"
|
||||
options.l1d_assoc=2
|
||||
options.l1i_assoc=2
|
||||
options.l2_assoc=2
|
||||
options.l3_assoc=2
|
||||
|
||||
if args:
|
||||
print "Error: script doesn't take any positional arguments"
|
||||
sys.exit(1)
|
||||
|
|
|
@ -44,6 +44,9 @@ class L1Cache(RubyCache):
|
|||
class L2Cache(RubyCache):
|
||||
latency = 15
|
||||
|
||||
def define_options(parser):
|
||||
return
|
||||
|
||||
def create_system(options, phys_mem, piobus, dma_devices):
|
||||
|
||||
if buildEnv['PROTOCOL'] != 'MESI_CMP_directory':
|
||||
|
|
|
@ -37,6 +37,9 @@ from m5.defines import buildEnv
|
|||
class Cache(RubyCache):
|
||||
latency = 3
|
||||
|
||||
def define_options(parser):
|
||||
return
|
||||
|
||||
def create_system(options, phys_mem, piobus, dma_devices):
|
||||
|
||||
if buildEnv['PROTOCOL'] != 'MI_example':
|
||||
|
|
|
@ -44,6 +44,9 @@ class L1Cache(RubyCache):
|
|||
class L2Cache(RubyCache):
|
||||
latency = 15
|
||||
|
||||
def define_options(parser):
|
||||
return
|
||||
|
||||
def create_system(options, phys_mem, piobus, dma_devices):
|
||||
|
||||
if buildEnv['PROTOCOL'] != 'MOESI_CMP_directory':
|
||||
|
|
|
@ -44,6 +44,9 @@ class L1Cache(RubyCache):
|
|||
class L2Cache(RubyCache):
|
||||
latency = 15
|
||||
|
||||
def define_options(parser):
|
||||
return
|
||||
|
||||
def create_system(options, phys_mem, piobus, dma_devices):
|
||||
|
||||
if buildEnv['PROTOCOL'] != 'MOESI_CMP_token':
|
||||
|
|
|
@ -43,6 +43,9 @@ class L1Cache(RubyCache):
|
|||
class L2Cache(RubyCache):
|
||||
latency = 15
|
||||
|
||||
def define_options(parser):
|
||||
return
|
||||
|
||||
def create_system(options, phys_mem, piobus, dma_devices):
|
||||
|
||||
if buildEnv['PROTOCOL'] != 'MOESI_hammer':
|
||||
|
|
|
@ -31,6 +31,27 @@ import m5
|
|||
from m5.objects import *
|
||||
from m5.defines import buildEnv
|
||||
|
||||
def define_options(parser):
|
||||
# ruby network options
|
||||
parser.add_option("--topology", type="string", default="Crossbar",
|
||||
help="check src/mem/ruby/network/topologies for complete set")
|
||||
parser.add_option("--mesh-rows", type="int", default=1,
|
||||
help="the number of rows in the mesh topology")
|
||||
parser.add_option("--garnet-network", type="string", default=none,
|
||||
help="'fixed'|'flexible'")
|
||||
|
||||
# ruby mapping options
|
||||
parser.add_option("--numa-high-bit", type="int", default=none,
|
||||
help="high order address bit to use for numa mapping")
|
||||
|
||||
# ruby sparse memory options
|
||||
parser.add_option("--use-map", action="store_true", default=False)
|
||||
parser.add_option("--map-levels", type="int", default=4)
|
||||
|
||||
protocol = buildEnv['PROTOCOL']
|
||||
exec "import %s" % protocol
|
||||
eval("%s.define_options(parser)" % protocol)
|
||||
|
||||
def create_system(options, physmem, piobus = None, dma_devices = []):
|
||||
|
||||
protocol = buildEnv['PROTOCOL']
|
||||
|
|
Loading…
Reference in a new issue