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>
This commit is contained in:
Gabe Black
2019-03-07 00:46:29 -08:00
parent f870912a00
commit 8e89366ada
3 changed files with 23 additions and 0 deletions

View File

@@ -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):