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();
if (delayedNotify.scheduled())
scheduler.deschedule(&delayedNotify);
+ _triggeredStamp = scheduler.changeStamp();
+
notify(staticSenseMethod);
notify(dynamicSenseMethod);
notify(staticSenseThread);
bool
Event::triggered() const
{
- return false;
+ return _triggeredStamp == scheduler.changeStamp();
}
Events topLevelEvents;
void cancel();
bool triggered() const;
+ uint64_t triggeredStamp() const { return _triggeredStamp; }
static Event *
getFromScEvent(sc_core::sc_event *e)
sc_core::sc_object *parent;
ScEvent delayedNotify;
+ mutable uint64_t _triggeredStamp;
mutable StaticSensitivities staticSenseMethod;
mutable StaticSensitivities staticSenseThread;