aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc_export2.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sc_export2.cc b/sc_export2.cc
index adf6e31..c5905bc 100644
--- a/sc_export2.cc
+++ b/sc_export2.cc
@@ -8,8 +8,12 @@
// other module provides an implementation of the interface and exposes it via a
// sc_export.
//
+// The sc_port deref into the interface and therefore allows to directly call
+// any interface method on the sc_port via the operator->().
+//
// The sc_port and sc_export are then bound to connect the driver and the
-// implementer.
+// implementer. The sc_export must additionally be bound against an interface
+// implementation.
//
// This example lays a foundation in understanding how TLM2 sockets work.
@@ -59,6 +63,7 @@ struct sender : public sc_module {
void do_protocol() {
const auto send = [this](msg_if::message msg) {
LOGM("%s", to_str(msg));
+ // sc_port derefs into msg_if via operator->().
p_msg->send(msg);
};
@@ -78,7 +83,7 @@ struct receiver : public sc_module, public msg_if {
}
// A sc_export instantiated with the custom interface. The sc_export can be
- // bound against a sc_port (with the same interface), which effectively bindd
+ // bound against a sc_port (with the same interface), which effectively binds
// the implementation behind the sc_export against the sc_port.
sc_export<msg_if> p_msg;