summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-03-07 00:46:29 -0800
committerGabe Black <gabeblack@google.com>2019-03-19 10:21:14 +0000
commit8e89366ada0213d45af088945406c82187b5014a (patch)
treed29d7ad18e311c3e9dca5296ed1c7cf2e53ee6fd /src/python
parentf870912a00dfa6b1ef8139ed35f65ef886b198c6 (diff)
downloadgem5-8e89366ada0213d45af088945406c82187b5014a.tar.xz
sim: Add a getPort function to SimObject.
This will retrieve a Port object from a given SimObject (which might not be a MemObject) no matter what flavor of Port it is. Change-Id: I636b85e9d4929a05a769e165849106bcb5f3e9c1 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17037 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/SimObject.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index b74e93a87..0e29980c6 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -1642,6 +1642,10 @@ class SimObject(object):
def getValue(self):
return self.getCCObject()
+ @cxxMethod(return_value_policy="reference")
+ def getPort(self, if_name, idx):
+ pass
+
# Create C++ port connections corresponding to the connections in
# _port_refs
def connectPorts(self):