48 _currPwrState(p->default_p_state),
53 p->power_model->setClockedObject(
this);
68 unsigned int currPwrState;
81 warn_once(
"ClockedObject: Already in the requested power state, " \
94 warn(
"ClockedObject: More than one power state change request "\
95 "encountered within the same simulation tick");
138 ret.resize(Enums::PwrState::Num_PwrState);
139 for (
unsigned i = 0;
i < Enums::PwrState::Num_PwrState;
i++)
140 ret[
i] = residencies[
i] / \
151 using namespace Stats;
155 .
desc(
"Number of power state transitions")
160 unsigned num_bins = std::max(
params()->p_state_clk_gate_bins, 10U);
163 (
params()->p_state_clk_gate_max / num_bins))
165 .
desc(
"Distribution of time spent in the clock gated state")
170 .
init(Enums::PwrState::Num_PwrState)
172 .
desc(
"Cumulative time (in ticks) in various power states")
175 for (
int i = 0;
i < Enums::PwrState::Num_PwrState;
i++) {
const FlagsType pdf
Print the percent of the total that this entry represents.
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation...
Result total() const
Return a total of all entries in this vector.
void computeStats()
Record stats values like state residency by computing the time difference from previous update...
const Params * params() const
const FlagsType nonan
Don't print if this is NAN.
virtual void regStats()
Register statistics for this object.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
Stats::Distribution pwrStateClkGateDist
Derived & init(size_type size)
Set this vector to have the given size.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void value(VCounter &vec) const
#define UNSERIALIZE_SCALAR(scalar)
Tick curTick()
The current simulated tick.
Enums::PwrState pwrState() const
uint64_t Tick
Tick count type.
void serialize(CheckpointOut &cp) const override
Serialize an object.
ClockedObject declaration and implementation.
Stats::Vector pwrStateResidencyTicks
Distribution & init(Counter min, Counter max, Counter bkt)
Set the parameters of this distribution.
Helper class for objects that need to be clocked.
void registerDumpCallback(Callback *cb)
Register a callback that should be called whenever statistics are about to be dumped.
#define SERIALIZE_SCALAR(scalar)
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
virtual const std::string name() const
std::ostream CheckpointOut
std::vector< double > pwrStateWeights() const
Returns the percentage residency for each power state.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Stats::Scalar numPwrStateTransitions
const FlagsType nozero
Don't print if this is zero.
Enums::PwrState _currPwrState
To keep track of the current power state.
void regStats() override
Register statistics for this object.
Abstract superclass for simulation objects.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
ClockedObject(const ClockedObjectParams *p)