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 <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2018-09-22 06:35:06 -07:00
parent 2ede803d7c
commit 0c3d23437a
2 changed files with 8 additions and 0 deletions

View File

@@ -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);
}