32 #ifndef __SIM_GLOBAL_EVENT_HH__ 33 #define __SIM_GLOBAL_EVENT_HH__ 84 :
Event(p, f), _globalEvent(global_event)
132 sched = sched || barrierEvent[
i]->scheduled();
141 return barrierEvent[0]->when();
154 template <
class Derived>
162 barrierEvent[
i] =
new typename Derived::BarrierEvent(
this, p, f);
222 : Base(p, f), repeat(0)
226 : Base(p, f), repeat(_repeat)
239 #endif // __SIM_GLOBAL_EVENT_HH__ BarrierEvent(Base *global_event, Priority p, Flags f)
Funky intermediate class to support CRTP so that we can have a common constructor to create the local...
GlobalSyncEvent(Tick when, Tick _repeat, Priority p, Flags f)
Tick when() const
Get the time that the event is scheduled.
BaseGlobalEventTemplate(Priority p, Flags f)
virtual BaseGlobalEvent * globalEvent()
If this is part of a GlobalEvent, return the pointer to the Global Event.
Barrier barrier
The barrier that all threads wait on before performing the global event.
A special global event that synchronizes all threads and forces them to process asynchronously enqueu...
BaseGlobalEvent * _globalEvent
BarrierEvent(BaseGlobalEvent *global_event, Priority p, Flags f)
GlobalEvent(Priority p, Flags f)
GlobalEvent(Tick when, Priority p, Flags f)
BaseGlobalEventTemplate< GlobalEvent > Base
virtual const char * description() const
Return a C string describing the event.
uint64_t Tick
Tick count type.
EventQueue * curEventQueue()
BarrierEvent(Base *global_event, Priority p, Flags f)
static std::mutex globalQMutex
Mutex variable for providing exculsive right to schedule global events.
BaseGlobalEventTemplate< GlobalSyncEvent > Base
The main global event class.
friend class BaseGlobalEvent
void reschedule(Tick when)
uint32_t numMainEventQueues
Current number of allocated main event queues.
GlobalSyncEvent(Priority p, Flags f)
virtual ~BaseGlobalEvent()
void release()
Managed event removed from the event queue.
Common base class for GlobalEvent and GlobalSyncEvent.
Common base class for Event and GlobalEvent, so they can share flag and priority definitions and acce...
Temporarily release the event queue service lock.
std::vector< BarrierEvent * > barrierEvent
The individual local event instances (one per thread/event queue).
The base class for the local events that will synchronize threads to perform the global event...