systemc: Make sure an immediate notification overrides a delayed one.
authorGabe Black <gabeblack@google.com>
Wed, 22 Aug 2018 01:59:13 +0000 (18:59 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 25 Sep 2018 23:54:09 +0000 (23:54 +0000)
If an event has a delayed notification pending, that should be cleared
if it's later notified immediately.

Change-Id: I4272f6b47a41d80756769f3fe69069a00016dbd6
Reviewed-on: https://gem5-review.googlesource.com/12223
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/event.cc

index 6e35da1c865587db5eed13ecf49b7ff0acb85699..77e47fba68c9e933dbe17e3912b4f3dba9720a7e 100644 (file)
@@ -122,6 +122,10 @@ Event::getParentObject() const
 void
 Event::notify()
 {
+    // An immediate notification overrides any pending delayed notification.
+    if (delayedNotify.scheduled())
+        scheduler.deschedule(&delayedNotify);
+
     auto local_sensitivities = sensitivities;
     for (auto s: local_sensitivities)
         s->notify(this);