}
+namespace
+{
+
+bool
+waitErrorCheck(sc_gem5::Process *p)
+{
+ if (p->procKind() == SC_METHOD_PROC_) {
+ SC_REPORT_ERROR(
+ "(E519) wait() is only allowed in SC_THREADs and SC_CTHREADs",
+ "\n in SC_METHODs use next_trigger() instead");
+ return true;
+ }
+ return false;
+}
+
+} // anonymous namespace
+
void
wait()
{
sc_gem5::Process *p = sc_gem5::scheduler.current();
+ if (waitErrorCheck(p))
+ return;
p->cancelTimeout();
p->clearDynamic();
sc_gem5::scheduler.yield();
wait(const sc_event &e)
{
sc_gem5::Process *p = sc_gem5::scheduler.current();
+ if (waitErrorCheck(p))
+ return;
p->cancelTimeout();
::sc_gem5::newDynamicSensitivityEvent(p, &e);
sc_gem5::scheduler.yield();
wait(const sc_event_or_list &eol)
{
sc_gem5::Process *p = sc_gem5::scheduler.current();
+ if (waitErrorCheck(p))
+ return;
p->cancelTimeout();
::sc_gem5::newDynamicSensitivityEventOrList(p, &eol);
sc_gem5::scheduler.yield();
wait(const sc_event_and_list &eal)
{
sc_gem5::Process *p = sc_gem5::scheduler.current();
+ if (waitErrorCheck(p))
+ return;
p->cancelTimeout();
::sc_gem5::newDynamicSensitivityEventAndList(p, &eal);
sc_gem5::scheduler.yield();
wait(const sc_time &t)
{
sc_gem5::Process *p = sc_gem5::scheduler.current();
+ if (waitErrorCheck(p))
+ return;
p->setTimeout(t);
p->clearDynamic();
sc_gem5::scheduler.yield();
wait(const sc_time &t, const sc_event &e)
{
sc_gem5::Process *p = sc_gem5::scheduler.current();
+ if (waitErrorCheck(p))
+ return;
p->setTimeout(t);
::sc_gem5::newDynamicSensitivityEvent(p, &e);
sc_gem5::scheduler.yield();
wait(const sc_time &t, const sc_event_or_list &eol)
{
sc_gem5::Process *p = sc_gem5::scheduler.current();
+ if (waitErrorCheck(p))
+ return;
p->setTimeout(t);
::sc_gem5::newDynamicSensitivityEventOrList(p, &eol);
sc_gem5::scheduler.yield();
wait(const sc_time &t, const sc_event_and_list &eal)
{
sc_gem5::Process *p = sc_gem5::scheduler.current();
+ if (waitErrorCheck(p))
+ return;
p->setTimeout(t);
::sc_gem5::newDynamicSensitivityEventAndList(p, &eal);
sc_gem5::scheduler.yield();