summaryrefslogtreecommitdiff
path: root/configs/ruby/MOESI_CMP_directory.py
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2010-08-20 11:46:11 -0700
committerBrad Beckmann <Brad.Beckmann@amd.com>2010-08-20 11:46:11 -0700
commit10e25cb1d05bd04e177cfa44a0c529af01acfad8 (patch)
tree5cc47d8b9cbb444bfc171d11998ad16dd7df47ba /configs/ruby/MOESI_CMP_directory.py
parent09854be558db4eae912efd3ff3b6ab4d35261c27 (diff)
downloadgem5-10e25cb1d05bd04e177cfa44a0c529af01acfad8.tar.xz
config: Improve ruby simobject names
This patch attaches ruby objects to the system before the topology is created so that their simobject names read their meaningful variable names instead of their topology name.
Diffstat (limited to 'configs/ruby/MOESI_CMP_directory.py')
-rw-r--r--configs/ruby/MOESI_CMP_directory.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/configs/ruby/MOESI_CMP_directory.py b/configs/ruby/MOESI_CMP_directory.py
index 8c332f8e4..ebc628fc0 100644
--- a/configs/ruby/MOESI_CMP_directory.py
+++ b/configs/ruby/MOESI_CMP_directory.py
@@ -47,7 +47,7 @@ class L2Cache(RubyCache):
def define_options(parser):
return
-def create_system(options, phys_mem, piobus, dma_devices):
+def create_system(options, system, piobus, dma_devices):
if buildEnv['PROTOCOL'] != 'MOESI_CMP_directory':
panic("This script requires the MOESI_CMP_directory protocol to be built.")
@@ -81,8 +81,8 @@ def create_system(options, phys_mem, piobus, dma_devices):
cpu_seq = RubySequencer(version = i,
icache = l1i_cache,
dcache = l1d_cache,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
if piobus != None:
cpu_seq.pio_port = piobus.port
@@ -92,7 +92,10 @@ def create_system(options, phys_mem, piobus, dma_devices):
L1IcacheMemory = l1i_cache,
L1DcacheMemory = l1d_cache,
l2_select_num_bits = \
- math.log(options.num_l2caches, 2))
+ math.log(options.num_l2caches,
+ 2))
+
+ exec("system.l1_cntrl%d = l1_cntrl" % i)
#
# Add controllers and sequencers to the appropriate lists
#
@@ -109,9 +112,11 @@ def create_system(options, phys_mem, piobus, dma_devices):
l2_cntrl = L2Cache_Controller(version = i,
L2cacheMemory = l2_cache)
+ exec("system.l2_cntrl%d = l2_cntrl" % i)
l2_cntrl_nodes.append(l2_cntrl)
- phys_mem_size = long(phys_mem.range.second) - long(phys_mem.range.first) + 1
+ phys_mem_size = long(system.physmem.range.second) - \
+ long(system.physmem.range.first) + 1
mem_module_size = phys_mem_size / options.num_dirs
for i in xrange(options.num_dirs):
@@ -127,9 +132,11 @@ def create_system(options, phys_mem, piobus, dma_devices):
dir_cntrl = Directory_Controller(version = i,
directory = \
RubyDirectoryMemory(version = i,
- size = dir_size),
+ size = \
+ dir_size),
memBuffer = mem_cntrl)
+ exec("system.dir_cntrl%d = dir_cntrl" % i)
dir_cntrl_nodes.append(dir_cntrl)
for i, dma_device in enumerate(dma_devices):
@@ -137,12 +144,13 @@ def create_system(options, phys_mem, piobus, dma_devices):
# Create the Ruby objects associated with the dma controller
#
dma_seq = DMASequencer(version = i,
- physMemPort = phys_mem.port,
- physmem = phys_mem)
+ physMemPort = system.physmem.port,
+ physmem = system.physmem)
dma_cntrl = DMA_Controller(version = i,
dma_sequencer = dma_seq)
+ exec("system.dma_cntrl%d = dma_cntrl" % i)
dma_cntrl.dma_sequencer.port = dma_device.dma
dma_cntrl_nodes.append(dma_cntrl)