diff options
author | Gabe Black <gabeblack@google.com> | 2018-10-01 02:33:55 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-16 00:43:35 +0000 |
commit | b2e1f81f51e630ef4399f24024c82404601f8340 (patch) | |
tree | 8a6be7cafcbc3b36e10daa1c433aed390a48eed7 /src/systemc/ext/core | |
parent | a7f1fe77d64e46e5f9a348b8ae02b3cce3042b98 (diff) | |
download | gem5-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/ext/core')
-rw-r--r-- | src/systemc/ext/core/sc_interface.hh | 1 | ||||
-rw-r--r-- | src/systemc/ext/core/sc_port.hh | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/systemc/ext/core/sc_interface.hh b/src/systemc/ext/core/sc_interface.hh index 3c6a27dea..3b5abdf09 100644 --- a/src/systemc/ext/core/sc_interface.hh +++ b/src/systemc/ext/core/sc_interface.hh @@ -39,6 +39,7 @@ class sc_event; class sc_interface { public: + virtual void register_port(sc_port_base &, const char *); virtual const sc_event &default_event() const; virtual ~sc_interface() {}; diff --git a/src/systemc/ext/core/sc_port.hh b/src/systemc/ext/core/sc_port.hh index 3586fec73..904d35b8e 100644 --- a/src/systemc/ext/core/sc_port.hh +++ b/src/systemc/ext/core/sc_port.hh @@ -30,6 +30,7 @@ #ifndef __SYSTEMC_EXT_CORE_SC_PORT_HH__ #define __SYSTEMC_EXT_CORE_SC_PORT_HH__ +#include <typeinfo> #include <vector> #include "../utils/sc_report_handler.hh" @@ -108,6 +109,7 @@ class sc_port_base : public sc_object virtual void _gem5AddInterface(sc_interface *i) = 0; ::sc_gem5::Port *_gem5Port; + virtual const char *_ifTypeName() const = 0; }; template <class IF> @@ -210,6 +212,8 @@ class sc_port_b : public sc_port_base _interfaces.push_back(interface); } + const char *_ifTypeName() const { return typeid(IF).name(); } + // Disabled sc_port_b() {} sc_port_b(const sc_port_b<IF> &) {} |