Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/13310

Change subject: systemc: Ignore immediate self notifications.
......................................................................

systemc: Ignore immediate self notifications.

Change-Id: If5140bd86159e9257eb9e6ccb8301dd6349dacff
---
M src/systemc/core/sensitivity.cc
M src/systemc/core/sensitivity.hh
2 files changed, 26 insertions(+), 14 deletions(-)



diff --git a/src/systemc/core/sensitivity.cc b/src/systemc/core/sensitivity.cc
index 4f84ce0..11e04a1 100644
--- a/src/systemc/core/sensitivity.cc
+++ b/src/systemc/core/sensitivity.cc
@@ -55,15 +55,32 @@
 }

 bool
-Sensitivity::notify(Event *e)
+Sensitivity::notifyWork(Event *e)
 {
-    if (process->disabled())
-        return false;
     satisfy();
     return true;
 }

 bool
+Sensitivity::notify(Event *e)
+{
+    if (scheduler.current() == process) {
+        static bool warned = false;
+        if (!warned) {
+            SC_REPORT_WARNING("(W536) immediate self-notification ignored "
+                    "as of IEEE 1666-2011", process->name());
+            warned = true;
+        }
+        return false;
+    }
+
+    if (process->disabled())
+        return false;
+
+    return notifyWork(e);
+}
+
+bool
 Sensitivity::ofMethod()
 {
     return process->procKind() == sc_core::SC_METHOD_PROC_;
@@ -203,11 +220,8 @@
 {}

 bool
-DynamicSensitivityEventOrList::notify(Event *e)
+DynamicSensitivityEventOrList::notifyWork(Event *e)
 {
-    if (process->disabled())
-        return false;
-
     events.erase(e->sc_event());

     // All the other events need this deleted from their lists since this
@@ -225,11 +239,8 @@
 {}

 bool
-DynamicSensitivityEventAndList::notify(Event *e)
+DynamicSensitivityEventAndList::notifyWork(Event *e)
 {
-    if (process->disabled())
-        return false;
-
     events.erase(e->sc_event());

     // This sensitivity is satisfied if all events have triggered.
diff --git a/src/systemc/core/sensitivity.hh b/src/systemc/core/sensitivity.hh
index 7a065d2..e024482 100644
--- a/src/systemc/core/sensitivity.hh
+++ b/src/systemc/core/sensitivity.hh
@@ -76,7 +76,8 @@
     virtual void clear() = 0;

     void satisfy();
-    virtual bool notify(Event *e);
+    virtual bool notifyWork(Event *e);
+    bool notify(Event *e);

     enum Category
     {
@@ -276,7 +277,7 @@
     DynamicSensitivityEventOrList(
             Process *p, const sc_core::sc_event_or_list *eol);

-    bool notify(Event *e) override;
+    bool notifyWork(Event *e) override;
 };

//XXX This sensitivity can't be reused. To reset it, it has to be deleted and
@@ -292,7 +293,7 @@
     DynamicSensitivityEventAndList(
             Process *p, const sc_core::sc_event_and_list *eal);

-    bool notify(Event *e) override;
+    bool notifyWork(Event *e) override;
 };

 } // namespace sc_gem5

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/13310
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: If5140bd86159e9257eb9e6ccb8301dd6349dacff
Gerrit-Change-Number: 13310
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to