gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
sc_gem5::Scheduler Class Reference

#include <scheduler.hh>

Classes

class  TimeSlot
 

Public Types

enum  Status {
  StatusOther = 0, StatusEvaluate, StatusUpdate, StatusDelta,
  StatusTiming, StatusPaused, StatusStopped
}
 
typedef std::list< ScEvent * > ScEvents
 
typedef std::map< Tick, TimeSlot * > TimeSlots
 

Public Member Functions

 Scheduler ()
 
 ~Scheduler ()
 
void clear ()
 
const std::string name () const
 
uint64_t numCycles ()
 
Processcurrent ()
 
void initPhase ()
 
void reg (Process *p)
 
void yield ()
 
void ready (Process *p)
 
void resume (Process *p)
 
bool suspend (Process *p)
 
void requestUpdate (Channel *c)
 
void asyncRequestUpdate (Channel *c)
 
void runNow (Process *p)
 
void runNext (Process *p)
 
void setEventQueue (EventQueue *_eq)
 
Tick getCurTick ()
 
Tick delayed (const ::sc_core::sc_time &delay)
 
void schedule (ScEvent *event, const ::sc_core::sc_time &delay)
 
void deschedule (ScEvent *event)
 
void completeTimeSlot (TimeSlot *ts)
 
bool pendingCurr ()
 
bool pendingFuture ()
 
Tick timeToPending ()
 
void runUpdate ()
 
void runDelta ()
 
void start (Tick max_tick, bool run_to_time)
 
void oneCycle ()
 
void schedulePause ()
 
void scheduleStop (bool finish_delta)
 
bool elaborationDone ()
 
void elaborationDone (bool b)
 
bool paused ()
 
bool stopped ()
 
bool inEvaluate ()
 
bool inUpdate ()
 
bool inDelta ()
 
bool inTiming ()
 
uint64_t changeStamp ()
 
void stepChangeStamp ()
 
void throwUp ()
 
Status status ()
 
void status (Status s)
 
void registerTraceFile (TraceFile *tf)
 
void unregisterTraceFile (TraceFile *tf)
 

Private Types

typedef const EventBase::Priority Priority
 

Private Member Functions

void schedule (::Event *event, Tick tick)
 
void schedule (::Event *event)
 
void deschedule (::Event *event)
 
ProcessgetNextReady ()
 
void runReady ()
 
void scheduleReadyEvent ()
 
void pause ()
 
void stop ()
 
bool starved ()
 
void scheduleStarvationEvent ()
 
void maxTickFunc ()
 
void timeAdvances ()
 
void scheduleTimeAdvancesEvent ()
 
void trace (bool delta)
 

Private Attributes

EventQueueeq
 
ScEvents deltas
 
TimeSlots timeSlots
 
EventWrapper< Scheduler, &Scheduler::runReadyreadyEvent
 
EventWrapper< Scheduler, &Scheduler::pausepauseEvent
 
EventWrapper< Scheduler, &Scheduler::stopstopEvent
 
const ::sc_core::sc_report_throwUp
 
EventWrapper< Scheduler, &Scheduler::pausestarvationEvent
 
bool _elaborationDone
 
bool _started
 
bool _stopNow
 
Status _status
 
Tick maxTick
 
Tick lastReadyTick
 
EventWrapper< Scheduler, &Scheduler::maxTickFuncmaxTickEvent
 
EventWrapper< Scheduler, &Scheduler::timeAdvancestimeAdvancesEvent
 
uint64_t _numCycles
 
uint64_t _changeStamp
 
Process_current
 
bool initDone
 
bool runToTime
 
bool runOnce
 
ProcessList initList
 
ProcessList readyListMethods
 
ProcessList readyListThreads
 
ChannelList updateList
 
ChannelList asyncUpdateList
 
std::mutex asyncListMutex
 
std::map<::Event *, TickeventsToSchedule
 
std::set< TraceFile * > traceFiles
 

Static Private Attributes

static Priority DefaultPriority = EventBase::Default_Pri
 
static Priority StopPriority = DefaultPriority - 1
 
static Priority PausePriority = DefaultPriority + 1
 
static Priority MaxTickPriority = DefaultPriority + 2
 
static Priority ReadyPriority = DefaultPriority + 3
 
static Priority StarvationPriority = ReadyPriority
 
static Priority TimeAdvancesPriority = EventBase::Maximum_Pri
 

Detailed Description

Definition at line 148 of file scheduler.hh.

Member Typedef Documentation

◆ Priority

Definition at line 380 of file scheduler.hh.

◆ ScEvents

Definition at line 151 of file scheduler.hh.

◆ TimeSlots

Definition at line 162 of file scheduler.hh.

Member Enumeration Documentation

◆ Status

Enumerator
StatusOther 
StatusEvaluate 
StatusUpdate 
StatusDelta 
StatusTiming 
StatusPaused 
StatusStopped 

Definition at line 345 of file scheduler.hh.

Constructor & Destructor Documentation

◆ Scheduler()

Scheduler::Scheduler ( )

Definition at line 48 of file scheduler.cc.

◆ ~Scheduler()

Scheduler::~Scheduler ( )

Definition at line 61 of file scheduler.cc.

References clear().

Member Function Documentation

◆ asyncRequestUpdate()

void Scheduler::asyncRequestUpdate ( Channel c)

◆ changeStamp()

uint64_t sc_gem5::Scheduler::changeStamp ( )
inline

◆ clear()

void Scheduler::clear ( )

◆ completeTimeSlot()

void sc_gem5::Scheduler::completeTimeSlot ( TimeSlot ts)
inline

◆ current()

Process* sc_gem5::Scheduler::current ( )
inline

◆ delayed()

Tick sc_gem5::Scheduler::delayed ( const ::sc_core::sc_time delay)
inline

Definition at line 233 of file scheduler.hh.

References getCurTick().

Referenced by sc_gem5::Event::notify(), and schedule().

◆ deschedule() [1/2]

void sc_gem5::Scheduler::deschedule ( ScEvent event)
inline

◆ deschedule() [2/2]

void sc_gem5::Scheduler::deschedule ( ::Event event)
inlineprivate

Definition at line 405 of file scheduler.hh.

References EventQueue::deschedule(), eventsToSchedule, and initDone.

◆ elaborationDone() [1/2]

bool sc_gem5::Scheduler::elaborationDone ( )
inline

Definition at line 356 of file scheduler.hh.

References _elaborationDone.

Referenced by sc_core::sc_simcontext::elaboration_done(), and sc_gem5::Kernel::init().

◆ elaborationDone() [2/2]

void sc_gem5::Scheduler::elaborationDone ( bool  b)
inline

Definition at line 357 of file scheduler.hh.

References _elaborationDone, and ArmISA::b.

◆ getCurTick()

Tick sc_gem5::Scheduler::getCurTick ( )
inline

◆ getNextReady()

Process* sc_gem5::Scheduler::getNextReady ( )
inlineprivate

Definition at line 417 of file scheduler.hh.

References sc_gem5::NodeList< T >::getNext(), MipsISA::p, readyListMethods, readyListThreads, and runReady().

Referenced by runReady(), and yield().

◆ inDelta()

bool sc_gem5::Scheduler::inDelta ( )
inline

Definition at line 363 of file scheduler.hh.

References status(), and StatusDelta.

◆ inEvaluate()

bool sc_gem5::Scheduler::inEvaluate ( )
inline

Definition at line 361 of file scheduler.hh.

References status(), and StatusEvaluate.

Referenced by ready(), requestUpdate(), runNext(), and schedule().

◆ initPhase()

void Scheduler::initPhase ( )

◆ inTiming()

bool sc_gem5::Scheduler::inTiming ( )
inline

Definition at line 364 of file scheduler.hh.

References status(), and StatusTiming.

◆ inUpdate()

bool sc_gem5::Scheduler::inUpdate ( )
inline

Definition at line 362 of file scheduler.hh.

References status(), and StatusUpdate.

Referenced by sc_gem5::Event::notify(), and schedule().

◆ maxTickFunc()

void sc_gem5::Scheduler::maxTickFunc ( )
inlineprivate

Definition at line 454 of file scheduler.hh.

References _changeStamp, getCurTick(), and pause().

◆ name()

const std::string sc_gem5::Scheduler::name ( ) const
inline

Definition at line 169 of file scheduler.hh.

◆ numCycles()

uint64_t sc_gem5::Scheduler::numCycles ( )
inline

Definition at line 171 of file scheduler.hh.

References _numCycles.

Referenced by sc_core::sc_delta_count().

◆ oneCycle()

void Scheduler::oneCycle ( )

Definition at line 439 of file scheduler.cc.

References MaxTick, runOnce, scheduleReadyEvent(), and start().

Referenced by sc_core::sc_start(), and timeToPending().

◆ pause()

void Scheduler::pause ( )
private

◆ paused()

bool sc_gem5::Scheduler::paused ( )
inline

Definition at line 359 of file scheduler.hh.

References status(), and StatusPaused.

◆ pendingCurr()

bool sc_gem5::Scheduler::pendingCurr ( )
inline

◆ pendingFuture()

bool sc_gem5::Scheduler::pendingFuture ( )
inline

Definition at line 317 of file scheduler.hh.

References timeSlots.

Referenced by sc_core::sc_pending_activity_at_future_time(), and timeToPending().

◆ ready()

void Scheduler::ready ( Process p)

◆ reg()

void Scheduler::reg ( Process p)

◆ registerTraceFile()

void sc_gem5::Scheduler::registerTraceFile ( TraceFile tf)
inline

Definition at line 376 of file scheduler.hh.

References traceFiles.

Referenced by sc_core::sc_create_vcd_trace_file().

◆ requestUpdate()

void Scheduler::requestUpdate ( Channel c)

◆ resume()

void Scheduler::resume ( Process p)

Definition at line 219 of file scheduler.cc.

References initDone, initList, sc_gem5::NodeList< T >::pushLast(), and ready().

Referenced by current(), and sc_gem5::Process::resume().

◆ runDelta()

void Scheduler::runDelta ( )

Definition at line 351 of file scheduler.cc.

References deltas, status(), StatusDelta, and throwUp().

Referenced by initPhase(), runReady(), and timeToPending().

◆ runNext()

void sc_gem5::Scheduler::runNext ( Process p)
inline

◆ runNow()

void sc_gem5::Scheduler::runNow ( Process p)
inline

◆ runReady()

void Scheduler::runReady ( )
private

◆ runUpdate()

void Scheduler::runUpdate ( )

◆ schedule() [1/3]

void sc_gem5::Scheduler::schedule ( ScEvent event,
const ::sc_core::sc_time delay 
)
inline

◆ schedule() [2/3]

void sc_gem5::Scheduler::schedule ( ::Event event,
Tick  tick 
)
inlineprivate

Definition at line 394 of file scheduler.hh.

References MipsISA::event, eventsToSchedule, initDone, and EventQueue::schedule().

◆ schedule() [3/3]

void sc_gem5::Scheduler::schedule ( ::Event event)
inlineprivate

Definition at line 402 of file scheduler.hh.

References getCurTick(), and schedule().

Referenced by schedule().

◆ schedulePause()

void Scheduler::schedulePause ( )

Definition at line 447 of file scheduler.cc.

References pauseEvent, and schedule().

Referenced by runReady(), sc_core::sc_pause(), and timeToPending().

◆ scheduleReadyEvent()

void Scheduler::scheduleReadyEvent ( )
private

Definition at line 268 of file scheduler.cc.

References deschedule(), readyEvent, schedule(), and starvationEvent.

Referenced by oneCycle(), ready(), requestUpdate(), runNext(), and schedule().

◆ scheduleStarvationEvent()

void Scheduler::scheduleStarvationEvent ( )
private

Definition at line 279 of file scheduler.cc.

References deschedule(), readyEvent, schedule(), and starvationEvent.

Referenced by completeTimeSlot(), initPhase(), runReady(), and start().

◆ scheduleStop()

void Scheduler::scheduleStop ( bool  finish_delta)

Definition at line 470 of file scheduler.cc.

References _stopNow, clear(), schedule(), and stopEvent.

Referenced by sc_core::sc_stop(), sc_gem5::Kernel::t0Handler(), and timeToPending().

◆ scheduleTimeAdvancesEvent()

void sc_gem5::Scheduler::scheduleTimeAdvancesEvent ( )
inlineprivate

Definition at line 465 of file scheduler.hh.

References schedule(), Event::scheduled(), and traceFiles.

Referenced by completeTimeSlot(), initPhase(), runReady(), and start().

◆ setEventQueue()

void sc_gem5::Scheduler::setEventQueue ( EventQueue _eq)
inline

Definition at line 227 of file scheduler.hh.

References eq.

Referenced by sc_gem5::Kernel::Kernel().

◆ start()

void Scheduler::start ( Tick  max_tick,
bool  run_to_time 
)

◆ starved()

bool sc_gem5::Scheduler::starved ( )
inlineprivate

◆ status() [1/2]

Status sc_gem5::Scheduler::status ( )
inline

◆ status() [2/2]

void sc_gem5::Scheduler::status ( Status  s)
inline

Definition at line 374 of file scheduler.hh.

References _status, and ArmISA::s.

◆ stepChangeStamp()

void sc_gem5::Scheduler::stepChangeStamp ( )
inline

Definition at line 367 of file scheduler.hh.

References _changeStamp, and throwUp().

Referenced by sc_gem5::Scheduler::TimeSlot::process().

◆ stop()

void Scheduler::stop ( )
private

◆ stopped()

bool sc_gem5::Scheduler::stopped ( )
inline

Definition at line 360 of file scheduler.hh.

References status(), and StatusStopped.

◆ suspend()

bool Scheduler::suspend ( Process p)

◆ throwUp()

void Scheduler::throwUp ( )

◆ timeAdvances()

void sc_gem5::Scheduler::timeAdvances ( )
inlineprivate

Definition at line 462 of file scheduler.hh.

References Event::trace().

◆ timeToPending()

Tick sc_gem5::Scheduler::timeToPending ( )
inline

◆ trace()

void Scheduler::trace ( bool  delta)
private

Definition at line 485 of file scheduler.cc.

References X86ISA::tf, and traceFiles.

Referenced by runReady().

◆ unregisterTraceFile()

void sc_gem5::Scheduler::unregisterTraceFile ( TraceFile tf)
inline

Definition at line 377 of file scheduler.hh.

References traceFiles.

Referenced by sc_core::sc_close_vcd_trace_file().

◆ yield()

void Scheduler::yield ( )

Member Data Documentation

◆ _changeStamp

uint64_t sc_gem5::Scheduler::_changeStamp
private

Definition at line 472 of file scheduler.hh.

Referenced by changeStamp(), maxTickFunc(), runReady(), and stepChangeStamp().

◆ _current

Process* sc_gem5::Scheduler::_current
private

Definition at line 474 of file scheduler.hh.

Referenced by current(), runNow(), runReady(), and yield().

◆ _elaborationDone

bool sc_gem5::Scheduler::_elaborationDone
private

Definition at line 445 of file scheduler.hh.

Referenced by elaborationDone().

◆ _numCycles

uint64_t sc_gem5::Scheduler::_numCycles
private

Definition at line 471 of file scheduler.hh.

Referenced by numCycles(), and runReady().

◆ _started

bool sc_gem5::Scheduler::_started
private

Definition at line 446 of file scheduler.hh.

Referenced by initPhase(), and start().

◆ _status

Status sc_gem5::Scheduler::_status
private

Definition at line 449 of file scheduler.hh.

Referenced by status().

◆ _stopNow

bool sc_gem5::Scheduler::_stopNow
private

Definition at line 447 of file scheduler.hh.

Referenced by ready(), runReady(), and scheduleStop().

◆ _throwUp

const ::sc_core::sc_report* sc_gem5::Scheduler::_throwUp
private

Definition at line 432 of file scheduler.hh.

Referenced by start(), and throwUp().

◆ asyncListMutex

std::mutex sc_gem5::Scheduler::asyncListMutex
private

Definition at line 488 of file scheduler.hh.

Referenced by asyncRequestUpdate(), and runUpdate().

◆ asyncUpdateList

ChannelList sc_gem5::Scheduler::asyncUpdateList
private

Definition at line 487 of file scheduler.hh.

Referenced by asyncRequestUpdate(), and runUpdate().

◆ DefaultPriority

Priority sc_gem5::Scheduler::DefaultPriority = EventBase::Default_Pri
staticprivate

Definition at line 381 of file scheduler.hh.

◆ deltas

ScEvents sc_gem5::Scheduler::deltas
private

Definition at line 413 of file scheduler.hh.

Referenced by clear(), deschedule(), pendingCurr(), runDelta(), and schedule().

◆ eq

EventQueue* sc_gem5::Scheduler::eq
private

Definition at line 390 of file scheduler.hh.

Referenced by getCurTick(), initPhase(), and setEventQueue().

◆ eventsToSchedule

std::map<::Event *, Tick> sc_gem5::Scheduler::eventsToSchedule
private

Definition at line 490 of file scheduler.hh.

Referenced by deschedule(), initPhase(), and schedule().

◆ initDone

bool sc_gem5::Scheduler::initDone
private

Definition at line 476 of file scheduler.hh.

Referenced by deschedule(), initPhase(), reg(), resume(), schedule(), start(), and suspend().

◆ initList

ProcessList sc_gem5::Scheduler::initList
private

Definition at line 480 of file scheduler.hh.

Referenced by clear(), initPhase(), reg(), resume(), and starved().

◆ lastReadyTick

Tick sc_gem5::Scheduler::lastReadyTick
private

Definition at line 452 of file scheduler.hh.

Referenced by runReady(), and start().

◆ maxTick

Tick sc_gem5::Scheduler::maxTick
private

Definition at line 451 of file scheduler.hh.

Referenced by start(), and starved().

◆ maxTickEvent

EventWrapper<Scheduler, &Scheduler::maxTickFunc> sc_gem5::Scheduler::maxTickEvent
private

Definition at line 460 of file scheduler.hh.

Referenced by clear(), and start().

◆ MaxTickPriority

Priority sc_gem5::Scheduler::MaxTickPriority = DefaultPriority + 2
staticprivate

Definition at line 385 of file scheduler.hh.

◆ pauseEvent

EventWrapper<Scheduler, &Scheduler::pause> sc_gem5::Scheduler::pauseEvent
private

Definition at line 429 of file scheduler.hh.

Referenced by clear(), schedulePause(), and start().

◆ PausePriority

Priority sc_gem5::Scheduler::PausePriority = DefaultPriority + 1
staticprivate

Definition at line 384 of file scheduler.hh.

◆ readyEvent

EventWrapper<Scheduler, &Scheduler::runReady> sc_gem5::Scheduler::readyEvent
private

Definition at line 424 of file scheduler.hh.

Referenced by clear(), scheduleReadyEvent(), and scheduleStarvationEvent().

◆ readyListMethods

ProcessList sc_gem5::Scheduler::readyListMethods
private

Definition at line 482 of file scheduler.hh.

Referenced by clear(), getNextReady(), pendingCurr(), ready(), runNext(), runNow(), runReady(), and starved().

◆ readyListThreads

ProcessList sc_gem5::Scheduler::readyListThreads
private

Definition at line 483 of file scheduler.hh.

Referenced by clear(), getNextReady(), pendingCurr(), ready(), runReady(), and starved().

◆ ReadyPriority

Priority sc_gem5::Scheduler::ReadyPriority = DefaultPriority + 3
staticprivate

Definition at line 386 of file scheduler.hh.

◆ runOnce

bool sc_gem5::Scheduler::runOnce
private

Definition at line 478 of file scheduler.hh.

Referenced by oneCycle(), pause(), runReady(), and stop().

◆ runToTime

bool sc_gem5::Scheduler::runToTime
private

Definition at line 477 of file scheduler.hh.

Referenced by completeTimeSlot(), initPhase(), runReady(), and start().

◆ starvationEvent

EventWrapper<Scheduler, &Scheduler::pause> sc_gem5::Scheduler::starvationEvent
private

Definition at line 442 of file scheduler.hh.

Referenced by clear(), scheduleReadyEvent(), scheduleStarvationEvent(), and start().

◆ StarvationPriority

Priority sc_gem5::Scheduler::StarvationPriority = ReadyPriority
staticprivate

Definition at line 387 of file scheduler.hh.

◆ stopEvent

EventWrapper<Scheduler, &Scheduler::stop> sc_gem5::Scheduler::stopEvent
private

Definition at line 430 of file scheduler.hh.

Referenced by clear(), scheduleStop(), and start().

◆ StopPriority

Priority sc_gem5::Scheduler::StopPriority = DefaultPriority - 1
staticprivate

Definition at line 383 of file scheduler.hh.

◆ timeAdvancesEvent

EventWrapper<Scheduler, &Scheduler::timeAdvances> sc_gem5::Scheduler::timeAdvancesEvent
private

Definition at line 463 of file scheduler.hh.

Referenced by clear().

◆ TimeAdvancesPriority

Priority sc_gem5::Scheduler::TimeAdvancesPriority = EventBase::Maximum_Pri
staticprivate

Definition at line 388 of file scheduler.hh.

◆ timeSlots

TimeSlots sc_gem5::Scheduler::timeSlots
private

◆ traceFiles

std::set<TraceFile *> sc_gem5::Scheduler::traceFiles
private

◆ updateList

ChannelList sc_gem5::Scheduler::updateList
private

Definition at line 485 of file scheduler.hh.

Referenced by clear(), pendingCurr(), requestUpdate(), runUpdate(), and starved().


The documentation for this class was generated from the following files:

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