{
_name += (to ? ".up_tick" : ".down_tick");
_procName = _name + ".p";
- p = new Method(_procName.c_str(), &funcWrapper);
+ p = new Method(_procName.c_str(), &funcWrapper, true);
scheduler.reg(p);
scheduler.dontInitialize(p);
}
::sc_core::sc_report *Process::lastReport() const { return _lastReport.get(); }
-Process::Process(const char *name, ProcessFuncWrapper *func) :
+Process::Process(const char *name, ProcessFuncWrapper *func, bool internal) :
::sc_core::sc_process_b(name), excWrapper(nullptr), func(func),
- _needsStart(true), _isUnwinding(false), _terminated(false),
- _suspended(false), _disabled(false), _syncReset(false), refCount(0),
- stackSize(::Fiber::DefaultStackSize), dynamicSensitivity(nullptr)
+ _internal(internal), _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() >
void lastReport(::sc_core::sc_report *report);
::sc_core::sc_report *lastReport() const;
+ bool hasStaticSensitivities() { return !staticSensitivities.empty(); }
+ bool internal() { return _internal; }
+
protected:
- Process(const char *name, ProcessFuncWrapper *func);
+ Process(const char *name, ProcessFuncWrapper *func, bool internal=false);
static Process *_newest;
ProcessFuncWrapper *func;
sc_core::sc_curr_proc_kind _procKind;
+
+ bool _internal;
+
bool _needsStart;
bool _dynamic;
bool _isUnwinding;
class Method : public Process
{
public:
- Method(const char *name, ProcessFuncWrapper *func) : Process(name, func) {}
+ Method(const char *name, ProcessFuncWrapper *func, bool internal=false) :
+ Process(name, func, internal)
+ {}
const char *kind() const override { return "sc_method_process"; }
class Thread : public Process
{
public:
- Thread(const char *name, ProcessFuncWrapper *func) :
- Process(name, func), ctx(nullptr)
+ Thread(const char *name, ProcessFuncWrapper *func, bool internal=false) :
+ Process(name, func, internal), ctx(nullptr)
{}
~Thread() { delete ctx; }
class CThread : public Thread
{
public:
- CThread(const char *name, ProcessFuncWrapper *func) : Thread(name, func)
+ CThread(const char *name, ProcessFuncWrapper *func, bool internal=false) :
+ Thread(name, func, internal)
{
// We'll be in the initialization list now, but we shouldn't be.
popListNode();
proc->addStatic(new PendingSensitivityFinder(proc, f));
}
+ if (opts && opts->_dontInitialize &&
+ opts->_events.empty() && opts->_ports.empty() &&
+ opts->_exports.empty() && opts->_interfaces.empty() &&
+ opts->_finders.empty()) {
+ SC_REPORT_WARNING(
+ "(W558) disable() or dont_initialize() called on process "
+ "with no static sensitivity, it will be orphaned",
+ proc->name());
+ }
+
scheduler.reg(proc);
if (dontInitialize)
for (Process *p = toFinalize.getNext(); p; p = toFinalize.getNext()) {
p->finalize();
p->popListNode();
+
+ if (!p->hasStaticSensitivities() && !p->internal()) {
+ SC_REPORT_WARNING(
+ "(W558) disable() or dont_initialize() called on process "
+ "with no static sensitivity, it will be orphaned",
+ p->name());
+ }
}
for (Process *p = initList.getNext(); p; p = initList.getNext()) {