summaryrefslogtreecommitdiff
path: root/configs/topologies/Crossbar.py
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:33 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:33 -0500
commite9ae8b7d29e83fa2cad55006d2c6dc58115965cc (patch)
treec418f84ec5ed77be77ca84de9517126b5cfa4ad6 /configs/topologies/Crossbar.py
parent24dc914d8758464ed6d757cf2830456562686be0 (diff)
downloadgem5-e9ae8b7d29e83fa2cad55006d2c6dc58115965cc.tar.xz
ruby: network: correct naming of routers
The routers are created before the network class. This results in the routers becoming children of the first link they are connected to and they get generic names like int_node and node_b. This patch creates the network object first and passes it to the topology creation function. Now the routers are children of the network object and names are much more sensible.
Diffstat (limited to 'configs/topologies/Crossbar.py')
-rw-r--r--configs/topologies/Crossbar.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/configs/topologies/Crossbar.py b/configs/topologies/Crossbar.py
index c85b8e8eb..e3dd431e7 100644
--- a/configs/topologies/Crossbar.py
+++ b/configs/topologies/Crossbar.py
@@ -34,19 +34,22 @@ from BaseTopology import SimpleTopology
class Crossbar(SimpleTopology):
description='Crossbar'
- def makeTopology(self, options, IntLink, ExtLink, Router):
- # Create an individual router for each controller plus one more for the
- # centralized crossbar. The large numbers of routers are needed because
- # external links do not model outgoing bandwidth in the simple network, but
- # internal links do.
+ def makeTopology(self, options, network, IntLink, ExtLink, Router):
+ # Create an individual router for each controller plus one more for
+ # the centralized crossbar. The large numbers of routers are needed
+ # because external links do not model outgoing bandwidth in the
+ # simple network, but internal links do.
routers = [Router(router_id=i) for i in range(len(self.nodes)+1)]
+ xbar = routers[len(self.nodes)] # the crossbar router is the last router created
+ network.routers = routers
+
ext_links = [ExtLink(link_id=i, ext_node=n, int_node=routers[i])
for (i, n) in enumerate(self.nodes)]
+ network.ext_links = ext_links
+
link_count = len(self.nodes)
- xbar = routers[len(self.nodes)] # the crossbar router is the last router created
int_links = [IntLink(link_id=(link_count+i),
node_a=routers[i], node_b=xbar)
for i in range(len(self.nodes))]
-
- return routers, int_links, ext_links
+ network.int_links = int_links