gem5 v24.0.0.0
Loading...
Searching...
No Matches
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::list< 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 (gem5::EventQueue *_eq)
 
gem5::Tick getCurTick ()
 
gem5::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 ()
 
gem5::Tick timeToPending ()
 
void runUpdate ()
 
void runDelta ()
 
void start (gem5::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)
 
TimeSlotacquireTimeSlot (gem5::Tick tick)
 
void releaseTimeSlot (TimeSlot *ts)
 

Private Types

typedef const gem5::EventBase::Priority Priority
 

Private Member Functions

void schedule (gem5::Event *event, gem5::Tick tick)
 
void schedule (gem5::Event *event)
 
void deschedule (gem5::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

gem5::EventQueueeq
 
ScEvents deltas
 
TimeSlots timeSlots
 
std::stack< TimeSlot * > freeTimeSlots
 
gem5::MemberEventWrapper<&Scheduler::runReadyreadyEvent
 
gem5::MemberEventWrapper<&Scheduler::pausepauseEvent
 
gem5::MemberEventWrapper<&Scheduler::stopstopEvent
 
const ::sc_core::sc_report_throwUp
 
gem5::MemberEventWrapper<&Scheduler::pausestarvationEvent
 
bool _elaborationDone
 
bool _started
 
bool _stopNow
 
Status _status
 
gem5::Tick maxTick
 
gem5::Tick lastReadyTick
 
gem5::MemberEventWrapper<&Scheduler::maxTickFuncmaxTickEvent
 
gem5::MemberEventWrapper<&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::atomic< bool > hasAsyncUpdate
 
std::map< gem5::Event *, gem5::TickeventsToSchedule
 
std::set< TraceFile * > traceFiles
 

Static Private Attributes

static Priority DefaultPriority = gem5::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 = gem5::EventBase::Maximum_Pri
 

Detailed Description

Definition at line 147 of file scheduler.hh.

Member Typedef Documentation

◆ Priority

Definition at line 423 of file scheduler.hh.

◆ ScEvents

Definition at line 150 of file scheduler.hh.

◆ TimeSlots

Definition at line 175 of file scheduler.hh.

Member Enumeration Documentation

◆ Status

Enumerator
StatusOther 
StatusEvaluate 
StatusUpdate 
StatusDelta 
StatusTiming 
StatusPaused 
StatusStopped 

Definition at line 367 of file scheduler.hh.

Constructor & Destructor Documentation

◆ Scheduler()

sc_gem5::Scheduler::Scheduler ( )

Definition at line 46 of file scheduler.cc.

◆ ~Scheduler()

sc_gem5::Scheduler::~Scheduler ( )

Definition at line 59 of file scheduler.cc.

References clear().

Member Function Documentation

◆ acquireTimeSlot()

TimeSlot * sc_gem5::Scheduler::acquireTimeSlot ( gem5::Tick tick)
inline

Definition at line 402 of file scheduler.hh.

References freeTimeSlots.

Referenced by schedule().

◆ asyncRequestUpdate()

void sc_gem5::Scheduler::asyncRequestUpdate ( Channel * c)

◆ changeStamp()

uint64_t sc_gem5::Scheduler::changeStamp ( )
inline

◆ clear()

◆ completeTimeSlot()

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

◆ current()

◆ delayed()

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

Definition at line 246 of file scheduler.hh.

References getCurTick().

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

◆ deschedule() [1/2]

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

Definition at line 448 of file scheduler.hh.

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

◆ deschedule() [2/2]

◆ elaborationDone() [1/2]

bool sc_gem5::Scheduler::elaborationDone ( )
inline

Definition at line 378 of file scheduler.hh.

References _elaborationDone.

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

◆ elaborationDone() [2/2]

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

Definition at line 379 of file scheduler.hh.

References _elaborationDone, and b.

◆ getCurTick()

◆ getNextReady()

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

Definition at line 461 of file scheduler.hh.

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

Referenced by runReady(), and yield().

◆ inDelta()

bool sc_gem5::Scheduler::inDelta ( )
inline

Definition at line 385 of file scheduler.hh.

References status(), and StatusDelta.

◆ inEvaluate()

bool sc_gem5::Scheduler::inEvaluate ( )
inline

Definition at line 383 of file scheduler.hh.

References status(), and StatusEvaluate.

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

◆ initPhase()

◆ inTiming()

bool sc_gem5::Scheduler::inTiming ( )
inline

Definition at line 386 of file scheduler.hh.

References status(), and StatusTiming.

◆ inUpdate()

bool sc_gem5::Scheduler::inUpdate ( )
inline

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

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

◆ name()

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

Definition at line 182 of file scheduler.hh.

◆ numCycles()

uint64_t sc_gem5::Scheduler::numCycles ( )
inline

Definition at line 184 of file scheduler.hh.

References _numCycles.

Referenced by sc_core::sc_delta_count().

◆ oneCycle()

void sc_gem5::Scheduler::oneCycle ( )

Definition at line 442 of file scheduler.cc.

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

Referenced by sc_core::sc_start().

◆ pause()

◆ paused()

bool sc_gem5::Scheduler::paused ( )
inline

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

References timeSlots.

Referenced by timeToPending().

◆ ready()

◆ reg()

◆ registerTraceFile()

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

Definition at line 398 of file scheduler.hh.

References traceFiles.

Referenced by sc_gem5::TraceFile::TraceFile().

◆ releaseTimeSlot()

void sc_gem5::Scheduler::releaseTimeSlot ( TimeSlot * ts)
inline

Definition at line 417 of file scheduler.hh.

References freeTimeSlots.

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

◆ requestUpdate()

void sc_gem5::Scheduler::requestUpdate ( Channel * c)

◆ resume()

void sc_gem5::Scheduler::resume ( Process * p)

Definition at line 216 of file scheduler.cc.

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

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

◆ runDelta()

void sc_gem5::Scheduler::runDelta ( )

Definition at line 350 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()

◆ runUpdate()

◆ schedule() [1/3]

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

Definition at line 445 of file scheduler.hh.

References getCurTick(), and schedule().

Referenced by schedule().

◆ schedule() [2/3]

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

Definition at line 437 of file scheduler.hh.

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

◆ schedule() [3/3]

◆ schedulePause()

void sc_gem5::Scheduler::schedulePause ( )

Definition at line 450 of file scheduler.cc.

References pauseEvent, schedule(), and gem5::Event::scheduled().

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

◆ scheduleReadyEvent()

void sc_gem5::Scheduler::scheduleReadyEvent ( )
private

◆ scheduleStarvationEvent()

void sc_gem5::Scheduler::scheduleStarvationEvent ( )
private

◆ scheduleStop()

void sc_gem5::Scheduler::scheduleStop ( bool finish_delta)

◆ scheduleTimeAdvancesEvent()

void sc_gem5::Scheduler::scheduleTimeAdvancesEvent ( )
inlineprivate

◆ setEventQueue()

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

Definition at line 240 of file scheduler.hh.

References eq.

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

◆ start()

◆ 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 396 of file scheduler.hh.

References _status.

◆ stepChangeStamp()

void sc_gem5::Scheduler::stepChangeStamp ( )
inline

Definition at line 389 of file scheduler.hh.

References _changeStamp.

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

◆ stop()

◆ stopped()

bool sc_gem5::Scheduler::stopped ( )
inline

Definition at line 382 of file scheduler.hh.

References status(), and StatusStopped.

◆ suspend()

bool sc_gem5::Scheduler::suspend ( Process * p)

Definition at line 235 of file scheduler.cc.

References initDone.

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

◆ throwUp()

◆ timeAdvances()

void sc_gem5::Scheduler::timeAdvances ( )
inlineprivate

Definition at line 507 of file scheduler.hh.

References trace().

◆ timeToPending()

gem5::Tick sc_gem5::Scheduler::timeToPending ( )
inline

Definition at line 346 of file scheduler.hh.

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

◆ trace()

void sc_gem5::Scheduler::trace ( bool delta)
private

Definition at line 488 of file scheduler.cc.

References traceFiles.

Referenced by runReady(), and timeAdvances().

◆ unregisterTraceFile()

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

Definition at line 399 of file scheduler.hh.

References traceFiles.

Referenced by sc_gem5::TraceFile::~TraceFile().

◆ yield()

Member Data Documentation

◆ _changeStamp

uint64_t sc_gem5::Scheduler::_changeStamp
private

Definition at line 517 of file scheduler.hh.

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

◆ _current

Process* sc_gem5::Scheduler::_current
private

Definition at line 519 of file scheduler.hh.

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

◆ _elaborationDone

bool sc_gem5::Scheduler::_elaborationDone
private

Definition at line 490 of file scheduler.hh.

Referenced by elaborationDone(), and elaborationDone().

◆ _numCycles

uint64_t sc_gem5::Scheduler::_numCycles
private

Definition at line 516 of file scheduler.hh.

Referenced by numCycles(), and runReady().

◆ _started

bool sc_gem5::Scheduler::_started
private

Definition at line 491 of file scheduler.hh.

Referenced by initPhase(), and start().

◆ _status

Status sc_gem5::Scheduler::_status
private

Definition at line 494 of file scheduler.hh.

Referenced by status(), and status().

◆ _stopNow

bool sc_gem5::Scheduler::_stopNow
private

Definition at line 492 of file scheduler.hh.

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

◆ _throwUp

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

Definition at line 476 of file scheduler.hh.

Referenced by start(), and throwUp().

◆ asyncListMutex

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

Definition at line 533 of file scheduler.hh.

Referenced by asyncRequestUpdate(), and runUpdate().

◆ asyncUpdateList

ChannelList sc_gem5::Scheduler::asyncUpdateList
private

Definition at line 532 of file scheduler.hh.

Referenced by asyncRequestUpdate(), and runUpdate().

◆ DefaultPriority

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

Definition at line 424 of file scheduler.hh.

◆ deltas

ScEvents sc_gem5::Scheduler::deltas
private

Definition at line 456 of file scheduler.hh.

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

◆ eq

gem5::EventQueue* sc_gem5::Scheduler::eq
private

Definition at line 433 of file scheduler.hh.

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

◆ eventsToSchedule

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

Definition at line 536 of file scheduler.hh.

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

◆ freeTimeSlots

std::stack<TimeSlot*> sc_gem5::Scheduler::freeTimeSlots
private

Definition at line 458 of file scheduler.hh.

Referenced by acquireTimeSlot(), and releaseTimeSlot().

◆ hasAsyncUpdate

std::atomic<bool> sc_gem5::Scheduler::hasAsyncUpdate
private

Definition at line 534 of file scheduler.hh.

Referenced by asyncRequestUpdate(), and runUpdate().

◆ initDone

bool sc_gem5::Scheduler::initDone
private

Definition at line 521 of file scheduler.hh.

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

◆ initList

ProcessList sc_gem5::Scheduler::initList
private

Definition at line 525 of file scheduler.hh.

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

◆ lastReadyTick

gem5::Tick sc_gem5::Scheduler::lastReadyTick
private

Definition at line 497 of file scheduler.hh.

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

◆ maxTick

gem5::Tick sc_gem5::Scheduler::maxTick
private

Definition at line 496 of file scheduler.hh.

Referenced by start(), and starved().

◆ maxTickEvent

gem5::MemberEventWrapper<&Scheduler::maxTickFunc> sc_gem5::Scheduler::maxTickEvent
private

Definition at line 505 of file scheduler.hh.

Referenced by clear(), and start().

◆ MaxTickPriority

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

Definition at line 428 of file scheduler.hh.

◆ pauseEvent

gem5::MemberEventWrapper<&Scheduler::pause> sc_gem5::Scheduler::pauseEvent
private

Definition at line 473 of file scheduler.hh.

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

◆ PausePriority

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

Definition at line 427 of file scheduler.hh.

◆ readyEvent

gem5::MemberEventWrapper<&Scheduler::runReady> sc_gem5::Scheduler::readyEvent
private

Definition at line 468 of file scheduler.hh.

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

◆ readyListMethods

ProcessList sc_gem5::Scheduler::readyListMethods
private

Definition at line 527 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 528 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 429 of file scheduler.hh.

◆ runOnce

bool sc_gem5::Scheduler::runOnce
private

Definition at line 523 of file scheduler.hh.

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

◆ runToTime

bool sc_gem5::Scheduler::runToTime
private

Definition at line 522 of file scheduler.hh.

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

◆ starvationEvent

gem5::MemberEventWrapper<&Scheduler::pause> sc_gem5::Scheduler::starvationEvent
private

Definition at line 487 of file scheduler.hh.

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

◆ StarvationPriority

Priority sc_gem5::Scheduler::StarvationPriority = ReadyPriority
staticprivate

Definition at line 430 of file scheduler.hh.

◆ stopEvent

gem5::MemberEventWrapper<&Scheduler::stop> sc_gem5::Scheduler::stopEvent
private

Definition at line 474 of file scheduler.hh.

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

◆ StopPriority

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

Definition at line 426 of file scheduler.hh.

◆ timeAdvancesEvent

gem5::MemberEventWrapper<&Scheduler::timeAdvances> sc_gem5::Scheduler::timeAdvancesEvent
private

Definition at line 508 of file scheduler.hh.

Referenced by clear(), and scheduleTimeAdvancesEvent().

◆ TimeAdvancesPriority

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

Definition at line 431 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 530 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 Tue Jun 18 2024 16:24:56 for gem5 by doxygen 1.11.0