49 #ifndef __SIM_CLOCKED_OBJECT_HH__
50 #define __SIM_CLOCKED_OBJECT_HH__
54 #include "enums/PwrState.hh"
55 #include "params/ClockedObject.hh"
102 cycle += elapsedCycles;
141 cycle = elapsedCycles;
289 #endif //__SIM_CLOCKED_OBJECT_HH__
Cycles is a wrapper class for representing cycle counts, i.e.
void computeStats()
Record stats values like state residency by computing the time difference from previous update...
ClockedObjectParams Params
Parameters of ClockedObject.
const Params * params() const
Cycles ticksToCycles(Tick t) const
Tick cyclesToTicks(Cycles c) const
virtual ~Clocked()
Virtual destructor due to inheritance.
double voltage() const
Get the current voltage this clock domain operates at.
uint64_t frequency() const
A vector of scalar stats.
ClockedObjectDumpCallback(ClockedObject *co_t)
void resetClock() const
Reset the object's clock using the current global tick value.
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
This is a simple scalar statistic, like a counter.
Clocked(ClockDomain &clk_domain)
Create a clocked object and set the clock domain based on the parameters.
Stats::Distribution pwrStateClkGateDist
void updateClockPeriod() const
Update the tick to the current tick.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
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...
Tick curTick()
The current simulated tick.
Enums::PwrState pwrState() const
std::string pwrStateName() const
uint64_t Tick
Tick count type.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
A simple distribution stat.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Stats::Vector pwrStateResidencyTicks
ClockDomain declarations.
void update() const
Align cycle and tick to the next clock edge if not already done.
Helper class for objects that need to be clocked.
virtual void process()
virtual process function that is invoked when the callback queue is executed.
ClockDomain & clockDomain
The clock domain this clocked object belongs to.
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain...
std::ostream CheckpointOut
std::vector< double > pwrStateWeights() const
Returns the percentage residency for each power state.
const SimObjectParams * _params
Cached copy of the object parameters.
T divCeil(const T &a, const U &b)
void registerWithClockDomain(Clocked *c)
Register a Clocked object with this ClockDomain.
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
Clocked & operator=(Clocked &)=delete
Stats::Scalar numPwrStateTransitions
Enums::PwrState _currPwrState
To keep track of the current power state.
void regStats() override
Register statistics for this object.
Abstract superclass for simulation objects.
ClockedObject(const ClockedObjectParams *p)
Tick clockPeriod() const
Get the clock period.