gem5
v20.1.0.0
|
#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 |
Private Member Functions | |
void | schedule (::Event *event, Tick tick) |
void | schedule (::Event *event) |
void | deschedule (::Event *event) |
Process * | getNextReady () |
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 |
EventQueue * | eq |
ScEvents | deltas |
TimeSlots | timeSlots |
EventWrapper< Scheduler, &Scheduler::runReady > | readyEvent |
EventWrapper< Scheduler, &Scheduler::pause > | pauseEvent |
EventWrapper< Scheduler, &Scheduler::stop > | stopEvent |
const ::sc_core::sc_report * | _throwUp |
EventWrapper< Scheduler, &Scheduler::pause > | starvationEvent |
bool | _elaborationDone |
bool | _started |
bool | _stopNow |
Status | _status |
Tick | maxTick |
Tick | lastReadyTick |
EventWrapper< Scheduler, &Scheduler::maxTickFunc > | maxTickEvent |
EventWrapper< Scheduler, &Scheduler::timeAdvances > | timeAdvancesEvent |
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 *, Tick > | eventsToSchedule |
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 |
Definition at line 146 of file scheduler.hh.
typedef std::list<ScEvent *> sc_gem5::Scheduler::ScEvents |
Definition at line 149 of file scheduler.hh.
typedef std::map<Tick, TimeSlot *> sc_gem5::Scheduler::TimeSlots |
Definition at line 160 of file scheduler.hh.
Enumerator | |
---|---|
StatusOther | |
StatusEvaluate | |
StatusUpdate | |
StatusDelta | |
StatusTiming | |
StatusPaused | |
StatusStopped |
Definition at line 343 of file scheduler.hh.
Scheduler::Scheduler | ( | ) |
Definition at line 46 of file scheduler.cc.
Scheduler::~Scheduler | ( | ) |
Definition at line 59 of file scheduler.cc.
References clear().
void Scheduler::asyncRequestUpdate | ( | Channel * | c | ) |
Definition at line 259 of file scheduler.cc.
References asyncListMutex, asyncUpdateList, ArmISA::c, X86ISA::lock, and sc_gem5::NodeList< T >::pushLast().
Referenced by sc_gem5::Channel::asyncRequestUpdate().
|
inline |
Definition at line 364 of file scheduler.hh.
References _changeStamp.
Referenced by sc_gem5::getChangeStamp(), sc_gem5::Event::notify(), and sc_gem5::Event::triggered().
void Scheduler::clear | ( | ) |
Definition at line 67 of file scheduler.cc.
References ArmISA::c, deltas, deschedule(), sc_gem5::NodeList< T >::getNext(), initList, maxTickEvent, MipsISA::p, pauseEvent, readyEvent, readyListMethods, readyListThreads, starvationEvent, stopEvent, timeAdvancesEvent, timeSlots, ArmISA::ts, and updateList.
Referenced by sc_gem5::ScMainFiber::main(), scheduleStop(), stop(), sc_gem5::Kernel::t0Handler(), and ~Scheduler().
|
inline |
Definition at line 289 of file scheduler.hh.
References runToTime, scheduleStarvationEvent(), scheduleTimeAdvancesEvent(), starved(), timeSlots, and ArmISA::ts.
Referenced by sc_gem5::Scheduler::TimeSlot::process().
|
inline |
Definition at line 170 of file scheduler.hh.
References _current.
Referenced by sc_gem5::WriteChecker< sc_core::SC_ONE_WRITER >::checkWriter(), sc_gem5::WriteChecker< sc_core::SC_MANY_WRITERS >::checkWriter(), sc_core::sc_report_handler::clear_cached_report(), sc_core::sc_report_handler::default_handler(), sc_core::sc_report_handler::get_cached_report(), sc_core::sc_simcontext::get_curr_proc_info(), sc_gem5::getCurrentProcess(), sc_core::next_trigger(), sc_gem5::Sensitivity::notify(), sc_gem5::pickParentObj(), sc_core::sc_report_handler::report(), sc_core::sc_gen_unique_name(), sc_core::sc_get_curr_process_handle(), sc_core::sc_report_compose_message(), sc_core::sc_set_location(), sc_gem5::Process::suspend(), sc_core::timed_out(), sc_core::sc_mutex::trylock(), sc_core::wait(), and sc_core::sc_signal_resolved::write().
|
inline |
Definition at line 231 of file scheduler.hh.
References getCurTick().
Referenced by sc_gem5::Event::notify(), and schedule().
|
inlineprivate |
Definition at line 403 of file scheduler.hh.
References EventQueue::deschedule(), eq, MipsISA::event, eventsToSchedule, and initDone.
|
inline |
Definition at line 263 of file scheduler.hh.
References deltas, MipsISA::event, MipsISA::on, panic_if, timeSlots, and ArmISA::ts.
Referenced by sc_gem5::Event::cancel(), sc_gem5::Process::cancelTimeout(), clear(), sc_gem5::Event::notify(), scheduleReadyEvent(), scheduleStarvationEvent(), start(), sc_gem5::ClockTick::~ClockTick(), sc_gem5::Event::~Event(), sc_core::sc_clock::~sc_clock(), and sc_gem5::ScEvent::~ScEvent().
|
inline |
Definition at line 354 of file scheduler.hh.
References _elaborationDone.
Referenced by sc_core::sc_simcontext::elaboration_done(), and sc_gem5::Kernel::init().
|
inline |
Definition at line 355 of file scheduler.hh.
References _elaborationDone, and ArmISA::b.
|
inline |
Definition at line 228 of file scheduler.hh.
References eq, and EventQueue::getCurTick().
Referenced by delayed(), sc_gem5::VcdTraceFile::initialize(), maxTickFunc(), runReady(), sc_core::sc_start(), schedule(), start(), timeToPending(), sc_gem5::VcdTraceFile::trace(), and sc_gem5::VcdTraceFile::~VcdTraceFile().
|
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().
|
inline |
Definition at line 361 of file scheduler.hh.
References status(), and StatusDelta.
|
inline |
Definition at line 359 of file scheduler.hh.
References status(), and StatusEvaluate.
Referenced by ready(), requestUpdate(), runNext(), and schedule().
void Scheduler::initPhase | ( | ) |
Definition at line 110 of file scheduler.cc.
References _started, eq, eventsToSchedule, sc_gem5::NodeList< T >::getNext(), initDone, initList, sc_gem5::kernel, MipsISA::p, runDelta(), runToTime, runUpdate(), sc_core::SC_ID_DISABLE_WILL_ORPHAN_PROCESS_, SC_REPORT_WARNING, sc_core::SC_RUNNING, EventQueue::schedule(), scheduleStarvationEvent(), scheduleTimeAdvancesEvent(), starved(), sc_gem5::Kernel::status(), status(), and StatusOther.
Referenced by sc_gem5::Kernel::t0Handler().
|
inline |
Definition at line 362 of file scheduler.hh.
References status(), and StatusTiming.
|
inline |
Definition at line 360 of file scheduler.hh.
References status(), and StatusUpdate.
Referenced by sc_gem5::Event::notify(), and schedule().
|
inlineprivate |
Definition at line 452 of file scheduler.hh.
References _changeStamp, getCurTick(), lastReadyTick, and pause().
|
inline |
Definition at line 167 of file scheduler.hh.
|
inline |
Definition at line 169 of file scheduler.hh.
References _numCycles.
Referenced by sc_core::sc_delta_count().
void Scheduler::oneCycle | ( | ) |
Definition at line 437 of file scheduler.cc.
References MaxTick, runOnce, scheduleReadyEvent(), and start().
Referenced by sc_core::sc_start().
|
private |
Definition at line 362 of file scheduler.cc.
References sc_gem5::ScMainFiber::called(), exitSimLoopNow(), fatal, Fiber::finished(), sc_gem5::kernel, Fiber::run(), runOnce, sc_core::SC_PAUSED, sc_gem5::scMainFiber, sc_gem5::Kernel::status(), status(), and StatusPaused.
Referenced by maxTickFunc().
|
inline |
Definition at line 357 of file scheduler.hh.
References status(), and StatusPaused.
|
inline |
Definition at line 307 of file scheduler.hh.
References deltas, sc_gem5::NodeList< T >::empty(), readyListMethods, readyListThreads, and updateList.
Referenced by sc_core::sc_pending_activity_at_current_time(), and timeToPending().
|
inline |
Definition at line 315 of file scheduler.hh.
References timeSlots.
Referenced by sc_core::sc_pending_activity_at_future_time(), and timeToPending().
void Scheduler::ready | ( | Process * | p | ) |
Definition at line 200 of file scheduler.cc.
References _stopNow, inEvaluate(), MipsISA::p, sc_gem5::NodeList< T >::pushLast(), readyListMethods, readyListThreads, sc_core::SC_METHOD_PROC_, and scheduleReadyEvent().
Referenced by sc_gem5::Process::ready(), and resume().
void Scheduler::reg | ( | Process * | p | ) |
Definition at line 147 of file scheduler.cc.
References initDone, initList, MipsISA::p, and sc_gem5::NodeList< T >::pushLast().
Referenced by sc_gem5::ClockTick::createProcess(), sc_gem5::newCThreadProcess(), sc_gem5::newMethodProcess(), sc_gem5::newThreadProcess(), and sc_gem5::spawnWork().
|
inline |
Definition at line 374 of file scheduler.hh.
References X86ISA::tf, and traceFiles.
Referenced by sc_core::sc_create_vcd_trace_file().
void Scheduler::requestUpdate | ( | Channel * | c | ) |
Definition at line 251 of file scheduler.cc.
References ArmISA::c, inEvaluate(), sc_gem5::NodeList< T >::pushLast(), scheduleReadyEvent(), and updateList.
Referenced by sc_gem5::Channel::requestUpdate().
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().
void Scheduler::runDelta | ( | ) |
Definition at line 349 of file scheduler.cc.
References deltas, status(), StatusDelta, and throwUp().
Referenced by initPhase(), and runReady().
|
inline |
Definition at line 215 of file scheduler.hh.
References inEvaluate(), MipsISA::p, sc_gem5::NodeList< T >::pushFirst(), readyListMethods, and scheduleReadyEvent().
Referenced by sc_gem5::Process::signalReset().
|
inline |
Definition at line 198 of file scheduler.hh.
References _current, MipsISA::p, sc_gem5::NodeList< T >::pushFirst(), readyListMethods, and yield().
Referenced by sc_gem5::Process::injectException(), and sc_gem5::Process::reset().
|
private |
Definition at line 287 of file scheduler.cc.
References _changeStamp, _current, _numCycles, _stopNow, sc_gem5::NodeList< T >::empty(), getCurTick(), getNextReady(), lastReadyTick, readyListMethods, readyListThreads, runDelta(), runOnce, runToTime, runUpdate(), schedulePause(), scheduleStarvationEvent(), scheduleTimeAdvancesEvent(), starved(), status(), StatusEvaluate, StatusOther, trace(), traceFiles, and yield().
void Scheduler::runUpdate | ( | ) |
Definition at line 326 of file scheduler.cc.
References asyncListMutex, asyncUpdateList, sc_gem5::NodeList< T >::getNext(), X86ISA::lock, sc_gem5::ListNode::popListNode(), sc_gem5::NodeList< T >::pushLast(), status(), StatusUpdate, throwUp(), sc_gem5::Channel::update(), and updateList.
Referenced by initPhase(), and runReady().
|
inlineprivate |
Definition at line 400 of file scheduler.hh.
References MipsISA::event, getCurTick(), and schedule().
Referenced by schedule().
Definition at line 392 of file scheduler.hh.
References eq, MipsISA::event, eventsToSchedule, initDone, and EventQueue::schedule().
|
inline |
Definition at line 238 of file scheduler.hh.
References delayed(), deltas, getCurTick(), inEvaluate(), inUpdate(), scheduleReadyEvent(), timeSlots, and ArmISA::ts.
Referenced by sc_core::sc_clock::before_end_of_elaboration(), sc_gem5::Event::notify(), sc_gem5::Scheduler::TimeSlot::process(), schedulePause(), scheduleReadyEvent(), scheduleStarvationEvent(), scheduleStop(), scheduleTimeAdvancesEvent(), sc_gem5::Process::setTimeout(), start(), and sc_gem5::ClockTick::tick().
void Scheduler::schedulePause | ( | ) |
Definition at line 445 of file scheduler.cc.
References pauseEvent, and schedule().
Referenced by runReady(), and sc_core::sc_pause().
|
private |
Definition at line 266 of file scheduler.cc.
References deschedule(), readyEvent, schedule(), and starvationEvent.
Referenced by oneCycle(), ready(), requestUpdate(), runNext(), and schedule().
|
private |
Definition at line 277 of file scheduler.cc.
References deschedule(), readyEvent, schedule(), and starvationEvent.
Referenced by completeTimeSlot(), initPhase(), runReady(), and start().
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().
|
inlineprivate |
Definition at line 463 of file scheduler.hh.
References schedule(), timeAdvancesEvent, and traceFiles.
Referenced by completeTimeSlot(), initPhase(), runReady(), and start().
|
inline |
Definition at line 225 of file scheduler.hh.
References eq.
Referenced by sc_gem5::Kernel::Kernel().
void Scheduler::start | ( | Tick | max_tick, |
bool | run_to_time | ||
) |
Definition at line 399 of file scheduler.cc.
References _started, _throwUp, deschedule(), getCurTick(), initDone, sc_gem5::kernel, lastReadyTick, maxTick, maxTickEvent, pauseEvent, Fiber::primaryFiber(), Fiber::run(), runToTime, sc_core::SC_RUNNING, schedule(), scheduleStarvationEvent(), scheduleTimeAdvancesEvent(), starvationEvent, starved(), sc_gem5::Kernel::status(), status(), StatusOther, and stopEvent.
Referenced by oneCycle(), and sc_core::sc_start().
|
inlineprivate |
Definition at line 433 of file scheduler.hh.
References deltas, sc_gem5::NodeList< T >::empty(), initList, maxTick, readyListMethods, readyListThreads, timeSlots, and updateList.
Referenced by completeTimeSlot(), initPhase(), runReady(), and start().
|
inline |
Definition at line 371 of file scheduler.hh.
References _status.
Referenced by inDelta(), inEvaluate(), initPhase(), inTiming(), inUpdate(), pause(), paused(), sc_gem5::Scheduler::TimeSlot::process(), runDelta(), runReady(), runUpdate(), start(), stop(), stopped(), and throwUp().
|
inline |
Definition at line 372 of file scheduler.hh.
|
inline |
Definition at line 365 of file scheduler.hh.
References _changeStamp.
Referenced by sc_gem5::Scheduler::TimeSlot::process().
|
private |
Definition at line 379 of file scheduler.cc.
References sc_gem5::ScMainFiber::called(), clear(), exitSimLoopNow(), fatal, Fiber::finished(), sc_gem5::kernel, Fiber::run(), runOnce, sc_gem5::scMainFiber, status(), StatusStopped, and sc_gem5::Kernel::stop().
|
inline |
Definition at line 358 of file scheduler.hh.
References status(), and StatusStopped.
bool Scheduler::suspend | ( | Process * | p | ) |
Definition at line 236 of file scheduler.cc.
References initDone, and MipsISA::p.
Referenced by sc_gem5::Process::suspend().
void Scheduler::throwUp | ( | ) |
Definition at line 454 of file scheduler.cc.
References _throwUp, sc_gem5::ScMainFiber::called(), Fiber::finished(), sc_core::sc_report_handler::get_catch_actions(), sc_gem5::reportHandlerProc, sc_gem5::reportifyException(), Fiber::run(), sc_gem5::scMainFiber, status(), and StatusOther.
Referenced by sc_gem5::Thread::Context::main(), sc_gem5::Scheduler::TimeSlot::process(), sc_gem5::Kernel::regStats(), runDelta(), runUpdate(), sc_gem5::Kernel::startup(), sc_gem5::Kernel::stopWork(), and yield().
|
inlineprivate |
Definition at line 460 of file scheduler.hh.
References trace().
|
inline |
Definition at line 322 of file scheduler.hh.
References getCurTick(), MaxTick, pendingCurr(), pendingFuture(), and timeSlots.
|
private |
Definition at line 483 of file scheduler.cc.
References X86ISA::tf, and traceFiles.
Referenced by runReady(), and timeAdvances().
|
inline |
Definition at line 375 of file scheduler.hh.
References X86ISA::tf, and traceFiles.
Referenced by sc_core::sc_close_vcd_trace_file().
void Scheduler::yield | ( | ) |
Definition at line 161 of file scheduler.cc.
References _current, sc_gem5::Process::excWrapper, sc_gem5::Process::fiber(), getNextReady(), sc_gem5::Process::inReset(), sc_gem5::Process::needsStart(), sc_core::sc_event::notify(), sc_gem5::ListNode::popListNode(), Fiber::primaryFiber(), sc_gem5::Process::reset(), sc_gem5::Process::resetEvent(), Fiber::run(), sc_gem5::Process::run(), sc_gem5::Process::scheduled(), sc_gem5::ExceptionWrapperBase::throw_it(), and throwUp().
Referenced by sc_gem5::Thread::Context::main(), runNow(), runReady(), sc_gem5::Process::suspend(), and sc_core::wait().
|
private |
Definition at line 470 of file scheduler.hh.
Referenced by changeStamp(), maxTickFunc(), runReady(), and stepChangeStamp().
|
private |
Definition at line 472 of file scheduler.hh.
Referenced by current(), runNow(), runReady(), and yield().
|
private |
Definition at line 443 of file scheduler.hh.
Referenced by elaborationDone().
|
private |
Definition at line 469 of file scheduler.hh.
Referenced by numCycles(), and runReady().
|
private |
Definition at line 444 of file scheduler.hh.
Referenced by initPhase(), and start().
|
private |
Definition at line 447 of file scheduler.hh.
Referenced by status().
|
private |
Definition at line 445 of file scheduler.hh.
Referenced by ready(), runReady(), and scheduleStop().
|
private |
Definition at line 430 of file scheduler.hh.
|
private |
Definition at line 486 of file scheduler.hh.
Referenced by asyncRequestUpdate(), and runUpdate().
|
private |
Definition at line 485 of file scheduler.hh.
Referenced by asyncRequestUpdate(), and runUpdate().
|
staticprivate |
Definition at line 379 of file scheduler.hh.
|
private |
Definition at line 411 of file scheduler.hh.
Referenced by clear(), deschedule(), pendingCurr(), runDelta(), schedule(), and starved().
|
private |
Definition at line 388 of file scheduler.hh.
Referenced by deschedule(), getCurTick(), initPhase(), schedule(), and setEventQueue().
Definition at line 488 of file scheduler.hh.
Referenced by deschedule(), initPhase(), and schedule().
|
private |
Definition at line 474 of file scheduler.hh.
Referenced by deschedule(), initPhase(), reg(), resume(), schedule(), start(), and suspend().
|
private |
Definition at line 478 of file scheduler.hh.
Referenced by clear(), initPhase(), reg(), resume(), and starved().
|
private |
Definition at line 450 of file scheduler.hh.
Referenced by maxTickFunc(), runReady(), and start().
|
private |
Definition at line 449 of file scheduler.hh.
|
private |
Definition at line 458 of file scheduler.hh.
|
staticprivate |
Definition at line 383 of file scheduler.hh.
|
private |
Definition at line 427 of file scheduler.hh.
Referenced by clear(), schedulePause(), and start().
|
staticprivate |
Definition at line 382 of file scheduler.hh.
|
private |
Definition at line 378 of file scheduler.hh.
|
private |
Definition at line 422 of file scheduler.hh.
Referenced by clear(), scheduleReadyEvent(), and scheduleStarvationEvent().
|
private |
Definition at line 480 of file scheduler.hh.
Referenced by clear(), getNextReady(), pendingCurr(), ready(), runNext(), runNow(), runReady(), and starved().
|
private |
Definition at line 481 of file scheduler.hh.
Referenced by clear(), getNextReady(), pendingCurr(), ready(), runReady(), and starved().
|
staticprivate |
Definition at line 384 of file scheduler.hh.
|
private |
Definition at line 476 of file scheduler.hh.
Referenced by oneCycle(), pause(), runReady(), and stop().
|
private |
Definition at line 475 of file scheduler.hh.
Referenced by completeTimeSlot(), initPhase(), runReady(), and start().
|
private |
Definition at line 440 of file scheduler.hh.
Referenced by clear(), scheduleReadyEvent(), scheduleStarvationEvent(), and start().
|
staticprivate |
Definition at line 385 of file scheduler.hh.
|
private |
Definition at line 428 of file scheduler.hh.
Referenced by clear(), scheduleStop(), and start().
|
staticprivate |
Definition at line 381 of file scheduler.hh.
|
private |
Definition at line 461 of file scheduler.hh.
Referenced by clear(), and scheduleTimeAdvancesEvent().
|
staticprivate |
Definition at line 386 of file scheduler.hh.
|
private |
Definition at line 412 of file scheduler.hh.
Referenced by clear(), completeTimeSlot(), deschedule(), pendingFuture(), schedule(), starved(), and timeToPending().
|
private |
Definition at line 490 of file scheduler.hh.
Referenced by registerTraceFile(), runReady(), scheduleTimeAdvancesEvent(), trace(), and unregisterTraceFile().
|
private |
Definition at line 483 of file scheduler.hh.
Referenced by clear(), pendingCurr(), requestUpdate(), runUpdate(), and starved().