From 48b58b3332251670432db2cc7832b80eb2787bda Mon Sep 17 00:00:00 2001 From: Brad Beckmann Date: Fri, 25 Mar 2011 10:13:50 -0700 Subject: ruby: fixed cache index setting --- configs/ruby/MOESI_CMP_token.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'configs/ruby/MOESI_CMP_token.py') diff --git a/configs/ruby/MOESI_CMP_token.py b/configs/ruby/MOESI_CMP_token.py index 1e1190cae..72721058b 100644 --- a/configs/ruby/MOESI_CMP_token.py +++ b/configs/ruby/MOESI_CMP_token.py @@ -82,15 +82,18 @@ def create_system(options, system, piobus, dma_devices): # controller constructors are called before the network constructor # l2_bits = int(math.log(options.num_l2caches, 2)) + block_size_bits = int(math.log(options.cacheline_size, 2)) for i in xrange(options.num_cpus): # # First create the Ruby objects associated with this cpu # l1i_cache = L1Cache(size = options.l1i_size, - assoc = options.l1i_assoc) + assoc = options.l1i_assoc, + start_index_bit = block_size_bits) l1d_cache = L1Cache(size = options.l1d_size, - assoc = options.l1d_assoc) + assoc = options.l1d_assoc, + start_index_bit = block_size_bits) cpu_seq = RubySequencer(version = i, icache = l1i_cache, @@ -123,13 +126,15 @@ def create_system(options, system, piobus, dma_devices): cpu_sequencers.append(cpu_seq) l1_cntrl_nodes.append(l1_cntrl) + l2_index_start = block_size_bits + l2_bits + for i in xrange(options.num_l2caches): # # First create the Ruby objects associated with this cpu # l2_cache = L2Cache(size = options.l2_size, assoc = options.l2_assoc, - start_index_bit = l2_bits) + start_index_bit = l2_index_start) l2_cntrl = L2Cache_Controller(version = i, L2cacheMemory = l2_cache, @@ -158,9 +163,7 @@ def create_system(options, system, piobus, dma_devices): size = \ dir_size), memBuffer = mem_cntrl, - l2_select_num_bits = \ - math.log(options.num_l2caches, - 2)) + l2_select_num_bits = l2_bits) exec("system.dir_cntrl%d = dir_cntrl" % i) dir_cntrl_nodes.append(dir_cntrl) -- cgit v1.2.3