gem5  v20.0.0.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 <memory>
44 #include <mutex>
45 #include <string>
46 
47 #include "base/debug.hh"
48 #include "base/flags.hh"
49 #include "base/types.hh"
50 #include "debug/Event.hh"
51 #include "sim/serialize.hh"
52 
53 class EventQueue; // forward declaration
54 class BaseGlobalEvent;
55 
61 extern Tick simQuantum;
62 
64 extern uint32_t numMainEventQueues;
65 
68 
71 
72 extern __thread EventQueue *_curEventQueue;
73 
75 extern bool inParallelMode;
76 
81 EventQueue *getEventQueue(uint32_t index);
82 
85 
91 class EventBase
92 {
93  protected:
94  typedef unsigned short FlagsType;
95  typedef ::Flags<FlagsType> Flags;
96 
97  static const FlagsType PublicRead = 0x003f; // public readable flags
98  static const FlagsType PublicWrite = 0x001d; // public writable flags
99  static const FlagsType Squashed = 0x0001; // has been squashed
100  static const FlagsType Scheduled = 0x0002; // has been scheduled
101  static const FlagsType Managed = 0x0004; // Use life cycle manager
102  static const FlagsType AutoDelete = Managed; // delete after dispatch
108  static const FlagsType Reserved0 = 0x0008;
109  static const FlagsType IsExitEvent = 0x0010; // special exit event
110  static const FlagsType IsMainQueue = 0x0020; // on main event queue
111  static const FlagsType Initialized = 0x7a40; // somewhat random bits
112  static const FlagsType InitMask = 0xffc0; // mask for init bits
113 
114  public:
118  typedef int8_t Priority;
119 
124 
130  static const Priority Minimum_Pri = SCHAR_MIN;
131 
139  static const Priority Debug_Enable_Pri = -101;
140 
148  static const Priority Debug_Break_Pri = -100;
149 
158  static const Priority CPU_Switch_Pri = -31;
159 
167  static const Priority Delayed_Writeback_Pri = -1;
168 
174  static const Priority Default_Pri = 0;
175 
182  static const Priority DVFS_Update_Pri = 31;
183 
191  static const Priority Serialize_Pri = 32;
192 
199  static const Priority CPU_Tick_Pri = 50;
200 
206  static const Priority CPU_Exit_Pri = 64;
207 
214  static const Priority Stat_Event_Pri = 90;
215 
221  static const Priority Progress_Event_Pri = 95;
222 
229  static const Priority Sim_Exit_Pri = 100;
230 
236  static const Priority Maximum_Pri = SCHAR_MAX;
237 };
238 
239 /*
240  * An item on an event queue. The action caused by a given
241  * event is specified by deriving a subclass and overriding the
242  * process() member function.
243  *
244  * Caution, the order of members is chosen to maximize data packing.
245  */
246 class Event : public EventBase, public Serializable
247 {
248  friend class EventQueue;
249 
250  private:
251  // The event queue is now a linked list of linked lists. The
252  // 'nextBin' pointer is to find the bin, where a bin is defined as
253  // when+priority. All events in the same bin will be stored in a
254  // second linked list (a stack) maintained by the 'nextInBin'
255  // pointer. The list will be accessed in LIFO order. The end
256  // result is that the insert/removal in 'nextBin' is
257  // linear/constant, and the lookup/removal in 'nextInBin' is
258  // constant/constant. Hopefully this is a significant improvement
259  // over the current fully linear insertion.
262 
263  static Event *insertBefore(Event *event, Event *curr);
264  static Event *removeItem(Event *event, Event *last);
265 
269 
270 #ifndef NDEBUG
271  static Counter instanceCounter;
273 
279 
283 #endif
284 
285 #ifdef EVENTQ_DEBUG
286  Tick whenCreated;
287  Tick whenScheduled;
288 #endif
289 
290  void
292  {
293  _when = when;
294 #ifndef NDEBUG
295  queue = q;
296 #endif
297 #ifdef EVENTQ_DEBUG
298  whenScheduled = curTick();
299 #endif
300  }
301 
302  bool
303  initialized() const
304  {
305  return (flags & InitMask) == Initialized;
306  }
307 
308  protected:
309  Flags
310  getFlags() const
311  {
312  return flags & PublicRead;
313  }
314 
315  bool
316  isFlagSet(Flags _flags) const
317  {
318  assert(_flags.noneSet(~PublicRead));
319  return flags.isSet(_flags);
320  }
321 
322  void
323  setFlags(Flags _flags)
324  {
325  assert(_flags.noneSet(~PublicWrite));
326  flags.set(_flags);
327  }
328 
329  void
331  {
332  assert(_flags.noneSet(~PublicWrite));
333  flags.clear(_flags);
334  }
335 
336  void
338  {
339  flags.clear(PublicWrite);
340  }
341 
347  virtual void trace(const char *action);
348 
350  const std::string instanceString() const;
351 
352  protected: /* Memory management */
378  void acquire()
379  {
380  if (flags.isSet(Event::Managed))
381  acquireImpl();
382  }
383 
387  void release() {
388  if (flags.isSet(Event::Managed))
389  releaseImpl();
390  }
391 
392  virtual void acquireImpl() {}
393 
394  virtual void releaseImpl() {
395  if (!scheduled())
396  delete this;
397  }
398 
401  public:
402 
403  /*
404  * Event constructor
405  * @param queue that the event gets scheduled on
406  *
407  * @ingroup api_eventq
408  */
410  : nextBin(nullptr), nextInBin(nullptr), _when(0), _priority(p),
411  flags(Initialized | f)
412  {
413  assert(f.noneSet(~PublicWrite));
414 #ifndef NDEBUG
415  instance = ++instanceCounter;
416  queue = NULL;
417 #endif
418 #ifdef EVENTQ_DEBUG
419  whenCreated = curTick();
420  whenScheduled = 0;
421 #endif
422  }
423 
428  virtual ~Event();
429  virtual const std::string name() const;
430 
434  virtual const char *description() const;
435 
437  void dump() const; //end of api group
439 
440  public:
441  /*
442  * This member function is invoked when the event is processed
443  * (occurs). There is no default implementation; each subclass
444  * must provide its own implementation. The event is not
445  * automatically deleted after it is processed (to allow for
446  * statically allocated event objects).
447  *
448  * If the AutoDestroy flag is set, the object is deleted once it
449  * is processed.
450  *
451  * @ingroup api_eventq
452  */
453  virtual void process() = 0;
454 
460  bool scheduled() const { return flags.isSet(Scheduled); }
461 
467  void squash() { flags.set(Squashed); }
468 
474  bool squashed() const { return flags.isSet(Squashed); }
475 
481  bool isExitEvent() const { return flags.isSet(IsExitEvent); }
482 
488  bool isManaged() const { return flags.isSet(Managed); }
489 
493  bool isAutoDelete() const { return isManaged(); }
494 
500  Tick when() const { return _when; }
501 
507  Priority priority() const { return _priority; }
508 
512  virtual BaseGlobalEvent *globalEvent() { return NULL; }
513 
514  void serialize(CheckpointOut &cp) const override;
515  void unserialize(CheckpointIn &cp) override;
516 };
517 
521 inline bool
522 operator<(const Event &l, const Event &r)
523 {
524  return l.when() < r.when() ||
525  (l.when() == r.when() && l.priority() < r.priority());
526 }
527 
531 inline bool
532 operator>(const Event &l, const Event &r)
533 {
534  return l.when() > r.when() ||
535  (l.when() == r.when() && l.priority() > r.priority());
536 }
537 
541 inline bool
542 operator<=(const Event &l, const Event &r)
543 {
544  return l.when() < r.when() ||
545  (l.when() == r.when() && l.priority() <= r.priority());
546 }
547 
551 inline bool
552 operator>=(const Event &l, const Event &r)
553 {
554  return l.when() > r.when() ||
555  (l.when() == r.when() && l.priority() >= r.priority());
556 }
557 
561 inline bool
562 operator==(const Event &l, const Event &r)
563 {
564  return l.when() == r.when() && l.priority() == r.priority();
565 }
566 
570 inline bool
571 operator!=(const Event &l, const Event &r)
572 {
573  return l.when() != r.when() || l.priority() != r.priority();
574 }
575 
615 {
616  private:
617  std::string objName;
620 
622  std::mutex async_queue_mutex;
623 
626 
647  std::mutex service_mutex;
648 
651  void insert(Event *event);
652  void remove(Event *event);
653 
657  void asyncInsert(Event *event);
658 
659  EventQueue(const EventQueue &);
660 
661  public:
675  {
676  public:
680  ScopedMigration(EventQueue *_new_eq, bool _doMigrate = true)
681  :new_eq(*_new_eq), old_eq(*curEventQueue()),
682  doMigrate((&new_eq != &old_eq)&&_doMigrate)
683  {
684  if (doMigrate){
685  old_eq.unlock();
686  new_eq.lock();
687  curEventQueue(&new_eq);
688  }
689  }
690 
692  {
693  if (doMigrate){
694  new_eq.unlock();
695  old_eq.lock();
696  curEventQueue(&old_eq);
697  }
698  }
699 
700  private:
703  bool doMigrate;
704  };
705 
716  {
717  public:
722  : eq(*_eq)
723  {
724  eq.unlock();
725  }
726 
728  {
729  eq.lock();
730  }
731 
732  private:
734  };
735 
739  EventQueue(const std::string &n);
740 
745  virtual const std::string name() const { return objName; }
746  void name(const std::string &st) { objName = st; } //end of api_eventq group
748 
754  void
755  schedule(Event *event, Tick when, bool global=false)
756  {
757  assert(when >= getCurTick());
758  assert(!event->scheduled());
759  assert(event->initialized());
760 
761  event->setWhen(when, this);
762 
763  // The check below is to make sure of two things
764  // a. A thread schedules local events on other queues through the
765  // asyncq.
766  // b. A thread schedules global events on the asyncq, whether or not
767  // this event belongs to this eventq. This is required to maintain
768  // a total order amongst the global events. See global_event.{cc,hh}
769  // for more explanation.
770  if (inParallelMode && (this != curEventQueue() || global)) {
771  asyncInsert(event);
772  } else {
773  insert(event);
774  }
775  event->flags.set(Event::Scheduled);
776  event->acquire();
777 
778  if (DTRACE(Event))
779  event->trace("scheduled");
780  }
781 
787  void
789  {
790  assert(event->scheduled());
791  assert(event->initialized());
792  assert(!inParallelMode || this == curEventQueue());
793 
794  remove(event);
795 
796  event->flags.clear(Event::Squashed);
797  event->flags.clear(Event::Scheduled);
798 
799  if (DTRACE(Event))
800  event->trace("descheduled");
801 
802  event->release();
803  }
804 
811  void
812  reschedule(Event *event, Tick when, bool always=false)
813  {
814  assert(when >= getCurTick());
815  assert(always || event->scheduled());
816  assert(event->initialized());
817  assert(!inParallelMode || this == curEventQueue());
818 
819  if (event->scheduled()) {
820  remove(event);
821  } else {
822  event->acquire();
823  }
824 
825  event->setWhen(when, this);
826  insert(event);
827  event->flags.clear(Event::Squashed);
828  event->flags.set(Event::Scheduled);
829 
830  if (DTRACE(Event))
831  event->trace("rescheduled");
832  }
833 
834  Tick nextTick() const { return head->when(); }
835  void setCurTick(Tick newVal) { _curTick = newVal; }
836 
846  Tick getCurTick() const { return _curTick; }
847  Event *getHead() const { return head; }
848 
849  Event *serviceOne();
850 
864  void
866  {
867  while (!empty()) {
868  if (nextTick() > when)
869  break;
870 
875  //assert(head->when() >= when && "event scheduled in the past");
876  serviceOne();
877  }
878 
879  setCurTick(when);
880  }
881 
887  bool empty() const { return head == NULL; }
888 
895  void dump() const;
896 
897  bool debugVerify() const;
898 
902  void handleAsyncInsertions();
903 
919  virtual void wakeup(Tick when = (Tick)-1) { }
920 
929  Event* replaceHead(Event* s);
930 
943  void lock() { service_mutex.lock(); }
944  void unlock() { service_mutex.unlock(); }
958  void checkpointReschedule(Event *event);
959 
960  virtual ~EventQueue()
961  {
962  while (!empty())
963  deschedule(getHead());
964  }
965 };
966 
967 void dumpMainQueue();
968 
970 {
971  protected:
974 
975  public:
980  EventManager(EventManager &em) : eventq(em.eventq) {}
981  EventManager(EventManager *em) : eventq(em->eventq) {}
982  EventManager(EventQueue *eq) : eventq(eq) {} //end of api_eventq group
984 
988  EventQueue *
989  eventQueue() const
990  {
991  return eventq;
992  }
993 
997  void
999  {
1000  eventq->schedule(&event, when);
1001  }
1002 
1006  void
1008  {
1009  eventq->deschedule(&event);
1010  }
1011 
1015  void
1016  reschedule(Event &event, Tick when, bool always = false)
1017  {
1018  eventq->reschedule(&event, when, always);
1019  }
1020 
1024  void
1026  {
1027  eventq->schedule(event, when);
1028  }
1029 
1033  void
1035  {
1036  eventq->deschedule(event);
1037  }
1038 
1042  void
1043  reschedule(Event *event, Tick when, bool always = false)
1044  {
1045  eventq->reschedule(event, when, always);
1046  }
1047 
1051  void wakeupEventQueue(Tick when = (Tick)-1)
1052  {
1053  eventq->wakeup(when);
1054  }
1055 
1056  void setCurTick(Tick newVal) { eventq->setCurTick(newVal); }
1057 };
1058 
1059 template <class T, void (T::* F)()>
1060 class EventWrapper : public Event
1061 {
1062  private:
1064 
1065  public:
1066  EventWrapper(T *obj, bool del = false, Priority p = Default_Pri)
1067  : Event(p), object(obj)
1068  {
1069  if (del)
1070  setFlags(AutoDelete);
1071  }
1072 
1073  EventWrapper(T &obj, bool del = false, Priority p = Default_Pri)
1074  : Event(p), object(&obj)
1075  {
1076  if (del)
1077  setFlags(AutoDelete);
1078  }
1079 
1080  void process() { (object->*F)(); }
1081 
1082  const std::string
1083  name() const
1084  {
1085  return object->name() + ".wrapped_event";
1086  }
1087 
1088  const char *description() const { return "EventWrapped"; }
1089 };
1090 
1092 {
1093  private:
1094  std::function<void(void)> callback;
1095  std::string _name;
1096 
1097  public:
1101  EventFunctionWrapper(const std::function<void(void)> &callback,
1102  const std::string &name,
1103  bool del = false,
1105  : Event(p), callback(callback), _name(name)
1106  {
1107  if (del)
1108  setFlags(AutoDelete);
1109  }
1110 
1114  void process() { callback(); }
1115 
1119  const std::string
1120  name() const
1121  {
1122  return _name + ".wrapped_function_event";
1123  }
1124 
1128  const char *description() const { return "EventFunctionWrapped"; }
1129 };
1130 
1131 #endif // __SIM_EVENTQ_HH__
void process()
Definition: eventq.hh:1080
EventQueue * eventq
A pointer to this object&#39;s event queue.
Definition: eventq.hh:973
static const Priority Maximum_Pri
Maximum priority.
Definition: eventq.hh:236
Bitfield< 29 > eq
Definition: miscregs.hh:48
EventFunctionWrapper(const std::function< void(void)> &callback, const std::string &name, bool del=false, Priority p=Default_Pri)
Definition: eventq.hh:1101
Bitfield< 30, 0 > index
void deschedule(Event *event)
Definition: eventq.hh:1034
void wakeupEventQueue(Tick when=(Tick) -1)
Definition: eventq.hh:1051
uint32_t numMainEventQueues
Current number of allocated main event queues.
Definition: eventq.cc:55
bool isAutoDelete() const
Definition: eventq.hh:493
void dumpMainQueue()
Definition: eventq.cc:363
bool operator>(const Event &l, const Event &r)
Definition: eventq.hh:532
const std::string & name()
Definition: trace.cc:50
bool empty() const
Returns true if no events are queued.
Definition: eventq.hh:887
void serviceEvents(Tick when)
process all events up to the given timestamp.
Definition: eventq.hh:865
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:206
virtual void acquireImpl()
Definition: eventq.hh:392
static const FlagsType Managed
Definition: eventq.hh:101
Counter instance
This event&#39;s unique ID.
Definition: eventq.hh:278
::Flags< FlagsType > Flags
Definition: eventq.hh:95
const std::string name() const
Definition: eventq.hh:1120
static const Priority Default_Pri
Default is zero for historical reasons.
Definition: eventq.hh:174
void setCurTick(Tick newVal)
Definition: eventq.hh:835
void squash()
Squash the current event.
Definition: eventq.hh:467
Tick _when
timestamp when event should be processed
Definition: eventq.hh:266
bool isSet() const
Definition: flags.hh:60
Priority _priority
event priority
Definition: eventq.hh:267
void clear()
Definition: flags.hh:66
EventManager(EventQueue *eq)
Definition: eventq.hh:982
Event * nextBin
Definition: eventq.hh:260
Bitfield< 2 > em
Definition: misc.hh:602
std::function< void(void)> callback
Definition: eventq.hh:1094
static const FlagsType Initialized
Definition: eventq.hh:111
int8_t Priority
Definition: eventq.hh:118
void schedule(Event *event, Tick when, bool global=false)
Schedule the given event on this queue.
Definition: eventq.hh:755
static const Priority Debug_Break_Pri
Breakpoints should happen before anything else (except enabling trace output), so we don&#39;t miss any a...
Definition: eventq.hh:148
void deschedule(Event *event)
Deschedule the specified event.
Definition: eventq.hh:788
static const FlagsType PublicRead
Definition: eventq.hh:97
EventQueue * getEventQueue(uint32_t index)
Function for returning eventq queue for the provided index.
Definition: eventq.cc:61
#define DTRACE(x)
Definition: debug.hh:143
Definition: cprintf.cc:40
void acquire()
Memory management hooks for events that have the Managed flag set.
Definition: eventq.hh:378
void setWhen(Tick when, EventQueue *q)
Definition: eventq.hh:291
void clearFlags()
Definition: eventq.hh:337
EventManager(EventManager *em)
Definition: eventq.hh:981
STL vector class.
Definition: stl.hh:37
bool operator>=(const Event &l, const Event &r)
Definition: eventq.hh:552
void reschedule(Event *event, Tick when, bool always=false)
Definition: eventq.hh:1043
unsigned short FlagsType
Definition: eventq.hh:94
static const FlagsType AutoDelete
Definition: eventq.hh:102
Bitfield< 31 > n
Bitfield< 6 > f
bool squashed() const
Check whether the event is squashed.
Definition: eventq.hh:474
Priority priority() const
Get the event priority.
Definition: eventq.hh:507
static const Priority Progress_Event_Pri
Progress events come at the end.
Definition: eventq.hh:221
static const FlagsType Squashed
Definition: eventq.hh:99
EventManager(EventManager &em)
Definition: eventq.hh:980
bool initialized() const
Definition: eventq.hh:303
Tick curTick()
The current simulated tick.
Definition: core.hh:44
Temporarily migrate execution to a different event queue.
Definition: eventq.hh:674
Flags flags
Definition: eventq.hh:268
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:919
virtual const std::string name() const
Definition: eventq.hh:745
Queue of events sorted in time order.
Definition: eventq.hh:614
Bitfield< 4 > s
const char * description() const
Return a C string describing the event.
Definition: eventq.hh:1088
std::string objName
Definition: eventq.hh:617
static const FlagsType Scheduled
Definition: eventq.hh:100
bool operator!=(const Event &l, const Event &r)
Definition: eventq.hh:571
uint64_t Tick
Tick count type.
Definition: types.hh:61
Tick simQuantum
Simulation Quantum for multiple eventq simulation.
Definition: eventq.cc:47
bool isExitEvent() const
See if this is a SimExitEvent (without resorting to RTTI)
Definition: eventq.hh:481
Tick _curTick
Definition: eventq.hh:619
EventWrapper(T *obj, bool del=false, Priority p=Default_Pri)
Definition: eventq.hh:1066
Bitfield< 27 > q
virtual BaseGlobalEvent * globalEvent()
If this is part of a GlobalEvent, return the pointer to the Global Event.
Definition: eventq.hh:512
EventQueue * curEventQueue()
Definition: eventq.hh:83
Event * nextInBin
Definition: eventq.hh:261
void deschedule(Event &event)
Definition: eventq.hh:1007
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
void reschedule(Event *event, Tick when, bool always=false)
Reschedule the specified event.
Definition: eventq.hh:812
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
Definition: eventq.hh:199
void schedule(Event &event, Tick when)
Definition: eventq.hh:998
void setFlags(Flags _flags)
Definition: eventq.hh:323
STL list class.
Definition: stl.hh:51
static const FlagsType Reserved0
This used to be AutoSerialize.
Definition: eventq.hh:108
void setCurTick(Tick newVal)
Definition: eventq.hh:1056
Flags getFlags() const
Definition: eventq.hh:310
void reschedule(Event &event, Tick when, bool always=false)
Definition: eventq.hh:1016
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Tick nextTick() const
Definition: eventq.hh:834
virtual void releaseImpl()
Definition: eventq.hh:394
int64_t Counter
Statistics counter type.
Definition: types.hh:56
bool isFlagSet(Flags _flags) const
Definition: eventq.hh:316
std::mutex async_queue_mutex
Mutex to protect async queue.
Definition: eventq.hh:622
Bitfield< 10, 5 > event
std::mutex service_mutex
Lock protecting event handling.
Definition: eventq.hh:647
Basic support for object serialization.
Definition: serialize.hh:166
bool inParallelMode
Current mode of execution: parallel / serial.
Definition: eventq.cc:58
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:460
void clearFlags(Flags _flags)
Definition: eventq.hh:330
Event * head
Definition: eventq.hh:618
void schedule(Event *event, Tick when)
Definition: eventq.hh:1025
Event(Priority p=Default_Pri, Flags f=0)
Definition: eventq.hh:409
const std::string name() const
Definition: eventq.hh:1083
void unlock()
Definition: eventq.hh:944
std::string _name
Definition: eventq.hh:1095
std::ostream CheckpointOut
Definition: serialize.hh:63
bool operator==(const Event &l, const Event &r)
Definition: eventq.hh:562
Bitfield< 31, 28 > st
Definition: eventq.hh:246
virtual ~EventQueue()
Definition: eventq.hh:960
static const Priority Delayed_Writeback_Pri
For some reason "delayed" inter-cluster writebacks are scheduled before regular writebacks (which hav...
Definition: eventq.hh:167
EventQueue * eventQueue() const
Definition: eventq.hh:989
bool operator<(const Event &l, const Event &r)
Definition: eventq.hh:522
static const Priority Debug_Enable_Pri
If we enable tracing on a particular cycle, do that as the very first thing so we don&#39;t miss any of t...
Definition: eventq.hh:139
ScopedMigration(EventQueue *_new_eq, bool _doMigrate=true)
Definition: eventq.hh:680
ScopedRelease(EventQueue *_eq)
api_eventq
Definition: eventq.hh:721
bool isManaged() const
Check whether this event will auto-delete.
Definition: eventq.hh:488
static const Priority Sim_Exit_Pri
If we want to exit on this cycle, it&#39;s the very last thing we do.
Definition: eventq.hh:229
bool operator<=(const Event &l, const Event &r)
Definition: eventq.hh:542
__thread EventQueue * _curEventQueue
The current event queue for the running thread.
Definition: eventq.cc:57
void unserialize(ThreadContext &tc, CheckpointIn &cp)
void release()
Managed event removed from the event queue.
Definition: eventq.hh:387
static const FlagsType PublicWrite
Definition: eventq.hh:98
void lock()
Provide an interface for locking/unlocking the event queue.
Definition: eventq.hh:943
void dump()
Dump all statistics data to the registered outputs.
Definition: statistics.cc:560
static const Priority Stat_Event_Pri
Statistics events (dump, reset, etc.) come after everything else, but before exit.
Definition: eventq.hh:214
Common base class for GlobalEvent and GlobalSyncEvent.
Definition: global_event.hh:60
static const Priority CPU_Switch_Pri
CPU switches schedule the new CPU&#39;s tick event for the same cycle (after unscheduling the old CPU&#39;s t...
Definition: eventq.hh:158
Common base class for Event and GlobalEvent, so they can share flag and priority definitions and acce...
Definition: eventq.hh:91
Event * getHead() const
Definition: eventq.hh:847
void name(const std::string &st)
Definition: eventq.hh:746
static const Priority Minimum_Pri
Event priorities, to provide tie-breakers for events scheduled at the same cycle. ...
Definition: eventq.hh:130
Temporarily release the event queue service lock.
Definition: eventq.hh:715
std::list< Event * > async_queue
List of events added by other threads to this event queue.
Definition: eventq.hh:625
EventWrapper(T &obj, bool del=false, Priority p=Default_Pri)
Definition: eventq.hh:1073
std::vector< EventQueue * > mainEventQueue
Array for main event queues.
Definition: eventq.cc:56
Bitfield< 0 > p
Tick when() const
Get the time that the event is scheduled.
Definition: eventq.hh:500
static const FlagsType IsExitEvent
Definition: eventq.hh:109
void set(Type flags)
Definition: flags.hh:68
Bitfield< 5 > l
static const Priority Serialize_Pri
Serailization needs to occur before tick events also, so that a serialize/unserialize is identical to...
Definition: eventq.hh:191
EventQueue * queue
queue to which this event belongs (though it may or may not be scheduled on this queue yet) ...
Definition: eventq.hh:282
const char * description() const
Return a C string describing the event.
Definition: eventq.hh:1128
static const FlagsType IsMainQueue
Definition: eventq.hh:110
Tick getCurTick() const
While curTick() is useful for any object assigned to this event queue, if an object that is assigned ...
Definition: eventq.hh:846
bool noneSet() const
Definition: flags.hh:64
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:182
static const FlagsType InitMask
Definition: eventq.hh:112

Generated on Mon Jun 8 2020 15:45:12 for gem5 by doxygen 1.8.13