diff options
Diffstat (limited to 'src/systemc/core')
-rw-r--r-- | src/systemc/core/event.cc | 6 | ||||
-rw-r--r-- | src/systemc/core/event.hh | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/systemc/core/event.cc b/src/systemc/core/event.cc index e7132e083..4fb99e6d9 100644 --- a/src/systemc/core/event.cc +++ b/src/systemc/core/event.cc @@ -47,7 +47,7 @@ Event::Event(sc_core::sc_event *_sc_event) : Event(_sc_event, nullptr) {} Event::Event(sc_core::sc_event *_sc_event, const char *_basename_cstr) : _sc_event(_sc_event), _basename(_basename_cstr ? _basename_cstr : ""), - delayedNotify([this]() { this->notify(); }) + delayedNotify([this]() { this->notify(); }), _triggeredStamp(~0ULL) { Module *p = currentModule(); @@ -166,6 +166,8 @@ Event::notify() if (delayedNotify.scheduled()) scheduler.deschedule(&delayedNotify); + _triggeredStamp = scheduler.changeStamp(); + notify(staticSenseMethod); notify(dynamicSenseMethod); notify(staticSenseThread); @@ -194,7 +196,7 @@ Event::cancel() bool Event::triggered() const { - return false; + return _triggeredStamp == scheduler.changeStamp(); } Events topLevelEvents; diff --git a/src/systemc/core/event.hh b/src/systemc/core/event.hh index 3d34fa6a0..2d620c91b 100644 --- a/src/systemc/core/event.hh +++ b/src/systemc/core/event.hh @@ -85,6 +85,7 @@ class Event void cancel(); bool triggered() const; + uint64_t triggeredStamp() const { return _triggeredStamp; } static Event * getFromScEvent(sc_core::sc_event *e) @@ -147,6 +148,7 @@ class Event sc_core::sc_object *parent; ScEvent delayedNotify; + mutable uint64_t _triggeredStamp; mutable StaticSensitivities staticSenseMethod; mutable StaticSensitivities staticSenseThread; |