systemc: Change how the timing of binding ports works.
authorGabe Black <gabeblack@google.com>
Mon, 1 Oct 2018 05:44:56 +0000 (22:44 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 16 Oct 2018 00:41:57 +0000 (00:41 +0000)
In the Accellera implementation, interfaces are bound to ports
immediately if no ports have been bound, and otherwise saves them for
later along with the ports. The existing implementation would save
all interface and port bindings to finalize at the end of elaboration.

This seems like pointless complexity, but it's necessary to get the
output to match in the tests.

Change-Id: Ib82d324ee2be9e56e6a41561611c7fca4f4f4e72
Reviewed-on: https://gem5-review.googlesource.com/c/13196
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/port.hh

index eb8dbfef319ccbbe5866cb45c4e342af33a33ed7..bf3b73a84aa869410392face8db363880e287dfe 100644 (file)
@@ -144,7 +144,10 @@ class Port
     void
     bind(::sc_core::sc_interface *interface)
     {
-        bindings.push_back(new Binding(interface));
+        if (bindings.empty())
+            addInterface(interface);
+        else
+            bindings.push_back(new Binding(interface));
     }
 
     void