systemc: Detect a process control corner case and report an error.
authorGabe Black <gabeblack@google.com>
Thu, 26 Jul 2018 22:15:20 +0000 (15:15 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 11 Sep 2018 21:49:30 +0000 (21:49 +0000)
This error reporting results in an exception being thrown, and one (or
more) of the tests depend on that behavior.

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

src/systemc/core/process.cc

index 6b4c4276610b16c41c79bec5437e3384e117ed5c..a54d5c24c18d1380770c576c96e659657c98435c 100644 (file)
@@ -178,6 +178,14 @@ Process::disable(bool inc_kids)
     if (inc_kids)
         forEachKid([](Process *p) { p->disable(true); });
 
+    if (!::sc_core::sc_allow_process_control_corners &&
+            dynamic_cast<SensitivityTimeout *>(dynamicSensitivity)) {
+        std::string message("attempt to disable a thread with timeout wait: ");
+        message += name();
+        SC_REPORT_ERROR("Undefined process control interaction",
+                message.c_str());
+    }
+
     _disabled = true;
 }