summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2010-01-29 20:29:33 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2010-01-29 20:29:33 -0800
commit057f5898ca5c2d43240ab756240abe8ddc7700be (patch)
treec1c010dc60d101bb844c897e963580b5138f8606
parentc441590b15ea724b07c5cf28afc75017d68a2eb3 (diff)
downloadgem5-057f5898ca5c2d43240ab756240abe8ddc7700be.tar.xz
ruby: ruby_se.py updated to new config system
-rw-r--r--configs/example/ruby_se.py57
1 files changed, 28 insertions, 29 deletions
diff --git a/configs/example/ruby_se.py b/configs/example/ruby_se.py
index e7e930077..600fa1b14 100644
--- a/configs/example/ruby_se.py
+++ b/configs/example/ruby_se.py
@@ -44,6 +44,9 @@ if buildEnv['FULL_SYSTEM']:
panic("This script requires syscall emulation mode (*_SE).")
addToPath('../common')
+addToPath('../ruby')
+
+import Ruby
import Simulation
from cpu2000 import *
@@ -64,9 +67,15 @@ parser.add_option("-o", "--options", default="",
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.")
-parser.add_option("--ruby-debug", action="store_true")
-parser.add_option("--ruby-debug-file", default="", help="Ruby debug out file (stdout if blank)")
+# 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)
+
execfile(os.path.join(config_root, "common", "Options.py"))
(options, args) = parser.parse_args()
@@ -130,46 +139,36 @@ if options.detailed:
(CPUClass, test_mem_mode, FutureClass) = Simulation.setCPUClass(options)
+#
+# Currently ruby only works in timing mode
+#
+assert(options.timing)
+assert(test_mem_mode == 'timing')
+assert(FutureClass == None)
+
CPUClass.clock = '1GHz'
np = options.num_cpus
-rubymem = RubyMemory(
- range = AddrRange("512MB"),
- clock = "1GHz",
- num_cpus = np,
- config_file = "ruby.config",
- stats_file = "m5out/ruby.stats"
-)
-
-if options.ruby_debug == True:
- rubymem.debug = True
- rubymem.debug_file = options.ruby_debug_file
-
system = System(cpu = [CPUClass(cpu_id=i) for i in xrange(np)],
- physmem = rubymem)
+ physmem = PhysicalMemory())
-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)
+system.ruby = Ruby.create_system(options, system.physmem)
-for i in xrange(np):
- system.cpu[i].connectMemPorts(system.physmem)
+assert(options.num_cpus == len(system.ruby.cpu_ruby_ports))
+for (i, cpu) in enumerate(system.cpu):
+ #
+ # Tie the cpu ports to the ruby cpu ports
+ #
+ cpu.icache_port = system.ruby.cpu_ruby_ports[i].port
+ cpu.dcache_port = system.ruby.cpu_ruby_ports[i].port
'''process = LiveProcess()
process.executable = options.cmd
process.cmd = [options.cmd, str(i)]
'''
- system.cpu[i].workload = process
-
- if options.fastmem:
- system.cpu[i].physmem_port = system.physmem.port
-
+ cpu.workload = process
root = Root(system = system)