gem5  v20.1.0.0
Classes | Public Types | Public Member Functions | 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 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

const typedef EventBase::Priority Priority
 
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 146 of file scheduler.hh.

Member Typedef Documentation

◆ ScEvents

Definition at line 149 of file scheduler.hh.

◆ TimeSlots

Definition at line 160 of file scheduler.hh.

Member Enumeration Documentation

◆ Status

Enumerator
StatusOther 
StatusEvaluate 
StatusUpdate 
StatusDelta 
StatusTiming 
StatusPaused 
StatusStopped 

Definition at line 343 of file scheduler.hh.

Constructor & Destructor Documentation

◆ Scheduler()

Scheduler::Scheduler ( )

Definition at line 46 of file scheduler.cc.

◆ ~Scheduler()

Scheduler::~Scheduler ( )

Definition at line 59 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 231 of file scheduler.hh.

References getCurTick().

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

◆ deschedule() [1/2]

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

Definition at line 403 of file scheduler.hh.

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

◆ deschedule() [2/2]

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

◆ elaborationDone() [1/2]

bool sc_gem5::Scheduler::elaborationDone ( )
inline

Definition at line 354 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 355 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 415 of file scheduler.hh.

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

Referenced by runReady(), and yield().

◆ inDelta()

bool sc_gem5::Scheduler::inDelta ( )
inline

Definition at line 361 of file scheduler.hh.

References status(), and StatusDelta.

◆ inEvaluate()

bool sc_gem5::Scheduler::inEvaluate ( )
inline

Definition at line 359 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 362 of file scheduler.hh.

References status(), and StatusTiming.

◆ inUpdate()

bool sc_gem5::Scheduler::inUpdate ( )
inline

Definition at line 360 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 452 of file scheduler.hh.

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

◆ name()

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

Definition at line 167 of file scheduler.hh.

◆ numCycles()

uint64_t sc_gem5::Scheduler::numCycles ( )
inline

Definition at line 169 of file scheduler.hh.

References _numCycles.

Referenced by sc_core::sc_delta_count().

◆ oneCycle()

void Scheduler::oneCycle ( )

Definition at line 437 of file scheduler.cc.

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

Referenced by sc_core::sc_start().

◆ pause()

void Scheduler::pause ( )
private

◆ paused()

bool sc_gem5::Scheduler::paused ( )
inline

Definition at line 357 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 315 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 374 of file scheduler.hh.

References X86ISA::tf, and 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 217 of file scheduler.cc.

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

Referenced by sc_gem5::Process::resume().

◆ runDelta()

void Scheduler::runDelta ( )

Definition at line 349 of file scheduler.cc.

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

Referenced by initPhase(), and runReady().

◆ 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 ( ::Event event)
inlineprivate

Definition at line 400 of file scheduler.hh.

References MipsISA::event, getCurTick(), and schedule().

Referenced by schedule().

◆ schedule() [2/3]

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

Definition at line 392 of file scheduler.hh.

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

◆ schedule() [3/3]

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

◆ schedulePause()

void Scheduler::schedulePause ( )

Definition at line 445 of file scheduler.cc.

References pauseEvent, and schedule().

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

◆ scheduleReadyEvent()

void Scheduler::scheduleReadyEvent ( )
private

Definition at line 266 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 277 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 468 of file scheduler.cc.

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

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

◆ scheduleTimeAdvancesEvent()

void sc_gem5::Scheduler::scheduleTimeAdvancesEvent ( )
inlineprivate

Definition at line 463 of file scheduler.hh.

References schedule(), timeAdvancesEvent, and traceFiles.

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

◆ setEventQueue()

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

Definition at line 225 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 372 of file scheduler.hh.

References _status, and ArmISA::s.

◆ stepChangeStamp()

void sc_gem5::Scheduler::stepChangeStamp ( )
inline

Definition at line 365 of file scheduler.hh.

References _changeStamp.

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

◆ stop()

void Scheduler::stop ( )
private

◆ stopped()

bool sc_gem5::Scheduler::stopped ( )
inline

Definition at line 358 of file scheduler.hh.

References status(), and StatusStopped.

◆ suspend()

bool Scheduler::suspend ( Process p)

Definition at line 236 of file scheduler.cc.

References initDone, and MipsISA::p.

Referenced by sc_gem5::Process::suspend().

◆ throwUp()

void Scheduler::throwUp ( )

◆ timeAdvances()

void sc_gem5::Scheduler::timeAdvances ( )
inlineprivate

Definition at line 460 of file scheduler.hh.

References trace().

◆ timeToPending()

Tick sc_gem5::Scheduler::timeToPending ( )
inline

Definition at line 322 of file scheduler.hh.

References getCurTick(), MaxTick, pendingCurr(), pendingFuture(), and timeSlots.

◆ trace()

void Scheduler::trace ( bool  delta)
private

Definition at line 483 of file scheduler.cc.

References X86ISA::tf, and traceFiles.

Referenced by runReady(), and timeAdvances().

◆ unregisterTraceFile()

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

Definition at line 375 of file scheduler.hh.

References X86ISA::tf, and 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 470 of file scheduler.hh.

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

◆ _current

Process* sc_gem5::Scheduler::_current
private

Definition at line 472 of file scheduler.hh.

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

◆ _elaborationDone

bool sc_gem5::Scheduler::_elaborationDone
private

Definition at line 443 of file scheduler.hh.

Referenced by elaborationDone().

◆ _numCycles

uint64_t sc_gem5::Scheduler::_numCycles
private

Definition at line 469 of file scheduler.hh.

Referenced by numCycles(), and runReady().

◆ _started

bool sc_gem5::Scheduler::_started
private

Definition at line 444 of file scheduler.hh.

Referenced by initPhase(), and start().

◆ _status

Status sc_gem5::Scheduler::_status
private

Definition at line 447 of file scheduler.hh.

Referenced by status().

◆ _stopNow

bool sc_gem5::Scheduler::_stopNow
private

Definition at line 445 of file scheduler.hh.

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

◆ _throwUp

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

Definition at line 430 of file scheduler.hh.

Referenced by start(), and throwUp().

◆ asyncListMutex

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

Definition at line 486 of file scheduler.hh.

Referenced by asyncRequestUpdate(), and runUpdate().

◆ asyncUpdateList

ChannelList sc_gem5::Scheduler::asyncUpdateList
private

Definition at line 485 of file scheduler.hh.

Referenced by asyncRequestUpdate(), and runUpdate().

◆ DefaultPriority

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

Definition at line 379 of file scheduler.hh.

◆ deltas

ScEvents sc_gem5::Scheduler::deltas
private

Definition at line 411 of file scheduler.hh.

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

◆ eq

EventQueue* sc_gem5::Scheduler::eq
private

Definition at line 388 of file scheduler.hh.

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

◆ eventsToSchedule

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

Definition at line 488 of file scheduler.hh.

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

◆ initDone

bool sc_gem5::Scheduler::initDone
private

Definition at line 474 of file scheduler.hh.

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

◆ initList

ProcessList sc_gem5::Scheduler::initList
private

Definition at line 478 of file scheduler.hh.

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

◆ lastReadyTick

Tick sc_gem5::Scheduler::lastReadyTick
private

Definition at line 450 of file scheduler.hh.

Referenced by maxTickFunc(), runReady(), and start().

◆ maxTick

Tick sc_gem5::Scheduler::maxTick
private

Definition at line 449 of file scheduler.hh.

Referenced by start(), and starved().

◆ maxTickEvent

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

Definition at line 458 of file scheduler.hh.

Referenced by clear(), and start().

◆ MaxTickPriority

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

Definition at line 383 of file scheduler.hh.

◆ pauseEvent

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

Definition at line 427 of file scheduler.hh.

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

◆ PausePriority

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

Definition at line 382 of file scheduler.hh.

◆ Priority

const typedef EventBase::Priority sc_gem5::Scheduler::Priority
private

Definition at line 378 of file scheduler.hh.

◆ readyEvent

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

Definition at line 422 of file scheduler.hh.

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

◆ readyListMethods

ProcessList sc_gem5::Scheduler::readyListMethods
private

Definition at line 480 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 481 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 384 of file scheduler.hh.

◆ runOnce

bool sc_gem5::Scheduler::runOnce
private

Definition at line 476 of file scheduler.hh.

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

◆ runToTime

bool sc_gem5::Scheduler::runToTime
private

Definition at line 475 of file scheduler.hh.

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

◆ starvationEvent

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

Definition at line 440 of file scheduler.hh.

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

◆ StarvationPriority

Priority sc_gem5::Scheduler::StarvationPriority = ReadyPriority
staticprivate

Definition at line 385 of file scheduler.hh.

◆ stopEvent

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

Definition at line 428 of file scheduler.hh.

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

◆ StopPriority

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

Definition at line 381 of file scheduler.hh.

◆ timeAdvancesEvent

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

Definition at line 461 of file scheduler.hh.

Referenced by clear(), and scheduleTimeAdvancesEvent().

◆ TimeAdvancesPriority

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

Definition at line 386 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 483 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 Wed Sep 30 2020 14:03:10 for gem5 by doxygen 1.8.17