systemc: Report an error if notifying during the update phase.
authorGabe Black <gabeblack@google.com>
Fri, 7 Sep 2018 22:24:17 +0000 (15:24 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 9 Oct 2018 21:41:46 +0000 (21:41 +0000)
Change-Id: If261c7a981a247884f0a6466756966b454f197f4
Reviewed-on: https://gem5-review.googlesource.com/c/12606
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/event.cc

index e91df1528cdd8c767057277c465998cc63b94aab..61fa80c8bd9c0e18cf4a41d9750535a34eb14244 100644 (file)
@@ -136,6 +136,11 @@ Event::getParentObject() const
 void
 Event::notify()
 {
+    if (scheduler.inUpdate()) {
+        SC_REPORT_ERROR("(E521) immediate notification is not allowed "
+                "during update phase or elaboration", "");
+    }
+
     // An immediate notification overrides any pending delayed notification.
     if (delayedNotify.scheduled())
         scheduler.deschedule(&delayedNotify);