Go to the documentation of this file.
37 #include <unordered_map>
43 #include "debug/Checkpoint.hh"
96 if (!curr || *
event < *curr) {
150 while (curr && *curr < *
event) {
178 while (
event != next) {
180 panic(
"event not found!");
195 panic(
"event not found!");
197 assert(
event->queue ==
this);
209 while (curr && *curr < *
event) {
214 if (!curr || *curr != *
event)
215 panic(
"event not found!");
226 std::lock_guard<EventQueue>
lock(*
this);
244 if (!
event->squashed()) {
248 event->trace(
"executed");
250 if (
event->isExitEvent()) {
269 short _flags =
flags;
300 DPRINTF(Checkpoint,
"Event '%s' need to be scheduled @%d\n",
317 cprintf(
"============================================================\n");
319 cprintf(
"------------------------------------------------------------\n");
326 Event *nextInBin = nextBin;
336 cprintf(
"============================================================\n");
342 std::unordered_map<long, bool> map;
349 Event *nextInBin = nextBin;
351 if (nextInBin->
when() < time) {
352 cprintf(
"time goes backwards!");
355 }
else if (nextInBin->
when() == time &&
362 if (map[
reinterpret_cast<long>(nextInBin)]) {
367 map[
reinterpret_cast<long>(nextInBin)] =
true;
369 time = nextInBin->
when();
422 return csprintf(
"%#x", (uintptr_t)
this);
432 cprintf(
"Created: %d\n", whenCreated);
436 cprintf(
"Scheduled at %d\n", whenScheduled);
445 : objName(
n), head(NULL), _curTick(0)
Tick curTick()
The universal simulation clock.
virtual const char * description() const
Return a C string describing the event.
Tick when() const
Get the time that the event is scheduled.
int64_t Counter
Statistics counter type.
virtual const std::string name() const
void cprintf(const char *format, const Args &...args)
Event * replaceHead(Event *s)
function for replacing the head of the event queue, so that a different set of events can run without...
#define UNSERIALIZE_SCALAR(scalar)
std::vector< EventQueue * > mainEventQueue
Array for main event queues.
void set(Type mask)
Set all flag's bits matching the given mask.
void clear()
Clear all flag's bits.
static Event * removeItem(Event *event, Event *last)
static const FlagsType Scheduled
EventQueue * getEventQueue(uint32_t index)
Function for returning eventq queue for the provided index.
bool inParallelMode
Current mode of execution: parallel / serial.
void lock()
Provide an interface for locking/unlocking the event queue.
std::string csprintf(const char *format, const Args &...args)
void release()
Managed event removed from the event queue.
virtual void releaseImpl()
std::list< Event * > async_queue
List of events added by other threads to this event queue.
Priority priority() const
Get the event priority.
Bitfield< 3, 0 > priority
static const FlagsType Squashed
void handleAsyncInsertions()
Function for moving events from the async_queue to the main queue.
void insert(Event *event)
Insert / remove event from the queue.
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
static Counter instanceCounter
Global counter to generate unique IDs for Event instances.
static const FlagsType IsMainQueue
uint64_t Tick
Tick count type.
void setCurTick(Tick newVal)
UncontendedMutex async_queue_mutex
Mutex to protect async queue.
EventQueue(const EventQueue &)
Queue of events sorted in time order.
static const FlagsType Initialized
Tick simQuantum
Simulation Quantum for multiple eventq simulation.
bool empty() const
Returns true if no events are queued.
__thread EventQueue * _curEventQueue
The current event queue for the running thread.
void acquire()
Memory management hooks for events that have the Managed flag set.
static const FlagsType Managed
friend void curEventQueue(EventQueue *)
#define SERIALIZE_SCALAR(scalar)
Priority _priority
event priority
Tick _when
timestamp when event should be processed
void serialize(CheckpointOut &cp) const override
Serialize an object.
void checkpointReschedule(Event *event)
Reschedule an event after a checkpoint.
virtual void acquireImpl()
uint32_t numMainEventQueues
Current number of allocated main event queues.
static Event * insertBefore(Event *event, Event *curr)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void asyncInsert(Event *event)
Function for adding events to the async queue.
void remove(Event *event)
const std::string instanceString() const
Return the instance number as a string.
std::ostream CheckpointOut
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Counter instance
This event's unique ID.
virtual void trace(const char *action)
This function isn't really useful if TRACING_ON is not defined.
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