diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-09-06 16:21:33 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-09-06 16:21:33 -0500 |
commit | e9ae8b7d29e83fa2cad55006d2c6dc58115965cc (patch) | |
tree | c418f84ec5ed77be77ca84de9517126b5cfa4ad6 /configs/topologies/MeshDirCorners.py | |
parent | 24dc914d8758464ed6d757cf2830456562686be0 (diff) | |
download | gem5-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/MeshDirCorners.py')
-rw-r--r-- | configs/topologies/MeshDirCorners.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/configs/topologies/MeshDirCorners.py b/configs/topologies/MeshDirCorners.py index 13b4acc19..40720004e 100644 --- a/configs/topologies/MeshDirCorners.py +++ b/configs/topologies/MeshDirCorners.py @@ -42,7 +42,7 @@ class MeshDirCorners(SimpleTopology): # configurations. The network specified is similar to GEMS old file # specified network. - def makeTopology(self, options, IntLink, ExtLink, Router): + def makeTopology(self, options, network, IntLink, ExtLink, Router): nodes = self.nodes num_routers = options.num_cpus @@ -74,6 +74,7 @@ class MeshDirCorners(SimpleTopology): # Create the routers in the mesh routers = [Router(router_id=i) for i in range(num_routers)] + network.routers = routers # link counter to set unique link ids link_count = 0 @@ -104,7 +105,10 @@ class MeshDirCorners(SimpleTopology): # Connect the dma nodes to router 0. These should only be DMA nodes. for (i, node) in enumerate(dma_nodes): assert(node.type == 'DMA_Controller') - ext_links.append(ExtLink(link_id=link_count, ext_node=node, int_node=routers[0])) + ext_links.append(ExtLink(link_id=link_count, ext_node=node, + int_node=routers[0])) + + network.ext_links = ext_links # Create the mesh links. First row (east-west) links then column # (north-south) links @@ -131,4 +135,4 @@ class MeshDirCorners(SimpleTopology): weight=2)) link_count += 1 - return routers, int_links, ext_links + network.int_links = int_links |