summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
Diffstat (limited to 'configs')
-rw-r--r--configs/common/Caches.py1
-rw-r--r--configs/common/FSConfig.py46
-rw-r--r--configs/common/Options.py5
-rw-r--r--configs/common/Simulation.py38
-rw-r--r--configs/example/fs.py37
-rw-r--r--configs/example/memtest-ruby.py122
-rw-r--r--configs/example/memtest.py5
-rw-r--r--configs/example/ruby_fs.py201
-rw-r--r--configs/example/ruby_se.py22
-rw-r--r--configs/example/se.py28
-rw-r--r--configs/splash2/cluster.py17
-rw-r--r--configs/splash2/run.py8
12 files changed, 468 insertions, 62 deletions
diff --git a/configs/common/Caches.py b/configs/common/Caches.py
index 1c3b089c7..412cfd3b1 100644
--- a/configs/common/Caches.py
+++ b/configs/common/Caches.py
@@ -26,7 +26,6 @@
#
# Authors: Lisa Hsu
-import m5
from m5.objects import *
class L1Cache(BaseCache):
diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index 180e0ac52..7ab7319cd 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -26,8 +26,6 @@
#
# Authors: Kevin Lim
-import m5
-from m5 import makeList
from m5.objects import *
from Benchmarks import *
@@ -81,6 +79,50 @@ def makeLinuxAlphaSystem(mem_mode, mdesc = None):
return self
+def makeLinuxAlphaRubySystem(mem_mode, rubymem, mdesc = None):
+ class BaseTsunami(Tsunami):
+ ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
+ ide = IdeController(disks=[Parent.disk0, Parent.disk2],
+ pci_func=0, pci_dev=0, pci_bus=0)
+
+
+ self = LinuxAlphaSystem(physmem = rubymem)
+ if not mdesc:
+ # generic system
+ mdesc = SysConfig()
+ self.readfile = mdesc.script()
+
+ # Create pio bus to connect all device pio ports to rubymem's pio port
+ self.piobus = Bus(bus_id=0)
+
+ self.disk0 = CowIdeDisk(driveID='master')
+ self.disk2 = CowIdeDisk(driveID='master')
+ self.disk0.childImage(mdesc.disk())
+ self.disk2.childImage(disk('linux-bigswap2.img'))
+ self.tsunami = BaseTsunami()
+ self.tsunami.attachIO(self.piobus)
+ self.tsunami.ide.pio = self.piobus.port
+ self.tsunami.ethernet.pio = self.piobus.port
+
+ # connect the dma ports directly to ruby dma ports
+ self.tsunami.ide.dma = self.physmem.dma_port
+ self.tsunami.ethernet.dma = self.physmem.dma_port
+
+ # connect the pio bus to rubymem
+ self.physmem.pio_port = self.piobus.port
+
+ self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
+ read_only = True))
+ self.intrctrl = IntrControl()
+ self.mem_mode = mem_mode
+ self.terminal = Terminal()
+ self.kernel = binary('vmlinux')
+ self.pal = binary('ts_osfpal')
+ self.console = binary('console')
+ self.boot_osflags = 'root=/dev/hda1 console=ttyS0'
+
+ return self
+
def makeSparcSystem(mem_mode, mdesc = None):
class CowMmDisk(MmDisk):
image = CowDiskImage(child=RawDiskImage(read_only=True),
diff --git a/configs/common/Options.py b/configs/common/Options.py
index 0ddd2f06d..abc26f1b5 100644
--- a/configs/common/Options.py
+++ b/configs/common/Options.py
@@ -38,6 +38,7 @@ parser.add_option("--fastmem", action="store_true")
# Run duration options
parser.add_option("-m", "--maxtick", type="int")
parser.add_option("--maxtime", type="float")
+parser.add_option("--maxinsts", type="int")
parser.add_option("--prog_intvl", type="int")
@@ -52,6 +53,9 @@ parser.add_option("--checkpoint-dir", action="store", type="string",
help="Place all checkpoints in this absolute directory")
parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
help="restore from checkpoint <N>")
+parser.add_option("--checkpoint-at-end", action="store_true",
+ help="take a checkpoint at end of run")
+
# CPU Switching - default switch model goes from a checkpoint
# to a timing simple CPU with caches to warm up, then to detailed CPU for
@@ -61,6 +65,7 @@ parser.add_option("-s", "--standard-switch", action="store_true",
parser.add_option("-w", "--warmup", action="store", type="int",
help="if -s, then this is the warmup period. else, this is ignored",
default=5000000000)
+parser.add_option("--profile", help="CPU profile interval")
# Fastforwarding and simpoint related materials
parser.add_option("-W", "--warmup-insts", action="store", type="int",
diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py
index d7dde241c..1c9d4ff4e 100644
--- a/configs/common/Simulation.py
+++ b/configs/common/Simulation.py
@@ -28,9 +28,13 @@
from os import getcwd
from os.path import join as joinpath
+
import m5
+from m5.defines import buildEnv
from m5.objects import *
-m5.AddToPath('../common')
+from m5.util import *
+
+addToPath('../common')
def setCPUClass(options):
@@ -82,10 +86,10 @@ def run(options, root, testsys, cpu_class):
cptdir = getcwd()
if options.fast_forward and options.checkpoint_restore != None:
- m5.fatal("Error: Can't specify both --fast-forward and --checkpoint-restore")
+ fatal("Can't specify both --fast-forward and --checkpoint-restore")
if options.standard_switch and not options.caches:
- m5.fatal("Error: Must specify --caches when using --standard-switch")
+ fatal("Must specify --caches when using --standard-switch")
np = options.num_cpus
max_checkpoints = options.max_checkpoints
@@ -95,6 +99,10 @@ def run(options, root, testsys, cpu_class):
for i in xrange(np):
testsys.cpu[i].progress_interval = options.prog_intvl
+ if options.maxinsts:
+ for i in xrange(np):
+ testsys.cpu[i].max_insts_any_thread = options.maxinsts
+
if cpu_class:
switch_cpus = [cpu_class(defer_registration=True, cpu_id=(np+i))
for i in xrange(np)]
@@ -103,7 +111,7 @@ def run(options, root, testsys, cpu_class):
if options.fast_forward:
testsys.cpu[i].max_insts_any_thread = int(options.fast_forward)
switch_cpus[i].system = testsys
- if not m5.build_env['FULL_SYSTEM']:
+ if not buildEnv['FULL_SYSTEM']:
switch_cpus[i].workload = testsys.cpu[i].workload
switch_cpus[i].clock = testsys.cpu[0].clock
# simulation period
@@ -122,7 +130,7 @@ def run(options, root, testsys, cpu_class):
for i in xrange(np):
switch_cpus[i].system = testsys
switch_cpus_1[i].system = testsys
- if not m5.build_env['FULL_SYSTEM']:
+ if not buildEnv['FULL_SYSTEM']:
switch_cpus[i].workload = testsys.cpu[i].workload
switch_cpus_1[i].workload = testsys.cpu[i].workload
switch_cpus[i].clock = testsys.cpu[0].clock
@@ -137,7 +145,7 @@ def run(options, root, testsys, cpu_class):
# Fast forward to a simpoint (warning: time consuming)
elif options.simpoint:
if testsys.cpu[i].workload[0].simpoint == 0:
- m5.fatal('simpoint not found')
+ fatal('simpoint not found')
testsys.cpu[i].max_insts_any_thread = \
testsys.cpu[i].workload[0].simpoint
# No distance specified, just switch
@@ -170,7 +178,7 @@ def run(options, root, testsys, cpu_class):
if options.simpoint:
for i in xrange(np):
if testsys.cpu[i].workload[0].simpoint == 0:
- m5.fatal('no simpoint for testsys.cpu[%d].workload[0]', i)
+ fatal('no simpoint for testsys.cpu[%d].workload[0]', i)
checkpoint_inst = int(testsys.cpu[i].workload[0].simpoint) + offset
testsys.cpu[i].max_insts_any_thread = checkpoint_inst
# used for output below
@@ -190,14 +198,13 @@ def run(options, root, testsys, cpu_class):
import re
if not isdir(cptdir):
- m5.fatal("checkpoint dir %s does not exist!", cptdir)
+ fatal("checkpoint dir %s does not exist!", cptdir)
if options.at_instruction:
checkpoint_dir = joinpath(cptdir, "cpt.%s.%s" % \
(options.bench, options.checkpoint_restore))
if not exists(checkpoint_dir):
- m5.fatal("Unable to find checkpoint directory %s",
- checkpoint_dir)
+ fatal("Unable to find checkpoint directory %s", checkpoint_dir)
print "Restoring checkpoint ..."
m5.restoreCheckpoint(root, checkpoint_dir)
@@ -205,7 +212,7 @@ def run(options, root, testsys, cpu_class):
elif options.simpoint:
# assume workload 0 has the simpoint
if testsys.cpu[0].workload[0].simpoint == 0:
- m5.fatal('Unable to find simpoint')
+ fatal('Unable to find simpoint')
options.checkpoint_restore += \
int(testsys.cpu[0].workload[0].simpoint)
@@ -213,8 +220,8 @@ def run(options, root, testsys, cpu_class):
checkpoint_dir = joinpath(cptdir, "cpt.%s.%d" % \
(options.bench, options.checkpoint_restore))
if not exists(checkpoint_dir):
- m5.fatal("Unable to find checkpoint directory %s.%s",
- options.bench, options.checkpoint_restore)
+ fatal("Unable to find checkpoint directory %s.%s",
+ options.bench, options.checkpoint_restore)
print "Restoring checkpoint ..."
m5.restoreCheckpoint(root,checkpoint_dir)
@@ -233,7 +240,7 @@ def run(options, root, testsys, cpu_class):
cpt_num = options.checkpoint_restore
if cpt_num > len(cpts):
- m5.fatal('Checkpoint %d not found', cpt_num)
+ fatal('Checkpoint %d not found', cpt_num)
## Adjust max tick based on our starting tick
maxtick = maxtick - int(cpts[cpt_num - 1])
@@ -367,3 +374,6 @@ def run(options, root, testsys, cpu_class):
exit_cause = exit_event.getCause()
print 'Exiting @ cycle %i because %s' % (m5.curTick(), exit_cause)
+ if options.checkpoint_at_end:
+ m5.checkpoint(root, joinpath(cptdir, "cpt.%d"))
+
diff --git a/configs/example/fs.py b/configs/example/fs.py
index b5be79a08..23285e101 100644
--- a/configs/example/fs.py
+++ b/configs/example/fs.py
@@ -26,15 +26,20 @@
#
# Authors: Ali Saidi
-import optparse, os, sys
+import optparse
+import os
+import sys
import m5
+from m5.defines import buildEnv
+from m5.objects import *
+from m5.util import addToPath, fatal
-if not m5.build_env['FULL_SYSTEM']:
- m5.fatal("This script requires full-system mode (*_FS).")
+if not buildEnv['FULL_SYSTEM']:
+ fatal("This script requires full-system mode (*_FS).")
+
+addToPath('../common')
-from m5.objects import *
-m5.AddToPath('../common')
from FSConfig import *
from SysPaths import *
from Benchmarks import *
@@ -98,16 +103,16 @@ else:
np = options.num_cpus
-if m5.build_env['TARGET_ISA'] == "alpha":
+if buildEnv['TARGET_ISA'] == "alpha":
test_sys = makeLinuxAlphaSystem(test_mem_mode, bm[0])
-elif m5.build_env['TARGET_ISA'] == "mips":
+elif buildEnv['TARGET_ISA'] == "mips":
test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0])
-elif m5.build_env['TARGET_ISA'] == "sparc":
+elif buildEnv['TARGET_ISA'] == "sparc":
test_sys = makeSparcSystem(test_mem_mode, bm[0])
-elif m5.build_env['TARGET_ISA'] == "x86":
+elif buildEnv['TARGET_ISA'] == "x86":
test_sys = makeLinuxX86System(test_mem_mode, np, bm[0])
else:
- m5.fatal("incapable of building non-alpha or non-sparc full system!")
+ fatal("incapable of building non-alpha or non-sparc full system!")
if options.kernel is not None:
test_sys.kernel = binary(options.kernel)
@@ -123,7 +128,7 @@ if options.l2cache:
test_sys.cpu = [TestCPUClass(cpu_id=i) for i in xrange(np)]
-if options.caches:
+if options.caches or options.l2cache:
test_sys.bridge.filter_ranges_a=[AddrRange(0, Addr.max)]
test_sys.bridge.filter_ranges_b=[AddrRange(0, size='8GB')]
test_sys.iocache = IOCache(addr_range=AddrRange(0, size='8GB'))
@@ -142,17 +147,17 @@ for i in xrange(np):
if options.fastmem:
test_sys.cpu[i].physmem_port = test_sys.physmem.port
-if m5.build_env['TARGET_ISA'] == 'mips':
+if buildEnv['TARGET_ISA'] == 'mips':
setMipsOptions(TestCPUClass)
if len(bm) == 2:
- if m5.build_env['TARGET_ISA'] == 'alpha':
+ if buildEnv['TARGET_ISA'] == 'alpha':
drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1])
- elif m5.build_env['TARGET_ISA'] == 'mips':
+ elif buildEnv['TARGET_ISA'] == 'mips':
drive_sys = makeLinuxMipsSystem(drive_mem_mode, bm[1])
- elif m5.build_env['TARGET_ISA'] == 'sparc':
+ elif buildEnv['TARGET_ISA'] == 'sparc':
drive_sys = makeSparcSystem(drive_mem_mode, bm[1])
- elif m5.build.env['TARGET_ISA'] == 'x86':
+ elif buildEnv['TARGET_ISA'] == 'x86':
drive_sys = makeX86System(drive_mem_mode, np, bm[1])
drive_sys.cpu = DriveCPUClass(cpu_id=0)
drive_sys.cpu.connectMemPorts(drive_sys.membus)
diff --git a/configs/example/memtest-ruby.py b/configs/example/memtest-ruby.py
new file mode 100644
index 000000000..e47b8e0a3
--- /dev/null
+++ b/configs/example/memtest-ruby.py
@@ -0,0 +1,122 @@
+# Copyright (c) 2006-2007 The Regents of The University of Michigan
+# Copyright (c) 2009 Advanced Micro Devices, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Ron Dreslinski
+# Brad Beckmann
+
+import m5
+from m5.objects import *
+from m5.defines import buildEnv
+from m5.util import addToPath
+import os, optparse, sys
+addToPath('../common')
+addToPath('../../tests/configs/')
+import ruby_config
+
+parser = optparse.OptionParser()
+
+parser.add_option("-a", "--atomic", action="store_true",
+ help="Use atomic (non-timing) mode")
+parser.add_option("-b", "--blocking", action="store_true",
+ help="Use blocking caches")
+parser.add_option("-l", "--maxloads", metavar="N", default=0,
+ help="Stop after N loads")
+parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick,
+ metavar="T",
+ help="Stop after T ticks")
+
+parser.add_option("-t", "--testers", type="int", metavar="N", default=1,
+ help="number of testers/cores")
+
+parser.add_option("-f", "--functional", type="int", default=0,
+ metavar="PCT",
+ help="Target percentage of functional accesses "
+ "[default: %default]")
+parser.add_option("-u", "--uncacheable", type="int", default=0,
+ metavar="PCT",
+ help="Target percentage of uncacheable accesses "
+ "[default: %default]")
+
+parser.add_option("--progress", type="int", default=1000,
+ metavar="NLOADS",
+ help="Progress message interval "
+ "[default: %default]")
+
+(options, args) = parser.parse_args()
+
+if args:
+ print "Error: script doesn't take any positional arguments"
+ sys.exit(1)
+
+block_size = 64
+
+if options.testers > block_size:
+ print "Error: Number of testers %d limited to %d because of false sharing" \
+ % (options.testers, block_size)
+ sys.exit(1)
+
+cpus = [ MemTest(atomic=options.atomic, max_loads=options.maxloads, \
+ percent_functional=options.functional, \
+ percent_uncacheable=options.uncacheable, \
+ progress_interval=options.progress) \
+ for i in xrange(options.testers) ]
+
+# create the desired simulated system
+# ruby memory must be at least 16 MB to work with the mem tester
+ruby_memory = ruby_config.generate("MI_example-homogeneous.rb",
+ cores = options.testers,
+ memory_size = 16,
+ ports_per_cpu = 1)
+
+system = System(cpu = cpus, funcmem = PhysicalMemory(),
+ physmem = ruby_memory)
+
+for cpu in cpus:
+ cpu.test = system.physmem.port
+ cpu.functional = system.funcmem.port
+
+
+# -----------------------
+# run simulation
+# -----------------------
+
+root = Root( system = system )
+if options.atomic:
+ root.system.mem_mode = 'atomic'
+else:
+ root.system.mem_mode = 'timing'
+
+# Not much point in this being higher than the L1 latency
+m5.ticks.setGlobalFrequency('1ns')
+
+# instantiate configuration
+m5.instantiate(root)
+
+# simulate until program terminates
+exit_event = m5.simulate(options.maxtick)
+
+print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()
diff --git a/configs/example/memtest.py b/configs/example/memtest.py
index 5bb874e85..d4497092b 100644
--- a/configs/example/memtest.py
+++ b/configs/example/memtest.py
@@ -26,10 +26,11 @@
#
# Authors: Ron Dreslinski
+import optparse
+import sys
+
import m5
from m5.objects import *
-import os, optparse, sys
-m5.AddToPath('../common')
parser = optparse.OptionParser()
diff --git a/configs/example/ruby_fs.py b/configs/example/ruby_fs.py
new file mode 100644
index 000000000..a4831f3bb
--- /dev/null
+++ b/configs/example/ruby_fs.py
@@ -0,0 +1,201 @@
+# Copyright (c) 2009 Advanced Micro Devices, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Brad Beckmann
+
+#
+# Full system configuraiton for ruby
+#
+
+import os
+import optparse
+import sys
+from os.path import join as joinpath
+
+import m5
+from m5.defines import buildEnv
+from m5.objects import *
+from m5.util import addToPath, panic
+
+if not buildEnv['FULL_SYSTEM']:
+ panic("This script requires full-system mode (*_FS).")
+
+addToPath('../../tests/configs/')
+addToPath('../common')
+
+import ruby_config
+
+from FSConfig import *
+from SysPaths import *
+from Benchmarks import *
+import Simulation
+from Caches import *
+
+# Get paths we might need. It's expected this file is in m5/configs/example.
+config_path = os.path.dirname(os.path.abspath(__file__))
+config_root = os.path.dirname(config_path)
+m5_root = os.path.dirname(config_root)
+
+parser = optparse.OptionParser()
+
+# Benchmark options
+parser.add_option("-b", "--benchmark", action="store", type="string",
+ dest="benchmark",
+ help="Specify the benchmark to run. Available benchmarks: %s"\
+ % DefinedBenchmarks)
+parser.add_option("-o", "--options", default="",
+ help='The options to pass to the binary, use " " around the entire string')
+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.")
+
+# ruby options
+parser.add_option("--ruby-debug", action="store_true")
+parser.add_option("--ruby-debug-file", default="", help="Ruby debug out file (stdout if blank)")
+parser.add_option("--protocol", default="", help="Ruby protocol compiled into binary")
+
+
+# ruby host memory experimentation
+parser.add_option("--cache_size", type="int")
+parser.add_option("--cache_assoc", type="int")
+parser.add_option("--map_levels", type="int")
+
+execfile(os.path.join(config_root, "common", "Options.py"))
+
+(options, args) = parser.parse_args()
+
+if args:
+ print "Error: script doesn't take any positional arguments"
+ sys.exit(1)
+
+if options.benchmark:
+ try:
+ bm = Benchmarks[options.benchmark]
+ except KeyError:
+ print "Error benchmark %s has not been defined." % options.benchmark
+ print "Valid benchmarks are: %s" % DefinedBenchmarks
+ sys.exit(1)
+else:
+ bm = [SysConfig()]
+
+#
+# currently ruby fs only works in simple timing mode because ruby does not
+# support atomic accesses by devices. Also ruby_fs currently assumes
+# that is running a checkpoints that were created by ALPHA_FS under atomic
+# mode. Since switch cpus are not defined in these checkpoints, we don't
+# fast forward with the atomic cpu and instead set the FutureClass to None.
+# Therefore the cpus resolve to the correct names and unserialize correctly.
+#
+assert(options.timing)
+class CPUClass(TimingSimpleCPU): pass
+test_mem_mode = 'timing'
+FutureClass = None
+
+CPUClass.clock = '1GHz'
+
+#
+# Since we are running in timing mode, set the number of M5 ticks to ruby ticks
+# to the cpu clock frequency
+#
+M5_to_ruby_tick = '1000t'
+
+np = options.num_cpus
+
+# check for max instruction count
+if options.max_inst:
+ max_inst = options.max_inst
+else:
+ max_inst = 0
+
+# set cache size
+if options.cache_size:
+ cache_size = options.cache_size
+else:
+ cache_size = 32768 # 32 kB is default
+
+# set cache assoc
+if options.cache_assoc:
+ cache_assoc = options.cache_assoc
+else:
+ cache_assoc = 8 # 8 is default
+
+# set map levels
+if options.map_levels:
+ map_levels = options.map_levels
+else:
+ map_levels = 4 # 4 levels is the default
+
+if options.protocol == "MOESI_hammer":
+ ruby_config_file = "MOESI_hammer-homogeneous.rb"
+elif options.protocol == "MOESI_CMP_token":
+ ruby_config_file = "TwoLevel_SplitL1UnifiedL2.rb"
+elif options.protocol == "MI_example":
+ ruby_config_file = "MI_example-homogeneous.rb"
+else:
+ print "Error: unsupported ruby protocol"
+ sys.exit(1)
+
+#
+# Currently, since ruby configuraiton is separate from m5, we need to manually
+# tell ruby that two dma ports are created by makeLinuxAlphaRubySystem().
+# Eventually, this will be fix with a unified configuration system.
+#
+rubymem = ruby_config.generate(ruby_config_file,
+ np,
+ np,
+ 128,
+ False,
+ cache_size,
+ cache_assoc,
+ map_levels,
+ 2,
+ M5_to_ruby_tick)
+
+if options.ruby_debug == True:
+ rubymem.debug = True
+ rubymem.debug_file = options.ruby_debug_file
+
+system = makeLinuxAlphaRubySystem(test_mem_mode, rubymem, bm[0])
+
+system.cpu = [CPUClass(cpu_id=i) for i in xrange(np)]
+
+if options.l2cache:
+ print "Error: -l2cache incompatible with ruby, must configure it ruby-style"
+ sys.exit(1)
+
+if options.caches:
+ print "Error: -caches incompatible with ruby, must configure it ruby-style"
+ sys.exit(1)
+
+for i in xrange(np):
+ system.cpu[i].connectMemPorts(system.physmem)
+
+ if options.fastmem:
+ system.cpu[i].physmem_port = system.physmem.port
+
+root = Root(system = system)
+
+Simulation.run(options, root, system, FutureClass)
diff --git a/configs/example/ruby_se.py b/configs/example/ruby_se.py
index 488ccb64a..e7e930077 100644
--- a/configs/example/ruby_se.py
+++ b/configs/example/ruby_se.py
@@ -30,17 +30,22 @@
#
# "m5 test.py"
+import os
+import optparse
+import sys
+from os.path import join as joinpath
+
import m5
+from m5.defines import buildEnv
+from m5.objects import *
+from m5.util import addToPath, panic
-if m5.build_env['FULL_SYSTEM']:
- m5.panic("This script requires syscall emulation mode (*_SE).")
+if buildEnv['FULL_SYSTEM']:
+ panic("This script requires syscall emulation mode (*_SE).")
+
+addToPath('../common')
-from m5.objects import *
-import os, optparse, sys
-from os.path import join as joinpath
-m5.AddToPath('../common')
import Simulation
-#from Caches import *
from cpu2000 import *
# Get paths we might need. It's expected this file is in m5/configs/example.
@@ -72,7 +77,7 @@ if args:
if options.bench:
try:
- if m5.build_env['TARGET_ISA'] != 'alpha':
+ if buildEnv['TARGET_ISA'] != 'alpha':
print >>sys.stderr, "Simpoints code only works for Alpha ISA at this time"
sys.exit(1)
exec("workload = %s('alpha', 'tru64', 'ref')" % options.bench)
@@ -133,7 +138,6 @@ rubymem = RubyMemory(
range = AddrRange("512MB"),
clock = "1GHz",
num_cpus = np,
- libruby_file = "src/mem/ruby/amd64-linux/generated/MOESI_CMP_directory/bin/libruby.so",
config_file = "ruby.config",
stats_file = "m5out/ruby.stats"
)
diff --git a/configs/example/se.py b/configs/example/se.py
index 67a2340ce..c490ed6b6 100644
--- a/configs/example/se.py
+++ b/configs/example/se.py
@@ -30,15 +30,21 @@
#
# "m5 test.py"
+import os
+import optparse
+import sys
+from os.path import join as joinpath
+
import m5
+from m5.defines import buildEnv
+from m5.objects import *
+from m5.util import addToPath, fatal
-if m5.build_env['FULL_SYSTEM']:
- m5.fatal("This script requires syscall emulation mode (*_SE).")
+if buildEnv['FULL_SYSTEM']:
+ fatal("This script requires syscall emulation mode (*_SE).")
+
+addToPath('../common')
-from m5.objects import *
-import os, optparse, sys
-from os.path import join as joinpath
-m5.AddToPath('../common')
import Simulation
from Caches import *
from cpu2000 import *
@@ -70,7 +76,7 @@ if args:
if options.bench:
try:
- if m5.build_env['TARGET_ISA'] != 'alpha':
+ if buildEnv['TARGET_ISA'] != 'alpha':
print >>sys.stderr, "Simpoints code only works for Alpha ISA at this time"
sys.exit(1)
exec("workload = %s('alpha', 'tru64', 'ref')" % options.bench)
@@ -94,8 +100,9 @@ if options.errout != "":
# By default, set workload to path of user-specified binary
workloads = options.cmd
+numThreads = 1
-if options.detailed:
+if options.detailed or options.inorder:
#check for SMT workload
workloads = options.cmd.split(';')
if len(workloads) > 1:
@@ -124,11 +131,12 @@ if options.detailed:
smt_process.errout = errouts[smt_idx]
process += [smt_process, ]
smt_idx += 1
-
+ numThreads = len(workloads)
+
(CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)
CPUClass.clock = '2GHz'
-CPUClass.numThreads = len(workloads)
+CPUClass.numThreads = numThreads;
np = options.num_cpus
diff --git a/configs/splash2/cluster.py b/configs/splash2/cluster.py
index 769bdcf5a..45c9ede82 100644
--- a/configs/splash2/cluster.py
+++ b/configs/splash2/cluster.py
@@ -30,10 +30,14 @@
#
# "m5 test.py"
+import os
+import optparse
+import sys
+
import m5
from m5.objects import *
-import os, optparse, sys
-m5.AddToPath('../common')
+
+m5.util.addToPath('../common')
# --------------------
# Define Command Line Options
@@ -266,10 +270,11 @@ elif options.benchmark == 'WaterNSquared':
elif options.benchmark == 'WaterSpatial':
root.workload = Water_spatial()
else:
- panic("The --benchmark environment variable was set to something" \
- +" improper.\nUse Cholesky, FFT, LUContig, LUNoncontig, Radix" \
- +", Barnes, FMM, OceanContig,\nOceanNoncontig, Raytrace," \
- +" WaterNSquared, or WaterSpatial\n")
+ m5.util.panic("""
+The --benchmark environment variable was set to something improper.
+Use Cholesky, FFT, LUContig, LUNoncontig, Radix, Barnes, FMM, OceanContig,
+OceanNoncontig, Raytrace, WaterNSquared, or WaterSpatial
+""")
# --------------------
# Assign the workload to the cpus
diff --git a/configs/splash2/run.py b/configs/splash2/run.py
index afa85a8f1..95ec790ba 100644
--- a/configs/splash2/run.py
+++ b/configs/splash2/run.py
@@ -29,10 +29,14 @@
# Splash2 Run Script
#
+import os
+import optparse
+import sys
+
import m5
from m5.objects import *
-import os, optparse, sys
-m5.AddToPath('../common')
+
+m5.util.addToPath('../common')
# --------------------
# Define Command Line Options