::sc_core::sc_report *Process::lastReport() const { return _lastReport.get(); }
-Process::Process(const char *name, ProcessFuncWrapper *func, bool _dynamic) :
+Process::Process(const char *name, ProcessFuncWrapper *func) :
::sc_core::sc_process_b(name), excWrapper(nullptr), func(func),
- _needsStart(true), _dynamic(_dynamic), _isUnwinding(false),
- _terminated(false), _suspended(false), _disabled(false),
- _syncReset(false), refCount(0), stackSize(::Fiber::DefaultStackSize),
- dynamicSensitivity(nullptr)
+ _needsStart(true), _isUnwinding(false), _terminated(false),
+ _suspended(false), _disabled(false), _syncReset(false), refCount(0),
+ stackSize(::Fiber::DefaultStackSize), dynamicSensitivity(nullptr)
{
+ _dynamic =
+ (::sc_core::sc_get_status() >
+ ::sc_core::SC_BEFORE_END_OF_ELABORATION);
_newest = this;
}
::sc_core::sc_report *lastReport() const;
protected:
- Process(const char *name, ProcessFuncWrapper *func, bool _dynamic);
+ Process(const char *name, ProcessFuncWrapper *func);
static Process *_newest;
class Method : public Process
{
public:
- Method(const char *name, ProcessFuncWrapper *func, bool _dynamic=false) :
- Process(name, func, _dynamic)
- {}
+ Method(const char *name, ProcessFuncWrapper *func) : Process(name, func) {}
const char *kind() const override { return "sc_method_process"; }
class Thread : public Process
{
public:
- Thread(const char *name, ProcessFuncWrapper *func, bool _dynamic=false) :
- Process(name, func, _dynamic), ctx(nullptr)
+ Thread(const char *name, ProcessFuncWrapper *func) :
+ Process(name, func), ctx(nullptr)
{}
~Thread() { delete ctx; }
class CThread : public Thread
{
public:
- CThread(const char *name, ProcessFuncWrapper *func, bool _dynamic=false) :
- Thread(name, func, _dynamic)
+ CThread(const char *name, ProcessFuncWrapper *func) : Thread(name, func)
{
// We'll be in the initialization list now, but we shouldn't be.
popListNode();
name = ::sc_core::sc_gen_unique_name("thread_p");
}
- bool dynamic =
- (::sc_core::sc_get_status() >
- ::sc_core::SC_BEFORE_END_OF_ELABORATION);
-
Process *proc;
if (method)
- proc = new Method(name, func, dynamic);
+ proc = new Method(name, func);
else
- proc = new Thread(name, func, dynamic);
+ proc = new Thread(name, func);
if (opts) {
for (auto e: opts->_events)