gem5
|
Helper class for objects that need to be clocked. More...
#include <clocked_object.hh>
Public Member Functions | |
void | updateClockPeriod () const |
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... | |
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 117 of file clocked_object.hh.
References clockDomain, and ClockDomain::registerWithClockDomain().
|
protecteddelete |
|
inlineprotectedvirtual |
Virtual destructor due to inheritance.
Definition at line 131 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 170 of file clocked_object.hh.
References clockPeriod(), tick, and update().
Referenced by BasePixelPump::beginLine(), BaseXBar::calcPacketTiming(), NetworkInterface::checkReschedule(), NetworkInterface::checkStallQueue(), HDLcd::cmdEnable(), MemTest::completeRequest(), NetworkInterface::dequeueCallback(), Pl111::dmaDone(), Cache::doTimingSupplyResponse(), GPUCoalescer::getRequestStatus(), Cache::handleFill(), Cache::handleUncacheableWriteResp(), InputUnit::increment_credit(), OutputUnit::insert_flit(), Sequencer::insertRequest(), GPUCoalescer::insertRequest(), VIPERCoalescer::invL1(), VIPERCoalescer::invwbL1(), DMASequencer::issueNext(), Sequencer::issueRequest(), GPUCoalescer::issueRequest(), DMASequencer::makeRequest(), MemTest::MemTest(), nextCycle(), ArmISA::TableWalker::nextWalk(), PerfectSwitch::operateMessageBuffer(), Throttle::operateVnet(), Ticked::ClockEvent::process(), LdsState::process(), AbstractController::queueMemoryRead(), AbstractController::queueMemoryWrite(), AbstractController::queueMemoryWritePartial(), Pl111::readFramebuffer(), MemTest::recvRetry(), HMCController::recvTimingReq(), NoncoherentXBar::recvTimingReq(), CoherentXBar::recvTimingReq(), Cache::recvTimingReq(), AbstractController::recvTimingResp(), NoncoherentXBar::recvTimingResp(), X86ISA::Walker::recvTimingResp(), CoherentXBar::recvTimingResp(), Cache::recvTimingResp(), CoherentXBar::recvTimingSnoopResp(), Cache::recvTimingSnoopResp(), BasePixelPump::renderPixels(), IGbE::restartClock(), NSGigE::rxKick(), NetworkInterface::scheduleOutputLink(), BasePixelPump::start(), DRAMSim2::startup(), GarnetSyntheticTraffic::tick(), MemTest::tick(), Sinic::Device::transferDone(), NSGigE::transferDone(), DmaPort::trySendTimingReq(), NSGigE::txKick(), NetworkLink::wakeup(), Sequencer::wakeup(), NetworkInterface::wakeup(), AbstractController::wakeUpAllBuffers(), AbstractController::wakeUpBuffers(), and VIPERCoalescer::wbL1().
|
inline |
Definition at line 213 of file clocked_object.hh.
References clockDomain, and ClockDomain::clockPeriod().
Referenced by BaseXBar::calcPacketTiming(), clockEdge(), cyclesToTicks(), frequency(), Cache::handleFill(), QueuedPrefetcher::insert(), CoherentXBar::recvAtomic(), Cache::recvAtomic(), CoherentXBar::recvAtomicSnoop(), Cache::recvAtomicSnoop(), RubyPort::MemSlavePort::recvTimingReq(), HMCController::recvTimingReq(), NoncoherentXBar::recvTimingReq(), CoherentXBar::recvTimingReq(), RubyPort::PioMasterPort::recvTimingResp(), NoncoherentXBar::recvTimingResp(), CoherentXBar::recvTimingResp(), CoherentXBar::recvTimingSnoopReq(), Cache::recvTimingSnoopReq(), CoherentXBar::recvTimingSnoopResp(), BankedArray::reserve(), resetClock(), IGbE::tick(), ticksToCycles(), update(), Sequencer::wakeup(), and GPUCoalescer::wakeup().
|
inline |
Determine the current cycle, corresponding to a tick aligned to a clock edge.
Definition at line 187 of file clocked_object.hh.
References cycle, and update().
Referenced by 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::FUPipeline::cyclesBeforeInsert(), OutputUnit::decrement_credit(), NetworkInterface::flitisizeMessage(), OutputUnit::has_credit(), OutputUnit::has_free_vc(), RubyTester::hitCallback(), Sequencer::hitCallback(), OutputUnit::increment_credit(), NetworkInterface::incrementStats(), Prefetcher::initializeStream(), Sequencer::insertRequest(), GPUCoalescer::insertRequest(), Prefetcher::issueNextPrefetch(), Throttle::operateVnet(), GPUCoalescer::recordMissLatency(), RubySystem::resetStats(), NetworkInterface::scheduleOutputLink(), OutputUnit::select_free_vc(), SwitchAllocator::send_allowed(), NetworkInterface::sendCredit(), BaseCache::setBlocked(), CrossbarSwitch::wakeup(), InputUnit::wakeup(), OutputUnit::wakeup(), NetworkLink::wakeup(), Sequencer::wakeup(), NetworkInterface::wakeup(), and GPUCoalescer::wakeup().
Definition at line 226 of file clocked_object.hh.
References ArmISA::c, and clockPeriod().
Referenced by NetworkInterface::checkStallQueue(), DMASequencer::issueNext(), Sequencer::issueRequest(), DMASequencer::makeRequest(), PerfectSwitch::operateMessageBuffer(), Throttle::operateVnet(), AbstractController::recvTimingResp(), and NetworkInterface::wakeup().
|
inline |
Definition at line 208 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 205 of file clocked_object.hh.
References clockEdge().
|
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 138 of file clocked_object.hh.
References clockPeriod(), curTick(), cycle, divCeil(), and tick.
Referenced by RubySystem::startup().
Definition at line 223 of file clocked_object.hh.
References clockPeriod(), and divCeil().
Referenced by BaseSetAssoc::accessBlock(), FALRU::accessBlock(), Pl111::dmaDone(), NetworkInterface::flitisizeMessage(), and Cache::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 81 of file clocked_object.hh.
References clockPeriod(), curTick(), cycle, divCeil(), and tick.
Referenced by clockEdge(), curCycle(), and updateClockPeriod().
|
inline |
Update the tick to the current tick.
Definition at line 151 of file clocked_object.hh.
References update().
|
inline |
Definition at line 218 of file clocked_object.hh.
References clockDomain, and ClockDomain::voltage().
Referenced by MathExprPowerModel::getStatValue(), and EnergyCtrl::read().
|
private |
The clock domain this clocked object belongs to.
Definition at line 109 of file clocked_object.hh.
Referenced by Clocked(), clockPeriod(), and voltage().
|
mutableprivate |
Definition at line 75 of file clocked_object.hh.
Referenced by curCycle(), resetClock(), and update().
|
mutableprivate |
Definition at line 71 of file clocked_object.hh.
Referenced by clockEdge(), resetClock(), and update().