gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 BasePrefetcher BaseTags BasicRouter MemObject Network NetworkInterface NetworkLink RubySystem Shader ThermalModel TickedObject

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

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 65 of file clocked_object.hh.

Constructor & Destructor Documentation

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

Clocked::Clocked ( Clocked )
protecteddelete
virtual Clocked::~Clocked ( )
inlineprotectedvirtual

Virtual destructor due to inheritance.

Definition at line 131 of file clocked_object.hh.

Member Function Documentation

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

Tick Clocked::clockPeriod ( ) const
inline
Cycles Clocked::curCycle ( ) const
inline

Determine the current cycle, corresponding to a tick aligned to a clock edge.

Returns
When curTick() is on a clock edge, return the Cycle corresponding to that clock edge. When curTick() is not on a clock edge, return the Cycle corresponding to the next 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().

Tick Clocked::cyclesToTicks ( Cycles  c) const
inline
uint64_t Clocked::frequency ( ) const
inline

Definition at line 208 of file clocked_object.hh.

References clockPeriod(), and SimClock::Frequency.

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 205 of file clocked_object.hh.

References clockEdge().

Clocked& Clocked::operator= ( Clocked )
protecteddelete
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 138 of file clocked_object.hh.

References clockPeriod(), curTick(), cycle, divCeil(), and tick.

Referenced by RubySystem::startup().

Cycles Clocked::ticksToCycles ( Tick  t) const
inline
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 81 of file clocked_object.hh.

References clockPeriod(), curTick(), cycle, divCeil(), and tick.

Referenced by clockEdge(), curCycle(), and updateClockPeriod().

void Clocked::updateClockPeriod ( ) const
inline

Update the tick to the current tick.

Definition at line 151 of file clocked_object.hh.

References update().

double Clocked::voltage ( ) const
inline

Definition at line 218 of file clocked_object.hh.

References clockDomain, and ClockDomain::voltage().

Referenced by MathExprPowerModel::getStatValue(), and EnergyCtrl::read().

Member Data Documentation

ClockDomain& Clocked::clockDomain
private

The clock domain this clocked object belongs to.

Definition at line 109 of file clocked_object.hh.

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

Cycles Clocked::cycle
mutableprivate

Definition at line 75 of file clocked_object.hh.

Referenced by curCycle(), resetClock(), and update().

Tick Clocked::tick
mutableprivate

Definition at line 71 of file clocked_object.hh.

Referenced by clockEdge(), resetClock(), and update().


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

Generated on Fri Jun 9 2017 13:04:05 for gem5 by doxygen 1.8.6