gem5
v19.0.0.0
|
Helper class for objects that need to be clocked. More...
#include <clocked_object.hh>
Public Member Functions | |
void | updateClockPeriod () |
Update the tick to the current tick. More... | |
Tick | clockEdge (Cycles cycles=Cycles(0)) const |
Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. More... | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. More... | |
Tick | nextCycle () const |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More... | |
uint64_t | frequency () const |
Tick | clockPeriod () const |
double | voltage () const |
Cycles | ticksToCycles (Tick t) const |
Tick | cyclesToTicks (Cycles c) const |
Protected Member Functions | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. More... | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. More... | |
void | resetClock () const |
Reset the object's clock using the current global tick value. More... | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. More... | |
Private Member Functions | |
void | update () const |
Align cycle and tick to the next clock edge if not already done. More... | |
Private Attributes | |
Tick | tick |
Cycles | cycle |
ClockDomain & | clockDomain |
The clock domain this clocked object belongs to. More... | |
Helper class for objects that need to be clocked.
Clocked objects typically inherit from this class. Objects that need SimObject functionality as well should inherit from ClockedObject.
Definition at line 65 of file clocked_object.hh.
|
inlineprotected |
Create a clocked object and set the clock domain based on the parameters.
Definition at line 118 of file clocked_object.hh.
References operator=(), and ClockDomain::registerWithClockDomain().
|
protecteddelete |
|
inlineprotectedvirtual |
Virtual destructor due to inheritance.
Definition at line 132 of file clocked_object.hh.
Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle.
When curTick() is on a clock edge, the number of cycles in the parameter is added to curTick() to be returned. When curTick() is not aligned to a clock edge, the number of cycles in the parameter is added to the next clock edge.
cycles | The number of cycles into the future |
Definition at line 180 of file clocked_object.hh.
References clockPeriod(), and update().
Referenced by BaseCache::access(), BaseKvmCPU::activateContext(), AtomicSimpleCPU::activateContext(), TimingSimpleCPU::activateContext(), TimingSimpleCPU::advanceInst(), BasePixelPump::beginLine(), BaseXBar::calcPacketTiming(), NetworkInterface::checkReschedule(), NetworkInterface::checkStallQueue(), HDLcd::cmdEnable(), MemTest::completeRequest(), NetworkInterface::dequeueCallback(), Pl111::dmaDone(), SMMUProcess::doDelay(), Cache::doTimingSupplyResponse(), TimingSimpleCPU::drain(), GPUCoalescer::getRequestStatus(), BaseCache::handleFill(), TimingSimpleCPU::handleReadPacket(), SimpleCache::handleRequest(), Cache::handleSnoop(), BaseCache::handleUncacheableWriteResp(), TimingSimpleCPU::handleWritePacket(), InputUnit::increment_credit(), OutputUnit::insert_flit(), Sequencer::insertRequest(), GPUCoalescer::insertRequest(), VIPERCoalescer::invL1(), VIPERCoalescer::invwbL1(), DMASequencer::issueNext(), SMMUTranslationProcess::issuePrefetch(), Sequencer::issueRequest(), GPUCoalescer::issueRequest(), DMASequencer::makeRequest(), MemTest::MemTest(), nextCycle(), ArmISA::TableWalker::nextWalk(), PerfectSwitch::operateMessageBuffer(), Throttle::operateVnet(), LdsState::process(), AccessMapPatternMatching::processEpochEvent(), SparcISA::ISA::processHSTickCompare(), SparcISA::ISA::processSTickCompare(), AbstractController::queueMemoryRead(), AbstractController::queueMemoryWrite(), AbstractController::queueMemoryWritePartial(), PseudoInst::quiesceCycles(), Pl111::readFramebuffer(), MemTest::recvRetry(), HMCController::recvTimingReq(), NoncoherentXBar::recvTimingReq(), CoherentXBar::recvTimingReq(), BaseCache::recvTimingReq(), AbstractController::recvTimingResp(), NoncoherentXBar::recvTimingResp(), X86ISA::Walker::recvTimingResp(), CoherentXBar::recvTimingResp(), BaseCache::recvTimingResp(), Cache::recvTimingSnoopResp(), CoherentXBar::recvTimingSnoopResp(), BasePixelPump::renderPixels(), IGbE::restartClock(), Sp805::restartCounter(), Gicv3Its::runProcessTiming(), NSGigE::rxKick(), TraceCPU::schedDcacheNext(), MipsISA::ISA::scheduleCP0Update(), NetworkInterface::scheduleOutputLink(), BaseCPU::schedulePowerGatingEvent(), FullO3CPU< O3CPUImpl >::scheduleTickEvent(), NoncoherentCache::serviceMSHRTargets(), Cache::serviceMSHRTargets(), SparcISA::ISA::setFSReg(), BasePixelPump::start(), AccessMapPatternMatching::startup(), DRAMSim2::startup(), BaseCPU::suspendContext(), GarnetSyntheticTraffic::tick(), AtomicSimpleCPU::tick(), MemTest::tick(), FullO3CPU< O3CPUImpl >::tick(), BaseKvmCPU::tick(), Sinic::Device::transferDone(), NSGigE::transferDone(), NSGigE::txKick(), FullO3CPU< O3CPUImpl >::wakeCPU(), NetworkLink::wakeup(), NetworkInterface::wakeup(), Sequencer::wakeup(), AbstractController::wakeUpAllBuffers(), AbstractController::wakeUpBuffers(), and VIPERCoalescer::wbL1().
|
inline |
Definition at line 220 of file clocked_object.hh.
References ClockDomain::clockPeriod().
Referenced by BaseXBar::calcPacketTiming(), clockEdge(), Iris::BaseCPU::clockPeriodUpdated(), cyclesToTicks(), SMMUProcess::doDelay(), BaseKvmCPU::doMMIOAccess(), ArmISA::TableWalker::fetchDescriptor(), ArmISA::Stage2MMU::Stage2Translation::finish(), frequency(), MathExprPowerModel::getStatValue(), A9GlobalTimer::Timer::getTimeCounterFromTicks(), QueuedPrefetcher::insert(), BaseKvmCPU::kvmRun(), CPUProgressEvent::process(), A9GlobalTimer::Timer::read(), CpuLocalTimer::Timer::read(), BaseCache::recvAtomic(), CoherentXBar::recvAtomicBackdoor(), Cache::recvAtomicSnoop(), CoherentXBar::recvAtomicSnoop(), RubyPort::MemSlavePort::recvTimingReq(), HMCController::recvTimingReq(), NoncoherentXBar::recvTimingReq(), CoherentXBar::recvTimingReq(), RubyPort::PioMasterPort::recvTimingResp(), NoncoherentXBar::recvTimingResp(), CoherentXBar::recvTimingResp(), Cache::recvTimingSnoopReq(), CoherentXBar::recvTimingSnoopReq(), CoherentXBar::recvTimingSnoopResp(), BankedArray::reserve(), resetClock(), A9GlobalTimer::Timer::restartCounter(), CpuLocalTimer::Timer::restartTimerCounter(), CpuLocalTimer::Timer::restartWatchdogCounter(), TraceCPU::schedDcacheNext(), BaseCache::sendMSHRQueuePacket(), AtomicSimpleCPU::tick(), IGbE::tick(), ticksToCycles(), QueuedPrefetcher::translationComplete(), update(), Sp805::value(), Sequencer::wakeup(), GPUCoalescer::wakeup(), and RealViewOsc::~RealViewOsc().
|
inlineprotectedvirtual |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed.
Reimplemented in Iris::BaseCPU, and FastModel::CortexA76.
Definition at line 151 of file clocked_object.hh.
Referenced by updateClockPeriod().
|
inline |
Determine the current cycle, corresponding to a tick aligned to a clock edge.
Definition at line 198 of file clocked_object.hh.
References cycle, and update().
Referenced by FullO3CPU< O3CPUImpl >::activateContext(), Minor::FUPipeline::advance(), SwitchAllocator::arbitrate_inports(), SwitchAllocator::arbitrate_outports(), NetworkInterface::calculateVC(), Minor::FUPipeline::canInsert(), SwitchAllocator::check_for_wakeup(), RubyTester::checkForDeadlock(), NetworkInterface::checkReschedule(), BaseCache::clearBlocked(), Throttle::collateStats(), GarnetNetwork::collateStats(), Minor::Execute::commit(), Minor::FUPipeline::cyclesBeforeInsert(), OutputUnit::decrement_credit(), Minor::Execute::evaluate(), NetworkInterface::flitisizeMessage(), FullO3CPU< O3CPUImpl >::FullO3CPU(), OutputUnit::has_credit(), OutputUnit::has_free_vc(), RubyTester::hitCallback(), OutputUnit::increment_credit(), NetworkInterface::incrementStats(), Prefetcher::initializeStream(), Sequencer::insertRequest(), GPUCoalescer::insertRequest(), Minor::Execute::issue(), Prefetcher::issueNextPrefetch(), Throttle::operateVnet(), AlphaISA::ISA::readIpr(), X86ISA::ISA::readMiscReg(), RiscvISA::ISA::readMiscReg(), Sequencer::recordMissLatency(), GPUCoalescer::recordMissLatency(), RubySystem::resetStats(), NetworkInterface::scheduleOutputLink(), OutputUnit::select_free_vc(), SwitchAllocator::send_allowed(), NetworkInterface::sendCredit(), BaseCache::setBlocked(), X86ISA::ISA::setMiscReg(), FullO3CPU< O3CPUImpl >::suspendContext(), TimingSimpleCPU::takeOverFrom(), FullO3CPU< O3CPUImpl >::takeOverFrom(), FullO3CPU< O3CPUImpl >::tick(), TimingSimpleCPU::updateCycleCounts(), FullO3CPU< O3CPUImpl >::wakeCPU(), CrossbarSwitch::wakeup(), InputUnit::wakeup(), OutputUnit::wakeup(), NetworkLink::wakeup(), NetworkInterface::wakeup(), Sequencer::wakeup(), and GPUCoalescer::wakeup().
Definition at line 230 of file clocked_object.hh.
References ArmISA::c, and clockPeriod().
Referenced by BaseCache::access(), NetworkInterface::checkStallQueue(), VIPERCoalescer::invL1(), VIPERCoalescer::invwbL1(), DMASequencer::issueNext(), Sequencer::issueRequest(), GPUCoalescer::issueRequest(), DMASequencer::makeRequest(), PerfectSwitch::operateMessageBuffer(), Throttle::operateVnet(), AbstractController::recvTimingResp(), NetworkInterface::wakeup(), and VIPERCoalescer::wbL1().
|
inline |
Definition at line 218 of file clocked_object.hh.
References clockPeriod(), and SimClock::Frequency.
Referenced by FastModel::CortexA76::clockPeriodUpdated(), LinuxAlphaSystem::setDelayLoop(), and AlphaBackdoor::startup().
|
inline |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future.
When curTick() is at the current cycle edge, this returns the next clock edge. When calling this during the middle of a cycle, this returns 2 clock edges in the future.
Definition at line 216 of file clocked_object.hh.
References clockEdge().
Referenced by BaseKvmCPU::drainResume(), AtomicSimpleCPU::drainResume(), TimingSimpleCPU::drainResume(), FullO3CPU< O3CPUImpl >::drainResume(), BaseKvmCPU::finishMMIOPending(), PseudoInst::quiesceSkip(), SMMUv3SlaveInterface::schedAtsTimingResp(), SMMUv3SlaveInterface::schedTimingResp(), SMMUv3SlaveInterface::scheduleDeviceRetry(), FullO3CPU< O3CPUImpl >::scheduleThreadExitEvent(), and SMMUv3::writeControl().
|
inlineprotected |
Reset the object's clock using the current global tick value.
Likely to be used only when the global clock is reset. Currently, this done only when Ruby is done warming up the memory system.
Definition at line 140 of file clocked_object.hh.
References clockPeriod(), curTick(), and divCeil().
Referenced by RubySystem::startup().
Definition at line 225 of file clocked_object.hh.
References clockPeriod(), and divCeil().
Referenced by BaseKvmCPU::activateContext(), AtomicSimpleCPU::activateContext(), BaseCache::calculateAccessLatency(), BaseCache::calculateTagOnlyLatency(), Pl111::dmaDone(), NetworkInterface::flitisizeMessage(), NoncoherentCache::handleAtomicReqMiss(), Cache::handleAtomicReqMiss(), RubyPort::MemSlavePort::recvAtomic(), AbstractController::recvAtomic(), and BaseKvmCPU::tick().
|
inlineprivate |
Align cycle and tick to the next clock edge if not already done.
When complete, tick must be at least curTick().
Definition at line 82 of file clocked_object.hh.
References clockPeriod(), curTick(), cycle, and divCeil().
Referenced by clockEdge(), PIFPrefetcher::CompactorEntry::CompactorEntry(), curCycle(), and updateClockPeriod().
|
inline |
Update the tick to the current tick.
Definition at line 159 of file clocked_object.hh.
References clockPeriodUpdated(), and update().
|
inline |
Definition at line 222 of file clocked_object.hh.
References ClockDomain::voltage().
Referenced by MathExprPowerModel::getStatValue(), and EnergyCtrl::read().
|
private |
The clock domain this clocked object belongs to.
Definition at line 110 of file clocked_object.hh.
|
mutableprivate |
Definition at line 75 of file clocked_object.hh.
Referenced by curCycle(), and update().
|
mutableprivate |
Definition at line 71 of file clocked_object.hh.
Referenced by BaseCache::calculateAccessLatency(), FullO3CPU< O3CPUImpl >::demapDataPage(), DRAMCtrl::Rank::forceSelfRefreshExit(), SBOOEPrefetcher::Sandbox::insert(), and SBOOEPrefetcher::Sandbox::Sandbox().