Ruby.py (9100:3caf131d7a95) Ruby.py (9148:a7a72f42919e)
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

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

131 class IntLinkClass(GarnetIntLink): pass
132 class ExtLinkClass(GarnetExtLink): pass
133 class RouterClass(GarnetRouter): pass
134 else:
135 class NetworkClass(SimpleNetwork): pass
136 class IntLinkClass(SimpleIntLink): pass
137 class ExtLinkClass(SimpleExtLink): pass
138 class RouterClass(BasicRouter): pass
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

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

131 class IntLinkClass(GarnetIntLink): pass
132 class ExtLinkClass(GarnetExtLink): pass
133 class RouterClass(GarnetRouter): pass
134 else:
135 class NetworkClass(SimpleNetwork): pass
136 class IntLinkClass(SimpleIntLink): pass
137 class ExtLinkClass(SimpleExtLink): pass
138 class RouterClass(BasicRouter): pass
139
139
140 #
141 # Important: the topology must be instantiated before the network and after
142 # the controllers. Hence the separation between topology definition and
140 #
141 # Important: the topology must be instantiated before the network and after
142 # the controllers. Hence the separation between topology definition and
143 # instantiation. TopologyCreator is in src/mem/ruby/network/topologies/.
143 # instantiation.
144 #
144 #
145 from TopologyCreator import instantiateTopology
146 try:
147 net_topology = instantiateTopology(topology, options, \
148 IntLinkClass, ExtLinkClass, \
149 RouterClass)
150 except:
151 print "Error: could not make topology %s" % options.topology
152 raise
145 # gem5 SimObject defined in src/mem/ruby/network/Network.py
146 net_topology = Topology()
147 net_topology.description = topology.description
153
148
149 routers, int_links, ext_links = topology.makeTopology(options,
150 IntLinkClass, ExtLinkClass, RouterClass)
151
152 net_topology.routers = routers
153 net_topology.int_links = int_links
154 net_topology.ext_links = ext_links
155
156
154 if options.network_fault_model:
155 assert(options.garnet_network == "fixed")
156 fault_model = FaultModel()
157 network = NetworkClass(ruby_system = ruby, topology = net_topology,\
158 enable_fault_model=True, fault_model = fault_model)
159 else:
160 network = NetworkClass(ruby_system = ruby, topology = net_topology)
161
162 #
163 # Loop through the directory controlers.
164 # Determine the total memory size of the ruby system and verify it is equal
157 if options.network_fault_model:
158 assert(options.garnet_network == "fixed")
159 fault_model = FaultModel()
160 network = NetworkClass(ruby_system = ruby, topology = net_topology,\
161 enable_fault_model=True, fault_model = fault_model)
162 else:
163 network = NetworkClass(ruby_system = ruby, topology = net_topology)
164
165 #
166 # Loop through the directory controlers.
167 # Determine the total memory size of the ruby system and verify it is equal
165 # to physmem. However, if Ruby memory is using sparse memory in SE
168 # to physmem. However, if Ruby memory is using sparse memory in SE
166 # mode, then the system should not back-up the memory state with
167 # the Memory Vector and thus the memory size bytes should stay at 0.
168 # Also set the numa bits to the appropriate values.
169 #
170 total_mem_size = MemorySize('0B')
171
172 dir_bits = int(math.log(options.num_dirs, 2))
173
174 if options.numa_high_bit:
175 numa_bit = options.numa_high_bit
176 else:
177 # if not specified, use the lowest bits above the block offest
178 if dir_bits > 0:
179 # add 5 because bits 0-5 are the block offset
180 numa_bit = dir_bits + 5
181 else:
182 numa_bit = 6
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
177 if options.numa_high_bit:
178 numa_bit = options.numa_high_bit
179 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
183
186
184 for dir_cntrl in dir_cntrls:
185 total_mem_size.value += dir_cntrl.directory.size.value
186 dir_cntrl.directory.numa_high_bit = numa_bit
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
187
190
188 phys_mem_size = 0
189 for mem in system.memories.unproxy(system):
190 phys_mem_size += long(mem.range.second) - long(mem.range.first) + 1
191 assert(total_mem_size.value == phys_mem_size)
192
193 ruby_profiler = RubyProfiler(ruby_system = ruby,
194 num_of_sequencers = len(cpu_sequencers))
195 ruby.network = network
196 ruby.profiler = ruby_profiler
197 ruby.mem_size = total_mem_size
198 ruby._cpu_ruby_ports = cpu_sequencers
199 ruby.random_seed = options.random_seed
191 phys_mem_size = 0
192 for mem in system.memories.unproxy(system):
193 phys_mem_size += long(mem.range.second) - long(mem.range.first) + 1
194 assert(total_mem_size.value == phys_mem_size)
195
196 ruby_profiler = RubyProfiler(ruby_system = ruby,
197 num_of_sequencers = len(cpu_sequencers))
198 ruby.network = network
199 ruby.profiler = ruby_profiler
200 ruby.mem_size = total_mem_size
201 ruby._cpu_ruby_ports = cpu_sequencers
202 ruby.random_seed = options.random_seed