summaryrefslogtreecommitdiff
path: root/src/systemc/core/port.cc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-01 02:33:55 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:43:35 +0000
commitb2e1f81f51e630ef4399f24024c82404601f8340 (patch)
tree8a6be7cafcbc3b36e10daa1c433aed390a48eed7 /src/systemc/core/port.cc
parenta7f1fe77d64e46e5f9a348b8ae02b3cce3042b98 (diff)
downloadgem5-b2e1f81f51e630ef4399f24024c82404601f8340.tar.xz
systemc: Add missing sc_interface::register_port, and add calls to it.
This function is standard and supposed to be on sc_interface, but it was somehow left out. This change adds it, and makes sure it's called by the port binding code. The default implementation does nothing, as it's supposed to according to the spec. Also note that only the ports farthest from the interfaces are suppose to call register_port. As the port bindings are completed, we keep track of whether a port has been bound to another port. If it has, the source port is farther from the interfaces than the target port (since it has to go "through" the target port to get to them, and so the target port should not call register_port. Change-Id: Ia98f9ff364385fd1699d88a1d99787d205816a08 Reviewed-on: https://gem5-review.googlesource.com/c/13199 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/port.cc')
-rw-r--r--src/systemc/core/port.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/systemc/core/port.cc b/src/systemc/core/port.cc
index 8ee0549a4..db025bbfe 100644
--- a/src/systemc/core/port.cc
+++ b/src/systemc/core/port.cc
@@ -120,6 +120,16 @@ Port::finalize()
sensitivities.clear();
}
+void
+Port::regPort()
+{
+ if (!regPortNeeded)
+ return;
+
+ for (int i = 0; i < size(); i++)
+ getInterface(i)->register_port(*portBase, portBase->_ifTypeName());
+}
+
std::list<Port *> allPorts;
} // namespace sc_gem5