1 # Copyright (c) 2011-2015 Advanced Micro Devices, Inc.
4 # For use for simulation and test purposes only
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
9 # 1. Redistributions of source code must retain the above copyright notice,
10 # this list of conditions and the following disclaimer.
12 # 2. Redistributions in binary form must reproduce the above copyright notice,
13 # this list of conditions and the following disclaimer in the documentation
14 # and/or other materials provided with the distribution.
16 # 3. Neither the name of the copyright holder nor the names of its
17 # contributors may be used to endorse or promote products derived from this
18 # software without specific prior written permission.
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 # POSSIBILITY OF SUCH DAMAGE.
36 from m5
.objects
import *
37 from m5
.defines
import buildEnv
38 from Ruby
import create_topology
39 from Ruby
import send_evicts
41 from topologies
.Cluster
import Cluster
42 from topologies
.Crossbar
import Crossbar
48 # Use SeqCount not class since we need global count
50 return CntrlBase
._seqs
- 1
55 # Use CntlCount not class since we need global count
56 CntrlBase
._cntrls
+= 1
57 return CntrlBase
._cntrls
- 1
61 def versionCount(cls
):
62 cls
._version
+= 1 # Use count for this particular type
63 return cls
._version
- 1
65 class L1Cache(RubyCache
):
66 resourceStalls
= False
71 def create(self
, size
, assoc
, options
):
72 self
.size
= MemorySize(size
)
74 self
.replacement_policy
= PseudoLRUReplacementPolicy()
76 class L2Cache(RubyCache
):
77 resourceStalls
= False
81 def create(self
, size
, assoc
, options
):
82 self
.size
= MemorySize(size
)
84 self
.replacement_policy
= PseudoLRUReplacementPolicy()
86 class CPCntrl(CorePair_Controller
, CntrlBase
):
88 def create(self
, options
, ruby_system
, system
):
89 self
.version
= self
.versionCount()
91 self
.L1Icache
= L1Cache()
92 self
.L1Icache
.create(options
.l1i_size
, options
.l1i_assoc
, options
)
93 self
.L1D0cache
= L1Cache()
94 self
.L1D0cache
.create(options
.l1d_size
, options
.l1d_assoc
, options
)
95 self
.L1D1cache
= L1Cache()
96 self
.L1D1cache
.create(options
.l1d_size
, options
.l1d_assoc
, options
)
97 self
.L2cache
= L2Cache()
98 self
.L2cache
.create(options
.l2_size
, options
.l2_assoc
, options
)
100 self
.sequencer
= RubySequencer()
101 self
.sequencer
.version
= self
.seqCount()
102 self
.sequencer
.icache
= self
.L1Icache
103 self
.sequencer
.dcache
= self
.L1D0cache
104 self
.sequencer
.ruby_system
= ruby_system
105 self
.sequencer
.coreid
= 0
106 self
.sequencer
.is_cpu_sequencer
= True
108 self
.sequencer1
= RubySequencer()
109 self
.sequencer1
.version
= self
.seqCount()
110 self
.sequencer1
.icache
= self
.L1Icache
111 self
.sequencer1
.dcache
= self
.L1D1cache
112 self
.sequencer1
.ruby_system
= ruby_system
113 self
.sequencer1
.coreid
= 1
114 self
.sequencer1
.is_cpu_sequencer
= True
116 self
.issue_latency
= options
.cpu_to_dir_latency
117 self
.send_evictions
= send_evicts(options
)
119 self
.ruby_system
= ruby_system
121 if options
.recycle_latency
:
122 self
.recycle_latency
= options
.recycle_latency
124 class TCPCache(RubyCache
):
127 dataArrayBanks
= 16 #number of data banks
128 tagArrayBanks
= 16 #number of tag banks
129 dataAccessLatency
= 4
131 def create(self
, options
):
132 self
.size
= MemorySize(options
.tcp_size
)
133 self
.assoc
= options
.tcp_assoc
134 self
.resourceStalls
= options
.no_tcc_resource_stalls
135 self
.replacement_policy
= PseudoLRUReplacementPolicy()
137 class TCPCntrl(TCP_Controller
, CntrlBase
):
139 def create(self
, options
, ruby_system
, system
):
140 self
.version
= self
.versionCount()
142 self
.L1cache
= TCPCache(tagAccessLatency
= options
.TCP_latency
,
143 dataAccessLatency
= options
.TCP_latency
)
144 self
.L1cache
.resourceStalls
= options
.no_resource_stalls
145 self
.L1cache
.create(options
)
146 self
.issue_latency
= 1
148 self
.coalescer
= VIPERCoalescer()
149 self
.coalescer
.version
= self
.seqCount()
150 self
.coalescer
.icache
= self
.L1cache
151 self
.coalescer
.dcache
= self
.L1cache
152 self
.coalescer
.ruby_system
= ruby_system
153 self
.coalescer
.support_inst_reqs
= False
154 self
.coalescer
.is_cpu_sequencer
= False
156 self
.sequencer
= RubySequencer()
157 self
.sequencer
.version
= self
.seqCount()
158 self
.sequencer
.icache
= self
.L1cache
159 self
.sequencer
.dcache
= self
.L1cache
160 self
.sequencer
.ruby_system
= ruby_system
161 self
.sequencer
.is_cpu_sequencer
= True
163 self
.use_seq_not_coal
= False
165 self
.ruby_system
= ruby_system
167 if options
.recycle_latency
:
168 self
.recycle_latency
= options
.recycle_latency
170 def createCP(self
, options
, ruby_system
, system
):
171 self
.version
= self
.versionCount()
173 self
.L1cache
= TCPCache(tagAccessLatency
= options
.TCP_latency
,
174 dataAccessLatency
= options
.TCP_latency
)
175 self
.L1cache
.resourceStalls
= options
.no_resource_stalls
176 self
.L1cache
.create(options
)
177 self
.issue_latency
= 1
179 self
.coalescer
= VIPERCoalescer()
180 self
.coalescer
.version
= self
.seqCount()
181 self
.coalescer
.icache
= self
.L1cache
182 self
.coalescer
.dcache
= self
.L1cache
183 self
.coalescer
.ruby_system
= ruby_system
184 self
.coalescer
.support_inst_reqs
= False
185 self
.coalescer
.is_cpu_sequencer
= False
187 self
.sequencer
= RubySequencer()
188 self
.sequencer
.version
= self
.seqCount()
189 self
.sequencer
.icache
= self
.L1cache
190 self
.sequencer
.dcache
= self
.L1cache
191 self
.sequencer
.ruby_system
= ruby_system
192 self
.sequencer
.is_cpu_sequencer
= True
194 self
.use_seq_not_coal
= True
196 self
.ruby_system
= ruby_system
198 if options
.recycle_latency
:
199 self
.recycle_latency
= options
.recycle_latency
201 class SQCCache(RubyCache
):
204 dataAccessLatency
= 1
207 def create(self
, options
):
208 self
.size
= MemorySize(options
.sqc_size
)
209 self
.assoc
= options
.sqc_assoc
210 self
.replacement_policy
= PseudoLRUReplacementPolicy()
212 class SQCCntrl(SQC_Controller
, CntrlBase
):
214 def create(self
, options
, ruby_system
, system
):
215 self
.version
= self
.versionCount()
217 self
.L1cache
= SQCCache()
218 self
.L1cache
.create(options
)
219 self
.L1cache
.resourceStalls
= options
.no_resource_stalls
221 self
.sequencer
= RubySequencer()
223 self
.sequencer
.version
= self
.seqCount()
224 self
.sequencer
.icache
= self
.L1cache
225 self
.sequencer
.dcache
= self
.L1cache
226 self
.sequencer
.ruby_system
= ruby_system
227 self
.sequencer
.support_data_reqs
= False
228 self
.sequencer
.is_cpu_sequencer
= False
230 self
.ruby_system
= ruby_system
232 if options
.recycle_latency
:
233 self
.recycle_latency
= options
.recycle_latency
235 class TCC(RubyCache
):
236 size
= MemorySize("256kB")
238 dataAccessLatency
= 8
240 resourceStalls
= True
241 def create(self
, options
):
242 self
.assoc
= options
.tcc_assoc
243 if hasattr(options
, 'bw_scalor') and options
.bw_scalor
> 0:
244 s
= options
.num_compute_units
246 tcc_size
= str(tcc_size
)+'kB'
247 self
.size
= MemorySize(tcc_size
)
248 self
.dataArrayBanks
= 64
249 self
.tagArrayBanks
= 64
251 self
.size
= MemorySize(options
.tcc_size
)
252 self
.dataArrayBanks
= 256 / options
.num_tccs
#number of data banks
253 self
.tagArrayBanks
= 256 / options
.num_tccs
#number of tag banks
254 self
.size
.value
= self
.size
.value
/ options
.num_tccs
255 if ((self
.size
.value
/ long(self
.assoc
)) < 128):
256 self
.size
.value
= long(128 * self
.assoc
)
257 self
.start_index_bit
= math
.log(options
.cacheline_size
, 2) + \
258 math
.log(options
.num_tccs
, 2)
259 self
.replacement_policy
= PseudoLRUReplacementPolicy()
262 class TCCCntrl(TCC_Controller
, CntrlBase
):
263 def create(self
, options
, ruby_system
, system
):
264 self
.version
= self
.versionCount()
266 self
.L2cache
.create(options
)
267 self
.L2cache
.resourceStalls
= options
.no_tcc_resource_stalls
269 self
.ruby_system
= ruby_system
271 if options
.recycle_latency
:
272 self
.recycle_latency
= options
.recycle_latency
274 class L3Cache(RubyCache
):
278 def create(self
, options
, ruby_system
, system
):
279 self
.size
= MemorySize(options
.l3_size
)
280 self
.size
.value
/= options
.num_dirs
281 self
.assoc
= options
.l3_assoc
282 self
.dataArrayBanks
/= options
.num_dirs
283 self
.tagArrayBanks
/= options
.num_dirs
284 self
.dataArrayBanks
/= options
.num_dirs
285 self
.tagArrayBanks
/= options
.num_dirs
286 self
.dataAccessLatency
= options
.l3_data_latency
287 self
.tagAccessLatency
= options
.l3_tag_latency
288 self
.resourceStalls
= False
289 self
.replacement_policy
= PseudoLRUReplacementPolicy()
291 class L3Cntrl(L3Cache_Controller
, CntrlBase
):
292 def create(self
, options
, ruby_system
, system
):
293 self
.version
= self
.versionCount()
294 self
.L3cache
= L3Cache()
295 self
.L3cache
.create(options
, ruby_system
, system
)
297 self
.l3_response_latency
= max(self
.L3cache
.dataAccessLatency
, self
.L3cache
.tagAccessLatency
)
298 self
.ruby_system
= ruby_system
300 if options
.recycle_latency
:
301 self
.recycle_latency
= options
.recycle_latency
303 def connectWireBuffers(self
, req_to_dir
, resp_to_dir
, l3_unblock_to_dir
,
304 req_to_l3
, probe_to_l3
, resp_to_l3
):
305 self
.reqToDir
= req_to_dir
306 self
.respToDir
= resp_to_dir
307 self
.l3UnblockToDir
= l3_unblock_to_dir
308 self
.reqToL3
= req_to_l3
309 self
.probeToL3
= probe_to_l3
310 self
.respToL3
= resp_to_l3
312 class DirMem(RubyDirectoryMemory
, CntrlBase
):
313 def create(self
, options
, ruby_system
, system
):
314 self
.version
= self
.versionCount()
316 phys_mem_size
= AddrRange(options
.mem_size
).size()
317 mem_module_size
= phys_mem_size
/ options
.num_dirs
318 dir_size
= MemorySize('0B')
319 dir_size
.value
= mem_module_size
322 class DirCntrl(Directory_Controller
, CntrlBase
):
323 def create(self
, options
, ruby_system
, system
):
324 self
.version
= self
.versionCount()
326 self
.response_latency
= 30
328 self
.directory
= DirMem()
329 self
.directory
.create(options
, ruby_system
, system
)
331 self
.L3CacheMemory
= L3Cache()
332 self
.L3CacheMemory
.create(options
, ruby_system
, system
)
334 self
.l3_hit_latency
= max(self
.L3CacheMemory
.dataAccessLatency
,
335 self
.L3CacheMemory
.tagAccessLatency
)
337 self
.number_of_TBEs
= options
.num_tbes
339 self
.ruby_system
= ruby_system
341 if options
.recycle_latency
:
342 self
.recycle_latency
= options
.recycle_latency
344 def connectWireBuffers(self
, req_to_dir
, resp_to_dir
, l3_unblock_to_dir
,
345 req_to_l3
, probe_to_l3
, resp_to_l3
):
346 self
.reqToDir
= req_to_dir
347 self
.respToDir
= resp_to_dir
348 self
.l3UnblockToDir
= l3_unblock_to_dir
349 self
.reqToL3
= req_to_l3
350 self
.probeToL3
= probe_to_l3
351 self
.respToL3
= resp_to_l3
353 def define_options(parser
):
354 parser
.add_option("--num-subcaches", type = "int", default
= 4)
355 parser
.add_option("--l3-data-latency", type = "int", default
= 20)
356 parser
.add_option("--l3-tag-latency", type = "int", default
= 15)
357 parser
.add_option("--cpu-to-dir-latency", type = "int", default
= 120)
358 parser
.add_option("--gpu-to-dir-latency", type = "int", default
= 120)
359 parser
.add_option("--no-resource-stalls", action
= "store_false",
361 parser
.add_option("--no-tcc-resource-stalls", action
= "store_false",
363 parser
.add_option("--use-L3-on-WT", action
= "store_true", default
= False)
364 parser
.add_option("--num-tbes", type = "int", default
= 256)
365 parser
.add_option("--l2-latency", type = "int", default
= 50) # load to use
366 parser
.add_option("--num-tccs", type = "int", default
= 1,
367 help = "number of TCC banks in the GPU")
368 parser
.add_option("--sqc-size", type = 'string', default
= '32kB',
369 help = "SQC cache size")
370 parser
.add_option("--sqc-assoc", type = 'int', default
= 8,
371 help = "SQC cache assoc")
372 parser
.add_option("--WB_L1", action
= "store_true", default
= False,
373 help = "writeback L1")
374 parser
.add_option("--WB_L2", action
= "store_true", default
= False,
375 help = "writeback L2")
376 parser
.add_option("--TCP_latency", type = "int", default
= 4,
377 help = "TCP latency")
378 parser
.add_option("--TCC_latency", type = "int", default
= 16,
379 help = "TCC latency")
380 parser
.add_option("--tcc-size", type = 'string', default
= '256kB',
381 help = "agregate tcc size")
382 parser
.add_option("--tcc-assoc", type = 'int', default
= 16,
384 parser
.add_option("--tcp-size", type = 'string', default
= '16kB',
386 parser
.add_option("--tcp-assoc", type = 'int', default
= 16,
388 parser
.add_option("--noL1", action
= "store_true", default
= False,
391 def create_system(options
, full_system
, system
, dma_devices
, bootmem
,
393 if buildEnv
['PROTOCOL'] != 'GPU_VIPER':
394 panic("This script requires the GPU_VIPER protocol to be built.")
399 # The ruby network creation expects the list of nodes in the system to be
400 # consistent with the NetDest list. Therefore the l1 controller nodes
401 # must be listed before the directory nodes and directory nodes before
412 # Must create the individual controllers before the network to ensure the
413 # controller constructors are called before the network constructor
416 # For an odd number of CPUs, still create the right number of controllers
417 TCC_bits
= int(math
.log(options
.num_tccs
, 2))
419 # This is the base crossbar that connects the L3s, Dirs, and cpu/gpu
423 if hasattr(options
, 'bw_scalor') and options
.bw_scalor
> 0:
424 #Assuming a 2GHz clock
425 crossbar_bw
= 16 * options
.num_compute_units
* options
.bw_scalor
426 mainCluster
= Cluster(intBW
=crossbar_bw
)
428 mainCluster
= Cluster(intBW
=8) # 16 GB/s
429 for i
in xrange(options
.num_dirs
):
431 dir_cntrl
= DirCntrl(noTCCdir
= True, TCC_select_num_bits
= TCC_bits
)
432 dir_cntrl
.create(options
, ruby_system
, system
)
433 dir_cntrl
.number_of_TBEs
= options
.num_tbes
434 dir_cntrl
.useL3OnWT
= options
.use_L3_on_WT
435 # the number_of_TBEs is inclusive of TBEs below
437 # Connect the Directory controller to the ruby network
438 dir_cntrl
.requestFromCores
= MessageBuffer(ordered
= True)
439 dir_cntrl
.requestFromCores
.slave
= ruby_system
.network
.master
441 dir_cntrl
.responseFromCores
= MessageBuffer()
442 dir_cntrl
.responseFromCores
.slave
= ruby_system
.network
.master
444 dir_cntrl
.unblockFromCores
= MessageBuffer()
445 dir_cntrl
.unblockFromCores
.slave
= ruby_system
.network
.master
447 dir_cntrl
.probeToCore
= MessageBuffer()
448 dir_cntrl
.probeToCore
.master
= ruby_system
.network
.slave
450 dir_cntrl
.responseToCore
= MessageBuffer()
451 dir_cntrl
.responseToCore
.master
= ruby_system
.network
.slave
453 dir_cntrl
.triggerQueue
= MessageBuffer(ordered
= True)
454 dir_cntrl
.L3triggerQueue
= MessageBuffer(ordered
= True)
455 dir_cntrl
.responseFromMemory
= MessageBuffer()
457 exec("ruby_system.dir_cntrl%d = dir_cntrl" % i
)
458 dir_cntrl_nodes
.append(dir_cntrl
)
460 mainCluster
.add(dir_cntrl
)
463 if hasattr(options
, 'bw_scalor') and options
.bw_scalor
> 0:
464 cpuCluster
= Cluster(extBW
= crossbar_bw
, intBW
= crossbar_bw
)
466 cpuCluster
= Cluster(extBW
= 8, intBW
= 8) # 16 GB/s
467 for i
in xrange((options
.num_cpus
+ 1) / 2):
470 cp_cntrl
.create(options
, ruby_system
, system
)
472 exec("ruby_system.cp_cntrl%d = cp_cntrl" % i
)
474 # Add controllers and sequencers to the appropriate lists
476 cpu_sequencers
.extend([cp_cntrl
.sequencer
, cp_cntrl
.sequencer1
])
478 # Connect the CP controllers and the network
479 cp_cntrl
.requestFromCore
= MessageBuffer()
480 cp_cntrl
.requestFromCore
.master
= ruby_system
.network
.slave
482 cp_cntrl
.responseFromCore
= MessageBuffer()
483 cp_cntrl
.responseFromCore
.master
= ruby_system
.network
.slave
485 cp_cntrl
.unblockFromCore
= MessageBuffer()
486 cp_cntrl
.unblockFromCore
.master
= ruby_system
.network
.slave
488 cp_cntrl
.probeToCore
= MessageBuffer()
489 cp_cntrl
.probeToCore
.slave
= ruby_system
.network
.master
491 cp_cntrl
.responseToCore
= MessageBuffer()
492 cp_cntrl
.responseToCore
.slave
= ruby_system
.network
.master
494 cp_cntrl
.mandatoryQueue
= MessageBuffer()
495 cp_cntrl
.triggerQueue
= MessageBuffer(ordered
= True)
497 cpuCluster
.add(cp_cntrl
)
500 if hasattr(options
, 'bw_scalor') and options
.bw_scalor
> 0:
501 gpuCluster
= Cluster(extBW
= crossbar_bw
, intBW
= crossbar_bw
)
503 gpuCluster
= Cluster(extBW
= 8, intBW
= 8) # 16 GB/s
504 for i
in xrange(options
.num_compute_units
):
506 tcp_cntrl
= TCPCntrl(TCC_select_num_bits
= TCC_bits
,
508 number_of_TBEs
= 2560)
509 # TBEs set to max outstanding requests
510 tcp_cntrl
.create(options
, ruby_system
, system
)
511 tcp_cntrl
.WB
= options
.WB_L1
512 tcp_cntrl
.disableL1
= options
.noL1
513 tcp_cntrl
.L1cache
.tagAccessLatency
= options
.TCP_latency
514 tcp_cntrl
.L1cache
.dataAccessLatency
= options
.TCP_latency
516 exec("ruby_system.tcp_cntrl%d = tcp_cntrl" % i
)
518 # Add controllers and sequencers to the appropriate lists
520 cpu_sequencers
.append(tcp_cntrl
.coalescer
)
521 tcp_cntrl_nodes
.append(tcp_cntrl
)
523 # Connect the TCP controller to the ruby network
524 tcp_cntrl
.requestFromTCP
= MessageBuffer(ordered
= True)
525 tcp_cntrl
.requestFromTCP
.master
= ruby_system
.network
.slave
527 tcp_cntrl
.responseFromTCP
= MessageBuffer(ordered
= True)
528 tcp_cntrl
.responseFromTCP
.master
= ruby_system
.network
.slave
530 tcp_cntrl
.unblockFromCore
= MessageBuffer()
531 tcp_cntrl
.unblockFromCore
.master
= ruby_system
.network
.slave
533 tcp_cntrl
.probeToTCP
= MessageBuffer(ordered
= True)
534 tcp_cntrl
.probeToTCP
.slave
= ruby_system
.network
.master
536 tcp_cntrl
.responseToTCP
= MessageBuffer(ordered
= True)
537 tcp_cntrl
.responseToTCP
.slave
= ruby_system
.network
.master
539 tcp_cntrl
.mandatoryQueue
= MessageBuffer()
541 gpuCluster
.add(tcp_cntrl
)
543 for i
in xrange(options
.num_sqc
):
545 sqc_cntrl
= SQCCntrl(TCC_select_num_bits
= TCC_bits
)
546 sqc_cntrl
.create(options
, ruby_system
, system
)
548 exec("ruby_system.sqc_cntrl%d = sqc_cntrl" % i
)
550 # Add controllers and sequencers to the appropriate lists
552 cpu_sequencers
.append(sqc_cntrl
.sequencer
)
554 # Connect the SQC controller to the ruby network
555 sqc_cntrl
.requestFromSQC
= MessageBuffer(ordered
= True)
556 sqc_cntrl
.requestFromSQC
.master
= ruby_system
.network
.slave
558 sqc_cntrl
.probeToSQC
= MessageBuffer(ordered
= True)
559 sqc_cntrl
.probeToSQC
.slave
= ruby_system
.network
.master
561 sqc_cntrl
.responseToSQC
= MessageBuffer(ordered
= True)
562 sqc_cntrl
.responseToSQC
.slave
= ruby_system
.network
.master
564 sqc_cntrl
.mandatoryQueue
= MessageBuffer()
566 # SQC also in GPU cluster
567 gpuCluster
.add(sqc_cntrl
)
569 for i
in xrange(options
.num_cp
):
571 tcp_ID
= options
.num_compute_units
+ i
572 sqc_ID
= options
.num_sqc
+ i
574 tcp_cntrl
= TCPCntrl(TCC_select_num_bits
= TCC_bits
,
576 number_of_TBEs
= 2560)
577 # TBEs set to max outstanding requests
578 tcp_cntrl
.createCP(options
, ruby_system
, system
)
579 tcp_cntrl
.WB
= options
.WB_L1
580 tcp_cntrl
.disableL1
= options
.noL1
581 tcp_cntrl
.L1cache
.tagAccessLatency
= options
.TCP_latency
582 tcp_cntrl
.L1cache
.dataAccessLatency
= options
.TCP_latency
584 exec("ruby_system.tcp_cntrl%d = tcp_cntrl" % tcp_ID
)
586 # Add controllers and sequencers to the appropriate lists
588 cpu_sequencers
.append(tcp_cntrl
.sequencer
)
589 tcp_cntrl_nodes
.append(tcp_cntrl
)
591 # Connect the CP (TCP) controllers to the ruby network
592 tcp_cntrl
.requestFromTCP
= MessageBuffer(ordered
= True)
593 tcp_cntrl
.requestFromTCP
.master
= ruby_system
.network
.slave
595 tcp_cntrl
.responseFromTCP
= MessageBuffer(ordered
= True)
596 tcp_cntrl
.responseFromTCP
.master
= ruby_system
.network
.slave
598 tcp_cntrl
.unblockFromCore
= MessageBuffer(ordered
= True)
599 tcp_cntrl
.unblockFromCore
.master
= ruby_system
.network
.slave
601 tcp_cntrl
.probeToTCP
= MessageBuffer(ordered
= True)
602 tcp_cntrl
.probeToTCP
.slave
= ruby_system
.network
.master
604 tcp_cntrl
.responseToTCP
= MessageBuffer(ordered
= True)
605 tcp_cntrl
.responseToTCP
.slave
= ruby_system
.network
.master
607 tcp_cntrl
.mandatoryQueue
= MessageBuffer()
609 gpuCluster
.add(tcp_cntrl
)
611 sqc_cntrl
= SQCCntrl(TCC_select_num_bits
= TCC_bits
)
612 sqc_cntrl
.create(options
, ruby_system
, system
)
614 exec("ruby_system.sqc_cntrl%d = sqc_cntrl" % sqc_ID
)
616 # Add controllers and sequencers to the appropriate lists
618 cpu_sequencers
.append(sqc_cntrl
.sequencer
)
620 # SQC also in GPU cluster
621 gpuCluster
.add(sqc_cntrl
)
623 for i
in xrange(options
.num_tccs
):
625 tcc_cntrl
= TCCCntrl(l2_response_latency
= options
.TCC_latency
)
626 tcc_cntrl
.create(options
, ruby_system
, system
)
627 tcc_cntrl
.l2_request_latency
= options
.gpu_to_dir_latency
628 tcc_cntrl
.l2_response_latency
= options
.TCC_latency
629 tcc_cntrl_nodes
.append(tcc_cntrl
)
630 tcc_cntrl
.WB
= options
.WB_L2
631 tcc_cntrl
.number_of_TBEs
= 2560 * options
.num_compute_units
632 # the number_of_TBEs is inclusive of TBEs below
634 # Connect the TCC controllers to the ruby network
635 tcc_cntrl
.requestFromTCP
= MessageBuffer(ordered
= True)
636 tcc_cntrl
.requestFromTCP
.slave
= ruby_system
.network
.master
638 tcc_cntrl
.responseToCore
= MessageBuffer(ordered
= True)
639 tcc_cntrl
.responseToCore
.master
= ruby_system
.network
.slave
641 tcc_cntrl
.probeFromNB
= MessageBuffer()
642 tcc_cntrl
.probeFromNB
.slave
= ruby_system
.network
.master
644 tcc_cntrl
.responseFromNB
= MessageBuffer()
645 tcc_cntrl
.responseFromNB
.slave
= ruby_system
.network
.master
647 tcc_cntrl
.requestToNB
= MessageBuffer(ordered
= True)
648 tcc_cntrl
.requestToNB
.master
= ruby_system
.network
.slave
650 tcc_cntrl
.responseToNB
= MessageBuffer()
651 tcc_cntrl
.responseToNB
.master
= ruby_system
.network
.slave
653 tcc_cntrl
.unblockToNB
= MessageBuffer()
654 tcc_cntrl
.unblockToNB
.master
= ruby_system
.network
.slave
656 tcc_cntrl
.triggerQueue
= MessageBuffer(ordered
= True)
658 exec("ruby_system.tcc_cntrl%d = tcc_cntrl" % i
)
660 # connect all of the wire buffers between L3 and dirs up
661 # TCC cntrls added to the GPU cluster
662 gpuCluster
.add(tcc_cntrl
)
664 # Assuming no DMA devices
665 assert(len(dma_devices
) == 0)
667 # Add cpu/gpu clusters to main cluster
668 mainCluster
.add(cpuCluster
)
669 mainCluster
.add(gpuCluster
)
671 ruby_system
.network
.number_of_virtual_networks
= 10
673 return (cpu_sequencers
, dir_cntrl_nodes
, mainCluster
)