GPU_VIPER_Baseline.py revision 11308:7d8836fd043d
12SN/A# 21762SN/A# Copyright (c) 2015 Advanced Micro Devices, Inc. 32SN/A# All rights reserved. 42SN/A# 52SN/A# For use for simulation and test purposes only 62SN/A# 72SN/A# Redistribution and use in source and binary forms, with or without 82SN/A# modification, are permitted provided that the following conditions are met: 92SN/A# 102SN/A# 1. Redistributions of source code must retain the above copyright notice, 112SN/A# this list of conditions and the following disclaimer. 122SN/A# 132SN/A# 2. Redistributions in binary form must reproduce the above copyright notice, 142SN/A# this list of conditions and the following disclaimer in the documentation 152SN/A# and/or other materials provided with the distribution. 162SN/A# 172SN/A# 3. Neither the name of the copyright holder nor the names of its contributors 182SN/A# may be used to endorse or promote products derived from this software 192SN/A# without specific prior written permission. 202SN/A# 212SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 222SN/A# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 232SN/A# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 242SN/A# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 252SN/A# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 262SN/A# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 272665Ssaidi@eecs.umich.edu# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 282665Ssaidi@eecs.umich.edu# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 292665Ssaidi@eecs.umich.edu# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 302SN/A# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 312SN/A# POSSIBILITY OF SUCH DAMAGE. 321717SN/A# 331717SN/A# Author: Sooraj Puthoor 342SN/A# 352SN/A 362SN/Aimport math 37707SN/Aimport m5 381858SN/Afrom m5.objects import * 3956SN/Afrom m5.defines import buildEnv 402856Srdreslin@umich.edufrom Ruby import create_topology 412109SN/Afrom Ruby import send_evicts 422SN/A 433520Sgblack@eecs.umich.edufrom Cluster import Cluster 443520Sgblack@eecs.umich.edufrom Crossbar import Crossbar 453520Sgblack@eecs.umich.edu 463520Sgblack@eecs.umich.educlass CntrlBase: 472190SN/A _seqs = 0 482315SN/A @classmethod 492680Sktlim@umich.edu def seqCount(cls): 502SN/A # Use SeqCount not class since we need global count 512856Srdreslin@umich.edu CntrlBase._seqs += 1 522SN/A return CntrlBase._seqs - 1 532356SN/A 542356SN/A _cntrls = 0 552356SN/A @classmethod 562356SN/A def cntrlCount(cls): 572356SN/A # Use CntlCount not class since we need global count 582356SN/A CntrlBase._cntrls += 1 592356SN/A return CntrlBase._cntrls - 1 602356SN/A 613126Sktlim@umich.edu _version = 0 622356SN/A @classmethod 632356SN/A def versionCount(cls): 642356SN/A cls._version += 1 # Use count for this particular type 652356SN/A return cls._version - 1 662356SN/A 672356SN/Aclass L1Cache(RubyCache): 682856Srdreslin@umich.edu resourceStalls = False 692SN/A dataArrayBanks = 2 701634SN/A tagArrayBanks = 2 711634SN/A dataAccessLatency = 1 721695SN/A tagAccessLatency = 1 731634SN/A def create(self, size, assoc, options): 741634SN/A self.size = MemorySize(size) 752359SN/A self.assoc = assoc 761695SN/A self.replacement_policy = PseudoLRUReplacementPolicy() 771695SN/A 781695SN/Aclass L2Cache(RubyCache): 791634SN/A resourceStalls = False 803495Sktlim@umich.edu assoc = 16 813495Sktlim@umich.edu dataArrayBanks = 16 823495Sktlim@umich.edu tagArrayBanks = 16 833495Sktlim@umich.edu def create(self, size, assoc, options): 843495Sktlim@umich.edu self.size = MemorySize(size) 853495Sktlim@umich.edu self.assoc = assoc 863495Sktlim@umich.edu self.replacement_policy = PseudoLRUReplacementPolicy() 873495Sktlim@umich.edu 883495Sktlim@umich.educlass CPCntrl(CorePair_Controller, CntrlBase): 893495Sktlim@umich.edu 903495Sktlim@umich.edu def create(self, options, ruby_system, system): 913495Sktlim@umich.edu self.version = self.versionCount() 923495Sktlim@umich.edu 933495Sktlim@umich.edu self.L1Icache = L1Cache() 941858SN/A self.L1Icache.create(options.l1i_size, options.l1i_assoc, options) 952SN/A self.L1D0cache = L1Cache() 963520Sgblack@eecs.umich.edu self.L1D0cache.create(options.l1d_size, options.l1d_assoc, options) 973520Sgblack@eecs.umich.edu self.L1D1cache = L1Cache() 983520Sgblack@eecs.umich.edu self.L1D1cache.create(options.l1d_size, options.l1d_assoc, options) 992SN/A self.L2cache = L2Cache() 1002SN/A self.L2cache.create(options.l2_size, options.l2_assoc, options) 1012SN/A 1022SN/A self.sequencer = RubySequencer() 1032SN/A self.sequencer.version = self.seqCount() 1041133SN/A self.sequencer.icache = self.L1Icache 1052SN/A self.sequencer.dcache = self.L1D0cache 1063521Sgblack@eecs.umich.edu self.sequencer.ruby_system = ruby_system 1073521Sgblack@eecs.umich.edu self.sequencer.coreid = 0 1081917SN/A self.sequencer.is_cpu_sequencer = True 1091917SN/A 1101917SN/A self.sequencer1 = RubySequencer() 1111917SN/A self.sequencer1.version = self.seqCount() 1121917SN/A self.sequencer1.icache = self.L1Icache 1131917SN/A self.sequencer1.dcache = self.L1D1cache 1141917SN/A self.sequencer1.ruby_system = ruby_system 1151917SN/A self.sequencer1.coreid = 1 1161917SN/A self.sequencer1.is_cpu_sequencer = True 1171917SN/A 1181917SN/A self.issue_latency = options.cpu_to_dir_latency 1191917SN/A self.send_evictions = send_evicts(options) 1202SN/A 1212SN/A self.ruby_system = ruby_system 1222SN/A 1232680Sktlim@umich.edu if options.recycle_latency: 1242SN/A self.recycle_latency = options.recycle_latency 1252SN/A 126393SN/Aclass TCPCache(RubyCache): 127393SN/A size = "16kB" 128393SN/A assoc = 16 129393SN/A dataArrayBanks = 16 130393SN/A tagArrayBanks = 16 131393SN/A dataAccessLatency = 4 132393SN/A tagAccessLatency = 1 133393SN/A def create(self, options): 134393SN/A self.size = MemorySize(options.tcp_size) 135393SN/A self.dataArrayBanks = 16 136393SN/A self.tagArrayBanks = 16 137393SN/A self.dataAccessLatency = 4 138393SN/A self.tagAccessLatency = 1 139393SN/A self.resourceStalls = options.no_tcc_resource_stalls 1402SN/A self.replacement_policy = PseudoLRUReplacementPolicy() 1412SN/A 1421400SN/Aclass TCPCntrl(TCP_Controller, CntrlBase): 1431400SN/A 1441400SN/A def create(self, options, ruby_system, system): 1451400SN/A self.version = self.versionCount() 1461400SN/A self.L1cache = TCPCache() 1471400SN/A self.L1cache.create(options) 1481400SN/A self.issue_latency = 1 1491400SN/A 1501400SN/A self.coalescer = VIPERCoalescer() 1511695SN/A self.coalescer.version = self.seqCount() 1521400SN/A self.coalescer.icache = self.L1cache 1531400SN/A self.coalescer.dcache = self.L1cache 1542378SN/A self.coalescer.ruby_system = ruby_system 1553170Sstever@eecs.umich.edu self.coalescer.support_inst_reqs = False 1561858SN/A self.coalescer.is_cpu_sequencer = False 1571917SN/A 1583617Sbinkertn@umich.edu self.sequencer = RubySequencer() 1593617Sbinkertn@umich.edu self.sequencer.version = self.seqCount() 1603617Sbinkertn@umich.edu self.sequencer.icache = self.L1cache 1613617Sbinkertn@umich.edu self.sequencer.dcache = self.L1cache 1621400SN/A self.sequencer.ruby_system = ruby_system 1632356SN/A self.sequencer.is_cpu_sequencer = True 1642315SN/A 1651917SN/A self.use_seq_not_coal = False 1661917SN/A 1671400SN/A self.ruby_system = ruby_system 1682SN/A if options.recycle_latency: 1691400SN/A self.recycle_latency = options.recycle_latency 1702SN/A 1711400SN/Aclass SQCCache(RubyCache): 1721191SN/A dataArrayBanks = 8 1732SN/A tagArrayBanks = 8 1741129SN/A dataAccessLatency = 1 1751917SN/A tagAccessLatency = 1 1762SN/A 1772SN/A def create(self, options): 1782103SN/A self.size = MemorySize(options.sqc_size) 1792103SN/A self.assoc = options.sqc_assoc 1802680Sktlim@umich.edu self.replacement_policy = PseudoLRUReplacementPolicy() 181180SN/A 1821492SN/Aclass SQCCntrl(SQC_Controller, CntrlBase): 1831492SN/A 1842798Sktlim@umich.edu def create(self, options, ruby_system, system): 185180SN/A self.version = self.versionCount() 186180SN/A self.L1cache = SQCCache() 187180SN/A self.L1cache.create(options) 188180SN/A self.L1cache.resourceStalls = False 189180SN/A self.sequencer = RubySequencer() 190124SN/A self.sequencer.version = self.seqCount() 191124SN/A self.sequencer.icache = self.L1cache 192124SN/A self.sequencer.dcache = self.L1cache 193124SN/A self.sequencer.ruby_system = ruby_system 1942SN/A self.sequencer.support_data_reqs = False 1952SN/A self.sequencer.is_cpu_sequencer = False 196124SN/A self.ruby_system = ruby_system 197124SN/A if options.recycle_latency: 198124SN/A self.recycle_latency = options.recycle_latency 199124SN/A 200124SN/Aclass TCC(RubyCache): 201503SN/A size = MemorySize("256kB") 2022SN/A assoc = 16 203124SN/A dataAccessLatency = 8 204124SN/A tagAccessLatency = 2 205124SN/A resourceStalls = True 206124SN/A def create(self, options): 207124SN/A self.assoc = options.tcc_assoc 208124SN/A if hasattr(options, 'bw_scalor') and options.bw_scalor > 0: 209124SN/A s = options.num_compute_units 2102SN/A tcc_size = s * 128 211921SN/A tcc_size = str(tcc_size)+'kB' 2122378SN/A self.size = MemorySize(tcc_size) 213921SN/A self.dataArrayBanks = 64 214921SN/A self.tagArrayBanks = 64 215921SN/A else: 216921SN/A self.size = MemorySize(options.tcc_size) 217921SN/A self.dataArrayBanks = 256 / options.num_tccs #number of data banks 218921SN/A self.tagArrayBanks = 256 / options.num_tccs #number of tag banks 219921SN/A self.size.value = self.size.value / options.num_tccs 220921SN/A if ((self.size.value / long(self.assoc)) < 128): 221921SN/A self.size.value = long(128 * self.assoc) 222921SN/A self.start_index_bit = math.log(options.cacheline_size, 2) + \ 223921SN/A math.log(options.num_tccs, 2) 224921SN/A self.replacement_policy = PseudoLRUReplacementPolicy() 225921SN/A 2262SN/Aclass TCCCntrl(TCC_Controller, CntrlBase): 2272SN/A def create(self, options, ruby_system, system): 228124SN/A self.version = self.versionCount() 229124SN/A self.L2cache = TCC() 230124SN/A self.L2cache.create(options) 231124SN/A self.ruby_system = ruby_system 2322SN/A self.L2cache.resourceStalls = options.no_tcc_resource_stalls 2332SN/A 234707SN/A if options.recycle_latency: 235707SN/A self.recycle_latency = options.recycle_latency 2361191SN/A 2371191SN/Aclass L3Cache(RubyCache): 2381191SN/A dataArrayBanks = 16 2391191SN/A tagArrayBanks = 16 2401191SN/A 2411191SN/A def create(self, options, ruby_system, system): 2421191SN/A self.size = MemorySize(options.l3_size) 2431191SN/A self.size.value /= options.num_dirs 2441191SN/A self.assoc = options.l3_assoc 2451191SN/A self.dataArrayBanks /= options.num_dirs 2461191SN/A self.tagArrayBanks /= options.num_dirs 2471191SN/A self.dataArrayBanks /= options.num_dirs 2481191SN/A self.tagArrayBanks /= options.num_dirs 2491191SN/A self.dataAccessLatency = options.l3_data_latency 2501191SN/A self.tagAccessLatency = options.l3_tag_latency 2511191SN/A self.resourceStalls = False 2521191SN/A self.replacement_policy = PseudoLRUReplacementPolicy() 2532SN/A 2542SN/Aclass ProbeFilter(RubyCache): 2552SN/A size = "4MB" 2562SN/A assoc = 16 2572SN/A dataArrayBanks = 256 258707SN/A tagArrayBanks = 256 259707SN/A 260707SN/A def create(self, options, ruby_system, system): 261707SN/A self.block_size = "%dB" % (64 * options.blocks_per_region) 262707SN/A self.size = options.region_dir_entries * \ 263707SN/A self.block_size * options.num_compute_units 264707SN/A self.assoc = 8 265707SN/A self.tagArrayBanks = 8 266707SN/A self.tagAccessLatency = options.dir_tag_latency 267707SN/A self.dataAccessLatency = 1 268707SN/A self.resourceStalls = options.no_resource_stalls 269707SN/A self.start_index_bit = 6 + int(math.log(options.blocks_per_region, 2)) 270707SN/A self.replacement_policy = PseudoLRUReplacementPolicy() 271729SN/A 2722SN/Aclass L3Cntrl(L3Cache_Controller, CntrlBase): 2732SN/A def create(self, options, ruby_system, system): 2741717SN/A self.version = self.versionCount() 275 self.L3cache = L3Cache() 276 self.L3cache.create(options, ruby_system, system) 277 self.l3_response_latency = \ 278 max(self.L3cache.dataAccessLatency, self.L3cache.tagAccessLatency) 279 self.ruby_system = ruby_system 280 if options.recycle_latency: 281 self.recycle_latency = options.recycle_latency 282 283 def connectWireBuffers(self, req_to_dir, resp_to_dir, l3_unblock_to_dir, 284 req_to_l3, probe_to_l3, resp_to_l3): 285 self.reqToDir = req_to_dir 286 self.respToDir = resp_to_dir 287 self.l3UnblockToDir = l3_unblock_to_dir 288 self.reqToL3 = req_to_l3 289 self.probeToL3 = probe_to_l3 290 self.respToL3 = resp_to_l3 291 292class DirMem(RubyDirectoryMemory, CntrlBase): 293 def create(self, options, ruby_system, system): 294 self.version = self.versionCount() 295 296 phys_mem_size = AddrRange(options.mem_size).size() 297 mem_module_size = phys_mem_size / options.num_dirs 298 dir_size = MemorySize('0B') 299 dir_size.value = mem_module_size 300 self.size = dir_size 301 302class DirCntrl(Directory_Controller, CntrlBase): 303 def create(self, options, ruby_system, system): 304 self.version = self.versionCount() 305 self.response_latency = 30 306 self.directory = DirMem() 307 self.directory.create(options, ruby_system, system) 308 self.L3CacheMemory = L3Cache() 309 self.L3CacheMemory.create(options, ruby_system, system) 310 self.ProbeFilterMemory = ProbeFilter() 311 self.ProbeFilterMemory.create(options, ruby_system, system) 312 self.l3_hit_latency = \ 313 max(self.L3CacheMemory.dataAccessLatency, 314 self.L3CacheMemory.tagAccessLatency) 315 316 self.ruby_system = ruby_system 317 if options.recycle_latency: 318 self.recycle_latency = options.recycle_latency 319 320 def connectWireBuffers(self, req_to_dir, resp_to_dir, l3_unblock_to_dir, 321 req_to_l3, probe_to_l3, resp_to_l3): 322 self.reqToDir = req_to_dir 323 self.respToDir = resp_to_dir 324 self.l3UnblockToDir = l3_unblock_to_dir 325 self.reqToL3 = req_to_l3 326 self.probeToL3 = probe_to_l3 327 self.respToL3 = resp_to_l3 328 329def define_options(parser): 330 parser.add_option("--num-subcaches", type = "int", default = 4) 331 parser.add_option("--l3-data-latency", type = "int", default = 20) 332 parser.add_option("--l3-tag-latency", type = "int", default = 15) 333 parser.add_option("--cpu-to-dir-latency", type = "int", default = 120) 334 parser.add_option("--gpu-to-dir-latency", type = "int", default = 120) 335 parser.add_option("--no-resource-stalls", action = "store_false", 336 default = True) 337 parser.add_option("--no-tcc-resource-stalls", action = "store_false", 338 default = True) 339 parser.add_option("--num-tbes", type = "int", default = 2560) 340 parser.add_option("--l2-latency", type = "int", default = 50) # load to use 341 parser.add_option("--num-tccs", type = "int", default = 1, 342 help = "number of TCC banks in the GPU") 343 parser.add_option("--sqc-size", type = 'string', default = '32kB', 344 help = "SQC cache size") 345 parser.add_option("--sqc-assoc", type = 'int', default = 8, 346 help = "SQC cache assoc") 347 parser.add_option("--region-dir-entries", type = "int", default = 8192) 348 parser.add_option("--dir-tag-latency", type = "int", default = 8) 349 parser.add_option("--dir-tag-banks", type = "int", default = 4) 350 parser.add_option("--blocks-per-region", type = "int", default = 1) 351 parser.add_option("--use-L3-on-WT", action = "store_true", default = False) 352 parser.add_option("--nonInclusiveDir", action = "store_true", 353 default = False) 354 parser.add_option("--WB_L1", action = "store_true", 355 default = False, help = "writeback L2") 356 parser.add_option("--WB_L2", action = "store_true", 357 default = False, help = "writeback L2") 358 parser.add_option("--TCP_latency", type = "int", 359 default = 4, help = "TCP latency") 360 parser.add_option("--TCC_latency", type = "int", 361 default = 16, help = "TCC latency") 362 parser.add_option("--tcc-size", type = 'string', default = '2MB', 363 help = "agregate tcc size") 364 parser.add_option("--tcc-assoc", type = 'int', default = 16, 365 help = "tcc assoc") 366 parser.add_option("--tcp-size", type = 'string', default = '16kB', 367 help = "tcp size") 368 parser.add_option("--sampler-sets", type = "int", default = 1024) 369 parser.add_option("--sampler-assoc", type = "int", default = 16) 370 parser.add_option("--sampler-counter", type = "int", default = 512) 371 parser.add_option("--noL1", action = "store_true", default = False, 372 help = "bypassL1") 373 parser.add_option("--noL2", action = "store_true", default = False, 374 help = "bypassL2") 375 376def create_system(options, full_system, system, dma_devices, ruby_system): 377 if buildEnv['PROTOCOL'] != 'GPU_VIPER_Baseline': 378 panic("This script requires the" \ 379 "GPU_VIPER_Baseline protocol to be built.") 380 381 cpu_sequencers = [] 382 383 # 384 # The ruby network creation expects the list of nodes in the system to be 385 # consistent with the NetDest list. Therefore the l1 controller nodes 386 # must be listed before the directory nodes and directory nodes before 387 # dma nodes, etc. 388 # 389 cp_cntrl_nodes = [] 390 tcp_cntrl_nodes = [] 391 sqc_cntrl_nodes = [] 392 tcc_cntrl_nodes = [] 393 dir_cntrl_nodes = [] 394 l3_cntrl_nodes = [] 395 396 # 397 # Must create the individual controllers before the network to ensure the 398 # controller constructors are called before the network constructor 399 # 400 401 # For an odd number of CPUs, still create the right number of controllers 402 TCC_bits = int(math.log(options.num_tccs, 2)) 403 404 # This is the base crossbar that connects the L3s, Dirs, and cpu/gpu 405 # Clusters 406 crossbar_bw = 16 * options.num_compute_units #Assuming a 2GHz clock 407 mainCluster = Cluster(intBW = crossbar_bw) 408 for i in xrange(options.num_dirs): 409 410 dir_cntrl = DirCntrl(noTCCdir=True,TCC_select_num_bits = TCC_bits) 411 dir_cntrl.create(options, ruby_system, system) 412 dir_cntrl.number_of_TBEs = options.num_tbes 413 dir_cntrl.useL3OnWT = options.use_L3_on_WT 414 dir_cntrl.inclusiveDir = not options.nonInclusiveDir 415 416 # Connect the Directory controller to the ruby network 417 dir_cntrl.requestFromCores = MessageBuffer(ordered = True) 418 dir_cntrl.requestFromCores.slave = ruby_system.network.master 419 420 dir_cntrl.responseFromCores = MessageBuffer() 421 dir_cntrl.responseFromCores.slave = ruby_system.network.master 422 423 dir_cntrl.unblockFromCores = MessageBuffer() 424 dir_cntrl.unblockFromCores.slave = ruby_system.network.master 425 426 dir_cntrl.probeToCore = MessageBuffer() 427 dir_cntrl.probeToCore.master = ruby_system.network.slave 428 429 dir_cntrl.responseToCore = MessageBuffer() 430 dir_cntrl.responseToCore.master = ruby_system.network.slave 431 432 dir_cntrl.triggerQueue = MessageBuffer(ordered = True) 433 dir_cntrl.L3triggerQueue = MessageBuffer(ordered = True) 434 dir_cntrl.responseFromMemory = MessageBuffer() 435 436 exec("system.dir_cntrl%d = dir_cntrl" % i) 437 dir_cntrl_nodes.append(dir_cntrl) 438 mainCluster.add(dir_cntrl) 439 440 cpuCluster = Cluster(extBW = crossbar_bw, intBW=crossbar_bw) 441 for i in xrange((options.num_cpus + 1) / 2): 442 443 cp_cntrl = CPCntrl() 444 cp_cntrl.create(options, ruby_system, system) 445 446 exec("system.cp_cntrl%d = cp_cntrl" % i) 447 # 448 # Add controllers and sequencers to the appropriate lists 449 # 450 cpu_sequencers.extend([cp_cntrl.sequencer, cp_cntrl.sequencer1]) 451 452 # Connect the CP controllers and the network 453 cp_cntrl.requestFromCore = MessageBuffer() 454 cp_cntrl.requestFromCore.master = ruby_system.network.slave 455 456 cp_cntrl.responseFromCore = MessageBuffer() 457 cp_cntrl.responseFromCore.master = ruby_system.network.slave 458 459 cp_cntrl.unblockFromCore = MessageBuffer() 460 cp_cntrl.unblockFromCore.master = ruby_system.network.slave 461 462 cp_cntrl.probeToCore = MessageBuffer() 463 cp_cntrl.probeToCore.slave = ruby_system.network.master 464 465 cp_cntrl.responseToCore = MessageBuffer() 466 cp_cntrl.responseToCore.slave = ruby_system.network.master 467 468 cp_cntrl.mandatoryQueue = MessageBuffer() 469 cp_cntrl.triggerQueue = MessageBuffer(ordered = True) 470 471 cpuCluster.add(cp_cntrl) 472 473 gpuCluster = Cluster(extBW = crossbar_bw, intBW = crossbar_bw) 474 for i in xrange(options.num_compute_units): 475 476 tcp_cntrl = TCPCntrl(TCC_select_num_bits = TCC_bits, 477 issue_latency = 1, 478 number_of_TBEs = 2560) 479 # TBEs set to max outstanding requests 480 tcp_cntrl.create(options, ruby_system, system) 481 tcp_cntrl.WB = options.WB_L1 482 tcp_cntrl.disableL1 = options.noL1 483 484 exec("system.tcp_cntrl%d = tcp_cntrl" % i) 485 # 486 # Add controllers and sequencers to the appropriate lists 487 # 488 cpu_sequencers.append(tcp_cntrl.coalescer) 489 tcp_cntrl_nodes.append(tcp_cntrl) 490 491 # Connect the CP (TCP) controllers to the ruby network 492 tcp_cntrl.requestFromTCP = MessageBuffer(ordered = True) 493 tcp_cntrl.requestFromTCP.master = ruby_system.network.slave 494 495 tcp_cntrl.responseFromTCP = MessageBuffer(ordered = True) 496 tcp_cntrl.responseFromTCP.master = ruby_system.network.slave 497 498 tcp_cntrl.unblockFromCore = MessageBuffer() 499 tcp_cntrl.unblockFromCore.master = ruby_system.network.slave 500 501 tcp_cntrl.probeToTCP = MessageBuffer(ordered = True) 502 tcp_cntrl.probeToTCP.slave = ruby_system.network.master 503 504 tcp_cntrl.responseToTCP = MessageBuffer(ordered = True) 505 tcp_cntrl.responseToTCP.slave = ruby_system.network.master 506 507 tcp_cntrl.mandatoryQueue = MessageBuffer() 508 509 gpuCluster.add(tcp_cntrl) 510 511 for i in xrange(options.num_sqc): 512 513 sqc_cntrl = SQCCntrl(TCC_select_num_bits = TCC_bits) 514 sqc_cntrl.create(options, ruby_system, system) 515 516 exec("system.sqc_cntrl%d = sqc_cntrl" % i) 517 # 518 # Add controllers and sequencers to the appropriate lists 519 # 520 cpu_sequencers.append(sqc_cntrl.sequencer) 521 522 # Connect the SQC controller to the ruby network 523 sqc_cntrl.requestFromSQC = MessageBuffer(ordered = True) 524 sqc_cntrl.requestFromSQC.master = ruby_system.network.slave 525 526 sqc_cntrl.probeToSQC = MessageBuffer(ordered = True) 527 sqc_cntrl.probeToSQC.slave = ruby_system.network.master 528 529 sqc_cntrl.responseToSQC = MessageBuffer(ordered = True) 530 sqc_cntrl.responseToSQC.slave = ruby_system.network.master 531 532 sqc_cntrl.mandatoryQueue = MessageBuffer() 533 534 # SQC also in GPU cluster 535 gpuCluster.add(sqc_cntrl) 536 537 # Because of wire buffers, num_tccs must equal num_tccdirs 538 numa_bit = 6 539 540 for i in xrange(options.num_tccs): 541 542 tcc_cntrl = TCCCntrl() 543 tcc_cntrl.create(options, ruby_system, system) 544 tcc_cntrl.l2_request_latency = options.gpu_to_dir_latency 545 tcc_cntrl.l2_response_latency = options.TCC_latency 546 tcc_cntrl_nodes.append(tcc_cntrl) 547 tcc_cntrl.WB = options.WB_L2 548 tcc_cntrl.number_of_TBEs = 2560 * options.num_compute_units 549 550 # Connect the TCC controllers to the ruby network 551 tcc_cntrl.requestFromTCP = MessageBuffer(ordered = True) 552 tcc_cntrl.requestFromTCP.slave = ruby_system.network.master 553 554 tcc_cntrl.responseToCore = MessageBuffer(ordered = True) 555 tcc_cntrl.responseToCore.master = ruby_system.network.slave 556 557 tcc_cntrl.probeFromNB = MessageBuffer() 558 tcc_cntrl.probeFromNB.slave = ruby_system.network.master 559 560 tcc_cntrl.responseFromNB = MessageBuffer() 561 tcc_cntrl.responseFromNB.slave = ruby_system.network.master 562 563 tcc_cntrl.requestToNB = MessageBuffer(ordered = True) 564 tcc_cntrl.requestToNB.master = ruby_system.network.slave 565 566 tcc_cntrl.responseToNB = MessageBuffer() 567 tcc_cntrl.responseToNB.master = ruby_system.network.slave 568 569 tcc_cntrl.unblockToNB = MessageBuffer() 570 tcc_cntrl.unblockToNB.master = ruby_system.network.slave 571 572 tcc_cntrl.triggerQueue = MessageBuffer(ordered = True) 573 574 exec("system.tcc_cntrl%d = tcc_cntrl" % i) 575 # connect all of the wire buffers between L3 and dirs up 576 # TCC cntrls added to the GPU cluster 577 gpuCluster.add(tcc_cntrl) 578 579 # Assuming no DMA devices 580 assert(len(dma_devices) == 0) 581 582 # Add cpu/gpu clusters to main cluster 583 mainCluster.add(cpuCluster) 584 mainCluster.add(gpuCluster) 585 586 ruby_system.network.number_of_virtual_networks = 10 587 588 return (cpu_sequencers, dir_cntrl_nodes, mainCluster) 589