gem5  v20.1.0.0
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Clocked Class Reference

Helper class for objects that need to be clocked. More...

#include <clocked_object.hh>

Inheritance diagram for Clocked:
BasePixelPump ClockedObject HDLcd::PixelPump AbstractController AbstractMemory ArmISA::TableWalker BaseCache BaseTags BaseTrafficGen BaseXBar BasicRouter Bridge ComputeUnit GarnetSyntheticTraffic LdsState MemDelay MemObject MemTest Network NetworkInterface NetworkLink PioDevice Prefetcher::AccessMapPatternMatching Prefetcher::Base QoS::MemCtrl RiscvISA::Walker RubyDirectedTester RubyPort RubySystem RubyTester SerialLink Shader SimpleCache SMMUv3 SMMUv3DeviceInterface ThermalModel TickedObject TLBCoalescer X86ISA::GpuTLB X86ISA::Walker

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
 
Clockedoperator= (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
 
ClockDomainclockDomain
 The clock domain this clocked object belongs to. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Clocked() [1/2]

Clocked::Clocked ( ClockDomain clk_domain)
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().

◆ Clocked() [2/2]

Clocked::Clocked ( Clocked )
protecteddelete

◆ ~Clocked()

virtual Clocked::~Clocked ( )
inlineprotectedvirtual

Virtual destructor due to inheritance.

Definition at line 126 of file clocked_object.hh.

Member Function Documentation

◆ clockEdge()

Tick Clocked::clockEdge ( Cycles  cycles = Cycles(0)) const
inline

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.

Parameters
cyclesThe number of cycles into the future
Returns
The start tick when the requested clock edge occurs. Precisely, this tick can be curTick() + [0, clockPeriod()) + clockPeriod() * cycles

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().

◆ clockPeriod()

Tick Clocked::clockPeriod ( ) const
inline

◆ clockPeriodUpdated()

virtual void Clocked::clockPeriodUpdated ( )
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().

◆ curCycle()

Cycles Clocked::curCycle ( ) const
inline

◆ cyclesToTicks()

Tick Clocked::cyclesToTicks ( Cycles  c) const
inline

◆ frequency()

uint64_t Clocked::frequency ( ) const
inline

Definition at line 212 of file clocked_object.hh.

References clockPeriod(), and SimClock::Frequency.

◆ nextCycle()

Tick Clocked::nextCycle ( ) const
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.

Returns
The start tick of the first cycle that is at least one cycle in the future. Precisely, the returned tick can be in the range curTick() + [clockPeriod(), 2 * clockPeriod())

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().

◆ operator=()

Clocked& Clocked::operator= ( Clocked )
protecteddelete

◆ resetClock()

void Clocked::resetClock ( ) const
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().

◆ ticksToCycles()

Cycles Clocked::ticksToCycles ( Tick  t) const
inline

◆ update()

void Clocked::update ( ) const
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().

◆ updateClockPeriod()

void Clocked::updateClockPeriod ( )
inline

Update the tick to the current tick.

Definition at line 153 of file clocked_object.hh.

References clockPeriodUpdated(), and update().

◆ voltage()

double Clocked::voltage ( ) const
inline

Member Data Documentation

◆ clockDomain

ClockDomain& Clocked::clockDomain
private

The clock domain this clocked object belongs to.

Definition at line 104 of file clocked_object.hh.

Referenced by Clocked(), clockPeriod(), and voltage().

◆ cycle

Cycles Clocked::cycle
mutableprivate

◆ tick

Tick Clocked::tick
mutableprivate

The documentation for this class was generated from the following file:

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