Go to the documentation of this file.
43 #include "pybind11/pybind11.h"
44 #include "pybind11/stl.h"
52 namespace py = pybind11;
83 py::object obj = py::cast(
this);
88 panic(
"Failed to get PyBind object to increase ref count\n");
93 py::object obj = py::cast(
this);
98 panic(
"Failed to get PyBind object to decrease ref count\n");
106 py::module_
m = m_native.def_submodule(
"event");
111 m.def(
"getMaxTick", &
get_max_tick, py::return_value_policy::copy);
115 py::return_value_policy::reference);
118 py::return_value_policy::reference);
120 py::class_<EventQueue>(
m,
"EventQueue")
125 }, py::arg(
"event"), py::arg(
"when"))
129 py::arg(
"event"), py::arg(
"tick"), py::arg(
"always") =
false)
137 std::unique_ptr<GlobalSimLoopExitEvent, py::nodelete>>(
138 m,
"GlobalSimLoopExitEvent")
146 py::class_<Event> c_event(
159 py::class_<PyEvent, Event>(
m,
"PyEvent")
160 .def(py::init<Event::Priority>(),
164 #define PRIO(n) c_event.attr(# n) = py::cast((int)Event::n)
167 PRIO(Debug_Enable_Pri);
168 PRIO(Debug_Break_Pri);
169 PRIO(CPU_Switch_Pri);
170 PRIO(Delayed_Writeback_Pri);
172 PRIO(DVFS_Update_Pri);
175 PRIO(Stat_Event_Pri);
176 PRIO(Progress_Event_Pri);
bool isExitEvent() const
See if this is a SimExitEvent (without resorting to RTTI)
Tick when() const
Get the time that the event is scheduled.
void terminateEventQueueThreads()
Terminate helper threads when running in parallel mode.
virtual const std::string name() const
void pybind_init_event(py::module_ &m_native)
PyEvent(Event::Priority priority)
EventQueue * getEventQueue(uint32_t index)
Function for returning eventq queue for the provided index.
void reschedule(Event *event, Tick when, bool always=false)
Reschedule the specified event.
void acquireImpl() override
void set_max_tick(Tick tick)
Set the maximum tick.
void exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat, bool serialize)
Schedule an event to exit the simulation loop (returning to Python) at the end of the current cycle (...
Priority priority() const
Get the event priority.
Tick get_max_tick()
Get the maximum simulation tick.
const std::string getCause() const
void deschedule(Event *event)
Deschedule the specified event.
uint64_t Tick
Tick count type.
Queue of events sorted in time order.
static const FlagsType Managed
PyBind wrapper for Events.
GlobalSimLoopExitEvent * simulate(Tick num_cycles)
EventQueue * curEventQueue()
bool squashed() const
Check whether the event is squashed.
void squash()
Squash the current event.
static const Priority Default_Pri
Default is zero for historical reasons.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void releaseImpl() override
bool scheduled() const
Determine if the current event is scheduled.
void dump() const
Dump the current event data.
void dump() const
This is a debugging function which will print everything on the event queue.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17