1# Copyright (c) 2009 Advanced Micro Devices, Inc. 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 42 unchanged lines hidden (view full) --- 51 for i in xrange(self.number_of_virtual_networks): 52 network_buffers.append(MessageBuffer(ordered = True)) 53 network_buffers.append(MessageBuffer(ordered = True)) 54 self.int_link_buffers = network_buffers 55 56 # Also add buffers for all router-link connections 57 for router in self.routers: 58 router_buffers = [] |
59 # Add message buffers to routers at the end of each 60 # unidirectional internal link |
61 for link in self.int_links: |
62 if link.dst_node == router: |
63 for i in xrange(self.number_of_virtual_networks): 64 router_buffers.append(MessageBuffer(ordered = True)) |
65 66 # Add message buffers to routers for each external link connection 67 for link in self.ext_links: 68 # Routers can only be int_nodes on ext_links 69 if link.int_node in self.routers: 70 for i in xrange(self.number_of_virtual_networks): 71 router_buffers.append(MessageBuffer(ordered = True)) 72 router.port_buffers = router_buffers 73 74class Switch(BasicRouter): 75 type = 'Switch' 76 cxx_header = 'mem/ruby/network/simple/Switch.hh' 77 virt_nets = Param.Int(Parent.number_of_virtual_networks, 78 "number of virtual networks") 79 port_buffers = VectorParam.MessageBuffer("Port buffers") |