SimpleNetwork.py (11111:6da33e720481) SimpleNetwork.py (11663:cf870cd20cfc)
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 = []
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 for each internal link connection
59 # Add message buffers to routers at the end of each
60 # unidirectional internal link
60 for link in self.int_links:
61 for link in self.int_links:
61 if link.node_a == router:
62 if link.dst_node == router:
62 for i in xrange(self.number_of_virtual_networks):
63 router_buffers.append(MessageBuffer(ordered = True))
63 for i in xrange(self.number_of_virtual_networks):
64 router_buffers.append(MessageBuffer(ordered = True))
64 if link.node_b == router:
65 for i in xrange(self.number_of_virtual_networks):
66 router_buffers.append(MessageBuffer(ordered = True))
67
68 # Add message buffers to routers for each external link connection
69 for link in self.ext_links:
70 # Routers can only be int_nodes on ext_links
71 if link.int_node in self.routers:
72 for i in xrange(self.number_of_virtual_networks):
73 router_buffers.append(MessageBuffer(ordered = True))
74 router.port_buffers = router_buffers
75
76class Switch(BasicRouter):
77 type = 'Switch'
78 cxx_header = 'mem/ruby/network/simple/Switch.hh'
79 virt_nets = Param.Int(Parent.number_of_virtual_networks,
80 "number of virtual networks")
81 port_buffers = VectorParam.MessageBuffer("Port buffers")
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")