gem5  v21.0.1.0
scheduler.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Google, Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met: redistributions of source code must retain the above copyright
7  * notice, this list of conditions and the following disclaimer;
8  * redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution;
11  * neither the name of the copyright holders nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef __SYSTEMC_CORE_SCHEDULER_HH__
29 #define __SYSTEMC_CORE_SCHEDULER_HH__
30 
31 #include <atomic>
32 #include <functional>
33 #include <list>
34 #include <map>
35 #include <mutex>
36 #include <set>
37 #include <vector>
38 
39 #include "base/logging.hh"
40 #include "sim/core.hh"
41 #include "sim/eventq.hh"
42 #include "systemc/core/channel.hh"
43 #include "systemc/core/list.hh"
44 #include "systemc/core/process.hh"
46 
47 class Fiber;
48 
49 namespace sc_gem5
50 {
51 
52 class TraceFile;
53 
56 
57 /*
58  * The scheduler supports three different mechanisms, the initialization phase,
59  * delta cycles, and timed notifications.
60  *
61  * INITIALIZATION PHASE
62  *
63  * The initialization phase has three parts:
64  * 1. Run requested channel updates.
65  * 2. Make processes which need to initialize runnable (methods and threads
66  * which didn't have dont_initialize called on them).
67  * 3. Process delta notifications.
68  *
69  * First, the Kernel SimObject calls the update() method during its startup()
70  * callback which handles the requested channel updates. The Kernel also
71  * schedules an event to be run at time 0 with a slightly elevated priority
72  * so that it happens before any "normal" event.
73  *
74  * When that t0 event happens, it calls the schedulers prepareForInit method
75  * which performs step 2 above. That indirectly causes the scheduler's
76  * readyEvent to be scheduled with slightly lowered priority, ensuring it
77  * happens after any "normal" event.
78  *
79  * Because delta notifications are scheduled at the standard priority, all
80  * of those events will happen next, performing step 3 above. Once they finish,
81  * if the readyEvent was scheduled above, there shouldn't be any higher
82  * priority events in front of it. When it runs, it will start the first
83  * evaluate phase of the first delta cycle.
84  *
85  * DELTA CYCLE
86  *
87  * A delta cycle has three phases within it.
88  * 1. The evaluate phase where runnable processes are allowed to run.
89  * 2. The update phase where requested channel updates hapen.
90  * 3. The delta notification phase where delta notifications happen.
91  *
92  * The readyEvent runs all three steps of the delta cycle. It first goes
93  * through the list of runnable processes and executes them until the set is
94  * empty, and then immediately runs the update phase. Since these are all part
95  * of the same event, there's no chance for other events to intervene and
96  * break the required order above.
97  *
98  * During the update phase above, the spec forbids any action which would make
99  * a process runnable. That means that once the update phase finishes, the set
100  * of runnable processes will be empty. There may, however, have been some
101  * delta notifications/timeouts which will have been scheduled during either
102  * the evaluate or update phase above. Those will have been accumulated in the
103  * scheduler, and are now all executed.
104  *
105  * If any processes became runnable during the delta notification phase, the
106  * readyEvent will have been scheduled and will be waiting and ready to run
107  * again, effectively starting the next delta cycle.
108  *
109  * TIMED NOTIFICATION PHASE
110  *
111  * If no processes became runnable, the event queue will continue to process
112  * events until it comes across an event which represents all the timed
113  * notifications which are supposed to happen at a particular time. The object
114  * which tracks them will execute all those notifications, and then destroy
115  * itself. If the readyEvent is now ready to run, the next delta cycle will
116  * start.
117  *
118  * PAUSE/STOP
119  *
120  * To inject a pause from sc_pause which should happen after the current delta
121  * cycle's delta notification phase, an event is scheduled with a lower than
122  * normal priority, but higher than the readyEvent. That ensures that any
123  * delta notifications which are scheduled with normal priority will happen
124  * first, since those are part of the current delta cycle. Then the pause
125  * event will happen before the next readyEvent which would start the next
126  * delta cycle. All of these events are scheduled for the current time, and so
127  * would happen before any timed notifications went off.
128  *
129  * To inject a stop from sc_stop, the delta cycles should stop before even the
130  * delta notifications have happened, but after the evaluate and update phases.
131  * For that, a stop event with slightly higher than normal priority will be
132  * scheduled so that it happens before any of the delta notification events
133  * which are at normal priority.
134  *
135  * MAX RUN TIME
136  *
137  * When sc_start is called, it's possible to pass in a maximum time the
138  * simulation should run to, at which point sc_pause is implicitly called. The
139  * simulation is supposed to run up to the latest timed notification phase
140  * which is less than or equal to the maximum time. In other words it should
141  * run timed notifications at the maximum time, but not the subsequent evaluate
142  * phase. That's implemented by scheduling an event at the max time with a
143  * priority which is lower than all the others except the ready event. Timed
144  * notifications will happen before it fires, but it will override any ready
145  * event and prevent the evaluate phase from starting.
146  */
147 
149 {
150  public:
152 
153  class TimeSlot : public ::Event
154  {
155  public:
158  // Event::when() is only set after it's scheduled to an event queue.
159  // However, TimeSlot won't be scheduled before init is done. We need
160  // to keep the real 'targeted_when' information before scheduled.
164  void process() override;
165 
166  protected:
167  void
168  releaseImpl() override
169  {
170  if (!scheduled())
172  }
173 
174  };
175 
177 
178  Scheduler();
179  ~Scheduler();
180 
181  void clear();
182 
183  const std::string name() const { return "systemc_scheduler"; }
184 
185  uint64_t numCycles() { return _numCycles; }
186  Process *current() { return _current; }
187 
188  void initPhase();
189 
190  // Register a process with the scheduler.
191  void reg(Process *p);
192 
193  // Run the next process, if there is one.
194  void yield();
195 
196  // Put a process on the ready list.
197  void ready(Process *p);
198 
199  // Mark a process as ready if init is finished, or put it on the list of
200  // processes to be initialized.
201  void resume(Process *p);
202 
203  // Remove a process from the ready/init list if it was on one of them, and
204  // return if it was.
205  bool suspend(Process *p);
206 
207  // Schedule an update for a given channel.
208  void requestUpdate(Channel *c);
209  // Same as above, but may be called from a different thread.
211 
212  // Run the given process immediately, preempting whatever may be running.
213  void
215  {
216  // This function may put a process on the wrong list, ie a thread
217  // the method list. That's fine since that's just a performance
218  // optimization, and the important thing here is how the processes are
219  // ordered.
220 
221  // If a process is running, schedule it/us to run again.
222  if (_current)
224  // Schedule p to run first.
226  yield();
227  }
228 
229  // Run this process at the next opportunity.
230  void
232  {
233  // Like above, it's ok if this isn't a method. Putting it on this list
234  // just gives it priority.
236  if (!inEvaluate())
238  }
239 
240  // Set an event queue for scheduling events.
241  void setEventQueue(EventQueue *_eq) { eq = _eq; }
242 
243  // Get the current time according to gem5.
244  Tick getCurTick() { return eq ? eq->getCurTick() : 0; }
245 
246  Tick
247  delayed(const ::sc_core::sc_time &delay)
248  {
249  return getCurTick() + delay.value();
250  }
251 
252  // For scheduling delayed/timed notifications/timeouts.
253  void
254  schedule(ScEvent *event, const ::sc_core::sc_time &delay)
255  {
256  Tick tick = delayed(delay);
257  if (tick < getCurTick())
258  tick = getCurTick();
259 
260  // Delta notification/timeout.
261  if (delay.value() == 0) {
262  event->schedule(deltas, tick);
263  if (!inEvaluate() && !inUpdate())
265  return;
266  }
267 
268  // Timed notification/timeout.
269  auto it = timeSlots.begin();
270  while (it != timeSlots.end() && (*it)->targeted_when < tick)
271  it++;
272  if (it == timeSlots.end() || (*it)->targeted_when != tick) {
273  it = timeSlots.emplace(it, acquireTimeSlot(tick));
274  schedule(*it, tick);
275  }
276  event->schedule((*it)->events, tick);
277  }
278 
279  // For descheduling delayed/timed notifications/timeouts.
280  void
282  {
283  ScEvents *on = event->scheduledOn();
284 
285  if (on == &deltas) {
286  event->deschedule();
287  return;
288  }
289 
290  // Timed notification/timeout.
291  auto tsit = timeSlots.begin();
292  while (tsit != timeSlots.end() &&
293  (*tsit)->targeted_when < event->when())
294  tsit++;
295 
296  panic_if(tsit == timeSlots.end() ||
297  (*tsit)->targeted_when != event->when(),
298  "Descheduling event at time with no events.");
299  TimeSlot *ts = *tsit;
300  ScEvents &events = ts->events;
301  assert(on == &events);
302  event->deschedule();
303 
304  // If no more events are happening at this time slot, get rid of it.
305  if (events.empty()) {
306  deschedule(ts);
307  timeSlots.erase(tsit);
308  }
309  }
310 
311  void
313  {
314  assert(ts == timeSlots.front());
315  timeSlots.erase(timeSlots.begin());
316  if (!runToTime && starved())
319  }
320 
321  // Pending activity ignores gem5 activity, much like how a systemc
322  // simulation wouldn't know about asynchronous external events (socket IO
323  // for instance) that might happen before time advances in a pure
324  // systemc simulation. Also the spec lists what specific types of pending
325  // activity needs to be counted, which obviously doesn't include gem5
326  // events.
327 
328  // Return whether there's pending systemc activity at this time.
329  bool
331  {
332  return !readyListMethods.empty() || !readyListThreads.empty() ||
333  !updateList.empty() || !deltas.empty();
334  }
335 
336  // Return whether there are pending timed notifications or timeouts.
337  bool
339  {
340  return !timeSlots.empty();
341  }
342 
343  // Return how many ticks there are until the first pending event, if any.
344  Tick
346  {
347  if (pendingCurr())
348  return 0;
349  if (pendingFuture())
350  return timeSlots.front()->targeted_when - getCurTick();
351  return MaxTick - getCurTick();
352  }
353 
354  // Run scheduled channel updates.
355  void runUpdate();
356 
357  // Run delta events.
358  void runDelta();
359 
360  void start(Tick max_tick, bool run_to_time);
361  void oneCycle();
362 
363  void schedulePause();
364  void scheduleStop(bool finish_delta);
365 
366  enum Status
367  {
375  };
376 
379 
380  bool paused() { return status() == StatusPaused; }
381  bool stopped() { return status() == StatusStopped; }
382  bool inEvaluate() { return status() == StatusEvaluate; }
383  bool inUpdate() { return status() == StatusUpdate; }
384  bool inDelta() { return status() == StatusDelta; }
385  bool inTiming() { return status() == StatusTiming; }
386 
387  uint64_t changeStamp() { return _changeStamp; }
389 
390  // Throw upwards, either to sc_main or to the report handler if sc_main
391  // isn't running.
392  void throwUp();
393 
394  Status status() { return _status; }
395  void status(Status s) { _status = s; }
396 
399 
400  TimeSlot*
402  {
403  TimeSlot *ts = nullptr;
404  if (!freeTimeSlots.empty()) {
405  ts = freeTimeSlots.top();
406  freeTimeSlots.pop();
407  } else {
408  ts = new TimeSlot(this);
409  }
410  ts->targeted_when = tick;
411  ts->events.clear();
412  return ts;
413  }
414 
415  void
417  {
418  freeTimeSlots.push(ts);
419  }
420 
421  private:
424 
431 
433 
434  // For gem5 style events.
435  void
437  {
438  if (initDone)
439  eq->schedule(event, tick);
440  else
441  eventsToSchedule[event] = tick;
442  }
443 
445 
446  void
448  {
449  if (initDone)
450  eq->deschedule(event);
451  else
452  eventsToSchedule.erase(event);
453  }
454 
457  std::stack<TimeSlot*> freeTimeSlots;
458 
459  Process *
461  {
463  return p ? p : readyListThreads.getNext();
464  }
465 
466  void runReady();
468  void scheduleReadyEvent();
469 
470  void pause();
471  void stop();
474 
475  const ::sc_core::sc_report *_throwUp;
476 
477  bool
479  {
480  return (readyListMethods.empty() && readyListThreads.empty() &&
481  updateList.empty() && deltas.empty() &&
482  (timeSlots.empty() ||
483  timeSlots.front()->targeted_when > maxTick) &&
484  initList.empty());
485  }
488 
490  bool _started;
491  bool _stopNow;
492 
494 
497  void
499  {
500  if (lastReadyTick != getCurTick())
501  _changeStamp++;
502  pause();
503  }
505 
506  void timeAdvances() { trace(false); }
508  void
510  {
511  if (!traceFiles.empty() && !timeAdvancesEvent.scheduled())
513  }
514 
515  uint64_t _numCycles;
516  uint64_t _changeStamp;
517 
519 
520  bool initDone;
521  bool runToTime;
522  bool runOnce;
523 
525 
528 
530 
532  std::mutex asyncListMutex;
533  std::atomic<bool> hasAsyncUpdate;
534 
535  std::map<::Event *, Tick> eventsToSchedule;
536 
537  std::set<TraceFile *> traceFiles;
538 
539  void trace(bool delta);
540 };
541 
542 extern Scheduler scheduler;
543 
544 // A proxy function to avoid having to expose the scheduler in header files.
546 
547 inline void
549 {
552 
553  try {
554  while (!events.empty())
555  events.front()->run();
556  } catch (...) {
557  if (events.empty())
559  else
560  scheduler.schedule(this);
561  scheduler.throwUp();
562  }
563 
566 }
567 
568 const ::sc_core::sc_report reportifyException();
569 
570 } // namespace sc_gem5
571 
572 #endif // __SYSTEMC_CORE_SCHEDULER_H__
sc_gem5::Scheduler::reg
void reg(Process *p)
Definition: scheduler.cc:146
sc_gem5::Scheduler::readyEvent
EventWrapper< Scheduler, &Scheduler::runReady > readyEvent
Definition: scheduler.hh:467
sc_gem5::reportifyException
const ::sc_core::sc_report reportifyException()
Definition: scheduler.cc:505
Event::scheduled
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:462
EventBase::AutoDelete
static const FlagsType AutoDelete
Definition: eventq.hh:104
sc_gem5::Scheduler::StatusStopped
@ StatusStopped
Definition: scheduler.hh:374
sc_gem5::Scheduler::delayed
Tick delayed(const ::sc_core::sc_time &delay)
Definition: scheduler.hh:247
sc_gem5::Scheduler::resume
void resume(Process *p)
Definition: scheduler.cc:216
sc_gem5::Scheduler::initList
ProcessList initList
Definition: scheduler.hh:524
sc_gem5::Scheduler::DefaultPriority
static Priority DefaultPriority
Definition: scheduler.hh:423
sc_gem5::Scheduler::maxTickFunc
void maxTickFunc()
Definition: scheduler.hh:498
sc_gem5::Scheduler::scheduleTimeAdvancesEvent
void scheduleTimeAdvancesEvent()
Definition: scheduler.hh:509
sc_gem5::Scheduler::scheduleStop
void scheduleStop(bool finish_delta)
Definition: scheduler.cc:469
sc_gem5::Scheduler::inTiming
bool inTiming()
Definition: scheduler.hh:385
sc_gem5::Scheduler::deschedule
void deschedule(ScEvent *event)
Definition: scheduler.hh:281
sc_gem5::Scheduler::ReadyPriority
static Priority ReadyPriority
Definition: scheduler.hh:428
sc_gem5::Scheduler::_numCycles
uint64_t _numCycles
Definition: scheduler.hh:515
sc_gem5::Scheduler::MaxTickPriority
static Priority MaxTickPriority
Definition: scheduler.hh:427
sc_gem5::Scheduler::pendingCurr
bool pendingCurr()
Definition: scheduler.hh:330
sc_gem5::Scheduler::StatusPaused
@ StatusPaused
Definition: scheduler.hh:373
sc_gem5::Scheduler::TimeSlot::TimeSlot
TimeSlot(Scheduler *scheduler)
Definition: scheduler.hh:156
sc_gem5::Scheduler::asyncRequestUpdate
void asyncRequestUpdate(Channel *c)
Definition: scheduler.cc:258
sc_gem5::Scheduler::updateList
ChannelList updateList
Definition: scheduler.hh:529
sc_gem5::Event
Definition: event.hh:58
sc_gem5::Scheduler::StatusDelta
@ StatusDelta
Definition: scheduler.hh:371
sc_gem5::Scheduler::elaborationDone
void elaborationDone(bool b)
Definition: scheduler.hh:378
EventWrapper
Definition: eventq.hh:1081
sc_gem5::Scheduler::Scheduler
Scheduler()
Definition: scheduler.cc:46
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:59
sc_gem5::Scheduler::getCurTick
Tick getCurTick()
Definition: scheduler.hh:244
sc_gem5::Scheduler::Status
Status
Definition: scheduler.hh:366
sc_gem5::Scheduler::Priority
const typedef EventBase::Priority Priority
Definition: scheduler.hh:422
sc_gem5::Scheduler::timeSlots
TimeSlots timeSlots
Definition: scheduler.hh:456
X86ISA::tf
Bitfield< 8 > tf
Definition: misc.hh:569
sc_gem5::Scheduler::stopped
bool stopped()
Definition: scheduler.hh:381
sc_gem5::Scheduler::inUpdate
bool inUpdate()
Definition: scheduler.hh:383
sc_gem5::Scheduler
Definition: scheduler.hh:148
sc_gem5::Scheduler::_throwUp
const ::sc_core::sc_report * _throwUp
Definition: scheduler.hh:475
sc_gem5::Scheduler::deltas
ScEvents deltas
Definition: scheduler.hh:455
sc_gem5::Scheduler::asyncListMutex
std::mutex asyncListMutex
Definition: scheduler.hh:532
sc_gem5::Scheduler::TimeSlots
std::list< TimeSlot * > TimeSlots
Definition: scheduler.hh:176
sc_gem5::Scheduler::runOnce
bool runOnce
Definition: scheduler.hh:522
sc_gem5::Scheduler::StarvationPriority
static Priority StarvationPriority
Definition: scheduler.hh:429
sc_gem5::Scheduler::changeStamp
uint64_t changeStamp()
Definition: scheduler.hh:387
EventQueue::getCurTick
Tick getCurTick() const
While curTick() is useful for any object assigned to this event queue, if an object that is assigned ...
Definition: eventq.hh:854
sc_gem5::Scheduler::maxTickEvent
EventWrapper< Scheduler, &Scheduler::maxTickFunc > maxTickEvent
Definition: scheduler.hh:504
sc_gem5::Scheduler::timeAdvances
void timeAdvances()
Definition: scheduler.hh:506
sc_gem5::Scheduler::ready
void ready(Process *p)
Definition: scheduler.cc:199
sc_gem5::Scheduler::ScEvents
std::list< ScEvent * > ScEvents
Definition: scheduler.hh:151
sc_gem5::Scheduler::releaseTimeSlot
void releaseTimeSlot(TimeSlot *ts)
Definition: scheduler.hh:416
sc_gem5::Scheduler::scheduleReadyEvent
void scheduleReadyEvent()
Definition: scheduler.cc:266
sc_gem5::Scheduler::numCycles
uint64_t numCycles()
Definition: scheduler.hh:185
ArmISA::ts
Bitfield< 55, 52 > ts
Definition: miscregs_types.hh:89
sc_gem5::Scheduler::deschedule
void deschedule(::Event *event)
Definition: scheduler.hh:447
sc_gem5::Scheduler::pause
void pause()
Definition: scheduler.cc:363
sc_gem5::NodeList::pushFirst
void pushFirst(T *t)
Definition: list.hh:72
sc_gem5::Scheduler::hasAsyncUpdate
std::atomic< bool > hasAsyncUpdate
Definition: scheduler.hh:533
sc_gem5::Scheduler::status
Status status()
Definition: scheduler.hh:394
sc_gem5::Scheduler::TimeSlot::targeted_when
Tick targeted_when
Definition: scheduler.hh:161
sc_gem5::Scheduler::pauseEvent
EventWrapper< Scheduler, &Scheduler::pause > pauseEvent
Definition: scheduler.hh:472
Fiber
This class represents a fiber, which is a light weight sort of thread which is cooperatively schedule...
Definition: fiber.hh:68
sc_gem5::Scheduler::throwUp
void throwUp()
Definition: scheduler.cc:455
sc_gem5::Scheduler::TimeSlot::process
void process() override
Definition: scheduler.hh:548
sc_gem5::Scheduler::lastReadyTick
Tick lastReadyTick
Definition: scheduler.hh:496
sc_gem5::Scheduler::~Scheduler
~Scheduler()
Definition: scheduler.cc:59
MipsISA::event
Bitfield< 10, 5 > event
Definition: pra_constants.hh:297
sc_gem5::Scheduler::StatusEvaluate
@ StatusEvaluate
Definition: scheduler.hh:369
sc_gem5::Scheduler::runNow
void runNow(Process *p)
Definition: scheduler.hh:214
sc_gem5::Scheduler::yield
void yield()
Definition: scheduler.cc:160
sched_event.hh
sc_gem5::Scheduler::_stopNow
bool _stopNow
Definition: scheduler.hh:491
sc_gem5::getCurrentProcess
Process * getCurrentProcess()
Definition: scheduler.cc:491
sc_gem5::Scheduler::_status
Status _status
Definition: scheduler.hh:493
sc_gem5::TraceFile
Definition: tracefile.hh:190
sc_gem5::NodeList::empty
bool empty()
Definition: list.hh:111
sc_gem5::Scheduler::unregisterTraceFile
void unregisterTraceFile(TraceFile *tf)
Definition: scheduler.hh:398
sc_gem5::Scheduler::runReady
void runReady()
Definition: scheduler.cc:287
sc_gem5::Scheduler::clear
void clear()
Definition: scheduler.cc:67
sc_gem5::Scheduler::initPhase
void initPhase()
Definition: scheduler.cc:109
sc_gem5::Scheduler::StatusTiming
@ StatusTiming
Definition: scheduler.hh:372
EventBase::Maximum_Pri
static const Priority Maximum_Pri
Maximum priority.
Definition: eventq.hh:238
sc_gem5::Scheduler::StopPriority
static Priority StopPriority
Definition: scheduler.hh:425
sc_gem5::Scheduler::readyListMethods
ProcessList readyListMethods
Definition: scheduler.hh:526
sc_gem5::Scheduler::schedulePause
void schedulePause()
Definition: scheduler.cc:446
sc_gem5::Scheduler::_elaborationDone
bool _elaborationDone
Definition: scheduler.hh:489
sc_gem5::Scheduler::suspend
bool suspend(Process *p)
Definition: scheduler.cc:235
sc_gem5::Scheduler::initDone
bool initDone
Definition: scheduler.hh:520
channel.hh
core.hh
sc_gem5::Process
Definition: process.hh:62
sc_gem5::Scheduler::schedule
void schedule(::Event *event)
Definition: scheduler.hh:444
sc_gem5::Scheduler::scheduleStarvationEvent
void scheduleStarvationEvent()
Definition: scheduler.cc:277
sc_gem5::Scheduler::schedule
void schedule(::Event *event, Tick tick)
Definition: scheduler.hh:436
sc_gem5::Scheduler::stopEvent
EventWrapper< Scheduler, &Scheduler::stop > stopEvent
Definition: scheduler.hh:473
sc_gem5::Scheduler::elaborationDone
bool elaborationDone()
Definition: scheduler.hh:377
sc_gem5::Scheduler::_changeStamp
uint64_t _changeStamp
Definition: scheduler.hh:516
process.hh
sc_gem5::Scheduler::starved
bool starved()
Definition: scheduler.hh:478
sc_gem5::Scheduler::eventsToSchedule
std::map<::Event *, Tick > eventsToSchedule
Definition: scheduler.hh:535
sc_gem5::NodeList::getNext
T * getNext()
Definition: list.hh:106
sc_gem5::Scheduler::stop
void stop()
Definition: scheduler.cc:380
EventQueue::schedule
void schedule(Event *event, Tick when, bool global=false)
Schedule the given event on this queue.
Definition: eventq.hh:761
sc_gem5::Scheduler::TimeSlot::parent_scheduler
Scheduler * parent_scheduler
Definition: scheduler.hh:162
sc_gem5::Scheduler::name
const std::string name() const
Definition: scheduler.hh:183
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:197
sc_gem5::Scheduler::requestUpdate
void requestUpdate(Channel *c)
Definition: scheduler.cc:250
sc_gem5::Scheduler::stepChangeStamp
void stepChangeStamp()
Definition: scheduler.hh:388
sc_gem5::Scheduler::current
Process * current()
Definition: scheduler.hh:186
sc_gem5::Scheduler::_current
Process * _current
Definition: scheduler.hh:518
ArmISA::b
Bitfield< 7 > b
Definition: miscregs_types.hh:376
sc_gem5::Scheduler::TimeSlot::releaseImpl
void releaseImpl() override
Definition: scheduler.hh:168
sc_gem5::ChannelList
NodeList< Channel > ChannelList
Definition: scheduler.hh:55
sc_gem5::Scheduler::status
void status(Status s)
Definition: scheduler.hh:395
sc_gem5::Scheduler::_started
bool _started
Definition: scheduler.hh:490
sc_gem5::Scheduler::oneCycle
void oneCycle()
Definition: scheduler.cc:438
sc_gem5::Scheduler::StatusUpdate
@ StatusUpdate
Definition: scheduler.hh:370
sc_gem5::Scheduler::runNext
void runNext(Process *p)
Definition: scheduler.hh:231
sc_gem5::Scheduler::runDelta
void runDelta()
Definition: scheduler.cc:350
sc_gem5::Scheduler::TimeAdvancesPriority
static Priority TimeAdvancesPriority
Definition: scheduler.hh:430
list.hh
EventQueue::deschedule
void deschedule(Event *event)
Deschedule the specified event.
Definition: eventq.hh:794
EventBase::Default_Pri
static const Priority Default_Pri
Default is zero for historical reasons.
Definition: eventq.hh:176
sc_gem5::Scheduler::TimeSlot::events
ScEvents events
Definition: scheduler.hh:163
sc_gem5::Scheduler::setEventQueue
void setEventQueue(EventQueue *_eq)
Definition: scheduler.hh:241
sc_gem5::Scheduler::timeAdvancesEvent
EventWrapper< Scheduler, &Scheduler::timeAdvances > timeAdvancesEvent
Definition: scheduler.hh:507
sc_gem5::Scheduler::inEvaluate
bool inEvaluate()
Definition: scheduler.hh:382
sc_gem5::Scheduler::start
void start(Tick max_tick, bool run_to_time)
Definition: scheduler.cc:400
logging.hh
sc_gem5::Scheduler::completeTimeSlot
void completeTimeSlot(TimeSlot *ts)
Definition: scheduler.hh:312
sc_gem5::Scheduler::eq
EventQueue * eq
Definition: scheduler.hh:432
sc_gem5::Scheduler::trace
void trace(bool delta)
Definition: scheduler.cc:484
sc_gem5::Scheduler::timeToPending
Tick timeToPending()
Definition: scheduler.hh:345
sc_gem5::Scheduler::freeTimeSlots
std::stack< TimeSlot * > freeTimeSlots
Definition: scheduler.hh:457
sc_gem5::Scheduler::PausePriority
static Priority PausePriority
Definition: scheduler.hh:426
ArmISA::c
Bitfield< 29 > c
Definition: miscregs_types.hh:50
sc_gem5::Scheduler::schedule
void schedule(ScEvent *event, const ::sc_core::sc_time &delay)
Definition: scheduler.hh:254
sc_gem5::Scheduler::paused
bool paused()
Definition: scheduler.hh:380
sc_gem5
Definition: sc_clock.cc:42
sc_gem5::Scheduler::inDelta
bool inDelta()
Definition: scheduler.hh:384
sc_gem5::Scheduler::asyncUpdateList
ChannelList asyncUpdateList
Definition: scheduler.hh:531
sc_gem5::NodeList< Process >
EventBase::Priority
int8_t Priority
Definition: eventq.hh:120
EventQueue
Queue of events sorted in time order.
Definition: eventq.hh:619
sc_gem5::Scheduler::runUpdate
void runUpdate()
Definition: scheduler.cc:326
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
sc_gem5::Scheduler::acquireTimeSlot
TimeSlot * acquireTimeSlot(Tick tick)
Definition: scheduler.hh:401
std::list< ScEvent * >
sc_gem5::Scheduler::pendingFuture
bool pendingFuture()
Definition: scheduler.hh:338
sc_gem5::Scheduler::registerTraceFile
void registerTraceFile(TraceFile *tf)
Definition: scheduler.hh:397
sc_gem5::scheduler
Scheduler scheduler
Definition: scheduler.cc:490
ArmISA::s
Bitfield< 4 > s
Definition: miscregs_types.hh:556
sc_gem5::Channel
Definition: channel.hh:39
sc_gem5::Scheduler::readyListThreads
ProcessList readyListThreads
Definition: scheduler.hh:527
MipsISA::on
Bitfield< 0 > on
Definition: dt_constants.hh:87
sc_gem5::Scheduler::starvationEvent
EventWrapper< Scheduler, &Scheduler::pause > starvationEvent
Definition: scheduler.hh:486
sc_gem5::Scheduler::runToTime
bool runToTime
Definition: scheduler.hh:521
sc_gem5::Scheduler::StatusOther
@ StatusOther
Definition: scheduler.hh:368
sc_gem5::Scheduler::traceFiles
std::set< TraceFile * > traceFiles
Definition: scheduler.hh:537
MaxTick
const Tick MaxTick
Definition: types.hh:61
sc_gem5::ScEvent
Definition: sched_event.hh:43
sc_gem5::Scheduler::getNextReady
Process * getNextReady()
Definition: scheduler.hh:460
sc_gem5::Scheduler::TimeSlot
Definition: scheduler.hh:153
sc_gem5::Scheduler::maxTick
Tick maxTick
Definition: scheduler.hh:495
sc_gem5::ProcessList
NodeList< Process > ProcessList
Definition: scheduler.hh:52
eventq.hh

Generated on Tue Jun 22 2021 15:28:28 for gem5 by doxygen 1.8.17