From 1d4c3ecdc347f42882a3d2f3c87dcd7725fda2e5 Mon Sep 17 00:00:00 2001 From: Brad Beckmann Date: Mon, 1 Feb 2010 14:27:16 -0800 Subject: [PATCH] ruby: Added FS support to the simple mesh topology Added full-system support to the simple mesh toplogy by allowing dma contrllers to be attached to router zero in the network. --- src/mem/ruby/network/Network.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/mem/ruby/network/Network.py b/src/mem/ruby/network/Network.py index 01ebfff70..619196591 100644 --- a/src/mem/ruby/network/Network.py +++ b/src/mem/ruby/network/Network.py @@ -70,20 +70,39 @@ def makeMesh(nodes, num_routers, num_rows): # Also, obviously the number or rows must be <= the number of routers # cntrls_per_router, remainder = divmod(len(nodes), num_routers) - assert(remainder == 0) assert(num_rows <= num_routers) num_columns = int(num_routers / num_rows) assert(num_columns * num_rows == num_routers) + # + # Add all but the remainder nodes to the list of nodes to be uniformly + # distributed across the network. + # + network_nodes = [] + remainder_nodes = [] + for node_index in xrange(len(nodes)): + if node_index < (len(nodes) - remainder): + network_nodes.append(nodes[node_index]) + else: + remainder_nodes.append(nodes[node_index]) + # # Connect each node to the appropriate router # ext_links = [] - for (i, n) in enumerate(nodes): + for (i, n) in enumerate(network_nodes): cntrl_level, router_id = divmod(i, num_routers) assert(cntrl_level < cntrls_per_router) ext_links.append(ExtLink(ext_node=n, int_node=router_id)) + # + # Connect the remainding nodes to router 0. These should only be DMA nodes. + # + for (i, node) in enumerate(remainder_nodes): + assert(node.type == 'DMA_Controller') + assert(i < remainder) + ext_links.append(ExtLink(ext_node=node, int_node=0)) + # # Create the mesh links. First row (east-west) links then column # (north-south) links