From 1cc084fc7a214e6b3ed30910e9cd9a0c81f25b2f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 30 Aug 2018 01:39:21 -0700 Subject: systemc: Raise an error when SC_METHOD, etc. is used after starting. Those mechanisms for creating processes are only allowed before the end of elaboration, or in other words before sc_start is called. Technically the check in Accellera's implementation won't trigger if the simulation is stopped, and we immitate that behavior. Change-Id: I9b8b5bd32f876781b6e0d5c0ee0e09de19bdabc1 Reviewed-on: https://gem5-review.googlesource.com/c/12447 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/channel/sc_clock.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/systemc/channel') diff --git a/src/systemc/channel/sc_clock.cc b/src/systemc/channel/sc_clock.cc index 6736e57cf..7cdd1c1d1 100644 --- a/src/systemc/channel/sc_clock.cc +++ b/src/systemc/channel/sc_clock.cc @@ -32,6 +32,7 @@ #include "sim/core.hh" #include "sim/eventq.hh" #include "systemc/core/kernel.hh" +#include "systemc/core/process_types.hh" #include "systemc/core/sched_event.hh" #include "systemc/core/scheduler.hh" #include "systemc/ext/channel/sc_clock.hh" @@ -60,7 +61,8 @@ class ClockTick : public ScEvent { _name += (to ? ".up_tick" : ".down_tick"); _procName = _name + ".p"; - p = newMethodProcess(_procName.c_str(), &funcWrapper); + p = new Method(_procName.c_str(), &funcWrapper); + scheduler.reg(p); scheduler.dontInitialize(p); } -- cgit v1.2.3