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>
This commit is contained in:
Gabe Black
2018-10-05 16:24:18 -07:00
parent 1f4e379119
commit 77d9e3bcf3
3 changed files with 21 additions and 2 deletions

View File

@@ -178,6 +178,16 @@ Event::notify(const sc_core::sc_time &t)
scheduler.schedule(&delayedNotify, 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()
{

View File

@@ -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;

View File

@@ -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