Ruby.py (9274:ba635023d4bb) Ruby.py (9318:dec0b284ded9)
1# Copyright (c) 2012 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 159 unchanged lines hidden (view full) ---

168 # to physmem. However, if Ruby memory is using sparse memory in SE
169 # mode, then the system should not back-up the memory state with
170 # the Memory Vector and thus the memory size bytes should stay at 0.
171 # Also set the numa bits to the appropriate values.
172 #
173 total_mem_size = MemorySize('0B')
174
175 dir_bits = int(math.log(options.num_dirs, 2))
1# Copyright (c) 2012 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 159 unchanged lines hidden (view full) ---

168 # to physmem. However, if Ruby memory is using sparse memory in SE
169 # mode, then the system should not back-up the memory state with
170 # the Memory Vector and thus the memory size bytes should stay at 0.
171 # Also set the numa bits to the appropriate values.
172 #
173 total_mem_size = MemorySize('0B')
174
175 dir_bits = int(math.log(options.num_dirs, 2))
176 ruby.block_size_bytes = options.cacheline_size
177 block_size_bits = int(math.log(options.cacheline_size, 2))
176
177 if options.numa_high_bit:
178 numa_bit = options.numa_high_bit
179 else:
178
179 if options.numa_high_bit:
180 numa_bit = options.numa_high_bit
181 else:
180 # if not specified, use the lowest bits above the block offest
181 if dir_bits > 0:
182 # add 5 because bits 0-5 are the block offset
183 numa_bit = dir_bits + 5
184 else:
185 numa_bit = 6
182 # if the numa_bit is not specified, set the directory bits as the
183 # lowest bits above the block offset bits, and the numa_bit as the
184 # highest of those directory bits
185 numa_bit = block_size_bits + dir_bits - 1
186
187 for dir_cntrl in dir_cntrls:
188 total_mem_size.value += dir_cntrl.directory.size.value
189 dir_cntrl.directory.numa_high_bit = numa_bit
190
191 phys_mem_size = sum(map(lambda mem: mem.range.size(),
192 system.memories.unproxy(system)))
193 assert(total_mem_size.value == phys_mem_size)
194
195 ruby_profiler = RubyProfiler(ruby_system = ruby,
196 num_of_sequencers = len(cpu_sequencers))
197 ruby.network = network
198 ruby.profiler = ruby_profiler
199 ruby.mem_size = total_mem_size
200 ruby._cpu_ruby_ports = cpu_sequencers
201 ruby.random_seed = options.random_seed
186
187 for dir_cntrl in dir_cntrls:
188 total_mem_size.value += dir_cntrl.directory.size.value
189 dir_cntrl.directory.numa_high_bit = numa_bit
190
191 phys_mem_size = sum(map(lambda mem: mem.range.size(),
192 system.memories.unproxy(system)))
193 assert(total_mem_size.value == phys_mem_size)
194
195 ruby_profiler = RubyProfiler(ruby_system = ruby,
196 num_of_sequencers = len(cpu_sequencers))
197 ruby.network = network
198 ruby.profiler = ruby_profiler
199 ruby.mem_size = total_mem_size
200 ruby._cpu_ruby_ports = cpu_sequencers
201 ruby.random_seed = options.random_seed