diff options
author | Gabe Black <gabeblack@google.com> | 2018-10-05 16:24:18 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-16 00:58:56 +0000 |
commit | 77d9e3bcf3a74fabeed3209bb4ce78e35d1b1f47 (patch) | |
tree | e4b230e8b9c1a4d1fc59c8cd72fd157014a3d961 /src | |
parent | 1f4e37911934a90088a8c68dc981ed6cc1be7b9c (diff) | |
download | gem5-77d9e3bcf3a74fabeed3209bb4ce78e35d1b1f47.tar.xz |
systemc: Add an error check to the deprecated notify_delayed.
This can't override pending notifications like normal notify does.
Change-Id: Ie5f12a97ffdcc3dfca20fa7852f89687ee8bfca3
Reviewed-on: https://gem5-review.googlesource.com/c/13305
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/systemc/core/event.cc | 10 | ||||
-rw-r--r-- | src/systemc/core/event.hh | 1 | ||||
-rw-r--r-- | src/systemc/core/sc_event.cc | 12 |
3 files changed, 21 insertions, 2 deletions
diff --git a/src/systemc/core/event.cc b/src/systemc/core/event.cc index 120b51476..2e356bdb6 100644 --- a/src/systemc/core/event.cc +++ b/src/systemc/core/event.cc @@ -179,6 +179,16 @@ Event::notify(const sc_core::sc_time &t) } void +Event::notifyDelayed(const sc_core::sc_time &t) +{ + if (delayedNotify.scheduled()) { + SC_REPORT_ERROR("(E531) notify_delayed() cannot be called on events " + "that have pending notifications", ""); + } + notify(t); +} + +void Event::cancel() { if (delayedNotify.scheduled()) diff --git a/src/systemc/core/event.hh b/src/systemc/core/event.hh index 532d98343..75687729f 100644 --- a/src/systemc/core/event.hh +++ b/src/systemc/core/event.hh @@ -82,6 +82,7 @@ class Event { notify(sc_core::sc_time(d, u)); } + void notifyDelayed(const sc_core::sc_time &t); void cancel(); bool triggered() const; diff --git a/src/systemc/core/sc_event.cc b/src/systemc/core/sc_event.cc index 318fea624..b2dc0e525 100644 --- a/src/systemc/core/sc_event.cc +++ b/src/systemc/core/sc_event.cc @@ -342,8 +342,16 @@ void sc_event::notify(const sc_time &t) { _gem5_event->notify(t); } void sc_event::notify(double d, sc_time_unit u) { _gem5_event->notify(d, u); } void sc_event::cancel() { _gem5_event->cancel(); } bool sc_event::triggered() const { return _gem5_event->triggered(); } -void sc_event::notify_delayed() { _gem5_event->notify(SC_ZERO_TIME); } -void sc_event::notify_delayed(const sc_time &t) { _gem5_event->notify(t); } +void +sc_event::notify_delayed() +{ + _gem5_event->notifyDelayed(SC_ZERO_TIME); +} +void +sc_event::notify_delayed(const sc_time &t) +{ + _gem5_event->notifyDelayed(t); +} sc_event_and_expr sc_event::operator & (const sc_event &e) const |