summaryrefslogtreecommitdiff
path: root/configs/topologies
diff options
context:
space:
mode:
authorDavid Hashe <david.hashe@amd.com>2018-04-18 16:40:28 -0400
committerBrandon Potter <Brandon.Potter@amd.com>2019-04-25 20:38:57 +0000
commitae3a00cd1fd8a0500a9d8be96c9b176a0326b133 (patch)
tree7779532d98e94308beac80806828872e56b2ff5b /configs/topologies
parent26e888965d08486aeed7ebb3ef934ceb1a38cd6f (diff)
downloadgem5-ae3a00cd1fd8a0500a9d8be96c9b176a0326b133.tar.xz
configs: faux-filesystem fix w/ ruby in se mode
These changes are needed so that the config scripts can report cache hierarchy information to the faux filesystem. This is useful for the ROCm runtime when it reads psuedofiles from the host filesytem from "/proc". Change-Id: Iad3e6c088d47c9b93979f584de748367eae8259b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12121 Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Maintainer: Brandon Potter <Brandon.Potter@amd.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'configs/topologies')
-rw-r--r--configs/topologies/BaseTopology.py9
-rw-r--r--configs/topologies/Cluster.py3
-rw-r--r--configs/topologies/MeshDirCorners_XY.py33
-rw-r--r--configs/topologies/Mesh_XY.py8
4 files changed, 52 insertions, 1 deletions
diff --git a/configs/topologies/BaseTopology.py b/configs/topologies/BaseTopology.py
index 180d4373a..15c9e8828 100644
--- a/configs/topologies/BaseTopology.py
+++ b/configs/topologies/BaseTopology.py
@@ -51,6 +51,15 @@ class BaseTopology(object):
"""
m5.util.fatal("BaseTopology should have been overridden!!")
+ def registerTopology(self, options):
+ """ Called from configs/ruby/Ruby.py
+ There is no return value. This should only be called in
+ SE mode. It is used by some topology objects to populate
+ the faux filesystem with accurate file contents.
+ No need to implement if not using FilesystemRegister
+ functionality.
+ """
+
class SimpleTopology(BaseTopology):
""" Provides methods needed for the topologies included in Ruby before
topology changes.
diff --git a/configs/topologies/Cluster.py b/configs/topologies/Cluster.py
index a0e7df638..65c568643 100644
--- a/configs/topologies/Cluster.py
+++ b/configs/topologies/Cluster.py
@@ -85,7 +85,8 @@ class Cluster(BaseTopology):
for node in self.nodes:
if type(node) == Cluster:
- node.makeTopology(options, network, IntLink, ExtLink, Router)
+ node.makeTopology(options, network, IntLink,
+ ExtLink, Router)
# connect this cluster to the router
link_out = IntLink(link_id=self.num_int_links(), src_node=self.router,
diff --git a/configs/topologies/MeshDirCorners_XY.py b/configs/topologies/MeshDirCorners_XY.py
index 95cb486ab..bdeaec147 100644
--- a/configs/topologies/MeshDirCorners_XY.py
+++ b/configs/topologies/MeshDirCorners_XY.py
@@ -32,6 +32,8 @@ from __future__ import absolute_import
from m5.params import *
from m5.objects import *
+from common import FileSystemConfig
+
from .BaseTopology import SimpleTopology
# Creates a Mesh topology with 4 directories, one at each corner.
@@ -98,6 +100,27 @@ class MeshDirCorners_XY(SimpleTopology):
latency = link_latency))
link_count += 1
+ # NUMA Node for each quadrant
+ # With odd columns or rows, the nodes will be unequal
+ numa_nodes = [ [], [], [], []]
+ for i in xrange(num_routers):
+ if i % num_columns < num_columns / 2 and \
+ i < num_routers / 2:
+ numa_nodes[0].append(i)
+ elif i % num_columns >= num_columns / 2 and \
+ i < num_routers / 2:
+ numa_nodes[1].append(i)
+ elif i % num_columns < num_columns / 2 and \
+ i >= num_routers / 2:
+ numa_nodes[2].append(i)
+ else:
+ numa_nodes[3].append(i)
+
+ num_numa_nodes = 0
+ for n in numa_nodes:
+ if n:
+ num_numa_nodes += 1
+
# Connect the dir nodes to the corners.
ext_links.append(ExtLink(link_id=link_count, ext_node=dir_nodes[0],
int_node=routers[0],
@@ -190,3 +213,13 @@ class MeshDirCorners_XY(SimpleTopology):
network.int_links = int_links
+
+ # Register nodes with filesystem
+ def registerTopology(self, options):
+ i = 0
+ for n in numa_nodes:
+ if n:
+ FileSystemConfig.register_node(n,
+ MemorySize(options.mem_size) / num_numa_nodes, i)
+ i += 1
+
diff --git a/configs/topologies/Mesh_XY.py b/configs/topologies/Mesh_XY.py
index 79575b35d..66fbd3618 100644
--- a/configs/topologies/Mesh_XY.py
+++ b/configs/topologies/Mesh_XY.py
@@ -34,6 +34,8 @@ from __future__ import absolute_import
from m5.params import *
from m5.objects import *
+from common import FileSystemConfig
+
from .BaseTopology import SimpleTopology
# Creates a generic Mesh assuming an equal number of cache
@@ -174,3 +176,9 @@ class Mesh_XY(SimpleTopology):
network.int_links = int_links
+
+ # Register nodes with filesystem
+ def registerTopology(self, options):
+ for i in xrange(options.num_cpus):
+ FileSystemConfig.register_node([i],
+ MemorySize(options.mem_size) / options.num_cpus, i)