From 0c3d23437a9961b46cb6e7f4150834f2345ed9fc Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 22 Sep 2018 06:35:06 -0700 Subject: systemc: Check the process type when using sc_join. Method processes aren't allowed in an sc_join. Change-Id: I5c8421a396dbe261645a074df514f69fc652c9c8 Reviewed-on: https://gem5-review.googlesource.com/c/12968 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/core/sc_join.cc | 7 +++++++ .../systemc/kernel/dynamic_processes/test04/expected_returncode | 1 + 2 files changed, 8 insertions(+) create mode 100644 src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode (limited to 'src/systemc') diff --git a/src/systemc/core/sc_join.cc b/src/systemc/core/sc_join.cc index 3e4c6eec4..3c27eaa42 100644 --- a/src/systemc/core/sc_join.cc +++ b/src/systemc/core/sc_join.cc @@ -32,6 +32,7 @@ #include "systemc/ext/core/sc_event.hh" #include "systemc/ext/core/sc_join.hh" #include "systemc/ext/core/sc_module.hh" +#include "systemc/ext/utils/sc_report_handler.hh" namespace sc_core { @@ -44,6 +45,12 @@ sc_join::add_process(sc_process_handle h) auto p = (::sc_gem5::Process *)h; assert(p); + if (p->procKind() == SC_METHOD_PROC_) { + SC_REPORT_ERROR("(E561) Attempt to register method process " + "with sc_join object", ""); + return; + } + remaining++; p->joinWait(this); } diff --git a/src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode b/src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/src/systemc/tests/systemc/kernel/dynamic_processes/test04/expected_returncode @@ -0,0 +1 @@ +1 -- cgit v1.2.3