gem5
v20.1.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 59 of file clocked_object.hh.
|
inlineprotected |
Create a clocked object and set the clock domain based on the parameters.
Definition at line 112 of file clocked_object.hh.
References clockDomain, and ClockDomain::registerWithClockDomain().
|
protecteddelete |
|
inlineprotectedvirtual |
Virtual destructor due to inheritance.
Definition at line 126 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 174 of file clocked_object.hh.
References clockPeriod(), tick, and update().
Referenced by BaseCache::access(), BasePixelPump::beginLine(), BaseXBar::calcPacketTiming(), SwitchAllocator::check_for_wakeup(), NetworkInterface::checkReschedule(), NetworkInterface::checkStallQueue(), HDLcd::cmdEnable(), MemTest::completeRequest(), NetworkInterface::dequeueCallback(), Pl111::dmaDone(), SMMUProcess::doDelay(), Cache::doTimingSupplyResponse(), BaseCache::handleFill(), SimpleCache::handleRequest(), Cache::handleSnoop(), BaseCache::handleUncacheableWriteResp(), InputUnit::increment_credit(), OutputUnit::insert_flit(), Sequencer::insertRequest(), VIPERCoalescer::invTCP(), DMASequencer::issueNext(), SMMUTranslationProcess::issuePrefetch(), VIPERCoalescer::issueRequest(), Sequencer::issueRequest(), DMASequencer::makeRequest(), nextCycle(), ArmISA::TableWalker::nextWalk(), PerfectSwitch::operateMessageBuffer(), Throttle::operateVnet(), WaitClass::prerdy(), WaitClass::preset(), LdsState::process(), Prefetcher::AccessMapPatternMatching::processEpochEvent(), WaitClass::rdy(), Pl111::readFramebuffer(), MemTest::recvRetry(), HMCController::recvTimingReq(), NoncoherentXBar::recvTimingReq(), CoherentXBar::recvTimingReq(), BaseCache::recvTimingReq(), AbstractController::recvTimingResp(), NoncoherentXBar::recvTimingResp(), RiscvISA::Walker::recvTimingResp(), X86ISA::Walker::recvTimingResp(), CoherentXBar::recvTimingResp(), BaseCache::recvTimingResp(), Cache::recvTimingSnoopResp(), CoherentXBar::recvTimingSnoopResp(), BasePixelPump::renderPixels(), IGbE::restartClock(), Sp805::restartCounter(), Gicv3Its::runProcessTiming(), NSGigE::rxKick(), NetworkBridge::scheduleFlit(), NetworkInterface::scheduleFlit(), NetworkInterface::scheduleOutputPort(), AbstractController::serviceMemoryQueue(), NoncoherentCache::serviceMSHRTargets(), Cache::serviceMSHRTargets(), WaitClass::set(), BasePixelPump::start(), Prefetcher::AccessMapPatternMatching::startup(), DRAMSim2::startup(), DRAMsim3::startup(), GarnetSyntheticTraffic::tick(), MemTest::tick(), Sinic::Device::transferDone(), NSGigE::transferDone(), DmaPort::trySendTimingReq(), NSGigE::txKick(), CrossbarSwitch::wakeup(), InputUnit::wakeup(), NetworkLink::wakeup(), Router::wakeup(), NetworkInterface::wakeup(), Sequencer::wakeup(), AbstractController::wakeUpAllBuffers(), and AbstractController::wakeUpBuffers().
|
inline |
Definition at line 214 of file clocked_object.hh.
References clockDomain, and ClockDomain::clockPeriod().
Referenced by BaseXBar::calcPacketTiming(), clockEdge(), cyclesToTicks(), GPUDispatcher::dispatch(), SMMUProcess::doDelay(), frequency(), MathExprPowerModel::getStatValue(), ComputeUnit::init(), Prefetcher::Queued::insert(), VIPERCoalescer::issueRequest(), GPUDispatcher::notifyWgCompl(), GPUCoalescer::printRequestTable(), BaseCache::recvAtomic(), CoherentXBar::recvAtomicBackdoor(), Cache::recvAtomicSnoop(), CoherentXBar::recvAtomicSnoop(), HMCController::recvTimingReq(), TLBCoalescer::CpuSidePort::recvTimingReq(), NoncoherentXBar::recvTimingReq(), CoherentXBar::recvTimingReq(), RubyPort::MemRequestPort::recvTimingResp(), RubyPort::PioRequestPort::recvTimingResp(), NoncoherentXBar::recvTimingResp(), CoherentXBar::recvTimingResp(), Cache::recvTimingSnoopReq(), CoherentXBar::recvTimingSnoopReq(), CoherentXBar::recvTimingSnoopResp(), BankedArray::reserve(), resetClock(), GPUDispatcher::scheduleDispatch(), VectorRegisterFile::scheduleWriteOperandsFromLoad(), ScalarRegisterFile::scheduleWriteOperandsFromLoad(), BaseCache::sendMSHRQueuePacket(), IGbE::tick(), ticksToCycles(), Prefetcher::Queued::translationComplete(), update(), GPUDispatcher::updateInvCounter(), Sp805::value(), NetworkInterface::wakeup(), HTMSequencer::wakeup(), Sequencer::wakeup(), and GPUCoalescer::wakeup().
|
inlineprotectedvirtual |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed.
Definition at line 145 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 192 of file clocked_object.hh.
References cycle, and update().
Referenced by Minor::FUPipeline::advance(), SwitchAllocator::arbitrate_outports(), Minor::FUPipeline::canInsert(), RubyTester::checkForDeadlock(), BaseCache::clearBlocked(), GPUCoalescer::coalescePacket(), Throttle::collateStats(), GarnetNetwork::collateStats(), Minor::FUPipeline::cyclesBeforeInsert(), OutputUnit::decrement_credit(), RubyTester::hitCallback(), OutputUnit::increment_credit(), RubyPrefetcher::initializeStream(), HTMSequencer::insertRequest(), Sequencer::insertRequest(), RubyPrefetcher::issueNextPrefetch(), Throttle::operateVnet(), GPUCoalescer::printRequestTable(), Sequencer::recordMissLatency(), RubySystem::resetStats(), BaseCache::setBlocked(), CrossbarSwitch::wakeup(), HTMSequencer::wakeup(), Sequencer::wakeup(), and GPUCoalescer::wakeup().
Definition at line 224 of file clocked_object.hh.
References ArmISA::c, and clockPeriod().
Referenced by BaseCache::access(), NetworkInterface::checkStallQueue(), Wavefront::exec(), NetworkInterface::incrementStats(), VIPERCoalescer::invTCP(), DMASequencer::issueNext(), VIPERCoalescer::issueRequest(), Sequencer::issueRequest(), X86ISA::GpuTLB::issueTLBLookup(), DMASequencer::makeRequest(), PerfectSwitch::operateMessageBuffer(), Throttle::operateVnet(), LdsState::processPacket(), AbstractController::recvTimingResp(), X86ISA::GpuTLB::translationReturn(), NetworkInterface::wakeup(), GPUCoalescer::wakeup(), VectorRegisterFile::waveExecuteInst(), and ScalarRegisterFile::waveExecuteInst().
|
inline |
Definition at line 212 of file clocked_object.hh.
References clockPeriod(), and SimClock::Frequency.
|
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 210 of file clocked_object.hh.
References clockEdge().
Referenced by ComputeUnit::dispWorkgroup(), ComputeUnit::exec(), SMMUv3DeviceInterface::schedAtsTimingResp(), SMMUv3DeviceInterface::schedTimingResp(), SMMUv3DeviceInterface::scheduleDeviceRetry(), 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 134 of file clocked_object.hh.
References clockPeriod(), curTick(), cycle, divCeil(), and tick.
Referenced by RubySystem::startup().
Definition at line 219 of file clocked_object.hh.
References clockPeriod(), divCeil(), and ArmISA::t.
Referenced by BaseCache::calculateAccessLatency(), BaseCache::calculateTagOnlyLatency(), Pl111::dmaDone(), NetworkInterface::flitisizeMessage(), NoncoherentCache::handleAtomicReqMiss(), Cache::handleAtomicReqMiss(), HTMSequencer::htmCallback(), RubyPort::MemResponsePort::recvAtomic(), and AbstractController::recvAtomic().
|
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 76 of file clocked_object.hh.
References clockPeriod(), curTick(), cycle, divCeil(), and tick.
Referenced by clockEdge(), curCycle(), Prefetcher::PIF::CompactorEntry::inSameSpatialRegion(), and updateClockPeriod().
|
inline |
Update the tick to the current tick.
Definition at line 153 of file clocked_object.hh.
References clockPeriodUpdated(), and update().
|
inline |
Definition at line 216 of file clocked_object.hh.
References clockDomain, and ClockDomain::voltage().
Referenced by MathExprPowerModel::getStatValue(), EnergyCtrl::read(), and EnergyCtrl::toMicroVolt().
|
private |
The clock domain this clocked object belongs to.
Definition at line 104 of file clocked_object.hh.
Referenced by Clocked(), clockPeriod(), and voltage().
|
mutableprivate |
Definition at line 69 of file clocked_object.hh.
Referenced by curCycle(), DRAMSim2::readComplete(), resetClock(), update(), and DRAMSim2::writeComplete().
|
mutableprivate |
Definition at line 65 of file clocked_object.hh.
Referenced by Prefetcher::SBOOE::Sandbox::access(), BaseCache::calculateAccessLatency(), clockEdge(), RubySystem::enqueueRubyEvent(), DRAMInterface::Rank::powerDownSleep(), SimpleMemory::recvTimingReq(), resetClock(), MemCtrl::restartScheduler(), DRAMInterface::Rank::schedulePowerEvent(), and update().