mem-ruby: Replace SLICC queueMemory calls with enqueue
[gem5.git] / configs / ruby / GPU_VIPER.py
1 # Copyright (c) 2011-2015 Advanced Micro Devices, Inc.
2 # All rights reserved.
3 #
4 # For use for simulation and test purposes only
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 #
9 # 1. Redistributions of source code must retain the above copyright notice,
10 # this list of conditions and the following disclaimer.
11 #
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.
15 #
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.
19 #
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.
31
32 import math
33 import m5
34 from m5.objects import *
35 from m5.defines import buildEnv
36 from m5.util import addToPath
37 from Ruby import create_topology
38 from Ruby import send_evicts
39
40 addToPath('../')
41
42 from topologies.Cluster import Cluster
43 from topologies.Crossbar import Crossbar
44
45 class CntrlBase:
46 _seqs = 0
47 @classmethod
48 def seqCount(cls):
49 # Use SeqCount not class since we need global count
50 CntrlBase._seqs += 1
51 return CntrlBase._seqs - 1
52
53 _cntrls = 0
54 @classmethod
55 def cntrlCount(cls):
56 # Use CntlCount not class since we need global count
57 CntrlBase._cntrls += 1
58 return CntrlBase._cntrls - 1
59
60 _version = 0
61 @classmethod
62 def versionCount(cls):
63 cls._version += 1 # Use count for this particular type
64 return cls._version - 1
65
66 class L1Cache(RubyCache):
67 resourceStalls = False
68 dataArrayBanks = 2
69 tagArrayBanks = 2
70 dataAccessLatency = 1
71 tagAccessLatency = 1
72 def create(self, size, assoc, options):
73 self.size = MemorySize(size)
74 self.assoc = assoc
75 self.replacement_policy = TreePLRURP()
76
77 class L2Cache(RubyCache):
78 resourceStalls = False
79 assoc = 16
80 dataArrayBanks = 16
81 tagArrayBanks = 16
82 def create(self, size, assoc, options):
83 self.size = MemorySize(size)
84 self.assoc = assoc
85 self.replacement_policy = TreePLRURP()
86
87 class CPCntrl(CorePair_Controller, CntrlBase):
88
89 def create(self, options, ruby_system, system):
90 self.version = self.versionCount()
91
92 self.L1Icache = L1Cache()
93 self.L1Icache.create(options.l1i_size, options.l1i_assoc, options)
94 self.L1D0cache = L1Cache()
95 self.L1D0cache.create(options.l1d_size, options.l1d_assoc, options)
96 self.L1D1cache = L1Cache()
97 self.L1D1cache.create(options.l1d_size, options.l1d_assoc, options)
98 self.L2cache = L2Cache()
99 self.L2cache.create(options.l2_size, options.l2_assoc, options)
100
101 self.sequencer = RubySequencer()
102 self.sequencer.version = self.seqCount()
103 self.sequencer.icache = self.L1Icache
104 self.sequencer.dcache = self.L1D0cache
105 self.sequencer.ruby_system = ruby_system
106 self.sequencer.coreid = 0
107 self.sequencer.is_cpu_sequencer = True
108
109 self.sequencer1 = RubySequencer()
110 self.sequencer1.version = self.seqCount()
111 self.sequencer1.icache = self.L1Icache
112 self.sequencer1.dcache = self.L1D1cache
113 self.sequencer1.ruby_system = ruby_system
114 self.sequencer1.coreid = 1
115 self.sequencer1.is_cpu_sequencer = True
116
117 self.issue_latency = options.cpu_to_dir_latency
118 self.send_evictions = send_evicts(options)
119
120 self.ruby_system = ruby_system
121
122 if options.recycle_latency:
123 self.recycle_latency = options.recycle_latency
124
125 class TCPCache(RubyCache):
126 size = "16kB"
127 assoc = 16
128 dataArrayBanks = 16 #number of data banks
129 tagArrayBanks = 16 #number of tag banks
130 dataAccessLatency = 4
131 tagAccessLatency = 1
132 def create(self, options):
133 self.size = MemorySize(options.tcp_size)
134 self.assoc = options.tcp_assoc
135 self.resourceStalls = options.no_tcc_resource_stalls
136 self.replacement_policy = TreePLRURP()
137
138 class TCPCntrl(TCP_Controller, CntrlBase):
139
140 def create(self, options, ruby_system, system):
141 self.version = self.versionCount()
142
143 self.L1cache = TCPCache(tagAccessLatency = options.TCP_latency,
144 dataAccessLatency = options.TCP_latency)
145 self.L1cache.resourceStalls = options.no_resource_stalls
146 self.L1cache.create(options)
147 self.issue_latency = 1
148
149 self.coalescer = VIPERCoalescer()
150 self.coalescer.version = self.seqCount()
151 self.coalescer.icache = self.L1cache
152 self.coalescer.dcache = self.L1cache
153 self.coalescer.ruby_system = ruby_system
154 self.coalescer.support_inst_reqs = False
155 self.coalescer.is_cpu_sequencer = False
156
157 self.sequencer = RubySequencer()
158 self.sequencer.version = self.seqCount()
159 self.sequencer.icache = self.L1cache
160 self.sequencer.dcache = self.L1cache
161 self.sequencer.ruby_system = ruby_system
162 self.sequencer.is_cpu_sequencer = True
163
164 self.use_seq_not_coal = False
165
166 self.ruby_system = ruby_system
167
168 if options.recycle_latency:
169 self.recycle_latency = options.recycle_latency
170
171 def createCP(self, options, ruby_system, system):
172 self.version = self.versionCount()
173
174 self.L1cache = TCPCache(tagAccessLatency = options.TCP_latency,
175 dataAccessLatency = options.TCP_latency)
176 self.L1cache.resourceStalls = options.no_resource_stalls
177 self.L1cache.create(options)
178 self.issue_latency = 1
179
180 self.coalescer = VIPERCoalescer()
181 self.coalescer.version = self.seqCount()
182 self.coalescer.icache = self.L1cache
183 self.coalescer.dcache = self.L1cache
184 self.coalescer.ruby_system = ruby_system
185 self.coalescer.support_inst_reqs = False
186 self.coalescer.is_cpu_sequencer = False
187
188 self.sequencer = RubySequencer()
189 self.sequencer.version = self.seqCount()
190 self.sequencer.icache = self.L1cache
191 self.sequencer.dcache = self.L1cache
192 self.sequencer.ruby_system = ruby_system
193 self.sequencer.is_cpu_sequencer = True
194
195 self.use_seq_not_coal = True
196
197 self.ruby_system = ruby_system
198
199 if options.recycle_latency:
200 self.recycle_latency = options.recycle_latency
201
202 class SQCCache(RubyCache):
203 dataArrayBanks = 8
204 tagArrayBanks = 8
205 dataAccessLatency = 1
206 tagAccessLatency = 1
207
208 def create(self, options):
209 self.size = MemorySize(options.sqc_size)
210 self.assoc = options.sqc_assoc
211 self.replacement_policy = TreePLRURP()
212
213 class SQCCntrl(SQC_Controller, CntrlBase):
214
215 def create(self, options, ruby_system, system):
216 self.version = self.versionCount()
217
218 self.L1cache = SQCCache()
219 self.L1cache.create(options)
220 self.L1cache.resourceStalls = options.no_resource_stalls
221
222 self.sequencer = RubySequencer()
223
224 self.sequencer.version = self.seqCount()
225 self.sequencer.icache = self.L1cache
226 self.sequencer.dcache = self.L1cache
227 self.sequencer.ruby_system = ruby_system
228 self.sequencer.support_data_reqs = False
229 self.sequencer.is_cpu_sequencer = False
230
231 self.ruby_system = ruby_system
232
233 if options.recycle_latency:
234 self.recycle_latency = options.recycle_latency
235
236 class TCC(RubyCache):
237 size = MemorySize("256kB")
238 assoc = 16
239 dataAccessLatency = 8
240 tagAccessLatency = 2
241 resourceStalls = True
242 def create(self, options):
243 self.assoc = options.tcc_assoc
244 if hasattr(options, 'bw_scalor') and options.bw_scalor > 0:
245 s = options.num_compute_units
246 tcc_size = s * 128
247 tcc_size = str(tcc_size)+'kB'
248 self.size = MemorySize(tcc_size)
249 self.dataArrayBanks = 64
250 self.tagArrayBanks = 64
251 else:
252 self.size = MemorySize(options.tcc_size)
253 self.dataArrayBanks = 256 / options.num_tccs #number of data banks
254 self.tagArrayBanks = 256 / options.num_tccs #number of tag banks
255 self.size.value = self.size.value / options.num_tccs
256 if ((self.size.value / long(self.assoc)) < 128):
257 self.size.value = long(128 * self.assoc)
258 self.start_index_bit = math.log(options.cacheline_size, 2) + \
259 math.log(options.num_tccs, 2)
260 self.replacement_policy = TreePLRURP()
261
262
263 class TCCCntrl(TCC_Controller, CntrlBase):
264 def create(self, options, ruby_system, system):
265 self.version = self.versionCount()
266 self.L2cache = TCC()
267 self.L2cache.create(options)
268 self.L2cache.resourceStalls = options.no_tcc_resource_stalls
269
270 self.ruby_system = ruby_system
271
272 if options.recycle_latency:
273 self.recycle_latency = options.recycle_latency
274
275 class L3Cache(RubyCache):
276 dataArrayBanks = 16
277 tagArrayBanks = 16
278
279 def create(self, options, ruby_system, system):
280 self.size = MemorySize(options.l3_size)
281 self.size.value /= options.num_dirs
282 self.assoc = options.l3_assoc
283 self.dataArrayBanks /= options.num_dirs
284 self.tagArrayBanks /= options.num_dirs
285 self.dataArrayBanks /= options.num_dirs
286 self.tagArrayBanks /= options.num_dirs
287 self.dataAccessLatency = options.l3_data_latency
288 self.tagAccessLatency = options.l3_tag_latency
289 self.resourceStalls = False
290 self.replacement_policy = TreePLRURP()
291
292 class L3Cntrl(L3Cache_Controller, CntrlBase):
293 def create(self, options, ruby_system, system):
294 self.version = self.versionCount()
295 self.L3cache = L3Cache()
296 self.L3cache.create(options, ruby_system, system)
297
298 self.l3_response_latency = max(self.L3cache.dataAccessLatency, self.L3cache.tagAccessLatency)
299 self.ruby_system = ruby_system
300
301 if options.recycle_latency:
302 self.recycle_latency = options.recycle_latency
303
304 def connectWireBuffers(self, req_to_dir, resp_to_dir, l3_unblock_to_dir,
305 req_to_l3, probe_to_l3, resp_to_l3):
306 self.reqToDir = req_to_dir
307 self.respToDir = resp_to_dir
308 self.l3UnblockToDir = l3_unblock_to_dir
309 self.reqToL3 = req_to_l3
310 self.probeToL3 = probe_to_l3
311 self.respToL3 = resp_to_l3
312
313 class DirMem(RubyDirectoryMemory, CntrlBase):
314 def create(self, options, ruby_system, system):
315 self.version = self.versionCount()
316
317 phys_mem_size = AddrRange(options.mem_size).size()
318 mem_module_size = phys_mem_size / options.num_dirs
319 dir_size = MemorySize('0B')
320 dir_size.value = mem_module_size
321 self.size = dir_size
322
323 class DirCntrl(Directory_Controller, CntrlBase):
324 def create(self, options, ruby_system, system):
325 self.version = self.versionCount()
326
327 self.response_latency = 30
328
329 self.directory = DirMem()
330 self.directory.create(options, ruby_system, system)
331
332 self.L3CacheMemory = L3Cache()
333 self.L3CacheMemory.create(options, ruby_system, system)
334
335 self.l3_hit_latency = max(self.L3CacheMemory.dataAccessLatency,
336 self.L3CacheMemory.tagAccessLatency)
337
338 self.number_of_TBEs = options.num_tbes
339
340 self.ruby_system = ruby_system
341
342 if options.recycle_latency:
343 self.recycle_latency = options.recycle_latency
344
345 def connectWireBuffers(self, req_to_dir, resp_to_dir, l3_unblock_to_dir,
346 req_to_l3, probe_to_l3, resp_to_l3):
347 self.reqToDir = req_to_dir
348 self.respToDir = resp_to_dir
349 self.l3UnblockToDir = l3_unblock_to_dir
350 self.reqToL3 = req_to_l3
351 self.probeToL3 = probe_to_l3
352 self.respToL3 = resp_to_l3
353
354 def define_options(parser):
355 parser.add_option("--num-subcaches", type = "int", default = 4)
356 parser.add_option("--l3-data-latency", type = "int", default = 20)
357 parser.add_option("--l3-tag-latency", type = "int", default = 15)
358 parser.add_option("--cpu-to-dir-latency", type = "int", default = 120)
359 parser.add_option("--gpu-to-dir-latency", type = "int", default = 120)
360 parser.add_option("--no-resource-stalls", action = "store_false",
361 default = True)
362 parser.add_option("--no-tcc-resource-stalls", action = "store_false",
363 default = True)
364 parser.add_option("--use-L3-on-WT", action = "store_true", default = False)
365 parser.add_option("--num-tbes", type = "int", default = 256)
366 parser.add_option("--l2-latency", type = "int", default = 50) # load to use
367 parser.add_option("--num-tccs", type = "int", default = 1,
368 help = "number of TCC banks in the GPU")
369 parser.add_option("--sqc-size", type = 'string', default = '32kB',
370 help = "SQC cache size")
371 parser.add_option("--sqc-assoc", type = 'int', default = 8,
372 help = "SQC cache assoc")
373 parser.add_option("--WB_L1", action = "store_true", default = False,
374 help = "writeback L1")
375 parser.add_option("--WB_L2", action = "store_true", default = False,
376 help = "writeback L2")
377 parser.add_option("--TCP_latency", type = "int", default = 4,
378 help = "TCP latency")
379 parser.add_option("--TCC_latency", type = "int", default = 16,
380 help = "TCC latency")
381 parser.add_option("--tcc-size", type = 'string', default = '256kB',
382 help = "agregate tcc size")
383 parser.add_option("--tcc-assoc", type = 'int', default = 16,
384 help = "tcc assoc")
385 parser.add_option("--tcp-size", type = 'string', default = '16kB',
386 help = "tcp size")
387 parser.add_option("--tcp-assoc", type = 'int', default = 16,
388 help = "tcp assoc")
389 parser.add_option("--noL1", action = "store_true", default = False,
390 help = "bypassL1")
391
392 def create_system(options, full_system, system, dma_devices, bootmem,
393 ruby_system):
394 if buildEnv['PROTOCOL'] != 'GPU_VIPER':
395 panic("This script requires the GPU_VIPER protocol to be built.")
396
397 cpu_sequencers = []
398
399 #
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
403 # dma nodes, etc.
404 #
405 cp_cntrl_nodes = []
406 tcp_cntrl_nodes = []
407 sqc_cntrl_nodes = []
408 tcc_cntrl_nodes = []
409 dir_cntrl_nodes = []
410 l3_cntrl_nodes = []
411
412 #
413 # Must create the individual controllers before the network to ensure the
414 # controller constructors are called before the network constructor
415 #
416
417 # For an odd number of CPUs, still create the right number of controllers
418 TCC_bits = int(math.log(options.num_tccs, 2))
419
420 # This is the base crossbar that connects the L3s, Dirs, and cpu/gpu
421 # Clusters
422 crossbar_bw = None
423 mainCluster = None
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)
428 else:
429 mainCluster = Cluster(intBW=8) # 16 GB/s
430 for i in range(options.num_dirs):
431
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
437
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
441
442 dir_cntrl.responseFromCores = MessageBuffer()
443 dir_cntrl.responseFromCores.slave = ruby_system.network.master
444
445 dir_cntrl.unblockFromCores = MessageBuffer()
446 dir_cntrl.unblockFromCores.slave = ruby_system.network.master
447
448 dir_cntrl.probeToCore = MessageBuffer()
449 dir_cntrl.probeToCore.master = ruby_system.network.slave
450
451 dir_cntrl.responseToCore = MessageBuffer()
452 dir_cntrl.responseToCore.master = ruby_system.network.slave
453
454 dir_cntrl.triggerQueue = MessageBuffer(ordered = True)
455 dir_cntrl.L3triggerQueue = MessageBuffer(ordered = True)
456 dir_cntrl.requestToMemory = MessageBuffer()
457 dir_cntrl.responseFromMemory = MessageBuffer()
458
459 exec("ruby_system.dir_cntrl%d = dir_cntrl" % i)
460 dir_cntrl_nodes.append(dir_cntrl)
461
462 mainCluster.add(dir_cntrl)
463
464 cpuCluster = None
465 if hasattr(options, 'bw_scalor') and options.bw_scalor > 0:
466 cpuCluster = Cluster(extBW = crossbar_bw, intBW = crossbar_bw)
467 else:
468 cpuCluster = Cluster(extBW = 8, intBW = 8) # 16 GB/s
469 for i in range((options.num_cpus + 1) // 2):
470
471 cp_cntrl = CPCntrl()
472 cp_cntrl.create(options, ruby_system, system)
473
474 exec("ruby_system.cp_cntrl%d = cp_cntrl" % i)
475 #
476 # Add controllers and sequencers to the appropriate lists
477 #
478 cpu_sequencers.extend([cp_cntrl.sequencer, cp_cntrl.sequencer1])
479
480 # Connect the CP controllers and the network
481 cp_cntrl.requestFromCore = MessageBuffer()
482 cp_cntrl.requestFromCore.master = ruby_system.network.slave
483
484 cp_cntrl.responseFromCore = MessageBuffer()
485 cp_cntrl.responseFromCore.master = ruby_system.network.slave
486
487 cp_cntrl.unblockFromCore = MessageBuffer()
488 cp_cntrl.unblockFromCore.master = ruby_system.network.slave
489
490 cp_cntrl.probeToCore = MessageBuffer()
491 cp_cntrl.probeToCore.slave = ruby_system.network.master
492
493 cp_cntrl.responseToCore = MessageBuffer()
494 cp_cntrl.responseToCore.slave = ruby_system.network.master
495
496 cp_cntrl.mandatoryQueue = MessageBuffer()
497 cp_cntrl.triggerQueue = MessageBuffer(ordered = True)
498
499 cpuCluster.add(cp_cntrl)
500
501 # Register CPUs and caches for each CorePair and directory (SE mode only)
502 if not full_system:
503 for i in xrange((options.num_cpus + 1) // 2):
504 FileSystemConfig.register_cpu(physical_package_id = 0,
505 core_siblings = \
506 xrange(options.num_cpus),
507 core_id = i*2,
508 thread_siblings = [])
509
510 FileSystemConfig.register_cpu(physical_package_id = 0,
511 core_siblings = \
512 xrange(options.num_cpus),
513 core_id = i*2+1,
514 thread_siblings = [])
515
516 FileSystemConfig.register_cache(level = 0,
517 idu_type = 'Instruction',
518 size = options.l1i_size,
519 line_size = options.cacheline_size,
520 assoc = options.l1i_assoc,
521 cpus = [i*2, i*2+1])
522
523 FileSystemConfig.register_cache(level = 0,
524 idu_type = 'Data',
525 size = options.l1d_size,
526 line_size = options.cacheline_size,
527 assoc = options.l1d_assoc,
528 cpus = [i*2])
529
530 FileSystemConfig.register_cache(level = 0,
531 idu_type = 'Data',
532 size = options.l1d_size,
533 line_size = options.cacheline_size,
534 assoc = options.l1d_assoc,
535 cpus = [i*2+1])
536
537 FileSystemConfig.register_cache(level = 1,
538 idu_type = 'Unified',
539 size = options.l2_size,
540 line_size = options.cacheline_size,
541 assoc = options.l2_assoc,
542 cpus = [i*2, i*2+1])
543
544 for i in range(options.num_dirs):
545 FileSystemConfig.register_cache(level = 2,
546 idu_type = 'Unified',
547 size = options.l3_size,
548 line_size = options.cacheline_size,
549 assoc = options.l3_assoc,
550 cpus = [n for n in
551 xrange(options.num_cpus)])
552
553 gpuCluster = None
554 if hasattr(options, 'bw_scalor') and options.bw_scalor > 0:
555 gpuCluster = Cluster(extBW = crossbar_bw, intBW = crossbar_bw)
556 else:
557 gpuCluster = Cluster(extBW = 8, intBW = 8) # 16 GB/s
558 for i in range(options.num_compute_units):
559
560 tcp_cntrl = TCPCntrl(TCC_select_num_bits = TCC_bits,
561 issue_latency = 1,
562 number_of_TBEs = 2560)
563 # TBEs set to max outstanding requests
564 tcp_cntrl.create(options, ruby_system, system)
565 tcp_cntrl.WB = options.WB_L1
566 tcp_cntrl.disableL1 = options.noL1
567 tcp_cntrl.L1cache.tagAccessLatency = options.TCP_latency
568 tcp_cntrl.L1cache.dataAccessLatency = options.TCP_latency
569
570 exec("ruby_system.tcp_cntrl%d = tcp_cntrl" % i)
571 #
572 # Add controllers and sequencers to the appropriate lists
573 #
574 cpu_sequencers.append(tcp_cntrl.coalescer)
575 tcp_cntrl_nodes.append(tcp_cntrl)
576
577 # Connect the TCP controller to the ruby network
578 tcp_cntrl.requestFromTCP = MessageBuffer(ordered = True)
579 tcp_cntrl.requestFromTCP.master = ruby_system.network.slave
580
581 tcp_cntrl.responseFromTCP = MessageBuffer(ordered = True)
582 tcp_cntrl.responseFromTCP.master = ruby_system.network.slave
583
584 tcp_cntrl.unblockFromCore = MessageBuffer()
585 tcp_cntrl.unblockFromCore.master = ruby_system.network.slave
586
587 tcp_cntrl.probeToTCP = MessageBuffer(ordered = True)
588 tcp_cntrl.probeToTCP.slave = ruby_system.network.master
589
590 tcp_cntrl.responseToTCP = MessageBuffer(ordered = True)
591 tcp_cntrl.responseToTCP.slave = ruby_system.network.master
592
593 tcp_cntrl.mandatoryQueue = MessageBuffer()
594
595 gpuCluster.add(tcp_cntrl)
596
597 for i in range(options.num_sqc):
598
599 sqc_cntrl = SQCCntrl(TCC_select_num_bits = TCC_bits)
600 sqc_cntrl.create(options, ruby_system, system)
601
602 exec("ruby_system.sqc_cntrl%d = sqc_cntrl" % i)
603 #
604 # Add controllers and sequencers to the appropriate lists
605 #
606 cpu_sequencers.append(sqc_cntrl.sequencer)
607
608 # Connect the SQC controller to the ruby network
609 sqc_cntrl.requestFromSQC = MessageBuffer(ordered = True)
610 sqc_cntrl.requestFromSQC.master = ruby_system.network.slave
611
612 sqc_cntrl.probeToSQC = MessageBuffer(ordered = True)
613 sqc_cntrl.probeToSQC.slave = ruby_system.network.master
614
615 sqc_cntrl.responseToSQC = MessageBuffer(ordered = True)
616 sqc_cntrl.responseToSQC.slave = ruby_system.network.master
617
618 sqc_cntrl.mandatoryQueue = MessageBuffer()
619
620 # SQC also in GPU cluster
621 gpuCluster.add(sqc_cntrl)
622
623 for i in range(options.num_cp):
624
625 tcp_ID = options.num_compute_units + i
626 sqc_ID = options.num_sqc + i
627
628 tcp_cntrl = TCPCntrl(TCC_select_num_bits = TCC_bits,
629 issue_latency = 1,
630 number_of_TBEs = 2560)
631 # TBEs set to max outstanding requests
632 tcp_cntrl.createCP(options, ruby_system, system)
633 tcp_cntrl.WB = options.WB_L1
634 tcp_cntrl.disableL1 = options.noL1
635 tcp_cntrl.L1cache.tagAccessLatency = options.TCP_latency
636 tcp_cntrl.L1cache.dataAccessLatency = options.TCP_latency
637
638 exec("ruby_system.tcp_cntrl%d = tcp_cntrl" % tcp_ID)
639 #
640 # Add controllers and sequencers to the appropriate lists
641 #
642 cpu_sequencers.append(tcp_cntrl.sequencer)
643 tcp_cntrl_nodes.append(tcp_cntrl)
644
645 # Connect the CP (TCP) controllers to the ruby network
646 tcp_cntrl.requestFromTCP = MessageBuffer(ordered = True)
647 tcp_cntrl.requestFromTCP.master = ruby_system.network.slave
648
649 tcp_cntrl.responseFromTCP = MessageBuffer(ordered = True)
650 tcp_cntrl.responseFromTCP.master = ruby_system.network.slave
651
652 tcp_cntrl.unblockFromCore = MessageBuffer(ordered = True)
653 tcp_cntrl.unblockFromCore.master = ruby_system.network.slave
654
655 tcp_cntrl.probeToTCP = MessageBuffer(ordered = True)
656 tcp_cntrl.probeToTCP.slave = ruby_system.network.master
657
658 tcp_cntrl.responseToTCP = MessageBuffer(ordered = True)
659 tcp_cntrl.responseToTCP.slave = ruby_system.network.master
660
661 tcp_cntrl.mandatoryQueue = MessageBuffer()
662
663 gpuCluster.add(tcp_cntrl)
664
665 sqc_cntrl = SQCCntrl(TCC_select_num_bits = TCC_bits)
666 sqc_cntrl.create(options, ruby_system, system)
667
668 exec("ruby_system.sqc_cntrl%d = sqc_cntrl" % sqc_ID)
669 #
670 # Add controllers and sequencers to the appropriate lists
671 #
672 cpu_sequencers.append(sqc_cntrl.sequencer)
673
674 # SQC also in GPU cluster
675 gpuCluster.add(sqc_cntrl)
676
677 for i in range(options.num_tccs):
678
679 tcc_cntrl = TCCCntrl(l2_response_latency = options.TCC_latency)
680 tcc_cntrl.create(options, ruby_system, system)
681 tcc_cntrl.l2_request_latency = options.gpu_to_dir_latency
682 tcc_cntrl.l2_response_latency = options.TCC_latency
683 tcc_cntrl_nodes.append(tcc_cntrl)
684 tcc_cntrl.WB = options.WB_L2
685 tcc_cntrl.number_of_TBEs = 2560 * options.num_compute_units
686 # the number_of_TBEs is inclusive of TBEs below
687
688 # Connect the TCC controllers to the ruby network
689 tcc_cntrl.requestFromTCP = MessageBuffer(ordered = True)
690 tcc_cntrl.requestFromTCP.slave = ruby_system.network.master
691
692 tcc_cntrl.responseToCore = MessageBuffer(ordered = True)
693 tcc_cntrl.responseToCore.master = ruby_system.network.slave
694
695 tcc_cntrl.probeFromNB = MessageBuffer()
696 tcc_cntrl.probeFromNB.slave = ruby_system.network.master
697
698 tcc_cntrl.responseFromNB = MessageBuffer()
699 tcc_cntrl.responseFromNB.slave = ruby_system.network.master
700
701 tcc_cntrl.requestToNB = MessageBuffer(ordered = True)
702 tcc_cntrl.requestToNB.master = ruby_system.network.slave
703
704 tcc_cntrl.responseToNB = MessageBuffer()
705 tcc_cntrl.responseToNB.master = ruby_system.network.slave
706
707 tcc_cntrl.unblockToNB = MessageBuffer()
708 tcc_cntrl.unblockToNB.master = ruby_system.network.slave
709
710 tcc_cntrl.triggerQueue = MessageBuffer(ordered = True)
711
712 exec("ruby_system.tcc_cntrl%d = tcc_cntrl" % i)
713
714 # connect all of the wire buffers between L3 and dirs up
715 # TCC cntrls added to the GPU cluster
716 gpuCluster.add(tcc_cntrl)
717
718 # Assuming no DMA devices
719 assert(len(dma_devices) == 0)
720
721 # Add cpu/gpu clusters to main cluster
722 mainCluster.add(cpuCluster)
723 mainCluster.add(gpuCluster)
724
725 ruby_system.network.number_of_virtual_networks = 10
726
727 return (cpu_sequencers, dir_cntrl_nodes, mainCluster)