summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-08-22 14:28:37 -0700
committerGabe Black <gabeblack@google.com>2018-09-25 23:55:10 +0000
commit71eeee982485916df7a849d1ebd67525fac3cd86 (patch)
tree3b7af0d455776df0a9b0e74448efd33d3f3616d5
parentc42dfdeda8ca198bf076817431f41d24463e1cda (diff)
downloadgem5-71eeee982485916df7a849d1ebd67525fac3cd86.tar.xz
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 Reviewed-on: https://gem5-review.googlesource.com/12247 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
-rw-r--r--src/systemc/core/process.cc12
-rw-r--r--src/systemc/core/process.hh2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc
index 3e629c3ec..5d5c5216f 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -104,6 +104,18 @@ SensitivityEventOrList::~SensitivityEventOrList()
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 267a7ed3d..fe75aa7de 100644
--- a/src/systemc/core/process.hh
+++ b/src/systemc/core/process.hh
@@ -138,6 +138,8 @@ class SensitivityTimeoutAndEventAndList :
Sensitivity(p), SensitivityTimeout(p, t),
SensitivityEventAndList(p, eal)
{}
+
+ void notifyWork(Event *e) override;
};
class SensitivityTimeoutAndEventOrList :