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

--- 319 unchanged lines hidden (view full) ---

328 void schedulePause();
329 void scheduleStop(bool finish_delta);
330
331 bool paused() { return _paused; }
332 bool stopped() { return _stopped; }
333
334 uint64_t changeStamp() { return _changeStamp; }
335
336 void throwToScMain(const ::sc_core::sc_report *r=nullptr);
337
338 private:
339 typedef const EventBase::Priority Priority;
340 static Priority DefaultPriority = EventBase::Default_Pri;
341
342 static Priority StopPriority = DefaultPriority - 1;
343 static Priority PausePriority = DefaultPriority + 1;
344 static Priority MaxTickPriority = DefaultPriority + 2;
345 static Priority ReadyPriority = DefaultPriority + 3;

--- 28 unchanged lines hidden (view full) ---

374 void runReady();
375 EventWrapper<Scheduler, &Scheduler::runReady> readyEvent;
376 void scheduleReadyEvent();
377
378 void pause();
379 void stop();
380 EventWrapper<Scheduler, &Scheduler::pause> pauseEvent;
381 EventWrapper<Scheduler, &Scheduler::stop> stopEvent;
382
383 Fiber *scMain;
384 const ::sc_core::sc_report *_throwToScMain;
385
386 bool
387 starved()
388 {
389 return (readyListMethods.empty() && readyListThreads.empty() &&
390 updateList.empty() && deltas.empty() &&
391 (timeSlots.empty() || timeSlots.begin()->first > maxTick) &&
392 initList.empty());

--- 43 unchanged lines hidden (view full) ---

436inline void
437Scheduler::TimeSlot::process()
438{
439 while (!events.empty())
440 events.front()->run();
441 scheduler.completeTimeSlot(this);
442}
443
444const ::sc_core::sc_report *reportifyException();
445
446} // namespace sc_gem5
447
448#endif // __SYSTEMC_CORE_SCHEDULER_H__