gem5  v19.0.0.0
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  * Authors: Steve Reinhardt
31  * Nathan Binkert
32  */
33 
34 /* @file
35  * EventQueue interfaces
36  */
37 
38 #ifndef __SIM_EVENTQ_HH__
39 #define __SIM_EVENTQ_HH__
40 
41 #include <algorithm>
42 #include <cassert>
43 #include <climits>
44 #include <functional>
45 #include <iosfwd>
46 #include <memory>
47 #include <mutex>
48 #include <string>
49 
50 #include "base/flags.hh"
51 #include "base/types.hh"
52 #include "debug/Event.hh"
53 #include "sim/serialize.hh"
54 
55 class EventQueue; // forward declaration
56 class BaseGlobalEvent;
57 
63 extern Tick simQuantum;
64 
66 extern uint32_t numMainEventQueues;
67 
70 
73 
74 extern __thread EventQueue *_curEventQueue;
75 
77 extern bool inParallelMode;
78 
83 EventQueue *getEventQueue(uint32_t index);
84 
87 
93 class EventBase
94 {
95  protected:
96  typedef unsigned short FlagsType;
97  typedef ::Flags<FlagsType> Flags;
98 
99  static const FlagsType PublicRead = 0x003f; // public readable flags
100  static const FlagsType PublicWrite = 0x001d; // public writable flags
101  static const FlagsType Squashed = 0x0001; // has been squashed
102  static const FlagsType Scheduled = 0x0002; // has been scheduled
103  static const FlagsType Managed = 0x0004; // Use life cycle manager
104  static const FlagsType AutoDelete = Managed; // delete after dispatch
110  static const FlagsType Reserved0 = 0x0008;
111  static const FlagsType IsExitEvent = 0x0010; // special exit event
112  static const FlagsType IsMainQueue = 0x0020; // on main event queue
113  static const FlagsType Initialized = 0x7a40; // somewhat random bits
114  static const FlagsType InitMask = 0xffc0; // mask for init bits
115 
116  public:
117  typedef int8_t Priority;
118 
123 
125  static const Priority Minimum_Pri = SCHAR_MIN;
126 
130  static const Priority Debug_Enable_Pri = -101;
131 
135  static const Priority Debug_Break_Pri = -100;
136 
141  static const Priority CPU_Switch_Pri = -31;
142 
146  static const Priority Delayed_Writeback_Pri = -1;
147 
149  static const Priority Default_Pri = 0;
150 
153  static const Priority DVFS_Update_Pri = 31;
154 
158  static const Priority Serialize_Pri = 32;
159 
162  static const Priority CPU_Tick_Pri = 50;
163 
165  static const Priority CPU_Exit_Pri = 64;
166 
169  static const Priority Stat_Event_Pri = 90;
170 
172  static const Priority Progress_Event_Pri = 95;
173 
176  static const Priority Sim_Exit_Pri = 100;
177 
179  static const Priority Maximum_Pri = SCHAR_MAX;
180 };
181 
182 /*
183  * An item on an event queue. The action caused by a given
184  * event is specified by deriving a subclass and overriding the
185  * process() member function.
186  *
187  * Caution, the order of members is chosen to maximize data packing.
188  */
189 class Event : public EventBase, public Serializable
190 {
191  friend class EventQueue;
192 
193  private:
194  // The event queue is now a linked list of linked lists. The
195  // 'nextBin' pointer is to find the bin, where a bin is defined as
196  // when+priority. All events in the same bin will be stored in a
197  // second linked list (a stack) maintained by the 'nextInBin'
198  // pointer. The list will be accessed in LIFO order. The end
199  // result is that the insert/removal in 'nextBin' is
200  // linear/constant, and the lookup/removal in 'nextInBin' is
201  // constant/constant. Hopefully this is a significant improvement
202  // over the current fully linear insertion.
205 
206  static Event *insertBefore(Event *event, Event *curr);
207  static Event *removeItem(Event *event, Event *last);
208 
212 
213 #ifndef NDEBUG
214  static Counter instanceCounter;
216 
222 
226 #endif
227 
228 #ifdef EVENTQ_DEBUG
229  Tick whenCreated;
230  Tick whenScheduled;
231 #endif
232 
233  void
235  {
236  _when = when;
237 #ifndef NDEBUG
238  queue = q;
239 #endif
240 #ifdef EVENTQ_DEBUG
241  whenScheduled = curTick();
242 #endif
243  }
244 
245  bool
246  initialized() const
247  {
248  return (flags & InitMask) == Initialized;
249  }
250 
251  protected:
253  Flags
254  getFlags() const
255  {
256  return flags & PublicRead;
257  }
258 
259  bool
260  isFlagSet(Flags _flags) const
261  {
262  assert(_flags.noneSet(~PublicRead));
263  return flags.isSet(_flags);
264  }
265 
267  void
268  setFlags(Flags _flags)
269  {
270  assert(_flags.noneSet(~PublicWrite));
271  flags.set(_flags);
272  }
273 
274  void
276  {
277  assert(_flags.noneSet(~PublicWrite));
278  flags.clear(_flags);
279  }
280 
281  void
283  {
284  flags.clear(PublicWrite);
285  }
286 
287  // This function isn't really useful if TRACING_ON is not defined
288  virtual void trace(const char *action);
289 
290  protected: /* Memory management */
316  void acquire()
317  {
318  if (flags.isSet(Event::Managed))
319  acquireImpl();
320  }
321 
325  void release() {
326  if (flags.isSet(Event::Managed))
327  releaseImpl();
328  }
329 
330  virtual void acquireImpl() {}
331 
332  virtual void releaseImpl() {
333  if (!scheduled())
334  delete this;
335  }
336 
339  public:
340 
341  /*
342  * Event constructor
343  * @param queue that the event gets scheduled on
344  */
346  : nextBin(nullptr), nextInBin(nullptr), _when(0), _priority(p),
347  flags(Initialized | f)
348  {
349  assert(f.noneSet(~PublicWrite));
350 #ifndef NDEBUG
351  instance = ++instanceCounter;
352  queue = NULL;
353 #endif
354 #ifdef EVENTQ_DEBUG
355  whenCreated = curTick();
356  whenScheduled = 0;
357 #endif
358  }
359 
360  virtual ~Event();
361  virtual const std::string name() const;
362 
366  virtual const char *description() const;
367 
369  void dump() const;
370 
371  public:
372  /*
373  * This member function is invoked when the event is processed
374  * (occurs). There is no default implementation; each subclass
375  * must provide its own implementation. The event is not
376  * automatically deleted after it is processed (to allow for
377  * statically allocated event objects).
378  *
379  * If the AutoDestroy flag is set, the object is deleted once it
380  * is processed.
381  */
382  virtual void process() = 0;
383 
385  bool scheduled() const { return flags.isSet(Scheduled); }
386 
388  void squash() { flags.set(Squashed); }
389 
391  bool squashed() const { return flags.isSet(Squashed); }
392 
394  bool isExitEvent() const { return flags.isSet(IsExitEvent); }
395 
397  bool isManaged() const { return flags.isSet(Managed); }
398  bool isAutoDelete() const { return isManaged(); }
399 
401  Tick when() const { return _when; }
402 
404  Priority priority() const { return _priority; }
405 
409  virtual BaseGlobalEvent *globalEvent() { return NULL; }
410 
411  void serialize(CheckpointOut &cp) const override;
412  void unserialize(CheckpointIn &cp) override;
413 };
414 
415 inline bool
416 operator<(const Event &l, const Event &r)
417 {
418  return l.when() < r.when() ||
419  (l.when() == r.when() && l.priority() < r.priority());
420 }
421 
422 inline bool
423 operator>(const Event &l, const Event &r)
424 {
425  return l.when() > r.when() ||
426  (l.when() == r.when() && l.priority() > r.priority());
427 }
428 
429 inline bool
430 operator<=(const Event &l, const Event &r)
431 {
432  return l.when() < r.when() ||
433  (l.when() == r.when() && l.priority() <= r.priority());
434 }
435 inline bool
436 operator>=(const Event &l, const Event &r)
437 {
438  return l.when() > r.when() ||
439  (l.when() == r.when() && l.priority() >= r.priority());
440 }
441 
442 inline bool
443 operator==(const Event &l, const Event &r)
444 {
445  return l.when() == r.when() && l.priority() == r.priority();
446 }
447 
448 inline bool
449 operator!=(const Event &l, const Event &r)
450 {
451  return l.when() != r.when() || l.priority() != r.priority();
452 }
453 
493 {
494  private:
495  std::string objName;
498 
500  std::mutex async_queue_mutex;
501 
504 
525  std::mutex service_mutex;
526 
529  void insert(Event *event);
530  void remove(Event *event);
531 
535  void asyncInsert(Event *event);
536 
537  EventQueue(const EventQueue &);
538 
539  public:
553  {
554  public:
555  ScopedMigration(EventQueue *_new_eq, bool _doMigrate = true)
556  :new_eq(*_new_eq), old_eq(*curEventQueue()),
557  doMigrate((&new_eq != &old_eq)&&_doMigrate)
558  {
559  if (doMigrate){
560  old_eq.unlock();
561  new_eq.lock();
562  curEventQueue(&new_eq);
563  }
564  }
565 
567  {
568  if (doMigrate){
569  new_eq.unlock();
570  old_eq.lock();
571  curEventQueue(&old_eq);
572  }
573  }
574 
575  private:
578  bool doMigrate;
579  };
580 
591  {
592  public:
594  : eq(*_eq)
595  {
596  eq.unlock();
597  }
598 
600  {
601  eq.lock();
602  }
603 
604  private:
606  };
607 
608  EventQueue(const std::string &n);
609 
610  virtual const std::string name() const { return objName; }
611  void name(const std::string &st) { objName = st; }
612 
615  void schedule(Event *event, Tick when, bool global = false);
616 
619  void deschedule(Event *event);
620 
623  void reschedule(Event *event, Tick when, bool always = false);
624 
625  Tick nextTick() const { return head->when(); }
626  void setCurTick(Tick newVal) { _curTick = newVal; }
627  Tick getCurTick() const { return _curTick; }
628  Event *getHead() const { return head; }
629 
630  Event *serviceOne();
631 
632  // process all events up to the given timestamp. we inline a
633  // quick test to see if there are any events to process; if so,
634  // call the internal out-of-line version to process them all.
635  void
637  {
638  while (!empty()) {
639  if (nextTick() > when)
640  break;
641 
646  //assert(head->when() >= when && "event scheduled in the past");
647  serviceOne();
648  }
649 
650  setCurTick(when);
651  }
652 
653  // return true if no events are queued
654  bool empty() const { return head == NULL; }
655 
656  void dump() const;
657 
658  bool debugVerify() const;
659 
661  void handleAsyncInsertions();
662 
676  virtual void wakeup(Tick when = (Tick)-1) { }
677 
686  Event* replaceHead(Event* s);
687 
700  void lock() { service_mutex.lock(); }
701  void unlock() { service_mutex.unlock(); }
715  void checkpointReschedule(Event *event);
716 
717  virtual ~EventQueue()
718  {
719  while (!empty())
720  deschedule(getHead());
721  }
722 };
723 
724 void dumpMainQueue();
725 
727 {
728  protected:
731 
732  public:
733  EventManager(EventManager &em) : eventq(em.eventq) {}
734  EventManager(EventManager *em) : eventq(em->eventq) {}
735  EventManager(EventQueue *eq) : eventq(eq) {}
736 
737  EventQueue *
738  eventQueue() const
739  {
740  return eventq;
741  }
742 
743  void
744  schedule(Event &event, Tick when)
745  {
746  eventq->schedule(&event, when);
747  }
748 
749  void
751  {
752  eventq->deschedule(&event);
753  }
754 
755  void
756  reschedule(Event &event, Tick when, bool always = false)
757  {
758  eventq->reschedule(&event, when, always);
759  }
760 
761  void
762  schedule(Event *event, Tick when)
763  {
764  eventq->schedule(event, when);
765  }
766 
767  void
769  {
770  eventq->deschedule(event);
771  }
772 
773  void
774  reschedule(Event *event, Tick when, bool always = false)
775  {
776  eventq->reschedule(event, when, always);
777  }
778 
779  void wakeupEventQueue(Tick when = (Tick)-1)
780  {
781  eventq->wakeup(when);
782  }
783 
784  void setCurTick(Tick newVal) { eventq->setCurTick(newVal); }
785 };
786 
787 template <class T, void (T::* F)()>
788 class EventWrapper : public Event
789 {
790  private:
791  T *object;
792 
793  public:
794  EventWrapper(T *obj, bool del = false, Priority p = Default_Pri)
795  : Event(p), object(obj)
796  {
797  if (del)
798  setFlags(AutoDelete);
799  }
800 
801  EventWrapper(T &obj, bool del = false, Priority p = Default_Pri)
802  : Event(p), object(&obj)
803  {
804  if (del)
805  setFlags(AutoDelete);
806  }
807 
808  void process() { (object->*F)(); }
809 
810  const std::string
811  name() const
812  {
813  return object->name() + ".wrapped_event";
814  }
815 
816  const char *description() const { return "EventWrapped"; }
817 };
818 
820 {
821  private:
822  std::function<void(void)> callback;
823  std::string _name;
824 
825  public:
826  EventFunctionWrapper(const std::function<void(void)> &callback,
827  const std::string &name,
828  bool del = false,
830  : Event(p), callback(callback), _name(name)
831  {
832  if (del)
833  setFlags(AutoDelete);
834  }
835 
836  void process() { callback(); }
837 
838  const std::string
839  name() const
840  {
841  return _name + ".wrapped_function_event";
842  }
843 
844  const char *description() const { return "EventFunctionWrapped"; }
845 };
846 
847 #endif // __SIM_EVENTQ_HH__
void process()
Definition: eventq.hh:808
EventQueue * eventq
A pointer to this object&#39;s event queue.
Definition: eventq.hh:730
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:676
EventFunctionWrapper(const std::function< void(void)> &callback, const std::string &name, bool del=false, Priority p=Default_Pri)
Definition: eventq.hh:826
static const Priority Progress_Event_Pri
Progress events come at the end.
Definition: eventq.hh:172
Bitfield< 29 > eq
Definition: miscregs.hh:50
Bitfield< 30, 0 > index
bool isManaged() const
Check whether this event will auto-delete.
Definition: eventq.hh:397
uint32_t numMainEventQueues
Current number of allocated main event queues.
Definition: eventq.cc:58
void dumpMainQueue()
Definition: eventq.cc:369
bool isAutoDelete() const
Definition: eventq.hh:398
const std::string & name()
Definition: trace.cc:54
void deschedule(Event *event)
Deschedule the specified event.
Definition: eventq_impl.hh:69
void wakeupEventQueue(Tick when=(Tick) -1)
Definition: eventq.hh:779
virtual void acquireImpl()
Definition: eventq.hh:330
Tick when() const
Get the time that the event is scheduled.
Definition: eventq.hh:401
static const FlagsType Managed
Definition: eventq.hh:103
Counter instance
This event&#39;s unique ID.
Definition: eventq.hh:221
::Flags< FlagsType > Flags
Definition: eventq.hh:97
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
Definition: eventq.hh:162
void deschedule(Event *event)
Definition: eventq.hh:768
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:141
EventManager(EventManager *em)
Definition: eventq.hh:734
void setCurTick(Tick newVal)
Definition: eventq.hh:626
Tick _when
timestamp when event should be processed
Definition: eventq.hh:209
bool isSet() const
Definition: flags.hh:62
void schedule(Event *event, Tick when)
Definition: eventq.hh:762
Priority _priority
event priority
Definition: eventq.hh:210
void clear()
Definition: flags.hh:68
int8_t Priority
Definition: eventq.hh:117
Event * nextBin
Definition: eventq.hh:203
Bitfield< 2 > em
Definition: misc.hh:604
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:135
std::function< void(void)> callback
Definition: eventq.hh:822
static const FlagsType Initialized
Definition: eventq.hh:113
ScopedMigration(EventQueue *_new_eq, bool _doMigrate=true)
Definition: eventq.hh:555
static const FlagsType PublicRead
Definition: eventq.hh:99
EventQueue * getEventQueue(uint32_t index)
Function for returning eventq queue for the provided index.
Definition: eventq.cc:64
Definition: cprintf.cc:42
void acquire()
Memory management hooks for events that have the Managed flag set.
Definition: eventq.hh:316
void setWhen(Tick when, EventQueue *q)
Definition: eventq.hh:234
void clearFlags()
Definition: eventq.hh:282
bool empty() const
Definition: eventq.hh:654
STL vector class.
Definition: stl.hh:40
void deschedule(Event &event)
Definition: eventq.hh:750
bool operator>(const Event &l, const Event &r)
Definition: eventq.hh:423
bool squashed() const
Check whether the event is squashed.
Definition: eventq.hh:391
unsigned short FlagsType
Definition: eventq.hh:96
static const FlagsType AutoDelete
Definition: eventq.hh:104
Bitfield< 31 > n
Bitfield< 6 > f
T * object
Definition: eventq.hh:791
static const FlagsType Squashed
Definition: eventq.hh:101
static const Priority Serialize_Pri
Serailization needs to occur before tick events also, so that a serialize/unserialize is identical to...
Definition: eventq.hh:158
bool initialized() const
Definition: eventq.hh:246
Tick curTick()
The current simulated tick.
Definition: core.hh:47
Temporarily migrate execution to a different event queue.
Definition: eventq.hh:552
Flags flags
Definition: eventq.hh:211
void reschedule(Event *event, Tick when, bool always=false)
Reschedule the specified event.
Definition: eventq_impl.hh:87
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:385
Queue of events sorted in time order.
Definition: eventq.hh:492
Bitfield< 4 > s
const char * description() const
Return a C string describing the event.
Definition: eventq.hh:816
std::string objName
Definition: eventq.hh:495
static const FlagsType Scheduled
Definition: eventq.hh:102
uint64_t Tick
Tick count type.
Definition: types.hh:63
Tick simQuantum
Simulation Quantum for multiple eventq simulation.
Definition: eventq.cc:50
Tick _curTick
Definition: eventq.hh:497
EventWrapper(T *obj, bool del=false, Priority p=Default_Pri)
Definition: eventq.hh:794
Bitfield< 27 > q
virtual BaseGlobalEvent * globalEvent()
If this is part of a GlobalEvent, return the pointer to the Global Event.
Definition: eventq.hh:409
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:176
const char * description() const
Return a C string describing the event.
Definition: eventq.hh:844
void reschedule(Event *event, Tick when, bool always=false)
Definition: eventq.hh:774
EventQueue * curEventQueue()
Definition: eventq.hh:85
Event * nextInBin
Definition: eventq.hh:204
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
bool operator>=(const Event &l, const Event &r)
Definition: eventq.hh:436
void serviceEvents(Tick when)
Definition: eventq.hh:636
void setFlags(Flags _flags)
Accessor for flags.
Definition: eventq.hh:268
const std::string name() const
Definition: eventq.hh:839
STL list class.
Definition: stl.hh:54
EventManager(EventQueue *eq)
Definition: eventq.hh:735
static const FlagsType Reserved0
This used to be AutoSerialize.
Definition: eventq.hh:110
void setCurTick(Tick newVal)
Definition: eventq.hh:784
void squash()
Squash the current event.
Definition: eventq.hh:388
bool operator<=(const Event &l, const Event &r)
Definition: eventq.hh:430
Flags getFlags() const
Accessor for flags.
Definition: eventq.hh:254
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Tick nextTick() const
Definition: eventq.hh:625
virtual void releaseImpl()
Definition: eventq.hh:332
int64_t Counter
Statistics counter type.
Definition: types.hh:58
bool isFlagSet(Flags _flags) const
Definition: eventq.hh:260
bool operator!=(const Event &l, const Event &r)
Definition: eventq.hh:449
std::mutex async_queue_mutex
Mutex to protect async queue.
Definition: eventq.hh:500
Bitfield< 10, 5 > event
std::mutex service_mutex
Lock protecting event handling.
Definition: eventq.hh:525
Basic support for object serialization.
Definition: serialize.hh:153
Tick getCurTick() const
Definition: eventq.hh:627
bool inParallelMode
Current mode of execution: parallel / serial.
Definition: eventq.cc:61
Priority priority() const
Get the event priority.
Definition: eventq.hh:404
void clearFlags(Flags _flags)
Definition: eventq.hh:275
Event * head
Definition: eventq.hh:496
void reschedule(Event &event, Tick when, bool always=false)
Definition: eventq.hh:756
bool isExitEvent() const
See if this is a SimExitEvent (without resorting to RTTI)
Definition: eventq.hh:394
EventQueue * eventQueue() const
Definition: eventq.hh:738
Event(Priority p=Default_Pri, Flags f=0)
Definition: eventq.hh:345
const std::string name() const
Definition: eventq.hh:811
void unlock()
Definition: eventq.hh:701
std::string _name
Definition: eventq.hh:823
std::ostream CheckpointOut
Definition: serialize.hh:68
Bitfield< 31, 28 > st
Definition: eventq.hh:189
virtual ~EventQueue()
Definition: eventq.hh:717
void schedule(Event *event, Tick when, bool global=false)
Schedule the given event on this queue.
Definition: eventq_impl.hh:42
ScopedRelease(EventQueue *_eq)
Definition: eventq.hh:593
void schedule(Event &event, Tick when)
Definition: eventq.hh:744
static const Priority Default_Pri
Default is zero for historical reasons.
Definition: eventq.hh:149
static const Priority Minimum_Pri
Event priorities, to provide tie-breakers for events scheduled at the same cycle. ...
Definition: eventq.hh:125
__thread EventQueue * _curEventQueue
The current event queue for the running thread.
Definition: eventq.cc:60
void unserialize(ThreadContext &tc, CheckpointIn &cp)
virtual const std::string name() const
Definition: eventq.hh:610
void release()
Managed event removed from the event queue.
Definition: eventq.hh:325
static const FlagsType PublicWrite
Definition: eventq.hh:100
void lock()
Provide an interface for locking/unlocking the event queue.
Definition: eventq.hh:700
void dump()
Dump all statistics data to the registered outputs.
Definition: statistics.cc:561
Common base class for GlobalEvent and GlobalSyncEvent.
Definition: global_event.hh:62
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:153
Common base class for Event and GlobalEvent, so they can share flag and priority definitions and acce...
Definition: eventq.hh:93
Event * getHead() const
Definition: eventq.hh:628
Temporarily release the event queue service lock.
Definition: eventq.hh:590
void name(const std::string &st)
Definition: eventq.hh:611
static const Priority Delayed_Writeback_Pri
For some reason "delayed" inter-cluster writebacks are scheduled before regular writebacks (which hav...
Definition: eventq.hh:146
std::list< Event * > async_queue
List of events added by other threads to this event queue.
Definition: eventq.hh:503
EventWrapper(T &obj, bool del=false, Priority p=Default_Pri)
Definition: eventq.hh:801
std::vector< EventQueue * > mainEventQueue
Array for main event queues.
Definition: eventq.cc:59
Bitfield< 0 > p
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:130
static const Priority Stat_Event_Pri
Statistics events (dump, reset, etc.) come after everything else, but before exit.
Definition: eventq.hh:169
static const FlagsType IsExitEvent
Definition: eventq.hh:111
void set(Type flags)
Definition: flags.hh:70
Bitfield< 5 > l
bool operator<(const Event &l, const Event &r)
Definition: eventq.hh:416
EventQueue * queue
queue to which this event belongs (though it may or may not be scheduled on this queue yet) ...
Definition: eventq.hh:225
EventManager(EventManager &em)
Definition: eventq.hh:733
static const Priority Maximum_Pri
Maximum priority.
Definition: eventq.hh:179
bool operator==(const Event &l, const Event &r)
Definition: eventq.hh:443
static const FlagsType IsMainQueue
Definition: eventq.hh:112
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:165
bool noneSet() const
Definition: flags.hh:66
static const FlagsType InitMask
Definition: eventq.hh:114

Generated on Fri Feb 28 2020 16:27:02 for gem5 by doxygen 1.8.13