45 bool stopAfterCallbacks =
false;
46 bool startComplete =
false;
47 bool endComplete =
false;
72 if (stopAfterCallbacks)
73 fatal(
"Simulation called sc_stop during elaboration.\n");
77 p->sc_port_base()->before_end_of_elaboration();
79 m->beforeEndOfElaboration();
81 c->sc_chan()->before_end_of_elaboration();
95 for (
auto p: allPorts)
99 for (
auto p: allPorts)
100 p->sc_port_base()->end_of_elaboration();
102 m->endOfElaboration();
104 c->sc_chan()->end_of_elaboration();
118 if (stopAfterCallbacks)
124 p->sc_port_base()->start_of_simulation();
126 m->startOfSimulation();
128 c->sc_chan()->start_of_simulation();
133 startComplete =
true;
135 if (stopAfterCallbacks)
145 stopAfterCallbacks =
true;
156 p->sc_port_base()->end_of_simulation();
158 m->endOfSimulation();
160 c->sc_chan()->end_of_simulation();
173 if (stopAfterCallbacks) {
188 SystemC_KernelParams::create()
191 "Only one systemc kernel object may be defined.\n");
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
bool finished() const
Returns whether the "main" function of this fiber has finished.
EventWrapper< Kernel, &Kernel::t0Handler > t0Event
std::list< Module * > allModules
#define fatal(...)
This implements a cprintf based fatal() function.
void regStats() override
Callback to set stat parameters.
static bool endOfSimulationComplete()
static sc_core::sc_status status()
static bool startOfSimulationComplete()
void scheduleStop(bool finish_delta)
Tick curTick()
The current simulated tick.
const Params * params() const
void startup() override
startup() is the final initialization call before simulation.
void setEventQueue(EventQueue *_eq)
EventQueue * eventQueue() const
std::list< Port * > allPorts
std::set< Channel * > allChannels
void schedule(Event &event, Tick when)
Common base class for Event and GlobalEvent, so they can share flag and priority definitions and acce...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Abstract superclass for simulation objects.