2 # Copyright (c) 2011-2015 Advanced Micro Devices, Inc.
5 # For use for simulation and test purposes only
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are met:
10 # 1. Redistributions of source code must retain the above copyright notice,
11 # this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright notice,
14 # this list of conditions and the following disclaimer in the documentation
15 # and/or other materials provided with the distribution.
17 # 3. Neither the name of the copyright holder nor the names of its contributors
18 # may be used to endorse or promote products derived from this software
19 # without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 # POSSIBILITY OF SUCH DAMAGE.
38 from m5
.objects
import *
39 from m5
.defines
import buildEnv
40 from Ruby
import create_topology
41 from Ruby
import send_evicts
43 from topologies
.Cluster
import Cluster
44 from topologies
.Crossbar
import Crossbar
50 # Use SeqCount not class since we need global count
52 return CntrlBase
._seqs
- 1
57 # Use CntlCount not class since we need global count
58 CntrlBase
._cntrls
+= 1
59 return CntrlBase
._cntrls
- 1
63 def versionCount(cls
):
64 cls
._version
+= 1 # Use count for this particular type
65 return cls
._version
- 1
67 class L1Cache(RubyCache
):
68 resourceStalls
= False
73 def create(self
, size
, assoc
, options
):
74 self
.size
= MemorySize(size
)
76 self
.replacement_policy
= PseudoLRUReplacementPolicy()
78 class L2Cache(RubyCache
):
79 resourceStalls
= False
83 def create(self
, size
, assoc
, options
):
84 self
.size
= MemorySize(size
)
86 self
.replacement_policy
= PseudoLRUReplacementPolicy()
88 class CPCntrl(CorePair_Controller
, CntrlBase
):
90 def create(self
, options
, ruby_system
, system
):
91 self
.version
= self
.versionCount()
93 self
.L1Icache
= L1Cache()
94 self
.L1Icache
.create(options
.l1i_size
, options
.l1i_assoc
, options
)
95 self
.L1D0cache
= L1Cache()
96 self
.L1D0cache
.create(options
.l1d_size
, options
.l1d_assoc
, options
)
97 self
.L1D1cache
= L1Cache()
98 self
.L1D1cache
.create(options
.l1d_size
, options
.l1d_assoc
, options
)
99 self
.L2cache
= L2Cache()
100 self
.L2cache
.create(options
.l2_size
, options
.l2_assoc
, options
)
102 self
.sequencer
= RubySequencer()
103 self
.sequencer
.version
= self
.seqCount()
104 self
.sequencer
.icache
= self
.L1Icache
105 self
.sequencer
.dcache
= self
.L1D0cache
106 self
.sequencer
.ruby_system
= ruby_system
107 self
.sequencer
.coreid
= 0
108 self
.sequencer
.is_cpu_sequencer
= True
110 self
.sequencer1
= RubySequencer()
111 self
.sequencer1
.version
= self
.seqCount()
112 self
.sequencer1
.icache
= self
.L1Icache
113 self
.sequencer1
.dcache
= self
.L1D1cache
114 self
.sequencer1
.ruby_system
= ruby_system
115 self
.sequencer1
.coreid
= 1
116 self
.sequencer1
.is_cpu_sequencer
= True
118 self
.issue_latency
= options
.cpu_to_dir_latency
119 self
.send_evictions
= send_evicts(options
)
121 self
.ruby_system
= ruby_system
123 if options
.recycle_latency
:
124 self
.recycle_latency
= options
.recycle_latency
126 class TCPCache(RubyCache
):
129 dataArrayBanks
= 16 #number of data banks
130 tagArrayBanks
= 16 #number of tag banks
131 dataAccessLatency
= 4
133 def create(self
, options
):
134 self
.size
= MemorySize(options
.tcp_size
)
135 self
.assoc
= options
.tcp_assoc
136 self
.resourceStalls
= options
.no_tcc_resource_stalls
137 self
.replacement_policy
= PseudoLRUReplacementPolicy()
139 class TCPCntrl(TCP_Controller
, CntrlBase
):
141 def create(self
, options
, ruby_system
, system
):
142 self
.version
= self
.versionCount()
144 self
.L1cache
= TCPCache(tagAccessLatency
= options
.TCP_latency
,
145 dataAccessLatency
= options
.TCP_latency
)
146 self
.L1cache
.resourceStalls
= options
.no_resource_stalls
147 self
.L1cache
.create(options
)
148 self
.issue_latency
= 1
150 self
.coalescer
= VIPERCoalescer()
151 self
.coalescer
.version
= self
.seqCount()
152 self
.coalescer
.icache
= self
.L1cache
153 self
.coalescer
.dcache
= self
.L1cache
154 self
.coalescer
.ruby_system
= ruby_system
155 self
.coalescer
.support_inst_reqs
= False
156 self
.coalescer
.is_cpu_sequencer
= False
158 self
.sequencer
= RubySequencer()
159 self
.sequencer
.version
= self
.seqCount()
160 self
.sequencer
.icache
= self
.L1cache
161 self
.sequencer
.dcache
= self
.L1cache
162 self
.sequencer
.ruby_system
= ruby_system
163 self
.sequencer
.is_cpu_sequencer
= True
165 self
.use_seq_not_coal
= False
167 self
.ruby_system
= ruby_system
169 if options
.recycle_latency
:
170 self
.recycle_latency
= options
.recycle_latency
172 def createCP(self
, options
, ruby_system
, system
):
173 self
.version
= self
.versionCount()
175 self
.L1cache
= TCPCache(tagAccessLatency
= options
.TCP_latency
,
176 dataAccessLatency
= options
.TCP_latency
)
177 self
.L1cache
.resourceStalls
= options
.no_resource_stalls
178 self
.L1cache
.create(options
)
179 self
.issue_latency
= 1
181 self
.coalescer
= VIPERCoalescer()
182 self
.coalescer
.version
= self
.seqCount()
183 self
.coalescer
.icache
= self
.L1cache
184 self
.coalescer
.dcache
= self
.L1cache
185 self
.coalescer
.ruby_system
= ruby_system
186 self
.coalescer
.support_inst_reqs
= False
187 self
.coalescer
.is_cpu_sequencer
= False
189 self
.sequencer
= RubySequencer()
190 self
.sequencer
.version
= self
.seqCount()
191 self
.sequencer
.icache
= self
.L1cache
192 self
.sequencer
.dcache
= self
.L1cache
193 self
.sequencer
.ruby_system
= ruby_system
194 self
.sequencer
.is_cpu_sequencer
= True
196 self
.use_seq_not_coal
= True
198 self
.ruby_system
= ruby_system
200 if options
.recycle_latency
:
201 self
.recycle_latency
= options
.recycle_latency
203 class SQCCache(RubyCache
):
206 dataAccessLatency
= 1
209 def create(self
, options
):
210 self
.size
= MemorySize(options
.sqc_size
)
211 self
.assoc
= options
.sqc_assoc
212 self
.replacement_policy
= PseudoLRUReplacementPolicy()
214 class SQCCntrl(SQC_Controller
, CntrlBase
):
216 def create(self
, options
, ruby_system
, system
):
217 self
.version
= self
.versionCount()
219 self
.L1cache
= SQCCache()
220 self
.L1cache
.create(options
)
221 self
.L1cache
.resourceStalls
= options
.no_resource_stalls
223 self
.sequencer
= RubySequencer()
225 self
.sequencer
.version
= self
.seqCount()
226 self
.sequencer
.icache
= self
.L1cache
227 self
.sequencer
.dcache
= self
.L1cache
228 self
.sequencer
.ruby_system
= ruby_system
229 self
.sequencer
.support_data_reqs
= False
230 self
.sequencer
.is_cpu_sequencer
= False
232 self
.ruby_system
= ruby_system
234 if options
.recycle_latency
:
235 self
.recycle_latency
= options
.recycle_latency
237 class TCC(RubyCache
):
238 size
= MemorySize("256kB")
240 dataAccessLatency
= 8
242 resourceStalls
= True
243 def create(self
, options
):
244 self
.assoc
= options
.tcc_assoc
245 if hasattr(options
, 'bw_scalor') and options
.bw_scalor
> 0:
246 s
= options
.num_compute_units
248 tcc_size
= str(tcc_size
)+'kB'
249 self
.size
= MemorySize(tcc_size
)
250 self
.dataArrayBanks
= 64
251 self
.tagArrayBanks
= 64
253 self
.size
= MemorySize(options
.tcc_size
)
254 self
.dataArrayBanks
= 256 / options
.num_tccs
#number of data banks
255 self
.tagArrayBanks
= 256 / options
.num_tccs
#number of tag banks
256 self
.size
.value
= self
.size
.value
/ options
.num_tccs
257 if ((self
.size
.value
/ long(self
.assoc
)) < 128):
258 self
.size
.value
= long(128 * self
.assoc
)
259 self
.start_index_bit
= math
.log(options
.cacheline_size
, 2) + \
260 math
.log(options
.num_tccs
, 2)
261 self
.replacement_policy
= PseudoLRUReplacementPolicy()
264 class TCCCntrl(TCC_Controller
, CntrlBase
):
265 def create(self
, options
, ruby_system
, system
):
266 self
.version
= self
.versionCount()
268 self
.L2cache
.create(options
)
269 self
.L2cache
.resourceStalls
= options
.no_tcc_resource_stalls
271 self
.ruby_system
= ruby_system
273 if options
.recycle_latency
:
274 self
.recycle_latency
= options
.recycle_latency
276 class L3Cache(RubyCache
):
280 def create(self
, options
, ruby_system
, system
):
281 self
.size
= MemorySize(options
.l3_size
)
282 self
.size
.value
/= options
.num_dirs
283 self
.assoc
= options
.l3_assoc
284 self
.dataArrayBanks
/= options
.num_dirs
285 self
.tagArrayBanks
/= options
.num_dirs
286 self
.dataArrayBanks
/= options
.num_dirs
287 self
.tagArrayBanks
/= options
.num_dirs
288 self
.dataAccessLatency
= options
.l3_data_latency
289 self
.tagAccessLatency
= options
.l3_tag_latency
290 self
.resourceStalls
= False
291 self
.replacement_policy
= PseudoLRUReplacementPolicy()
293 class L3Cntrl(L3Cache_Controller
, CntrlBase
):
294 def create(self
, options
, ruby_system
, system
):
295 self
.version
= self
.versionCount()
296 self
.L3cache
= L3Cache()
297 self
.L3cache
.create(options
, ruby_system
, system
)
299 self
.l3_response_latency
= max(self
.L3cache
.dataAccessLatency
, self
.L3cache
.tagAccessLatency
)
300 self
.ruby_system
= ruby_system
302 if options
.recycle_latency
:
303 self
.recycle_latency
= options
.recycle_latency
305 def connectWireBuffers(self
, req_to_dir
, resp_to_dir
, l3_unblock_to_dir
,
306 req_to_l3
, probe_to_l3
, resp_to_l3
):
307 self
.reqToDir
= req_to_dir
308 self
.respToDir
= resp_to_dir
309 self
.l3UnblockToDir
= l3_unblock_to_dir
310 self
.reqToL3
= req_to_l3
311 self
.probeToL3
= probe_to_l3
312 self
.respToL3
= resp_to_l3
314 class DirMem(RubyDirectoryMemory
, CntrlBase
):
315 def create(self
, options
, ruby_system
, system
):
316 self
.version
= self
.versionCount()
318 phys_mem_size
= AddrRange(options
.mem_size
).size()
319 mem_module_size
= phys_mem_size
/ options
.num_dirs
320 dir_size
= MemorySize('0B')
321 dir_size
.value
= mem_module_size
324 class DirCntrl(Directory_Controller
, CntrlBase
):
325 def create(self
, options
, ruby_system
, system
):
326 self
.version
= self
.versionCount()
328 self
.response_latency
= 30
330 self
.directory
= DirMem()
331 self
.directory
.create(options
, ruby_system
, system
)
333 self
.L3CacheMemory
= L3Cache()
334 self
.L3CacheMemory
.create(options
, ruby_system
, system
)
336 self
.l3_hit_latency
= max(self
.L3CacheMemory
.dataAccessLatency
,
337 self
.L3CacheMemory
.tagAccessLatency
)
339 self
.number_of_TBEs
= options
.num_tbes
341 self
.ruby_system
= ruby_system
343 if options
.recycle_latency
:
344 self
.recycle_latency
= options
.recycle_latency
346 def connectWireBuffers(self
, req_to_dir
, resp_to_dir
, l3_unblock_to_dir
,
347 req_to_l3
, probe_to_l3
, resp_to_l3
):
348 self
.reqToDir
= req_to_dir
349 self
.respToDir
= resp_to_dir
350 self
.l3UnblockToDir
= l3_unblock_to_dir
351 self
.reqToL3
= req_to_l3
352 self
.probeToL3
= probe_to_l3
353 self
.respToL3
= resp_to_l3
355 def define_options(parser
):
356 parser
.add_option("--num-subcaches", type = "int", default
= 4)
357 parser
.add_option("--l3-data-latency", type = "int", default
= 20)
358 parser
.add_option("--l3-tag-latency", type = "int", default
= 15)
359 parser
.add_option("--cpu-to-dir-latency", type = "int", default
= 120)
360 parser
.add_option("--gpu-to-dir-latency", type = "int", default
= 120)
361 parser
.add_option("--no-resource-stalls", action
= "store_false",
363 parser
.add_option("--no-tcc-resource-stalls", action
= "store_false",
365 parser
.add_option("--use-L3-on-WT", action
= "store_true", default
= False)
366 parser
.add_option("--num-tbes", type = "int", default
= 256)
367 parser
.add_option("--l2-latency", type = "int", default
= 50) # load to use
368 parser
.add_option("--num-tccs", type = "int", default
= 1,
369 help = "number of TCC banks in the GPU")
370 parser
.add_option("--sqc-size", type = 'string', default
= '32kB',
371 help = "SQC cache size")
372 parser
.add_option("--sqc-assoc", type = 'int', default
= 8,
373 help = "SQC cache assoc")
374 parser
.add_option("--WB_L1", action
= "store_true", default
= False,
375 help = "writeback L1")
376 parser
.add_option("--WB_L2", action
= "store_true", default
= False,
377 help = "writeback L2")
378 parser
.add_option("--TCP_latency", type = "int", default
= 4,
379 help = "TCP latency")
380 parser
.add_option("--TCC_latency", type = "int", default
= 16,
381 help = "TCC latency")
382 parser
.add_option("--tcc-size", type = 'string', default
= '256kB',
383 help = "agregate tcc size")
384 parser
.add_option("--tcc-assoc", type = 'int', default
= 16,
386 parser
.add_option("--tcp-size", type = 'string', default
= '16kB',
388 parser
.add_option("--tcp-assoc", type = 'int', default
= 16,
390 parser
.add_option("--noL1", action
= "store_true", default
= False,
393 def create_system(options
, full_system
, system
, dma_devices
, ruby_system
):
394 if buildEnv
['PROTOCOL'] != 'GPU_VIPER':
395 panic("This script requires the GPU_VIPER protocol to be built.")
400 # The ruby network creation expects the list of nodes in the system to be
401 # consistent with the NetDest list. Therefore the l1 controller nodes
402 # must be listed before the directory nodes and directory nodes before
413 # Must create the individual controllers before the network to ensure the
414 # controller constructors are called before the network constructor
417 # For an odd number of CPUs, still create the right number of controllers
418 TCC_bits
= int(math
.log(options
.num_tccs
, 2))
420 # This is the base crossbar that connects the L3s, Dirs, and cpu/gpu
424 if hasattr(options
, 'bw_scalor') and options
.bw_scalor
> 0:
425 #Assuming a 2GHz clock
426 crossbar_bw
= 16 * options
.num_compute_units
* options
.bw_scalor
427 mainCluster
= Cluster(intBW
=crossbar_bw
)
429 mainCluster
= Cluster(intBW
=8) # 16 GB/s
430 for i
in xrange(options
.num_dirs
):
432 dir_cntrl
= DirCntrl(noTCCdir
= True, TCC_select_num_bits
= TCC_bits
)
433 dir_cntrl
.create(options
, ruby_system
, system
)
434 dir_cntrl
.number_of_TBEs
= options
.num_tbes
435 dir_cntrl
.useL3OnWT
= options
.use_L3_on_WT
436 # the number_of_TBEs is inclusive of TBEs below
438 # Connect the Directory controller to the ruby network
439 dir_cntrl
.requestFromCores
= MessageBuffer(ordered
= True)
440 dir_cntrl
.requestFromCores
.slave
= ruby_system
.network
.master
442 dir_cntrl
.responseFromCores
= MessageBuffer()
443 dir_cntrl
.responseFromCores
.slave
= ruby_system
.network
.master
445 dir_cntrl
.unblockFromCores
= MessageBuffer()
446 dir_cntrl
.unblockFromCores
.slave
= ruby_system
.network
.master
448 dir_cntrl
.probeToCore
= MessageBuffer()
449 dir_cntrl
.probeToCore
.master
= ruby_system
.network
.slave
451 dir_cntrl
.responseToCore
= MessageBuffer()
452 dir_cntrl
.responseToCore
.master
= ruby_system
.network
.slave
454 dir_cntrl
.triggerQueue
= MessageBuffer(ordered
= True)
455 dir_cntrl
.L3triggerQueue
= MessageBuffer(ordered
= True)
456 dir_cntrl
.responseFromMemory
= MessageBuffer()
458 exec("ruby_system.dir_cntrl%d = dir_cntrl" % i
)
459 dir_cntrl_nodes
.append(dir_cntrl
)
461 mainCluster
.add(dir_cntrl
)
464 if hasattr(options
, 'bw_scalor') and options
.bw_scalor
> 0:
465 cpuCluster
= Cluster(extBW
= crossbar_bw
, intBW
= crossbar_bw
)
467 cpuCluster
= Cluster(extBW
= 8, intBW
= 8) # 16 GB/s
468 for i
in xrange((options
.num_cpus
+ 1) / 2):
471 cp_cntrl
.create(options
, ruby_system
, system
)
473 exec("ruby_system.cp_cntrl%d = cp_cntrl" % i
)
475 # Add controllers and sequencers to the appropriate lists
477 cpu_sequencers
.extend([cp_cntrl
.sequencer
, cp_cntrl
.sequencer1
])
479 # Connect the CP controllers and the network
480 cp_cntrl
.requestFromCore
= MessageBuffer()
481 cp_cntrl
.requestFromCore
.master
= ruby_system
.network
.slave
483 cp_cntrl
.responseFromCore
= MessageBuffer()
484 cp_cntrl
.responseFromCore
.master
= ruby_system
.network
.slave
486 cp_cntrl
.unblockFromCore
= MessageBuffer()
487 cp_cntrl
.unblockFromCore
.master
= ruby_system
.network
.slave
489 cp_cntrl
.probeToCore
= MessageBuffer()
490 cp_cntrl
.probeToCore
.slave
= ruby_system
.network
.master
492 cp_cntrl
.responseToCore
= MessageBuffer()
493 cp_cntrl
.responseToCore
.slave
= ruby_system
.network
.master
495 cp_cntrl
.mandatoryQueue
= MessageBuffer()
496 cp_cntrl
.triggerQueue
= MessageBuffer(ordered
= True)
498 cpuCluster
.add(cp_cntrl
)
501 if hasattr(options
, 'bw_scalor') and options
.bw_scalor
> 0:
502 gpuCluster
= Cluster(extBW
= crossbar_bw
, intBW
= crossbar_bw
)
504 gpuCluster
= Cluster(extBW
= 8, intBW
= 8) # 16 GB/s
505 for i
in xrange(options
.num_compute_units
):
507 tcp_cntrl
= TCPCntrl(TCC_select_num_bits
= TCC_bits
,
509 number_of_TBEs
= 2560)
510 # TBEs set to max outstanding requests
511 tcp_cntrl
.create(options
, ruby_system
, system
)
512 tcp_cntrl
.WB
= options
.WB_L1
513 tcp_cntrl
.disableL1
= options
.noL1
514 tcp_cntrl
.L1cache
.tagAccessLatency
= options
.TCP_latency
515 tcp_cntrl
.L1cache
.dataAccessLatency
= options
.TCP_latency
517 exec("ruby_system.tcp_cntrl%d = tcp_cntrl" % i
)
519 # Add controllers and sequencers to the appropriate lists
521 cpu_sequencers
.append(tcp_cntrl
.coalescer
)
522 tcp_cntrl_nodes
.append(tcp_cntrl
)
524 # Connect the TCP controller to the ruby network
525 tcp_cntrl
.requestFromTCP
= MessageBuffer(ordered
= True)
526 tcp_cntrl
.requestFromTCP
.master
= ruby_system
.network
.slave
528 tcp_cntrl
.responseFromTCP
= MessageBuffer(ordered
= True)
529 tcp_cntrl
.responseFromTCP
.master
= ruby_system
.network
.slave
531 tcp_cntrl
.unblockFromCore
= MessageBuffer()
532 tcp_cntrl
.unblockFromCore
.master
= ruby_system
.network
.slave
534 tcp_cntrl
.probeToTCP
= MessageBuffer(ordered
= True)
535 tcp_cntrl
.probeToTCP
.slave
= ruby_system
.network
.master
537 tcp_cntrl
.responseToTCP
= MessageBuffer(ordered
= True)
538 tcp_cntrl
.responseToTCP
.slave
= ruby_system
.network
.master
540 tcp_cntrl
.mandatoryQueue
= MessageBuffer()
542 gpuCluster
.add(tcp_cntrl
)
544 for i
in xrange(options
.num_sqc
):
546 sqc_cntrl
= SQCCntrl(TCC_select_num_bits
= TCC_bits
)
547 sqc_cntrl
.create(options
, ruby_system
, system
)
549 exec("ruby_system.sqc_cntrl%d = sqc_cntrl" % i
)
551 # Add controllers and sequencers to the appropriate lists
553 cpu_sequencers
.append(sqc_cntrl
.sequencer
)
555 # Connect the SQC controller to the ruby network
556 sqc_cntrl
.requestFromSQC
= MessageBuffer(ordered
= True)
557 sqc_cntrl
.requestFromSQC
.master
= ruby_system
.network
.slave
559 sqc_cntrl
.probeToSQC
= MessageBuffer(ordered
= True)
560 sqc_cntrl
.probeToSQC
.slave
= ruby_system
.network
.master
562 sqc_cntrl
.responseToSQC
= MessageBuffer(ordered
= True)
563 sqc_cntrl
.responseToSQC
.slave
= ruby_system
.network
.master
565 sqc_cntrl
.mandatoryQueue
= MessageBuffer()
567 # SQC also in GPU cluster
568 gpuCluster
.add(sqc_cntrl
)
570 for i
in xrange(options
.num_cp
):
572 tcp_ID
= options
.num_compute_units
+ i
573 sqc_ID
= options
.num_sqc
+ i
575 tcp_cntrl
= TCPCntrl(TCC_select_num_bits
= TCC_bits
,
577 number_of_TBEs
= 2560)
578 # TBEs set to max outstanding requests
579 tcp_cntrl
.createCP(options
, ruby_system
, system
)
580 tcp_cntrl
.WB
= options
.WB_L1
581 tcp_cntrl
.disableL1
= options
.noL1
582 tcp_cntrl
.L1cache
.tagAccessLatency
= options
.TCP_latency
583 tcp_cntrl
.L1cache
.dataAccessLatency
= options
.TCP_latency
585 exec("ruby_system.tcp_cntrl%d = tcp_cntrl" % tcp_ID
)
587 # Add controllers and sequencers to the appropriate lists
589 cpu_sequencers
.append(tcp_cntrl
.sequencer
)
590 tcp_cntrl_nodes
.append(tcp_cntrl
)
592 # Connect the CP (TCP) controllers to the ruby network
593 tcp_cntrl
.requestFromTCP
= MessageBuffer(ordered
= True)
594 tcp_cntrl
.requestFromTCP
.master
= ruby_system
.network
.slave
596 tcp_cntrl
.responseFromTCP
= MessageBuffer(ordered
= True)
597 tcp_cntrl
.responseFromTCP
.master
= ruby_system
.network
.slave
599 tcp_cntrl
.unblockFromCore
= MessageBuffer(ordered
= True)
600 tcp_cntrl
.unblockFromCore
.master
= ruby_system
.network
.slave
602 tcp_cntrl
.probeToTCP
= MessageBuffer(ordered
= True)
603 tcp_cntrl
.probeToTCP
.slave
= ruby_system
.network
.master
605 tcp_cntrl
.responseToTCP
= MessageBuffer(ordered
= True)
606 tcp_cntrl
.responseToTCP
.slave
= ruby_system
.network
.master
608 tcp_cntrl
.mandatoryQueue
= MessageBuffer()
610 gpuCluster
.add(tcp_cntrl
)
612 sqc_cntrl
= SQCCntrl(TCC_select_num_bits
= TCC_bits
)
613 sqc_cntrl
.create(options
, ruby_system
, system
)
615 exec("ruby_system.sqc_cntrl%d = sqc_cntrl" % sqc_ID
)
617 # Add controllers and sequencers to the appropriate lists
619 cpu_sequencers
.append(sqc_cntrl
.sequencer
)
621 # SQC also in GPU cluster
622 gpuCluster
.add(sqc_cntrl
)
624 for i
in xrange(options
.num_tccs
):
626 tcc_cntrl
= TCCCntrl(l2_response_latency
= options
.TCC_latency
)
627 tcc_cntrl
.create(options
, ruby_system
, system
)
628 tcc_cntrl
.l2_request_latency
= options
.gpu_to_dir_latency
629 tcc_cntrl
.l2_response_latency
= options
.TCC_latency
630 tcc_cntrl_nodes
.append(tcc_cntrl
)
631 tcc_cntrl
.WB
= options
.WB_L2
632 tcc_cntrl
.number_of_TBEs
= 2560 * options
.num_compute_units
633 # the number_of_TBEs is inclusive of TBEs below
635 # Connect the TCC controllers to the ruby network
636 tcc_cntrl
.requestFromTCP
= MessageBuffer(ordered
= True)
637 tcc_cntrl
.requestFromTCP
.slave
= ruby_system
.network
.master
639 tcc_cntrl
.responseToCore
= MessageBuffer(ordered
= True)
640 tcc_cntrl
.responseToCore
.master
= ruby_system
.network
.slave
642 tcc_cntrl
.probeFromNB
= MessageBuffer()
643 tcc_cntrl
.probeFromNB
.slave
= ruby_system
.network
.master
645 tcc_cntrl
.responseFromNB
= MessageBuffer()
646 tcc_cntrl
.responseFromNB
.slave
= ruby_system
.network
.master
648 tcc_cntrl
.requestToNB
= MessageBuffer(ordered
= True)
649 tcc_cntrl
.requestToNB
.master
= ruby_system
.network
.slave
651 tcc_cntrl
.responseToNB
= MessageBuffer()
652 tcc_cntrl
.responseToNB
.master
= ruby_system
.network
.slave
654 tcc_cntrl
.unblockToNB
= MessageBuffer()
655 tcc_cntrl
.unblockToNB
.master
= ruby_system
.network
.slave
657 tcc_cntrl
.triggerQueue
= MessageBuffer(ordered
= True)
659 exec("ruby_system.tcc_cntrl%d = tcc_cntrl" % i
)
661 # connect all of the wire buffers between L3 and dirs up
662 # TCC cntrls added to the GPU cluster
663 gpuCluster
.add(tcc_cntrl
)
665 # Assuming no DMA devices
666 assert(len(dma_devices
) == 0)
668 # Add cpu/gpu clusters to main cluster
669 mainCluster
.add(cpuCluster
)
670 mainCluster
.add(gpuCluster
)
672 ruby_system
.network
.number_of_virtual_networks
= 10
674 return (cpu_sequencers
, dir_cntrl_nodes
, mainCluster
)