systemc: Ignore attempts to throw a signal to a method.
authorGabe Black <gabeblack@google.com>
Sat, 6 Oct 2018 11:10:39 +0000 (04:10 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 16 Oct 2018 01:02:55 +0000 (01:02 +0000)
Change-Id: I8c2b20525aa46955f4f2df34436b7424e706e410
Reviewed-on: https://gem5-review.googlesource.com/c/13313
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/process.cc

index 93542fc009be61cac1e59c491edf97fa9af29604..7d21960bd4cec5036aa16451a5c4f980c00eb5b4 100644 (file)
@@ -206,8 +206,12 @@ Process::throw_it(ExceptionWrapperBase &exc, bool inc_kids)
     if (inc_kids)
         forEachKid([&exc](Process *p) { p->throw_it(exc, true); });
 
-    if (_needsStart || _terminated)
+    if (_needsStart || _terminated ||
+            procKind() == ::sc_core::SC_METHOD_PROC_) {
+        SC_REPORT_WARNING("(W556) throw_it on method/non-running process "
+                "is being ignored ", name());
         return;
+    }
 
     injectException(exc);
 }