systemc: Add a sensitivity type for exports.
authorGabe Black <gabeblack@google.com>
Sat, 21 Jul 2018 02:24:58 +0000 (19:24 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 11 Sep 2018 21:44:54 +0000 (21:44 +0000)
Dynamic processes can be sensitive to exports, so we need a pending
sensitivity to represent them.

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

src/systemc/core/process.hh

index afdbb379869e2f7491dd59a6a94a5a95940bcf46..3b1fb4eb68016210e3821178d74e3e9c0aad5c5f 100644 (file)
@@ -39,6 +39,7 @@
 #include "systemc/core/list.hh"
 #include "systemc/core/object.hh"
 #include "systemc/ext/core/sc_event.hh"
+#include "systemc/ext/core/sc_export.hh"
 #include "systemc/ext/core/sc_interface.hh"
 #include "systemc/ext/core/sc_module.hh"
 #include "systemc/ext/core/sc_port.hh"
@@ -224,6 +225,24 @@ class PendingSensitivityPort : public PendingSensitivity
     }
 };
 
+class PendingSensitivityExport : public PendingSensitivity
+{
+  private:
+    const sc_core::sc_export_base *exp;
+
+  public:
+    PendingSensitivityExport(Process *p, const sc_core::sc_export_base *exp) :
+        PendingSensitivity(p), exp(exp)
+    {}
+
+    void
+    finalize(Sensitivities &s) override
+    {
+        s.push_back(new SensitivityEvent(process,
+                    &exp->get_interface()->default_event()));
+    }
+};
+
 class PendingSensitivityFinder : public PendingSensitivity
 {
   private: