Ruby.py (9862:54d6728d99cf) Ruby.py (10004:5d8b72563869)
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

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

162 # Determine the total memory size of the ruby system and verify it is equal
163 # to physmem. However, if Ruby memory is using sparse memory in SE
164 # mode, then the system should not back-up the memory state with
165 # the Memory Vector and thus the memory size bytes should stay at 0.
166 # Also set the numa bits to the appropriate values.
167 #
168 total_mem_size = MemorySize('0B')
169
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

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

162 # Determine the total memory size of the ruby system and verify it is equal
163 # to physmem. However, if Ruby memory is using sparse memory in SE
164 # mode, then the system should not back-up the memory state with
165 # the Memory Vector and thus the memory size bytes should stay at 0.
166 # Also set the numa bits to the appropriate values.
167 #
168 total_mem_size = MemorySize('0B')
169
170 dir_bits = int(math.log(options.num_dirs, 2))
171 ruby.block_size_bytes = options.cacheline_size
172 block_size_bits = int(math.log(options.cacheline_size, 2))
173
174 if options.numa_high_bit:
175 numa_bit = options.numa_high_bit
176 else:
177 # if the numa_bit is not specified, set the directory bits as the
178 # lowest bits above the block offset bits, and the numa_bit as the
179 # highest of those directory bits
170 ruby.block_size_bytes = options.cacheline_size
171 block_size_bits = int(math.log(options.cacheline_size, 2))
172
173 if options.numa_high_bit:
174 numa_bit = options.numa_high_bit
175 else:
176 # if the numa_bit is not specified, set the directory bits as the
177 # lowest bits above the block offset bits, and the numa_bit as the
178 # highest of those directory bits
179 dir_bits = int(math.log(options.num_dirs, 2))
180 numa_bit = block_size_bits + dir_bits - 1
181
182 for dir_cntrl in dir_cntrls:
183 total_mem_size.value += dir_cntrl.directory.size.value
184 dir_cntrl.directory.numa_high_bit = numa_bit
185
186 phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
187 assert(total_mem_size.value == phys_mem_size)
188
189 ruby_profiler = RubyProfiler(ruby_system = ruby,
190 num_of_sequencers = len(cpu_sequencers))
191 ruby.network = network
192 ruby.profiler = ruby_profiler
193 ruby.mem_size = total_mem_size
194 ruby._cpu_ruby_ports = cpu_sequencers
195 ruby.random_seed = options.random_seed
180 numa_bit = block_size_bits + dir_bits - 1
181
182 for dir_cntrl in dir_cntrls:
183 total_mem_size.value += dir_cntrl.directory.size.value
184 dir_cntrl.directory.numa_high_bit = numa_bit
185
186 phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
187 assert(total_mem_size.value == phys_mem_size)
188
189 ruby_profiler = RubyProfiler(ruby_system = ruby,
190 num_of_sequencers = len(cpu_sequencers))
191 ruby.network = network
192 ruby.profiler = ruby_profiler
193 ruby.mem_size = total_mem_size
194 ruby._cpu_ruby_ports = cpu_sequencers
195 ruby.random_seed = options.random_seed