gem5 v24.0.0.0
Loading...
Searching...
No Matches
eventq.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * Copyright (c) 2013 Mark D. Hill and David A. Wood
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met: redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer;
11 * redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution;
14 * neither the name of the copyright holders nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* @file
32 * EventQueue interfaces
33 */
34
35#ifndef __SIM_EVENTQ_HH__
36#define __SIM_EVENTQ_HH__
37
38#include <algorithm>
39#include <cassert>
40#include <climits>
41#include <functional>
42#include <iosfwd>
43#include <list>
44#include <memory>
45#include <string>
46
47#include "base/debug.hh"
48#include "base/flags.hh"
49#include "base/named.hh"
50#include "base/trace.hh"
51#include "base/type_traits.hh"
52#include "base/types.hh"
54#include "debug/Event.hh"
55#include "sim/cur_tick.hh"
56#include "sim/serialize.hh"
57
58namespace gem5
59{
60
61class EventQueue; // forward declaration
62class BaseGlobalEvent;
63
69extern Tick simQuantum;
70
72extern uint32_t numMainEventQueues;
73
76
79
80extern __thread EventQueue *_curEventQueue;
81
83extern bool inParallelMode;
84
89EventQueue *getEventQueue(uint32_t index);
90
92inline void curEventQueue(EventQueue *q);
93
100{
101 protected:
102 typedef unsigned short FlagsType;
103 typedef ::gem5::Flags<FlagsType> Flags;
104
105 static const FlagsType PublicRead = 0x003f; // public readable flags
106 static const FlagsType PublicWrite = 0x001d; // public writable flags
107 static const FlagsType Squashed = 0x0001; // has been squashed
108 static const FlagsType Scheduled = 0x0002; // has been scheduled
109 static const FlagsType Managed = 0x0004; // Use life cycle manager
110 static const FlagsType AutoDelete = Managed; // delete after dispatch
116 static const FlagsType Reserved0 = 0x0008;
117 static const FlagsType IsExitEvent = 0x0010; // special exit event
118 static const FlagsType IsMainQueue = 0x0020; // on main event queue
119 static const FlagsType Initialized = 0x7a40; // somewhat random bits
120 static const FlagsType InitMask = 0xffc0; // mask for init bits
121
122 public:
126 typedef int8_t Priority;
127
132
138 static const Priority Minimum_Pri = SCHAR_MIN;
139
147 static const Priority Debug_Enable_Pri = -101;
148
156 static const Priority Debug_Break_Pri = -100;
157
166 static const Priority CPU_Switch_Pri = -31;
167
176
182 static const Priority Default_Pri = 0;
183
190 static const Priority DVFS_Update_Pri = 31;
191
199 static const Priority Serialize_Pri = 32;
200
207 static const Priority CPU_Tick_Pri = 50;
208
214 static const Priority CPU_Exit_Pri = 64;
215
222 static const Priority Stat_Event_Pri = 90;
223
229 static const Priority Progress_Event_Pri = 95;
230
237 static const Priority Sim_Exit_Pri = 100;
238
244 static const Priority Maximum_Pri = SCHAR_MAX;
245};
246
247/*
248 * An item on an event queue. The action caused by a given
249 * event is specified by deriving a subclass and overriding the
250 * process() member function.
251 *
252 * Caution, the order of members is chosen to maximize data packing.
253 */
254class Event : public EventBase, public Serializable
255{
256 friend class EventQueue;
257
258 private:
259 // The event queue is now a linked list of linked lists. The
260 // 'nextBin' pointer is to find the bin, where a bin is defined as
261 // when+priority. All events in the same bin will be stored in a
262 // second linked list (a stack) maintained by the 'nextInBin'
263 // pointer. The list will be accessed in LIFO order. The end
264 // result is that the insert/removal in 'nextBin' is
265 // linear/constant, and the lookup/removal in 'nextInBin' is
266 // constant/constant. Hopefully this is a significant improvement
267 // over the current fully linear insertion.
270
271 static Event *insertBefore(Event *event, Event *curr);
272 static Event *removeItem(Event *event, Event *last);
273
277
278#ifndef NDEBUG
281
287
291#endif
292
293#ifdef EVENTQ_DEBUG
294 Tick whenCreated;
295 Tick whenScheduled;
296#endif
297
298 void
300 {
301 _when = when;
302#ifndef NDEBUG
303 queue = q;
304#endif
305#ifdef EVENTQ_DEBUG
306 whenScheduled = curTick();
307#endif
308 }
309
310 bool
312 {
313 return (flags & InitMask) == Initialized;
314 }
315
316 protected:
317 Flags
318 getFlags() const
319 {
320 return flags & PublicRead;
321 }
322
323 bool
324 isFlagSet(Flags _flags) const
325 {
326 assert(_flags.noneSet(~PublicRead));
327 return flags.isSet(_flags);
328 }
329
330 void
332 {
333 assert(_flags.noneSet(~PublicWrite));
334 flags.set(_flags);
335 }
336
337 void
339 {
340 assert(_flags.noneSet(~PublicWrite));
341 flags.clear(_flags);
342 }
343
344 void
346 {
348 }
349
355 virtual void trace(const char *action);
356
358 const std::string instanceString() const;
359
360 protected: /* Memory management */
386 void acquire();
387
391 void release();
392
393 virtual void acquireImpl();
394
395 virtual void releaseImpl();
396
399 public:
400
401 /*
402 * Event constructor
403 * @param queue that the event gets scheduled on
404 *
405 * @ingroup api_eventq
406 */
408 : nextBin(nullptr), nextInBin(nullptr), _when(0), _priority(p),
410 {
411 assert(f.noneSet(~PublicWrite));
412#ifndef NDEBUG
414 queue = NULL;
415#endif
416#ifdef EVENTQ_DEBUG
417 whenCreated = curTick();
418 whenScheduled = 0;
419#endif
420 }
421
426 virtual ~Event();
427 virtual const std::string name() const;
428
432 virtual const char *description() const;
433
435 void dump() const;
436 //end of api group
437
438 public:
439 /*
440 * This member function is invoked when the event is processed
441 * (occurs). There is no default implementation; each subclass
442 * must provide its own implementation. The event is not
443 * automatically deleted after it is processed (to allow for
444 * statically allocated event objects).
445 *
446 * If the AutoDestroy flag is set, the object is deleted once it
447 * is processed.
448 *
449 * @ingroup api_eventq
450 */
451 virtual void process() = 0;
452
458 bool scheduled() const { return flags.isSet(Scheduled); }
459
466
472 bool squashed() const { return flags.isSet(Squashed); }
473
479 bool isExitEvent() const { return flags.isSet(IsExitEvent); }
480
486 bool isManaged() const { return flags.isSet(Managed); }
487
494 bool isAutoDelete() const { return isManaged(); }
495
501 Tick when() const { return _when; }
502
508 Priority priority() const { return _priority; }
509
513 virtual BaseGlobalEvent *globalEvent() { return NULL; }
514
515 void serialize(CheckpointOut &cp) const override;
516 void unserialize(CheckpointIn &cp) override;
517};
518
522inline bool
523operator<(const Event &l, const Event &r)
524{
525 return l.when() < r.when() ||
526 (l.when() == r.when() && l.priority() < r.priority());
527}
528
532inline bool
533operator>(const Event &l, const Event &r)
534{
535 return l.when() > r.when() ||
536 (l.when() == r.when() && l.priority() > r.priority());
537}
538
542inline bool
543operator<=(const Event &l, const Event &r)
544{
545 return l.when() < r.when() ||
546 (l.when() == r.when() && l.priority() <= r.priority());
547}
548
552inline bool
553operator>=(const Event &l, const Event &r)
554{
555 return l.when() > r.when() ||
556 (l.when() == r.when() && l.priority() >= r.priority());
557}
558
562inline bool
563operator==(const Event &l, const Event &r)
564{
565 return l.when() == r.when() && l.priority() == r.priority();
566}
567
571inline bool
572operator!=(const Event &l, const Event &r)
573{
574 return l.when() != r.when() || l.priority() != r.priority();
575}
576
616{
617 private:
618 friend void curEventQueue(EventQueue *);
619
620 std::string objName;
623
626
629
651
654 void insert(Event *event);
655 void remove(Event *event);
656
660 void asyncInsert(Event *event);
661
663
664 public:
666 {
667 public:
682 ScopedMigration(EventQueue *_new_eq, bool _doMigrate = true)
683 :new_eq(*_new_eq), old_eq(*curEventQueue()),
684 doMigrate((&new_eq != &old_eq)&&_doMigrate)
685 {
686 if (doMigrate){
687 old_eq.unlock();
688 new_eq.lock();
690 }
691 }
692
694 {
695 if (doMigrate){
696 new_eq.unlock();
697 old_eq.lock();
699 }
700 }
701
702 private:
706 };
707
708
710 {
711 public:
724 : eq(*_eq)
725 {
726 eq.unlock();
727 }
728
730 {
731 eq.lock();
732 }
733
734 private:
736 };
737
741 EventQueue(const std::string &n);
742
747 virtual const std::string name() const { return objName; }
748 void name(const std::string &st) { objName = st; }
749 //end of api_eventq group
750
756 void
757 schedule(Event *event, Tick when, bool global=false)
758 {
759 assert(when >= getCurTick());
760 assert(!event->scheduled());
761 assert(event->initialized());
762
763 event->setWhen(when, this);
764
765 // The check below is to make sure of two things
766 // a. A thread schedules local events on other queues through the
767 // asyncq.
768 // b. A thread schedules global events on the asyncq, whether or not
769 // this event belongs to this eventq. This is required to maintain
770 // a total order amongst the global events. See global_event.{cc,hh}
771 // for more explanation.
772 if (inParallelMode && (this != curEventQueue() || global)) {
774 } else {
775 insert(event);
776 }
777 event->flags.set(Event::Scheduled);
778 event->acquire();
779
780 if (debug::Event)
781 event->trace("scheduled");
782 }
783
789 void
791 {
792 assert(event->scheduled());
793 assert(event->initialized());
794 assert(!inParallelMode || this == curEventQueue());
795
796 remove(event);
797
798 event->flags.clear(Event::Squashed);
799 event->flags.clear(Event::Scheduled);
800
801 if (debug::Event)
802 event->trace("descheduled");
803
804 event->release();
805 }
806
813 void
814 reschedule(Event *event, Tick when, bool always=false)
815 {
816 assert(when >= getCurTick());
817 assert(always || event->scheduled());
818 assert(event->initialized());
819 assert(!inParallelMode || this == curEventQueue());
820
821 if (event->scheduled()) {
822 remove(event);
823 } else {
824 event->acquire();
825 }
826
827 event->setWhen(when, this);
828 insert(event);
829 event->flags.clear(Event::Squashed);
830 event->flags.set(Event::Scheduled);
831
832 if (debug::Event)
833 event->trace("rescheduled");
834 }
835
836 Tick nextTick() const { return head->when(); }
837 void setCurTick(Tick newVal) { _curTick = newVal; }
838
850 Tick getCurTick() const { return _curTick; }
851 Event *getHead() const { return head; }
852
853 Event *serviceOne();
854
868 void
870 {
871 while (!empty()) {
872 if (nextTick() > when)
873 break;
874
879 //assert(head->when() >= when && "event scheduled in the past");
880 serviceOne();
881 }
882
883 setCurTick(when);
884 }
885
891 bool empty() const { return head == NULL; }
892
899 void dump() const;
900
901 bool debugVerify() const;
902
907
923 virtual void wakeup(Tick when = (Tick)-1) { }
924
934
947 void lock() { service_mutex.lock(); }
963
964 virtual ~EventQueue()
965 {
966 while (!empty())
968 }
969};
970
971inline void
973{
975 Gem5Internal::_curTickPtr = (q == nullptr) ? nullptr : &q->_curTick;
976}
977
978void dumpMainQueue();
979
981{
982 protected:
985
986 public:
997 //end of api_eventq group
998
1002 EventQueue *
1004 {
1005 return eventq;
1006 }
1007
1011 void
1013 {
1014 eventq->schedule(&event, when);
1015 }
1016
1020 void
1022 {
1024 }
1025
1029 void
1030 reschedule(Event &event, Tick when, bool always = false)
1031 {
1032 eventq->reschedule(&event, when, always);
1033 }
1034
1038 void
1040 {
1041 eventq->schedule(event, when);
1042 }
1043
1047 void
1049 {
1051 }
1052
1056 void
1057 reschedule(Event *event, Tick when, bool always = false)
1058 {
1059 eventq->reschedule(event, when, always);
1060 }
1061
1068 void wakeupEventQueue(Tick when = (Tick)-1)
1069 {
1070 eventq->wakeup(when);
1071 }
1072
1073 void setCurTick(Tick newVal) { eventq->setCurTick(newVal); }
1074};
1075
1090template <auto F>
1091class MemberEventWrapper final: public Event, public Named
1092{
1094 static_assert(std::is_same_v<void, MemberFunctionReturn_t<F>>);
1095 static_assert(std::is_same_v<MemberFunctionArgsTuple_t<F>, std::tuple<>>);
1096
1097public:
1098 [[deprecated("Use reference version of this constructor instead")]]
1100 bool del = false,
1102 MemberEventWrapper{*object, del, p}
1103 {}
1104
1113 bool del = false,
1115 Event(p),
1116 Named(object.name() + ".wrapped_event"),
1117 mObject(&object)
1118 {
1119 if (del) setFlags(AutoDelete);
1121 }
1122
1123 void process() override {
1124 (mObject->*F)();
1125 }
1126
1127 const char *description() const override { return "EventWrapped"; }
1128private:
1130};
1131
1132template <class T, void (T::* F)()>
1133using EventWrapper [[deprecated("Use MemberEventWrapper instead")]]
1135
1137{
1138 private:
1139 std::function<void(void)> callback;
1140 std::string _name;
1141
1142 public:
1149 EventFunctionWrapper(const std::function<void(void)> &callback,
1150 const std::string &name,
1151 bool del = false,
1154 {
1155 if (del)
1157 }
1158
1162 void process() { callback(); }
1163
1167 const std::string
1168 name() const
1169 {
1170 return _name + ".wrapped_function_event";
1171 }
1172
1176 const char *description() const { return "EventFunctionWrapped"; }
1177};
1178
1184#define SERIALIZE_EVENT(event) event.serializeSection(cp, #event);
1185
1191#define UNSERIALIZE_EVENT(event) \
1192 do { \
1193 event.unserializeSection(cp, #event); \
1194 eventQueue()->checkpointReschedule(&event); \
1195 } while (0)
1196
1197} // namespace gem5
1198
1199#endif // __SIM_EVENTQ_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Common base class for GlobalEvent and GlobalSyncEvent.
Common base class for Event and GlobalEvent, so they can share flag and priority definitions and acce...
Definition eventq.hh:100
static const FlagsType Squashed
Definition eventq.hh:107
::gem5::Flags< FlagsType > Flags
Definition eventq.hh:103
static const FlagsType IsMainQueue
Definition eventq.hh:118
static const FlagsType Initialized
Definition eventq.hh:119
static const FlagsType Managed
Definition eventq.hh:109
static const FlagsType Scheduled
Definition eventq.hh:108
static const FlagsType AutoDelete
Definition eventq.hh:110
static const FlagsType PublicWrite
Definition eventq.hh:106
unsigned short FlagsType
Definition eventq.hh:102
static const FlagsType PublicRead
Definition eventq.hh:105
static const FlagsType InitMask
Definition eventq.hh:120
static const FlagsType Reserved0
This used to be AutoSerialize.
Definition eventq.hh:116
static const FlagsType IsExitEvent
Definition eventq.hh:117
std::function< void(void)> callback
Definition eventq.hh:1139
void setCurTick(Tick newVal)
Definition eventq.hh:1073
EventQueue * eventq
A pointer to this object's event queue.
Definition eventq.hh:984
ScopedRelease(EventQueue *_eq)
Temporarily release the event queue service lock.
Definition eventq.hh:723
Queue of events sorted in time order.
Definition eventq.hh:616
Event * getHead() const
Definition eventq.hh:851
Event * serviceOne()
Definition eventq.cc:224
EventQueue(const EventQueue &)
Tick nextTick() const
Definition eventq.hh:836
bool debugVerify() const
Definition eventq.cc:340
void handleAsyncInsertions()
Function for moving events from the async_queue to the main queue.
Definition eventq.cc:458
std::list< Event * > async_queue
List of events added by other threads to this event queue.
Definition eventq.hh:628
void setCurTick(Tick newVal)
Definition eventq.hh:837
void asyncInsert(Event *event)
Function for adding events to the async queue.
Definition eventq.cc:450
std::string objName
Definition eventq.hh:620
friend void curEventQueue(EventQueue *)
Definition eventq.hh:972
virtual ~EventQueue()
Definition eventq.hh:964
void lock()
Provide an interface for locking/unlocking the event queue.
Definition eventq.hh:947
void checkpointReschedule(Event *event)
Reschedule an event after a checkpoint.
Definition eventq.cc:306
void insert(Event *event)
Insert / remove event from the queue.
Definition eventq.cc:138
Event * replaceHead(Event *s)
function for replacing the head of the event queue, so that a different set of events can run without...
Definition eventq.cc:382
void remove(Event *event)
Definition eventq.cc:192
UncontendedMutex async_queue_mutex
Mutex to protect async queue.
Definition eventq.hh:625
UncontendedMutex service_mutex
Lock protecting event handling.
Definition eventq.hh:650
Priority _priority
event priority
Definition eventq.hh:275
virtual void process()=0
static Event * removeItem(Event *event, Event *last)
Definition eventq.cc:161
virtual void acquireImpl()
Definition eventq.cc:126
bool isFlagSet(Flags _flags) const
Definition eventq.hh:324
Flags flags
Definition eventq.hh:276
Event * nextBin
Definition eventq.hh:268
virtual BaseGlobalEvent * globalEvent()
If this is part of a GlobalEvent, return the pointer to the Global Event.
Definition eventq.hh:513
void setWhen(Tick when, EventQueue *q)
Definition eventq.hh:299
EventQueue * queue
queue to which this event belongs (though it may or may not be scheduled on this queue yet)
Definition eventq.hh:290
virtual void releaseImpl()
Definition eventq.cc:131
void acquire()
Memory management hooks for events that have the Managed flag set.
Definition eventq.cc:112
Flags getFlags() const
Definition eventq.hh:318
void clearFlags()
Definition eventq.hh:345
static Event * insertBefore(Event *event, Event *curr)
Definition eventq.cc:91
void release()
Managed event removed from the event queue.
Definition eventq.cc:119
void setFlags(Flags _flags)
Definition eventq.hh:331
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition eventq.cc:274
static Counter instanceCounter
Global counter to generate unique IDs for Event instances.
Definition eventq.hh:280
Counter instance
This event's unique ID.
Definition eventq.hh:286
Event(Priority p=Default_Pri, Flags f=0)
Definition eventq.hh:407
bool initialized() const
Definition eventq.hh:311
Tick _when
timestamp when event should be processed
Definition eventq.hh:274
Event * nextInBin
Definition eventq.hh:269
const std::string instanceString() const
Return the instance number as a string.
Definition eventq.cc:417
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition eventq.cc:265
void clearFlags(Flags _flags)
Definition eventq.hh:338
Wrap a member function inside MemberEventWrapper to use it as an event callback.
Definition eventq.hh:1092
MemberEventWrapper(CLASS &object, bool del=false, Priority p=Default_Pri)
Construct a new MemberEventWrapper object.
Definition eventq.hh:1112
const char * description() const override
Return a C string describing the event.
Definition eventq.hh:1127
MemberFunctionClass_t< F > CLASS
Definition eventq.hh:1093
MemberEventWrapper(CLASS *object, bool del=false, Priority p=Default_Pri)
Definition eventq.hh:1099
void process() override
Definition eventq.hh:1123
Interface for things with names.
Definition named.hh:39
virtual std::string name() const
Definition named.hh:47
Basic support for object serialization.
Definition serialize.hh:170
STL list class.
Definition stl.hh:51
STL vector class.
Definition stl.hh:37
int8_t Priority
Definition eventq.hh:126
EventManager(EventQueue *eq)
Definition eventq.hh:996
void dump() const
This is a debugging function which will print everything on the event queue.
Definition eventq.cc:315
const std::string name() const
Definition eventq.hh:1168
ScopedMigration(EventQueue *_new_eq, bool _doMigrate=true)
Temporarily migrate execution to a different event queue.
Definition eventq.hh:682
void reschedule(Event *event, Tick when, bool always=false)
Reschedule the specified event.
Definition eventq.hh:814
static const Priority Delayed_Writeback_Pri
For some reason "delayed" inter-cluster writebacks are scheduled before regular writebacks (which hav...
Definition eventq.hh:175
void schedule(Event *event, Tick when, bool global=false)
Schedule the given event on this queue.
Definition eventq.hh:757
static const Priority Debug_Break_Pri
Breakpoints should happen before anything else (except enabling trace output), so we don't miss any a...
Definition eventq.hh:156
void schedule(Event *event, Tick when)
Definition eventq.hh:1039
void deschedule(Event *event)
Deschedule the specified event.
Definition eventq.hh:790
void deschedule(Event &event)
Definition eventq.hh:1021
static const Priority Maximum_Pri
Maximum priority.
Definition eventq.hh:244
virtual ~Event()
Definition eventq.cc:77
EventFunctionWrapper(const std::function< void(void)> &callback, const std::string &name, bool del=false, Priority p=Default_Pri)
This function wraps a function into an event, to be executed later.
Definition eventq.hh:1149
bool isAutoDelete() const
The function returns true if the object is automatically deleted after the event is processed.
Definition eventq.hh:494
void name(const std::string &st)
Definition eventq.hh:748
void wakeupEventQueue(Tick when=(Tick) -1)
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues ...
Definition eventq.hh:1068
void serviceEvents(Tick when)
process all events up to the given timestamp.
Definition eventq.hh:869
void deschedule(Event *event)
Definition eventq.hh:1048
virtual const std::string name() const
Definition eventq.hh:747
virtual const std::string name() const
Definition eventq.cc:84
bool scheduled() const
Determine if the current event is scheduled.
Definition eventq.hh:458
void reschedule(Event *event, Tick when, bool always=false)
Definition eventq.hh:1057
void squash()
Squash the current event.
Definition eventq.hh:465
Tick getCurTick() const
While curTick() is useful for any object assigned to this event queue, if an object that is assigned ...
Definition eventq.hh:850
static const Priority CPU_Switch_Pri
CPU switches schedule the new CPU's tick event for the same cycle (after unscheduling the old CPU's t...
Definition eventq.hh:166
void schedule(Event &event, Tick when)
Definition eventq.hh:1012
EventManager(EventManager &em)
Event manger manages events in the event queue.
Definition eventq.hh:994
void dump() const
Dump the current event data.
Definition eventq.cc:427
Priority priority() const
Get the event priority.
Definition eventq.hh:508
bool isManaged() const
Check whether this event will auto-delete.
Definition eventq.hh:486
static const Priority Sim_Exit_Pri
If we want to exit on this cycle, it's the very last thing we do.
Definition eventq.hh:237
EventManager(EventManager *em)
Definition eventq.hh:995
static const Priority Progress_Event_Pri
Progress events come at the end.
Definition eventq.hh:229
const char * description() const
Return a C string describing the event.
Definition eventq.hh:1176
void reschedule(Event &event, Tick when, bool always=false)
Definition eventq.hh:1030
bool empty() const
Returns true if no events are queued.
Definition eventq.hh:891
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
Definition eventq.hh:207
virtual void wakeup(Tick when=(Tick) -1)
Function to signal that the event loop should be woken up because an event has been scheduled by an a...
Definition eventq.hh:923
virtual const char * description() const
Return a C string describing the event.
Definition eventq.cc:399
Tick when() const
Get the time that the event is scheduled.
Definition eventq.hh:501
static const Priority Default_Pri
Default is zero for historical reasons.
Definition eventq.hh:182
static const Priority Debug_Enable_Pri
If we enable tracing on a particular cycle, do that as the very first thing so we don't miss any of t...
Definition eventq.hh:147
static const Priority Serialize_Pri
Serailization needs to occur before tick events also, so that a serialize/unserialize is identical to...
Definition eventq.hh:199
EventQueue * eventQueue() const
Definition eventq.hh:1003
static const Priority CPU_Exit_Pri
If we want to exit a thread in a CPU, it comes after CPU_Tick_Pri.
Definition eventq.hh:214
static const Priority Stat_Event_Pri
Statistics events (dump, reset, etc.) come after everything else, but before exit.
Definition eventq.hh:222
bool squashed() const
Check whether the event is squashed.
Definition eventq.hh:472
static const Priority Minimum_Pri
Event priorities, to provide tie-breakers for events scheduled at the same cycle.
Definition eventq.hh:138
bool isExitEvent() const
See if this is a SimExitEvent (without resorting to RTTI)
Definition eventq.hh:479
static const Priority DVFS_Update_Pri
DVFS update event leads to stats dump therefore given a lower priority to ensure all relevant states ...
Definition eventq.hh:190
void set(Type mask)
Set all flag's bits matching the given mask.
Definition flags.hh:116
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
Definition flags.hh:83
void clear()
Clear all flag's bits.
Definition flags.hh:102
bool noneSet(Type mask) const
Verifies whether no bits matching the given mask are set.
Definition flags.hh:99
#define gem5_assert(cond,...)
The assert macro will function like a normal assert, but will use panic instead of straight abort().
Definition logging.hh:317
Bitfield< 31 > n
Bitfield< 4 > s
Bitfield< 27 > q
Definition misc_types.hh:55
Bitfield< 31, 28 > st
Bitfield< 6 > f
Definition misc_types.hh:68
__thread Tick * _curTickPtr
Definition cur_tick.cc:37
Bitfield< 10, 5 > event
Bitfield< 5 > l
Bitfield< 30, 0 > index
Bitfield< 0 > p
Bitfield< 29 > eq
Definition misc.hh:58
Bitfield< 2 > em
Definition misc.hh:617
double Counter
All counters are of 64-bit values.
Definition types.hh:46
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
Tick simQuantum
Simulation Quantum for multiple eventq simulation.
Definition eventq.cc:48
bool operator>(const Time &l, const Time &r)
Definition time.hh:233
static bool operator==(const PCStateBase &a, const PCStateBase &b)
Definition pcstate.hh:163
Tick curTick()
The universal simulation clock.
Definition cur_tick.hh:46
typename MemberFunctionSignature< decltype(F)>::class_t MemberFunctionClass_t
std::ostream CheckpointOut
Definition serialize.hh:66
__thread EventQueue * _curEventQueue
The current event queue for the running thread.
Definition eventq.cc:58
void dumpMainQueue()
Definition eventq.cc:390
uint64_t Tick
Tick count type.
Definition types.hh:58
uint32_t numMainEventQueues
Current number of allocated main event queues.
Definition eventq.cc:56
static bool operator!=(const PCStateBase &a, const PCStateBase &b)
Definition pcstate.hh:169
bool operator>=(const Time &l, const Time &r)
Definition time.hh:240
bool operator<(const Time &l, const Time &r)
Definition time.hh:219
EventQueue * curEventQueue()
Definition eventq.hh:91
bool operator<=(const Time &l, const Time &r)
Definition time.hh:226
bool inParallelMode
Current mode of execution: parallel / serial.
Definition eventq.cc:59
EventQueue * getEventQueue(uint32_t index)
Function for returning eventq queue for the provided index.
Definition eventq.cc:62
std::vector< EventQueue * > mainEventQueue
Array for main event queues.
Definition eventq.cc:57

Generated on Tue Jun 18 2024 16:24:06 for gem5 by doxygen 1.11.0