l1_cntrl.forwardFromCache = MessageBuffer()
mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
- options, system.mem_ranges, bootmem, ruby_system, system)
+ options, bootmem, ruby_system, system)
dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
if rom_dir_cntrl_node is not None:
dir_cntrl_nodes.append(rom_dir_cntrl_node)
clk_domain = ruby_system.clk_domain, clk_divider = 3)
mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
- options, system.mem_ranges, bootmem, ruby_system, system)
+ options, bootmem, ruby_system, system)
dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
if rom_dir_cntrl_node is not None:
dir_cntrl_nodes.append(rom_dir_cntrl_node)
clk_divider = 3)
mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
- options, system.mem_ranges, bootmem, ruby_system, system)
+ options, bootmem, ruby_system, system)
dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
if rom_dir_cntrl_node is not None:
dir_cntrl_nodes.append(rom_dir_cntrl_node)
clk_divider=3)
mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
- options, system.mem_ranges, bootmem, ruby_system, system)
+ options, bootmem, ruby_system, system)
dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
if rom_dir_cntrl_node is not None:
dir_cntrl_nodes.append(rom_dir_cntrl_node)
mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
- options, system.mem_ranges, bootmem, ruby_system, system)
+ options, bootmem, ruby_system, system)
dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
if rom_dir_cntrl_node is not None:
dir_cntrl_nodes.append(rom_dir_cntrl_node)
clk_divider=3)
mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
- options, system.mem_ranges, bootmem, ruby_system, system)
+ options, bootmem, ruby_system, system)
dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
if rom_dir_cntrl_node is not None:
dir_cntrl_nodes.append(rom_dir_cntrl_node)
clk_divider=3)
mem_dir_cntrl_nodes, rom_dir_cntrl_node = create_directories(
- options, system.mem_ranges, bootmem, ruby_system, system)
+ options, bootmem, ruby_system, system)
dir_cntrl_nodes = mem_dir_cntrl_nodes[:]
if rom_dir_cntrl_node is not None:
dir_cntrl_nodes.append(rom_dir_cntrl_node)
mem_ctrls = []
crossbars = []
+ if options.numa_high_bit:
+ dir_bits = int(math.log(options.num_dirs, 2))
+ intlv_size = 2 ** (options.numa_high_bit - dir_bits + 1)
+ else:
+ # if the numa_bit is not specified, set the directory bits as the
+ # lowest bits above the block offset bits
+ intlv_size = options.cacheline_size
+
# Sets bits to be used for interleaving. Creates memory controllers
# attached to a directory controller. A separate controller is created
# for each address range as the abstract memory can handle only one
crossbars.append(crossbar)
dir_cntrl.memory = crossbar.slave
+ dir_ranges = []
for r in system.mem_ranges:
mem_ctrl = MemConfig.create_mem_ctrl(
MemConfig.get(options.mem_type), r, index, options.num_dirs,
- int(math.log(options.num_dirs, 2)), options.cacheline_size)
+ int(math.log(options.num_dirs, 2)), intlv_size)
if options.access_backing_store:
mem_ctrl.kvm_map=False
mem_ctrls.append(mem_ctrl)
+ dir_ranges.append(mem_ctrl.range)
if crossbar != None:
mem_ctrl.port = crossbar.master
mem_ctrl.port = dir_cntrl.memory
index += 1
+ dir_cntrl.addr_ranges = dir_ranges
system.mem_ctrls = mem_ctrls
ruby.phys_mem = SimpleMemory(range=system.mem_ranges[0],
in_addr_map=False)
-def create_directories(options, mem_ranges, bootmem, ruby_system,
- system):
+def create_directories(options, bootmem, ruby_system, system):
dir_cntrl_nodes = []
- if options.numa_high_bit:
- numa_bit = options.numa_high_bit
- else:
- # if the numa_bit is not specified, set the directory bits as the
- # lowest bits above the block offset bits, and the numa_bit as the
- # highest of those directory bits
- dir_bits = int(math.log(options.num_dirs, 2))
- block_size_bits = int(math.log(options.cacheline_size, 2))
- numa_bit = block_size_bits + dir_bits - 1
-
for i in xrange(options.num_dirs):
- dir_ranges = []
- for r in mem_ranges:
- addr_range = m5.objects.AddrRange(r.start, size = r.size(),
- intlvHighBit = numa_bit,
- intlvBits = dir_bits,
- intlvMatch = i)
- dir_ranges.append(addr_range)
-
dir_cntrl = Directory_Controller()
dir_cntrl.version = i
dir_cntrl.directory = RubyDirectoryMemory()
dir_cntrl.ruby_system = ruby_system
- dir_cntrl.addr_ranges = dir_ranges
exec("ruby_system.dir_cntrl%d = dir_cntrl" % i)
dir_cntrl_nodes.append(dir_cntrl)