diff options
author | Brad Beckmann ext:(%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E) <Brad.Beckmann@amd.com> | 2011-06-30 19:49:26 -0500 |
---|---|---|
committer | Brad Beckmann ext:(%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E) <Brad.Beckmann@amd.com> | 2011-06-30 19:49:26 -0500 |
commit | c86f849d5a1da1fc77f2fca43b82cb6760f68bc9 (patch) | |
tree | f192cbc73d86ee4e15e752f6ed174e4ce3425c9e /configs/ruby | |
parent | f4cfd65d2982f0f97304ef05083b40f3346a496f (diff) | |
download | gem5-c86f849d5a1da1fc77f2fca43b82cb6760f68bc9.tar.xz |
Ruby: Add support for functional accesses
This patch rpovides functional access support in Ruby. Currently only
the M5Port of RubyPort supports functional accesses. The support for
functional through the PioPort will be added as a separate patch.
Diffstat (limited to 'configs/ruby')
-rw-r--r-- | configs/ruby/MESI_CMP_directory.py | 17 | ||||
-rw-r--r-- | configs/ruby/MI_example.py | 11 | ||||
-rw-r--r-- | configs/ruby/MOESI_CMP_directory.py | 19 | ||||
-rw-r--r-- | configs/ruby/MOESI_CMP_token.py | 17 | ||||
-rw-r--r-- | configs/ruby/MOESI_hammer.py | 13 | ||||
-rw-r--r-- | configs/ruby/Ruby.py | 24 |
6 files changed, 59 insertions, 42 deletions
diff --git a/configs/ruby/MESI_CMP_directory.py b/configs/ruby/MESI_CMP_directory.py index f0e072f90..fdb6ce0b0 100644 --- a/configs/ruby/MESI_CMP_directory.py +++ b/configs/ruby/MESI_CMP_directory.py @@ -47,7 +47,7 @@ class L2Cache(RubyCache): def define_options(parser): return -def create_system(options, system, piobus, dma_devices): +def create_system(options, system, piobus, dma_devices, ruby_system): if buildEnv['PROTOCOL'] != 'MESI_CMP_directory': panic("This script requires the MESI_CMP_directory protocol to be built.") @@ -88,13 +88,15 @@ def create_system(options, system, piobus, dma_devices): cntrl_id = cntrl_count, L1IcacheMemory = l1i_cache, L1DcacheMemory = l1d_cache, - l2_select_num_bits = l2_bits) + l2_select_num_bits = l2_bits, + ruby_system = ruby_system) cpu_seq = RubySequencer(version = i, icache = l1i_cache, dcache = l1d_cache, physMemPort = system.physmem.port, - physmem = system.physmem) + physmem = system.physmem, + ruby_system = ruby_system) l1_cntrl.sequencer = cpu_seq @@ -123,7 +125,8 @@ def create_system(options, system, piobus, dma_devices): l2_cntrl = L2Cache_Controller(version = i, cntrl_id = cntrl_count, - L2cacheMemory = l2_cache) + L2cacheMemory = l2_cache, + ruby_system = ruby_system) exec("system.l2_cntrl%d = l2_cntrl" % i) l2_cntrl_nodes.append(l2_cntrl) @@ -148,9 +151,9 @@ def create_system(options, system, piobus, dma_devices): cntrl_id = cntrl_count, directory = \ RubyDirectoryMemory(version = i, - size = \ - dir_size), - memBuffer = mem_cntrl) + size = dir_size), + memBuffer = mem_cntrl, + ruby_system = ruby_system) exec("system.dir_cntrl%d = dir_cntrl" % i) dir_cntrl_nodes.append(dir_cntrl) diff --git a/configs/ruby/MI_example.py b/configs/ruby/MI_example.py index 5018f2c18..4ea5e5993 100644 --- a/configs/ruby/MI_example.py +++ b/configs/ruby/MI_example.py @@ -41,7 +41,7 @@ class Cache(RubyCache): def define_options(parser): return -def create_system(options, system, piobus, dma_devices): +def create_system(options, system, piobus, dma_devices, ruby_system): if buildEnv['PROTOCOL'] != 'MI_example': panic("This script requires the MI_example protocol to be built.") @@ -80,13 +80,15 @@ def create_system(options, system, piobus, dma_devices): # l1_cntrl = L1Cache_Controller(version = i, cntrl_id = cntrl_count, - cacheMemory = cache) + cacheMemory = cache, + ruby_system = ruby_system) cpu_seq = RubySequencer(version = i, icache = cache, dcache = cache, physMemPort = system.physmem.port, - physmem = system.physmem) + physmem = system.physmem, + ruby_system = ruby_system) l1_cntrl.sequencer = cpu_seq @@ -125,7 +127,8 @@ def create_system(options, system, piobus, dma_devices): use_map = options.use_map, map_levels = \ options.map_levels), - memBuffer = mem_cntrl) + memBuffer = mem_cntrl, + ruby_system = ruby_system) exec("system.dir_cntrl%d = dir_cntrl" % i) dir_cntrl_nodes.append(dir_cntrl) diff --git a/configs/ruby/MOESI_CMP_directory.py b/configs/ruby/MOESI_CMP_directory.py index c8b16fc5d..5da1cf310 100644 --- a/configs/ruby/MOESI_CMP_directory.py +++ b/configs/ruby/MOESI_CMP_directory.py @@ -47,8 +47,8 @@ class L2Cache(RubyCache): def define_options(parser): return -def create_system(options, system, piobus, dma_devices): - +def create_system(options, system, piobus, dma_devices, ruby_system): + if buildEnv['PROTOCOL'] != 'MOESI_CMP_directory': panic("This script requires the MOESI_CMP_directory protocol to be built.") @@ -88,13 +88,15 @@ def create_system(options, system, piobus, dma_devices): cntrl_id = cntrl_count, L1IcacheMemory = l1i_cache, L1DcacheMemory = l1d_cache, - l2_select_num_bits = l2_bits) + l2_select_num_bits = l2_bits, + ruby_system = ruby_system) cpu_seq = RubySequencer(version = i, icache = l1i_cache, dcache = l1d_cache, physMemPort = system.physmem.port, - physmem = system.physmem) + physmem = system.physmem, + ruby_system = ruby_system) l1_cntrl.sequencer = cpu_seq @@ -122,7 +124,8 @@ def create_system(options, system, piobus, dma_devices): l2_cntrl = L2Cache_Controller(version = i, cntrl_id = cntrl_count, - L2cacheMemory = l2_cache) + L2cacheMemory = l2_cache, + ruby_system = ruby_system) exec("system.l2_cntrl%d = l2_cntrl" % i) l2_cntrl_nodes.append(l2_cntrl) @@ -147,9 +150,9 @@ def create_system(options, system, piobus, dma_devices): cntrl_id = cntrl_count, directory = \ RubyDirectoryMemory(version = i, - size = \ - dir_size), - memBuffer = mem_cntrl) + size = dir_size), + memBuffer = mem_cntrl, + ruby_system = ruby_system) exec("system.dir_cntrl%d = dir_cntrl" % i) dir_cntrl_nodes.append(dir_cntrl) diff --git a/configs/ruby/MOESI_CMP_token.py b/configs/ruby/MOESI_CMP_token.py index 36999be5d..c7f9dda11 100644 --- a/configs/ruby/MOESI_CMP_token.py +++ b/configs/ruby/MOESI_CMP_token.py @@ -54,7 +54,7 @@ def define_options(parser): parser.add_option("--allow-atomic-migration", action="store_true", help="allow migratory sharing for atomic only accessed blocks") -def create_system(options, system, piobus, dma_devices): +def create_system(options, system, piobus, dma_devices, ruby_system): if buildEnv['PROTOCOL'] != 'MOESI_CMP_token': panic("This script requires the MOESI_CMP_token protocol to be built.") @@ -110,13 +110,15 @@ def create_system(options, system, piobus, dma_devices): dynamic_timeout_enabled = \ not options.disable_dyn_timeouts, no_mig_atomic = not \ - options.allow_atomic_migration) + options.allow_atomic_migration, + ruby_system = ruby_system) cpu_seq = RubySequencer(version = i, icache = l1i_cache, dcache = l1d_cache, physMemPort = system.physmem.port, - physmem = system.physmem) + physmem = system.physmem, + ruby_system = ruby_system) l1_cntrl.sequencer = cpu_seq @@ -145,7 +147,8 @@ def create_system(options, system, piobus, dma_devices): l2_cntrl = L2Cache_Controller(version = i, cntrl_id = cntrl_count, L2cacheMemory = l2_cache, - N_tokens = n_tokens) + N_tokens = n_tokens, + ruby_system = ruby_system) exec("system.l2_cntrl%d = l2_cntrl" % i) l2_cntrl_nodes.append(l2_cntrl) @@ -170,10 +173,10 @@ def create_system(options, system, piobus, dma_devices): cntrl_id = cntrl_count, directory = \ RubyDirectoryMemory(version = i, - size = \ - dir_size), + size = dir_size), memBuffer = mem_cntrl, - l2_select_num_bits = l2_bits) + l2_select_num_bits = l2_bits, + ruby_system = ruby_system) exec("system.dir_cntrl%d = dir_cntrl" % i) dir_cntrl_nodes.append(dir_cntrl) diff --git a/configs/ruby/MOESI_hammer.py b/configs/ruby/MOESI_hammer.py index 7e789d8e3..6e46f3e0f 100644 --- a/configs/ruby/MOESI_hammer.py +++ b/configs/ruby/MOESI_hammer.py @@ -58,8 +58,8 @@ def define_options(parser): parser.add_option("--dir-on", action="store_true", help="Hammer: enable Full-bit Directory") -def create_system(options, system, piobus, dma_devices): - +def create_system(options, system, piobus, dma_devices, ruby_system): + if buildEnv['PROTOCOL'] != 'MOESI_hammer': panic("This script requires the MOESI_hammer protocol to be built.") @@ -102,13 +102,15 @@ def create_system(options, system, piobus, dma_devices): L1DcacheMemory = l1d_cache, L2cacheMemory = l2_cache, no_mig_atomic = not \ - options.allow_atomic_migration) + options.allow_atomic_migration, + ruby_system = ruby_system) cpu_seq = RubySequencer(version = i, icache = l1i_cache, dcache = l1d_cache, physMemPort = system.physmem.port, - physmem = system.physmem) + physmem = system.physmem, + ruby_system = ruby_system) l1_cntrl.sequencer = cpu_seq @@ -181,7 +183,8 @@ def create_system(options, system, piobus, dma_devices): probeFilter = pf, memBuffer = mem_cntrl, probe_filter_enabled = options.pf_on, - full_bit_dir_enabled = options.dir_on) + full_bit_dir_enabled = options.dir_on, + ruby_system = ruby_system) if options.recycle_latency: dir_cntrl.recycle_latency = options.recycle_latency diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py index 3c58dfd2f..9174709b4 100644 --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -62,11 +62,15 @@ def define_options(parser): def create_system(options, system, piobus = None, dma_devices = []): + system.ruby = RubySystem(clock = options.clock) + ruby = system.ruby + protocol = buildEnv['PROTOCOL'] exec "import %s" % protocol try: (cpu_sequencers, dir_cntrls, all_cntrls) = \ - eval("%s.create_system(options, system, piobus, dma_devices)" \ + eval("%s.create_system(options, system, piobus, \ + dma_devices, ruby)" \ % protocol) except: print "Error: could not create sytem for ruby protocol %s" % protocol @@ -105,7 +109,7 @@ def create_system(options, system, piobus = None, dma_devices = []): print "Error: could not create topology %s" % options.topology raise - network = NetworkClass(topology = net_topology) + network = NetworkClass(ruby_system = ruby, topology = net_topology) # # Loop through the directory controlers. @@ -137,15 +141,13 @@ def create_system(options, system, piobus = None, dma_devices = []): long(system.physmem.range.first) + 1 assert(total_mem_size.value == physmem_size) - ruby_profiler = RubyProfiler(num_of_sequencers = len(cpu_sequencers)) + ruby_profiler = RubyProfiler(ruby_system = ruby, + num_of_sequencers = len(cpu_sequencers)) + ruby_tracer = RubyTracer(ruby_system = ruby) - ruby = RubySystem(clock = options.clock, - network = network, - profiler = ruby_profiler, - tracer = RubyTracer(), - mem_size = total_mem_size) - + ruby.network = network + ruby.profiler = ruby_profiler + ruby.tracer = ruby_tracer + ruby.mem_size = total_mem_size ruby._cpu_ruby_ports = cpu_sequencers ruby.random_seed = options.random_seed - - return ruby |