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

Change subject: systemc: Override notifyWork for timeout/event_and_list sensitivities.
......................................................................

systemc: Override notifyWork for timeout/event_and_list sensitivities.

The notifyWork function for SensitivityEventAndList assumes it's
being triggered by an event which is part of its list, but when
SensitivityTimeoutAndEventAndList triggers it might be from an event
or from a timeout. This change overrides notifyWork for that class and
makes it delegate to notifyWork for the subclasses depending on whether
there's an event pointer.

Change-Id: I598af2b78d71ee9934edea10ca7ac5c88149e3f3
---
M src/systemc/core/process.cc
M src/systemc/core/process.hh
2 files changed, 14 insertions(+), 0 deletions(-)



diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc
index 3e629c3..5d5c521 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -104,6 +104,18 @@
         Event::getFromScEvent(e)->delSensitivity(this);
 }

+void
+SensitivityTimeoutAndEventAndList::notifyWork(Event *e)
+{
+    if (e) {
+        // An event went off which must be part of the sc_event_and_list.
+        SensitivityEventAndList::notifyWork(e);
+    } else {
+        // There's no inciting event, so this must be a timeout.
+        SensitivityTimeout::notifyWork(e);
+    }
+}
+

 class UnwindExceptionReset : public ::sc_core::sc_unwind_exception
 {
diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh
index 384250c..01ee5a6 100644
--- a/src/systemc/core/process.hh
+++ b/src/systemc/core/process.hh
@@ -138,6 +138,8 @@
         Sensitivity(p), SensitivityTimeout(p, t),
         SensitivityEventAndList(p, eal)
     {}
+
+    void notifyWork(Event *e) override;
 };

 class SensitivityTimeoutAndEventOrList :

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12247
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: I598af2b78d71ee9934edea10ca7ac5c88149e3f3
Gerrit-Change-Number: 12247
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