49 #ifndef __SIM_CLOCKED_OBJECT_HH__ 50 #define __SIM_CLOCKED_OBJECT_HH__ 54 #include "enums/PwrState.hh" 55 #include "params/ClockedObject.hh" 103 cycle += elapsedCycles;
119 : tick(0), cycle(0), clockDomain(clk_domain)
143 cycle = elapsedCycles;
247 return reinterpret_cast<const Params*
>(_params);
253 Enums::PwrState
pwrState()
const {
return _currPwrState; }
258 return Enums::PwrStateStrings[_currPwrState];
272 void pwrState(Enums::PwrState);
285 void regStats()
override;
286 void preDumpStats()
override;
295 #endif //__SIM_CLOCKED_OBJECT_HH__
Stats::Vector pwrStateResidencyTicks
Cycles is a wrapper class for representing cycle counts, i.e.
ClockedObjectParams Params
Parameters of ClockedObject.
virtual ~Clocked()
Virtual destructor due to inheritance.
A vector of scalar stats.
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
std::string pwrStateName() const
const Params * params() const
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.
Tick cyclesToTicks(Cycles c) const
void resetClock() const
Reset the object's clock using the current global tick value.
Tick curTick()
The current simulated tick.
Stats::Distribution pwrStateClkGateDist
uint64_t frequency() 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(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
ClockDomain declarations.
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
Helper class for objects that need to be clocked.
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...
Stats::Scalar numPwrStateTransitions
Enums::PwrState pwrState() const
ClockDomain & clockDomain
The clock domain this clocked object belongs to.
virtual void clockPeriodUpdated()
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is ch...
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain...
Cycles ticksToCycles(Tick t) const
std::ostream CheckpointOut
void updateClockPeriod()
Update the tick to the current tick.
ClockedObject & clockedObject
T divCeil(const T &a, const U &b)
void registerWithClockDomain(Clocked *c)
Register a Clocked object with this ClockDomain.
void unserialize(ThreadContext &tc, CheckpointIn &cp)
Clocked & operator=(Clocked &)=delete
void update() const
Align cycle and tick to the next clock edge if not already done.
Enums::PwrState _currPwrState
To keep track of the current power state.
double voltage() const
Get the current voltage this clock domain operates at.
Abstract superclass for simulation objects.
Tick clockPeriod() const
Get the clock period.