43bool stopAfterCallbacks =
false;
44bool startComplete =
false;
45bool endComplete =
false;
58 gem5::SimObject(params),
59 t0Event(*this, false,
gem5::EventBase::Default_Pri - 1)
71 if (stopAfterCallbacks)
72 fatal(
"Simulation called sc_stop during elaboration.\n");
76 p->sc_port_base()->before_end_of_elaboration();
78 m->beforeEndOfElaboration();
80 c->sc_chan()->before_end_of_elaboration();
101 p->sc_port_base()->end_of_elaboration();
103 m->endOfElaboration();
105 c->sc_chan()->end_of_elaboration();
119 if (stopAfterCallbacks)
125 p->sc_port_base()->start_of_simulation();
127 m->startOfSimulation();
129 c->sc_chan()->start_of_simulation();
134 startComplete =
true;
136 if (stopAfterCallbacks)
146 stopAfterCallbacks =
true;
157 p->sc_port_base()->end_of_simulation();
159 m->endOfSimulation();
161 c->sc_chan()->end_of_simulation();
174 if (stopAfterCallbacks) {
189gem5::SystemC_KernelParams::create()
const
191 using namespace gem5;
193 "Only one systemc kernel object may be defined.\n");
void startup() override
startup() is the final initialization call before simulation.
static sc_core::sc_status status()
gem5::SystemC_KernelParams Params
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
static bool endOfSimulationComplete()
gem5::MemberEventWrapper<&Kernel::t0Handler > t0Event
void regStats() override
Callback to set stat parameters.
static bool startOfSimulationComplete()
Kernel(const Params ¶ms, int)
void scheduleStop(bool finish_delta)
void setEventQueue(gem5::EventQueue *_eq)
void schedule(Event &event, Tick when)
EventQueue * eventQueue() const
bool finished() const
Returns whether the "main" function of this fiber has finished.
#define fatal(...)
This implements a cprintf based fatal() function.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
virtual void regStats()
Callback to set stat parameters.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
@ SC_BEFORE_END_OF_ELABORATION
std::list< Port * > allPorts
std::set< Channel * > allChannels
std::list< Module * > allModules