changeset cf870cd20cfc in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=cf870cd20cfc
description:
        config: make internal links in network topology unidirectional.
        This patch makes the internal links within the network topology
        unidirectional, thus allowing any deadlock-free routing algorithms to
        be specified from the topology itself using weights.
        This patch also renames Mesh.py and MeshDirCorners.py to
        Mesh_XY.py and MeshDirCorners_XY.py (Mesh with XY routing).
        It also adds a Mesh_westfirst.py and CrossbarGarnet.py topologies.

diffstat:

 configs/topologies/Cluster.py                                  |   23 +-
 configs/topologies/Crossbar.py                                 |   18 +-
 configs/topologies/CrossbarGarnet.py                           |   50 +++
 configs/topologies/Mesh.py                                     |  117 -------
 configs/topologies/MeshDirCorners.py                           |  138 --------
 configs/topologies/MeshDirCorners_XY.py                        |  164 
++++++++++
 configs/topologies/Mesh_XY.py                                  |  152 +++++++++
 configs/topologies/Mesh_westfirst.py                           |  158 +++++++++
 configs/topologies/Pt2Pt.py                                    |    4 +-
 configs/topologies/Torus.py                                    |  129 -------
 src/mem/ruby/network/BasicLink.cc                              |    4 -
 src/mem/ruby/network/BasicLink.hh                              |    8 -
 src/mem/ruby/network/BasicLink.py                              |   11 +-
 src/mem/ruby/network/Network.hh                                |    7 +-
 src/mem/ruby/network/Topology.cc                               |   50 +-
 src/mem/ruby/network/Topology.hh                               |    3 +-
 src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc  |   19 +-
 src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh  |    7 +-
 src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.cc |   13 +-
 src/mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh |    7 +-
 src/mem/ruby/network/simple/SimpleNetwork.cc                   |    7 +-
 src/mem/ruby/network/simple/SimpleNetwork.hh                   |    7 +-
 src/mem/ruby/network/simple/SimpleNetwork.py                   |    8 +-
 23 files changed, 613 insertions(+), 491 deletions(-)

diffs (truncated from 1459 to 300 lines):

diff -r 004d34b65092 -r cf870cd20cfc configs/topologies/Cluster.py
--- a/configs/topologies/Cluster.py     Thu Oct 06 14:35:17 2016 -0400
+++ b/configs/topologies/Cluster.py     Thu Oct 06 14:35:18 2016 -0400
@@ -86,23 +86,30 @@
                 node.makeTopology(options, network, IntLink, ExtLink, Router)
 
                 # connect this cluster to the router
-                link = IntLink(link_id=self.num_int_links(), 
node_a=self.router,
-                        node_b=node.router)
+                link_out = IntLink(link_id=self.num_int_links(), 
src_node=self.router,
+                           dst_node_=node.router)
+                link_in = IntLink(link_id=self.num_int_links(), 
src_node=node.router,
+                                  dst_node_=self.router)
 
                 if node.extBW:
-                    link.bandwidth_factor = node.extBW
+                    link_out.bandwidth_factor = node.extBW
+                    link_in.bandwidth_factor = node.extBW
 
-                # if there is an interanl b/w for this node
+                # if there is an internal b/w for this node
                 # and no ext b/w to override
                 elif self.intBW:
-                    link.bandwidth_factor = self.intBW
+                    link_out.bandwidth_factor = self.intBW
+                    link_in.bandwidth_factor = self.intBW
 
                 if node.extLatency:
-                    link.latency = node.extLatency
+                    link_out.latency = node.extLatency
+                    link_in.latency = node.extLatency
                 elif self.intLatency:
-                    link.latency = self.intLatency
+                    link_out.latency = self.intLatency
+                    link_in.latency = self.intLatency
 
-                network.int_links.append(link)
+                network.int_links.append(link_out)
+                network.int_links.append(link_in)
             else:
                 # node is just a controller,
                 # connect it to the router via a ext_link
diff -r 004d34b65092 -r cf870cd20cfc configs/topologies/Crossbar.py
--- a/configs/topologies/Crossbar.py    Thu Oct 06 14:35:17 2016 -0400
+++ b/configs/topologies/Crossbar.py    Thu Oct 06 14:35:18 2016 -0400
@@ -39,6 +39,7 @@
         # 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.
+        # For garnet, one router suffices, use CrossbarGarnet.py
 
         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
@@ -49,7 +50,18 @@
         network.ext_links = ext_links
 
         link_count = len(self.nodes)
-        int_links = [IntLink(link_id=(link_count+i),
-                             node_a=routers[i], node_b=xbar)
-                        for i in range(len(self.nodes))]
+
+        int_links = []
+        for i in range(len(self.nodes)):
+            int_links.append(IntLink(link_id=(link_count+i),
+                                     src_node=routers[i],
+                                     dst_node=xbar))
+
+        link_count += len(self.nodes)
+
+        for i in range(len(self.nodes)):
+            int_links.append(IntLink(link_id=(link_count+i),
+                                     src_node=xbar,
+                                     dst_node=routers[i]))
+
         network.int_links = int_links
diff -r 004d34b65092 -r cf870cd20cfc configs/topologies/CrossbarGarnet.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/topologies/CrossbarGarnet.py      Thu Oct 06 14:35:18 2016 -0400
@@ -0,0 +1,50 @@
+# Copyright (c) 2016 Georgia Institute of Technology
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Tushar Krishna
+
+from m5.params import *
+from m5.objects import *
+
+from BaseTopology import SimpleTopology
+
+class CrossbarGarnet(SimpleTopology):
+    description='CrossbarGarnet'
+
+    def makeTopology(self, options, network, IntLink, ExtLink, Router):
+        # Create one router in Garnet. Internally models a crossbar and
+        # the associated allocator.
+        # For simple network, use Crossbar.py
+
+        xbar = Router(router_id=0)
+        network.routers = xbar
+
+        ext_links = [ExtLink(link_id=i, ext_node=n, int_node=xbar)
+                        for (i, n) in enumerate(self.nodes)]
+        network.ext_links = ext_links
+
+        int_links = []
+        network.int_links = int_links
diff -r 004d34b65092 -r cf870cd20cfc configs/topologies/Mesh.py
--- a/configs/topologies/Mesh.py        Thu Oct 06 14:35:17 2016 -0400
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-# Copyright (c) 2010 Advanced Micro Devices, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met: redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer;
-# redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution;
-# neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Authors: Brad Beckmann
-
-from m5.params import *
-from m5.objects import *
-
-from BaseTopology import SimpleTopology
-
-class Mesh(SimpleTopology):
-    description='Mesh'
-
-    def __init__(self, controllers):
-        self.nodes = controllers
-
-    # Makes a generic mesh assuming an equal number of cache and directory 
cntrls
-
-    def makeTopology(self, options, network, IntLink, ExtLink, Router):
-        nodes = self.nodes
-
-        num_routers = options.num_cpus
-        num_rows = options.mesh_rows
-
-        # There must be an evenly divisible number of cntrls to routers
-        # Also, obviously the number or rows must be <= the number of routers
-        cntrls_per_router, remainder = divmod(len(nodes), num_routers)
-        assert(num_rows <= num_routers)
-        num_columns = int(num_routers / num_rows)
-        assert(num_columns * num_rows == num_routers)
-
-        # 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
-
-        # 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(network_nodes):
-            cntrl_level, router_id = divmod(i, num_routers)
-            assert(cntrl_level < cntrls_per_router)
-            ext_links.append(ExtLink(link_id=link_count, ext_node=n,
-                                    int_node=routers[router_id]))
-            link_count += 1
-
-        # 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(link_id=link_count, ext_node=node,
-                                    int_node=routers[0]))
-            link_count += 1
-
-        network.ext_links = ext_links
-
-        # Create the mesh links.  First row (east-west) links then column
-        # (north-south) links
-        int_links = []
-        for row in xrange(num_rows):
-            for col in xrange(num_columns):
-                if (col + 1 < num_columns):
-                    east_id = col + (row * num_columns)
-                    west_id = (col + 1) + (row * num_columns)
-                    int_links.append(IntLink(link_id=link_count,
-                                            node_a=routers[east_id],
-                                            node_b=routers[west_id],
-                                            weight=1))
-                    link_count += 1
-
-        for col in xrange(num_columns):
-            for row in xrange(num_rows):
-                if (row + 1 < num_rows):
-                    north_id = col + (row * num_columns)
-                    south_id = col + ((row + 1) * num_columns)
-                    int_links.append(IntLink(link_id=link_count,
-                                            node_a=routers[north_id],
-                                            node_b=routers[south_id],
-                                            weight=2))
-                    link_count += 1
-
-        network.int_links = int_links
diff -r 004d34b65092 -r cf870cd20cfc configs/topologies/MeshDirCorners.py
--- a/configs/topologies/MeshDirCorners.py      Thu Oct 06 14:35:17 2016 -0400
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-# Copyright (c) 2010 Advanced Micro Devices, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met: redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer;
-# redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution;
-# neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Authors: Brad Beckmann
-
-from m5.params import *
-from m5.objects import *
-
-from BaseTopology import SimpleTopology
-
-class MeshDirCorners(SimpleTopology):
-    description='MeshDirCorners'
-
-    def __init__(self, controllers):
-        self.nodes = controllers
-
-    # This file contains a special network creation function.  This
-    # networks is not general and will only work with specific system
-    # configurations.  The network specified is similar to GEMS old file
-    # specified network.
-
-    def makeTopology(self, options, network, IntLink, ExtLink, Router):
-        nodes = self.nodes
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to