gem5  v20.1.0.0
Typedefs | Functions | Variables
The Event Queue API.

These methods relate to the event queue interface. More...

Typedefs

typedef int8_t EventBase::Priority
 

Functions

virtual void Event::trace (const char *action)
 This function isn't really useful if TRACING_ON is not defined. More...
 
bool Event::scheduled () const
 Determine if the current event is scheduled. More...
 
void Event::squash ()
 Squash the current event. More...
 
bool Event::squashed () const
 Check whether the event is squashed. More...
 
bool Event::isExitEvent () const
 See if this is a SimExitEvent (without resorting to RTTI) More...
 
bool Event::isManaged () const
 Check whether this event will auto-delete. More...
 
bool Event::isAutoDelete () const
 The function returns true if the object is automatically deleted after the event is processed. More...
 
Tick Event::when () const
 Get the time that the event is scheduled. More...
 
Priority Event::priority () const
 Get the event priority. More...
 
bool operator< (const Event &l, const Event &r)
 
bool operator> (const Event &l, const Event &r)
 
bool operator<= (const Event &l, const Event &r)
 
bool operator>= (const Event &l, const Event &r)
 
bool operator== (const Event &l, const Event &r)
 
bool operator!= (const Event &l, const Event &r)
 
 EventQueue::ScopedMigration::ScopedMigration (EventQueue *_new_eq, bool _doMigrate=true)
 Temporarily migrate execution to a different event queue. More...
 
 EventQueue::EventQueue (const std::string &n)
 
void EventQueue::schedule (Event *event, Tick when, bool global=false)
 Schedule the given event on this queue. More...
 
void EventQueue::deschedule (Event *event)
 Deschedule the specified event. More...
 
void EventQueue::reschedule (Event *event, Tick when, bool always=false)
 Reschedule the specified event. More...
 
Tick EventQueue::getCurTick () const
 While curTick() is useful for any object assigned to this event queue, if an object that is assigned to another event queue (or a non-event object) need to access the current tick of this event queue, this function is used. More...
 
void EventQueue::serviceEvents (Tick when)
 process all events up to the given timestamp. More...
 
bool EventQueue::empty () const
 Returns true if no events are queued. More...
 
void EventQueue::dump () const
 This is a debugging function which will print everything on the event queue. More...
 
virtual void EventQueue::wakeup (Tick when=(Tick) -1)
 Function to signal that the event loop should be woken up because an event has been scheduled by an agent outside the gem5 event loop(s) whose event insertion may not have been noticed by gem5. More...
 
EventQueueEventManager::eventQueue () const
 
void EventManager::schedule (Event &event, Tick when)
 
void EventManager::deschedule (Event &event)
 
void EventManager::reschedule (Event &event, Tick when, bool always=false)
 
void EventManager::schedule (Event *event, Tick when)
 
void EventManager::deschedule (Event *event)
 
void EventManager::reschedule (Event *event, Tick when, bool always=false)
 
void EventManager::wakeupEventQueue (Tick when=(Tick) -1)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More...
 
 EventFunctionWrapper::EventFunctionWrapper (const std::function< void(void)> &callback, const std::string &name, bool del=false, Priority p=Default_Pri)
 This function wraps a function into an event, to be executed later. More...
 
void EventFunctionWrapper::process ()
 
const std::string EventFunctionWrapper::name () const
 
const char * EventFunctionWrapper::description () const
 Return a C string describing the event. More...
 

Variables

static const Priority EventBase::Minimum_Pri = SCHAR_MIN
 Event priorities, to provide tie-breakers for events scheduled at the same cycle. More...
 
static const Priority EventBase::Debug_Enable_Pri = -101
 If we enable tracing on a particular cycle, do that as the very first thing so we don't miss any of the events on that cycle (even if we enter the debugger). More...
 
static const Priority EventBase::Debug_Break_Pri = -100
 Breakpoints should happen before anything else (except enabling trace output), so we don't miss any action when debugging. More...
 
static const Priority EventBase::CPU_Switch_Pri = -31
 CPU switches schedule the new CPU's tick event for the same cycle (after unscheduling the old CPU's tick event). More...
 
static const Priority EventBase::Delayed_Writeback_Pri = -1
 For some reason "delayed" inter-cluster writebacks are scheduled before regular writebacks (which have default priority). More...
 
static const Priority EventBase::Default_Pri = 0
 Default is zero for historical reasons. More...
 
static const Priority EventBase::DVFS_Update_Pri = 31
 DVFS update event leads to stats dump therefore given a lower priority to ensure all relevant states have been updated. More...
 
static const Priority EventBase::Serialize_Pri = 32
 Serailization needs to occur before tick events also, so that a serialize/unserialize is identical to an on-line CPU switch. More...
 
static const Priority EventBase::CPU_Tick_Pri = 50
 CPU ticks must come after other associated CPU events (such as writebacks). More...
 
static const Priority EventBase::CPU_Exit_Pri = 64
 If we want to exit a thread in a CPU, it comes after CPU_Tick_Pri. More...
 
static const Priority EventBase::Stat_Event_Pri = 90
 Statistics events (dump, reset, etc.) come after everything else, but before exit. More...
 
static const Priority EventBase::Progress_Event_Pri = 95
 Progress events come at the end. More...
 
static const Priority EventBase::Sim_Exit_Pri = 100
 If we want to exit on this cycle, it's the very last thing we do. More...
 
static const Priority EventBase::Maximum_Pri = SCHAR_MAX
 Maximum priority. More...
 
virtual Event::~Event ()
 
virtual const std::string Event::name () const
 
virtual const char * Event::description () const
 Return a C string describing the event. More...
 
void Event::dump () const
 Dump the current event data. More...
 
virtual const std::string EventQueue::name () const
 
void EventQueue::name (const std::string &st)
 
 EventManager::EventManager (EventManager &em)
 Event manger manages events in the event queue. More...
 
 EventManager::EventManager (EventManager *em)
 
 EventManager::EventManager (EventQueue *eq)
 

Detailed Description

These methods relate to the event queue interface.

Typedef Documentation

◆ Priority

typedef int8_t EventBase::Priority

Definition at line 118 of file eventq.hh.

Function Documentation

◆ deschedule() [1/3]

void EventManager::deschedule ( Event event)
inline

◆ deschedule() [2/3]

void EventQueue::deschedule ( Event event)
inline

◆ deschedule() [3/3]

void EventManager::deschedule ( Event event)
inline

Definition at line 1041 of file eventq.hh.

References EventQueue::deschedule(), MipsISA::event, and EventManager::eventq.

◆ description() [1/2]

const char * Event::description ( ) const
virtual

◆ description() [2/2]

const char* EventFunctionWrapper::description ( ) const
inlinevirtual

Return a C string describing the event.

This string should not be dynamically allocated; just a const char array describing the event class.

Reimplemented from Event.

Definition at line 1141 of file eventq.hh.

◆ dump() [1/2]

void Event::dump ( ) const

Dump the current event data.

Definition at line 404 of file eventq.cc.

References cprintf(), and name().

Referenced by EventQueue::debugVerify(), EventQueue::dump(), and pybind_init_event().

◆ dump() [2/2]

void EventQueue::dump ( ) const

This is a debugging function which will print everything on the event queue.

Definition at line 288 of file eventq.cc.

References cprintf(), curTick(), Event::dump(), Event::nextBin, and Event::nextInBin.

Referenced by pybind_init_event().

◆ empty()

bool EventQueue::empty ( ) const
inline

◆ EventFunctionWrapper()

EventFunctionWrapper::EventFunctionWrapper ( const std::function< void(void)> &  callback,
const std::string &  name,
bool  del = false,
Priority  p = Default_Pri 
)
inline

This function wraps a function into an event, to be executed later.

Definition at line 1114 of file eventq.hh.

References EventBase::AutoDelete, and Event::setFlags().

◆ EventManager() [1/3]

EventManager::EventManager ( EventManager em)
inline

Event manger manages events in the event queue.

Where you can schedule and deschedule different events.

Definition at line 987 of file eventq.hh.

◆ EventManager() [2/3]

EventManager::EventManager ( EventManager em)
inline

Definition at line 988 of file eventq.hh.

◆ EventManager() [3/3]

EventManager::EventManager ( EventQueue eq)
inline

Definition at line 989 of file eventq.hh.

◆ eventQueue()

EventQueue* EventManager::eventQueue ( ) const
inline

◆ EventQueue()

EventQueue::EventQueue ( const std::string &  n)

◆ getCurTick()

Tick EventQueue::getCurTick ( ) const
inline

While curTick() is useful for any object assigned to this event queue, if an object that is assigned to another event queue (or a non-event object) need to access the current tick of this event queue, this function is used.

Tick is the unit of time used in gem5.

Returns
Tick The current tick of this event queue.

Definition at line 850 of file eventq.hh.

References EventQueue::_curTick.

Referenced by curTick(), SimpleThread::getCurrentInstCount(), sc_gem5::Scheduler::getCurTick(), EventQueue::reschedule(), and EventQueue::schedule().

◆ isAutoDelete()

bool Event::isAutoDelete ( ) const
inline

The function returns true if the object is automatically deleted after the event is processed.

Definition at line 496 of file eventq.hh.

References Event::isManaged().

Referenced by RubySystem::memWriteback().

◆ isExitEvent()

bool Event::isExitEvent ( ) const
inline

See if this is a SimExitEvent (without resorting to RTTI)

Definition at line 481 of file eventq.hh.

References Event::flags, EventBase::IsExitEvent, and Flags< T >::isSet().

Referenced by pybind_init_event().

◆ isManaged()

bool Event::isManaged ( ) const
inline

Check whether this event will auto-delete.

Definition at line 488 of file eventq.hh.

References Event::flags, Flags< T >::isSet(), and EventBase::Managed.

Referenced by Event::isAutoDelete().

◆ name() [1/4]

const std::string Event::name ( ) const
virtual

◆ name() [2/4]

virtual const std::string EventQueue::name ( ) const
inlinevirtual

Definition at line 747 of file eventq.hh.

References EventQueue::objName.

◆ name() [3/4]

const std::string EventFunctionWrapper::name ( ) const
inlinevirtual

Reimplemented from Event.

Definition at line 1133 of file eventq.hh.

References EventFunctionWrapper::_name.

◆ name() [4/4]

void EventQueue::name ( const std::string &  st)
inline

Definition at line 748 of file eventq.hh.

References EventQueue::objName, and ArmISA::st.

◆ operator!=()

bool operator!= ( const Event l,
const Event r 
)
inline

Definition at line 574 of file eventq.hh.

References MipsISA::l, and MipsISA::r.

◆ operator<()

bool operator< ( const Event l,
const Event r 
)
inline

Definition at line 525 of file eventq.hh.

References MipsISA::l, and MipsISA::r.

◆ operator<=()

bool operator<= ( const Event l,
const Event r 
)
inline

Definition at line 545 of file eventq.hh.

References MipsISA::l, and MipsISA::r.

◆ operator==()

bool operator== ( const Event l,
const Event r 
)
inline

Definition at line 565 of file eventq.hh.

References MipsISA::l, and MipsISA::r.

◆ operator>()

bool operator> ( const Event l,
const Event r 
)
inline

Definition at line 535 of file eventq.hh.

References MipsISA::l, and MipsISA::r.

◆ operator>=()

bool operator>= ( const Event l,
const Event r 
)
inline

Definition at line 555 of file eventq.hh.

References MipsISA::l, and MipsISA::r.

◆ priority()

Priority Event::priority ( ) const
inline

Get the event priority.

Definition at line 510 of file eventq.hh.

References Event::_priority.

Referenced by EventQueue::debugVerify(), and pybind_init_event().

◆ process()

void EventFunctionWrapper::process ( )
inlinevirtual

Implements Event.

Definition at line 1127 of file eventq.hh.

References EventFunctionWrapper::callback.

Referenced by StubSlavePort::recvRespRetry(), and Uart8250::write().

◆ reschedule() [1/3]

void EventManager::reschedule ( Event event,
Tick  when,
bool  always = false 
)
inline

◆ reschedule() [2/3]

void EventQueue::reschedule ( Event event,
Tick  when,
bool  always = false 
)
inline

Reschedule the specified event.

Should be called only from the owning thread.

Definition at line 814 of file eventq.hh.

References curEventQueue(), DTRACE, MipsISA::event, EventQueue::getCurTick(), inParallelMode, EventQueue::insert(), EventQueue::remove(), EventBase::Scheduled, and EventBase::Squashed.

Referenced by pybind_init_event(), and EventManager::reschedule().

◆ reschedule() [3/3]

void EventManager::reschedule ( Event event,
Tick  when,
bool  always = false 
)
inline

Definition at line 1050 of file eventq.hh.

References MipsISA::event, EventManager::eventq, and EventQueue::reschedule().

◆ schedule() [1/3]

void EventManager::schedule ( Event event,
Tick  when 
)
inline

Definition at line 1005 of file eventq.hh.

References MipsISA::event, EventManager::eventq, and EventQueue::schedule().

Referenced by DRAMSim2::accessAndRespond(), DRAMsim3::accessAndRespond(), FlashDevice::accessDevice(), DRAMInterface::activateBank(), BasePixelPump::beginLine(), DRAMInterface::Rank::checkDrainDone(), DRAMInterface::checkRefreshState(), IGbE::chkInterrupt(), NVMInterface::chooseRead(), HDLcd::cmdEnable(), GPUCoalescer::completeHitCallback(), Sinic::Base::cpuIntrPost(), NSGigE::cpuIntrPost(), Prefetcher::BOP::delayQueueEventWrapper(), GPUDispatcher::dispatch(), ComputeUnit::dispWorkgroup(), Pl111::dmaDone(), HSADevice::dmaVirt(), HSAPacketProcessor::dmaVirt(), DRAMInterface::doBurstAccess(), NVMInterface::doBurstAccess(), IdeDisk::doDmaDataRead(), IdeDisk::doDmaDataWrite(), IdeDisk::doDmaRead(), IdeDisk::doDmaTransfer(), IdeDisk::doDmaWrite(), ThermalModel::doStep(), RegisterFile::enqRegBusyEvent(), RegisterFile::enqRegFreeEvent(), RubySystem::enqueueRubyEvent(), ComputeUnit::exec(), Shader::execScheduledAdds(), GoodbyeObject::fillBuffer(), SimpleCache::handleRequest(), DmaPort::handleResp(), X86ISA::GpuTLB::handleTranslationReturn(), RubyDirectedTester::hitCallback(), ComputeUnit::injectGlobalMemFence(), Prefetcher::BOP::insertIntoDelayQueue(), Sequencer::insertRequest(), VIPERCoalescer::issueRequest(), X86ISA::GpuTLB::issueTLBLookup(), GPUCoalescer::makeRequest(), ArmISA::TableWalker::nextWalk(), GPUDispatcher::notifyWgCompl(), DVFSHandler::perfLevel(), IGbE::postInterrupt(), DRAMInterface::prechargeBank(), Prefetcher::AccessMapPatternMatching::processEpochEvent(), HelloObject::processEvent(), DRAMInterface::Rank::processPowerEvent(), NVMInterface::processReadReadyEvent(), DRAMInterface::Rank::processRefreshEvent(), NVMInterface::processWriteRespondEvent(), PowerDomain::pwrStateChangeCallback(), Pl111::readFramebuffer(), BaseCache::recvAtomic(), MemTest::recvRetry(), StubSlavePort::recvTimingReq(), TLBCoalescer::CpuSidePort::recvTimingReq(), SimpleMemory::recvTimingReq(), RiscvISA::Walker::recvTimingResp(), X86ISA::Walker::recvTimingResp(), ComputeUnit::DataPort::recvTimingResp(), BasePixelPump::renderPixels(), IGbE::restartClock(), PL031::resyncMatch(), EtherTapBase::retransmit(), Gicv3Its::runProcessTiming(), NSGigE::rxKick(), CommMonitor::samplePeriodic(), HSAPacketProcessor::schedAQLProcessing(), SMMUv3DeviceInterface::schedAtsTimingResp(), PacketQueue::schedSendEvent(), SMMUv3DeviceInterface::scheduleDeviceRetry(), GPUDispatcher::scheduleDispatch(), DRAMInterface::Rank::schedulePowerEvent(), BaseTrafficGen::scheduleUpdate(), SMMUProcess::scheduleWakeup(), DRAMInterface::Rank::scheduleWakeUpEvent(), HWScheduler::schedWakeup(), EtherBus::send(), ComputeUnit::sendRequest(), DRAMSim2::sendResponse(), DRAMsim3::sendResponse(), EtherTapBase::sendSimulated(), Pl011::setInterrupts(), Intel8254Timer::Counter::CounterEvent::setTo(), BasePixelPump::start(), IdeDisk::startDma(), sc_gem5::Kernel::startup(), HelloObject::startup(), CommMonitor::startup(), MC146818::startup(), ThermalModel::startup(), Prefetcher::AccessMapPatternMatching::startup(), DRAMSim2::startup(), DRAMsim3::startup(), DRAMInterface::Rank::startup(), GarnetSyntheticTraffic::tick(), MemTest::tick(), IGbE::tick(), DRAMSim2::tick(), DRAMsim3::tick(), Root::timeSync(), Root::timeSyncEnable(), X86ISA::GpuTLB::translationReturn(), NSGigE::transmit(), DmaPort::trySendTimingReq(), NSGigE::txKick(), GPUDispatcher::unserialize(), Sinic::Base::unserialize(), Uart8250::unserialize(), PL031::unserialize(), EnergyCtrl::unserialize(), SparcISA::ISA::unserialize(), DVFSHandler::unserialize(), VGic::unserialize(), BaseTrafficGen::unserialize(), Sinic::Device::unserialize(), NSGigE::unserialize(), IdeDisk::unserialize(), Pl111::unserialize(), GicV2::unserialize(), IGbE::unserialize(), ArchTimer::updateCounter(), GPUDispatcher::updateInvCounter(), TLBCoalescer::updatePhysAddresses(), HDLcd::virtRefresh(), RubyDirectedTester::wakeup(), Sequencer::wakeup(), RubyTester::wakeup(), GPUCoalescer::wakeup(), EnergyCtrl::write(), SMMUv3::writeControl(), and MC146818::writeData().

◆ schedule() [2/3]

void EventManager::schedule ( Event event,
Tick  when 
)
inline

Definition at line 1032 of file eventq.hh.

References MipsISA::event, EventManager::eventq, and EventQueue::schedule().

◆ schedule() [3/3]

void EventQueue::schedule ( Event event,
Tick  when,
bool  global = false 
)
inline

◆ scheduled()

bool Event::scheduled ( ) const
inline

Determine if the current event is scheduled.

Definition at line 460 of file eventq.hh.

References Event::flags, Flags< T >::isSet(), and EventBase::Scheduled.

Referenced by DRAMSim2::accessAndRespond(), DRAMsim3::accessAndRespond(), FlashDevice::accessDevice(), DRAMInterface::activateBank(), BaseKvmCPU::activateContext(), AtomicSimpleCPU::activateContext(), BaseCPU::activateContext(), TimingSimpleCPU::activateContext(), BasePixelPump::PixelEvent::active(), MemCtrl::addToReadQueue(), MemCtrl::addToWriteQueue(), DRAMInterface::checkRefreshState(), IGbE::chkInterrupt(), NVMInterface::chooseRead(), HDLcd::cmdDisable(), GPUCoalescer::completeHitCallback(), MemTest::completeRequest(), IGbE::cpuPostInt(), BaseRemoteGDB::descheduleInstCommitEvent(), BaseCPU::deschedulePowerGatingEvent(), GPUDispatcher::dispatch(), Shader::dispatchWorkgroups(), ComputeUnit::dispWorkgroup(), Pl111::dmaDone(), DRAMInterface::doBurstAccess(), NVMInterface::doBurstAccess(), FlashDevice::drain(), BaseKvmCPU::drain(), AtomicSimpleCPU::drain(), ArchTimer::drain(), BaseTrafficGen::drain(), TimingSimpleCPU::drain(), IGbE::drain(), MemCtrl::drain(), BaseKvmCPU::drainResume(), AtomicSimpleCPU::drainResume(), TimingSimpleCPU::drainResume(), IGbE::ethRxPkt(), BaseKvmCPU::finishMMIOPending(), DefaultFetch< Impl >::finishTranslation(), DmaPort::handleResp(), GenericTimer::handleStream(), X86ISA::GpuTLB::handleTranslationReturn(), IGbE::DescCache< iGbReg::RxDesc >::hasOutstandingEvents(), BaseRemoteGDB::incomingData(), Prefetcher::BOP::insertIntoDelayQueue(), Sequencer::insertRequest(), TimingSimpleCPU::isCpuDrained(), Sequencer::isDeadlockEventScheduled(), GPUCoalescer::isDeadlockEventScheduled(), DefaultFetch< Impl >::isDrained(), VIPERCoalescer::issueRequest(), GPUCoalescer::makeRequest(), BaseKvmCPU::notifyFork(), GPUDispatcher::notifyWgCompl(), DVFSHandler::perfLevel(), IGbE::postInterrupt(), DRAMInterface::prechargeBank(), LdsState::process(), MemCtrl::processNextReqEvent(), NVMInterface::processReadReadyEvent(), MemCtrl::processRespondEvent(), NVMInterface::processWriteRespondEvent(), pybind_init_event(), UFSHostDevice::readDevice(), Pl111::readFramebuffer(), TLBCoalescer::CpuSidePort::recvTimingReq(), SimpleMemory::recvTimingReq(), RiscvISA::Walker::recvTimingResp(), X86ISA::Walker::recvTimingResp(), TimingSimpleCPU::DcachePort::recvTimingResp(), Event::releaseImpl(), MemCtrl::requestEventScheduled(), DRAMInterface::respondEvent(), MemCtrl::respondEventScheduled(), IGbE::restartClock(), PL031::resyncMatch(), EtherTapBase::retransmit(), LdsState::returnQueuePush(), Gicv3Its::runProcessTiming(), NSGigE::rxKick(), HSAPacketProcessor::schedAQLProcessing(), TraceCPU::schedDcacheNextEvent(), PacketQueue::schedSendEvent(), Shader::ScheduleAdd(), SMMUv3DeviceInterface::scheduleDeviceRetry(), GPUDispatcher::scheduleDispatch(), BaseCPU::schedulePowerGatingEvent(), FullO3CPU< O3CPUImpl >::scheduleTickEvent(), HWScheduler::schedWakeup(), Iris::ThreadContext::semihostingEvent(), DmaPort::sendDma(), DRAMSim2::sendResponse(), DRAMsim3::sendResponse(), EtherTapBase::sendSimulated(), Sp805::serialize(), GPUDispatcher::serialize(), Uart8250::serialize(), PL031::serialize(), EnergyCtrl::serialize(), SystemCounter::serialize(), SparcISA::ISA::serialize(), BaseTrafficGen::serialize(), Sinic::Device::serialize(), NSGigE::serialize(), IdeDisk::serialize(), Pl111::serialize(), IGbE::serialize(), BaseCache::CacheResponsePort::setBlocked(), Pl011::setInterrupts(), BaseRemoteGDB::setSingleStep(), Iris::ThreadContext::setStatus(), BaseRemoteGDB::singleStep(), Ticked::start(), Pl111::startDma(), MC146818::startup(), Ticked::stop(), BasePixelPump::stop(), BaseKvmCPU::suspendContext(), AtomicSimpleCPU::suspendContext(), TimingSimpleCPU::suspendContext(), BaseKvmCPU::switchOut(), AtomicSimpleCPU::switchOut(), TimingSimpleCPU::switchOut(), BaseKvmCPU::takeOverFrom(), AtomicSimpleCPU::takeOverFrom(), GarnetSyntheticTraffic::tick(), MemTest::tick(), UFSHostDevice::transferHandler(), BaseTrafficGen::transition(), NSGigE::transmit(), NSGigE::txKick(), HWScheduler::unregisterQueue(), FullO3CPU< O3CPUImpl >::unscheduleTickEvent(), GPUDispatcher::unserialize(), ArchTimer::updateCounter(), GPUDispatcher::updateInvCounter(), TLBCoalescer::updatePhysAddresses(), Sp805::value(), Sp805::write(), Uart8250::write(), EnergyCtrl::write(), MC146818::writeData(), UFSHostDevice::writeDevice(), AtomicSimpleCPU::~AtomicSimpleCPU(), and Iris::ThreadContext::~ThreadContext().

◆ ScopedMigration()

EventQueue::ScopedMigration::ScopedMigration ( EventQueue _new_eq,
bool  _doMigrate = true 
)
inline

Temporarily migrate execution to a different event queue.

An instance of this class temporarily migrates execution to different event queue by releasing the current queue, locking the new queue, and updating curEventQueue(). This can, for example, be useful when performing IO across thread event queues when timing is not crucial (e.g., during fast forwarding).

ScopedMigration does nothing if both eqs are the same

Definition at line 682 of file eventq.hh.

References curEventQueue(), EventQueue::ScopedMigration::doMigrate, EventQueue::lock(), EventQueue::ScopedMigration::new_eq, EventQueue::ScopedMigration::old_eq, and EventQueue::unlock().

◆ serviceEvents()

void EventQueue::serviceEvents ( Tick  when)
inline

process all events up to the given timestamp.

we inline a quick test to see if there are any events to process; if so, call the internal out-of-line version to process them all.

Notes:

  • This is only used for "instruction" event queues. Instead of counting ticks, this is actually counting instructions.
  • This updates the current tick value to the value of the entry at the head of the queue.
Todo:
this assert is a good bug catcher. I need to make it true again.

Definition at line 869 of file eventq.hh.

References EventQueue::empty(), EventQueue::nextTick(), EventQueue::serviceOne(), and EventQueue::setCurTick().

Referenced by Minor::Execute::doInstCommitAccounting(), Iris::ThreadContext::maintainStepping(), and BaseSimpleCPU::preExecute().

◆ squash()

void Event::squash ( )
inline

◆ squashed()

bool Event::squashed ( ) const
inline

Check whether the event is squashed.

Definition at line 474 of file eventq.hh.

References Event::flags, Flags< T >::isSet(), and EventBase::Squashed.

Referenced by pybind_init_event(), and FullO3CPU< O3CPUImpl >::scheduleTickEvent().

◆ trace()

void Event::trace ( const char *  action)
protectedvirtual

This function isn't really useful if TRACING_ON is not defined.

trace event activity

Definition at line 378 of file eventq.cc.

References DPRINTF_UNCONDITIONAL.

◆ wakeup()

virtual void EventQueue::wakeup ( Tick  when = (Tick)-1)
inlinevirtual

Function to signal that the event loop should be woken up because an event has been scheduled by an agent outside the gem5 event loop(s) whose event insertion may not have been noticed by gem5.

This function isn't needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 onto other schedulers.

Parameters
whenTime of a delayed wakeup (if known). This parameter can be used by an implementation to schedule a wakeup in the future if it is sure it will remain active until then. Or it can be ignored and the event queue can be woken up now.

Definition at line 923 of file eventq.hh.

Referenced by dumprstStatsHandler(), dumpStatsHandler(), exitNowHandler(), ioHandler(), PollQueue::setupAsyncIO(), and EventManager::wakeupEventQueue().

◆ wakeupEventQueue()

void EventManager::wakeupEventQueue ( Tick  when = (Tick)-1)
inline

This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers.

Definition at line 1061 of file eventq.hh.

References EventManager::eventq, and EventQueue::wakeup().

◆ when()

Tick Event::when ( ) const
inline

◆ ~Event()

Event::~Event ( )
virtual

Definition at line 76 of file eventq.cc.

Variable Documentation

◆ CPU_Exit_Pri

const Priority EventBase::CPU_Exit_Pri = 64
static

If we want to exit a thread in a CPU, it comes after CPU_Tick_Pri.

Definition at line 206 of file eventq.hh.

◆ CPU_Switch_Pri

const Priority EventBase::CPU_Switch_Pri = -31
static

CPU switches schedule the new CPU's tick event for the same cycle (after unscheduling the old CPU's tick event).

The switch needs to come before any tick events to make sure we don't tick both CPUs in the same cycle.

Definition at line 158 of file eventq.hh.

◆ CPU_Tick_Pri

const Priority EventBase::CPU_Tick_Pri = 50
static

CPU ticks must come after other associated CPU events (such as writebacks).

Definition at line 199 of file eventq.hh.

Referenced by DefaultCommit< Impl >::generateTrapEvent(), and MipsISA::ISA::scheduleCP0Update().

◆ Debug_Break_Pri

const Priority EventBase::Debug_Break_Pri = -100
static

Breakpoints should happen before anything else (except enabling trace output), so we don't miss any action when debugging.

Definition at line 148 of file eventq.hh.

◆ Debug_Enable_Pri

const Priority EventBase::Debug_Enable_Pri = -101
static

If we enable tracing on a particular cycle, do that as the very first thing so we don't miss any of the events on that cycle (even if we enter the debugger).

Definition at line 139 of file eventq.hh.

◆ Default_Pri

const Priority EventBase::Default_Pri = 0
static

Default is zero for historical reasons.

Definition at line 174 of file eventq.hh.

Referenced by pybind_init_event().

◆ Delayed_Writeback_Pri

const Priority EventBase::Delayed_Writeback_Pri = -1
static

For some reason "delayed" inter-cluster writebacks are scheduled before regular writebacks (which have default priority).

Steve?

Definition at line 167 of file eventq.hh.

◆ DVFS_Update_Pri

const Priority EventBase::DVFS_Update_Pri = 31
static

DVFS update event leads to stats dump therefore given a lower priority to ensure all relevant states have been updated.

Definition at line 182 of file eventq.hh.

◆ Maximum_Pri

const Priority EventBase::Maximum_Pri = SCHAR_MAX
static

Maximum priority.

Definition at line 236 of file eventq.hh.

◆ Minimum_Pri

const Priority EventBase::Minimum_Pri = SCHAR_MIN
static

Event priorities, to provide tie-breakers for events scheduled at the same cycle.

Most events are scheduled at the default priority; these values are used to control events that need to be ordered within a cycle. Minimum priority

Definition at line 130 of file eventq.hh.

◆ Progress_Event_Pri

const Priority EventBase::Progress_Event_Pri = 95
static

Progress events come at the end.

Definition at line 221 of file eventq.hh.

Referenced by simulate().

◆ Serialize_Pri

const Priority EventBase::Serialize_Pri = 32
static

Serailization needs to occur before tick events also, so that a serialize/unserialize is identical to an on-line CPU switch.

Definition at line 191 of file eventq.hh.

◆ Sim_Exit_Pri

const Priority EventBase::Sim_Exit_Pri = 100
static

If we want to exit on this cycle, it's the very last thing we do.

Definition at line 229 of file eventq.hh.

Referenced by Iris::ThreadContext::ThreadContext().

◆ Stat_Event_Pri

const Priority EventBase::Stat_Event_Pri = 90
static

Statistics events (dump, reset, etc.) come after everything else, but before exit.

Definition at line 214 of file eventq.hh.


Generated on Wed Sep 30 2020 14:02:20 for gem5 by doxygen 1.8.17