summaryrefslogtreecommitdiff
path: root/src/systemc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-06 00:57:48 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 01:01:03 +0000
commitd6c3453025cf2115e508a75a1583695684303c7f (patch)
tree3920071ef06e4b4034f450b207bf3f817589a77e /src/systemc
parent05f2a5f4f67c6d6b71497a0b6c75faf728f963f6 (diff)
downloadgem5-d6c3453025cf2115e508a75a1583695684303c7f.tar.xz
systemc: Ignore immediate self notifications.
Change-Id: If5140bd86159e9257eb9e6ccb8301dd6349dacff Reviewed-on: https://gem5-review.googlesource.com/c/13310 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc')
-rw-r--r--src/systemc/core/sensitivity.cc31
-rw-r--r--src/systemc/core/sensitivity.hh7
2 files changed, 25 insertions, 13 deletions
diff --git a/src/systemc/core/sensitivity.cc b/src/systemc/core/sensitivity.cc
index 4f84ce0e9..11e04a100 100644
--- a/src/systemc/core/sensitivity.cc
+++ b/src/systemc/core/sensitivity.cc
@@ -55,12 +55,29 @@ Sensitivity::satisfy()
}
bool
+Sensitivity::notifyWork(Event *e)
+{
+ 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;
- satisfy();
- return true;
+
+ return notifyWork(e);
}
bool
@@ -203,11 +220,8 @@ DynamicSensitivityEventOrList::DynamicSensitivityEventOrList(
{}
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 @@ DynamicSensitivityEventAndList::DynamicSensitivityEventAndList(
{}
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 7a065d2a8..e0244828b 100644
--- a/src/systemc/core/sensitivity.hh
+++ b/src/systemc/core/sensitivity.hh
@@ -76,7 +76,8 @@ class Sensitivity
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 @@ class DynamicSensitivityEventOrList :
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 @@ class DynamicSensitivityEventAndList :
DynamicSensitivityEventAndList(
Process *p, const sc_core::sc_event_and_list *eal);
- bool notify(Event *e) override;
+ bool notifyWork(Event *e) override;
};
} // namespace sc_gem5