Go to the documentation of this file.
85 static bool threads_initialized =
false;
88 if (!threads_initialized) {
98 threads_initialized =
true;
101 "simulate() limit reached", 0);
104 inform(
"Entering event queue @ %d. Starting simulation...\n",
curTick());
107 num_cycles =
curTick() + num_cycles;
116 fatal(
"Quantum for multi-eventq simulation not specified");
130 assert(local_event != NULL);
136 assert(global_event != NULL);
140 assert(global_exit_event != NULL);
143 if (quantum_event != NULL) {
145 delete quantum_event;
148 return global_exit_event;
159 bool was_set =
false;
186 assert(!eventq->
empty());
188 "event scheduled in the past");
193 std::lock_guard<EventQueue>
lock(*eventq);
217 if (exit_event != NULL) {
#define fatal(...)
This implements a cprintf based fatal() function.
volatile bool async_event
Some asynchronous event has happened.
volatile bool async_io
Async I/O request (SIGIO).
volatile bool async_statdump
Async request to dump stats.
volatile bool async_exit
Async request to exit simulator.
bool inParallelMode
Current mode of execution: parallel / serial.
volatile bool async_exception
Python exception.
uint64_t Tick
Tick count type.
std::mutex asyncEventMutex
Mutex for handling async events.
A special global event that synchronizes all threads and forces them to process asynchronously enqueu...
volatile bool async_statreset
Async request to reset stats.
vector< EventQueue * > mainEventQueue
Array for main event queues.
GlobalSimLoopExitEvent * simulate_limit_event
void reschedule(Tick when)
bool empty() const
Returns true if no events are queued.
void handleAsyncInsertions()
Function for moving events from the async_queue to the main queue.
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 (...
EventQueue * curEventQueue()
GlobalSimLoopExitEvent * simulate(Tick num_cycles)
Simulate for num_cycles additional cycles.
static void thread_loop(EventQueue *queue)
The main function for all subordinate threads (i.e., all threads other than the main thread).
virtual BaseGlobalEvent * globalEvent()
If this is part of a GlobalEvent, return the pointer to the Global Event.
void schedStatEvent(bool dump, bool reset, Tick when, Tick repeat)
Schedule statistics dumping.
Tick simQuantum
Simulation Quantum for multiple eventq simulation.
Event * doSimLoop(EventQueue *)
forward declaration
Queue of events sorted in time order.
static const Priority Progress_Event_Pri
Progress events come at the end.
static bool testAndClearAsyncEvent()
Test and clear the global async_event flag, such that each time the flag is cleared,...
uint32_t numMainEventQueues
Current number of allocated main event queues.
Common base class for GlobalEvent and GlobalSyncEvent.
Barrier * threadBarrier
Global barrier for synchronizing threads entering/exiting the simulation loop.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17