51 #include "debug/ClockDomain.hh" 52 #include "params/ClockDomain.hh" 53 #include "params/DerivedClockDomain.hh" 54 #include "params/SrcClockDomain.hh" 60 ADD_STAT(clock,
"Clock period in ticks")
83 freqOpPoints(p->clock),
84 _domainID(p->domain_id),
85 _perfLevel(p->init_perf_level)
92 fatal_if(!vdom,
"DVFS: Empty voltage domain specified for "\
97 "DVFS: Number of frequency and voltage scaling points do "\
98 "not match: %d:%d ID: %d %s.\n", vdom->
numVoltages(),
104 "DVFS: Frequency operation points not in descending order for "\
118 if (clock_period == 0) {
119 fatal(
"%s has a clock period of zero\n",
name());
124 (*m)->updateClockPeriod();
130 "Setting clock period to %d ticks for source clock %s\n",
135 (*c)->updateClockPeriod();
191 SrcClockDomainParams::create()
198 parent(*p->clk_domain),
199 clockDivider(p->clk_divider)
204 fatal(
"Clock divider param cannot be less than 1");
220 (*m)->updateClockPeriod();
228 "Setting clock period to %d ticks for derived clock %s\n",
233 (*c)->updateClockPeriod();
238 DerivedClockDomainParams::create()
void registerSrcClockDom(SrcClockDomain *src_clock_dom)
Register a SrcClockDomain with this voltage domain.
VoltageDomain * voltageDomain() const
Get the voltage domain.
Stats::Value clock
Stat to report clock period of clock domain.
#define fatal(...)
This implements a cprintf based fatal() function.
void addDerivedDomain(DerivedClockDomain *clock_domain)
Add a derived domain.
void startup() override
startup() is the final initialization call before simulation.
void signalPerfLevelUpdate()
Inform other components about the changed performance level.
const uint64_t clockDivider
Local clock divider of the domain.
VoltageDomain * _voltageDomain
Voltage domain this clock domain belongs to.
Derived & scalar(T &value)
PerfLevel perfLevel() const
ClockDomainStats(ClockDomain &cd)
const uint32_t _domainID
Software recognizable id number for the domain, should be unique for each domain. ...
The derived clock domains provides the notion of a clock domain that is connected to a parent clock d...
#define UNSERIALIZE_SCALAR(scalar)
void serialize(CheckpointOut &cp) const override
Serialize an object.
const std::vector< Tick > freqOpPoints
List of possible frequency operational points, should be in descending order An empty list correspond...
bool validPerfLevel(PerfLevel perf_level) const
Checks whether the performance level requested exists in the current domain configuration.
bool sanitiseVoltages()
Recomputes the highest (fastest, i.e., numerically lowest) requested performance level of all associa...
uint64_t Tick
Tick count type.
ClockedObject declaration and implementation.
ClockDomain & parent
Reference to the parent clock domain this clock domain derives its clock period from.
Tick clkPeriodAtPerfLevel() const
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
ClockDomain declarations.
double voltage() const
Get the current voltage.
virtual const std::string name() const
void updateClockPeriod()
Called by the parent clock domain to propagate changes.
void serialize(CheckpointOut &cp) const override
Serialize an object.
A VoltageDomain is used to group clock domains that operate under the same voltage.
SrcClockDomain(const Params *p)
#define SERIALIZE_SCALAR(scalar)
The source clock domains provides the notion of a clock domain that is connected to a tunable clock s...
uint32_t domainID() const
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
std::vector< DerivedClockDomain * > children
Pointers to potential derived clock domains so we can propagate changes.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain...
std::vector< Clocked * > members
Pointers to members of this clock domain, so that when the clock period changes, we can update each m...
std::ostream CheckpointOut
ClockDomain(const Params *p, VoltageDomain *voltage_domain)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
uint32_t numVoltages() const
DerivedClockDomain(const Params *p)
Tick _clockPeriod
Pre-computed clock period in ticks.
std::vector< Info * > stats
PerfLevel _perfLevel
Current performance level the domain is set to.
double voltage() const
Get the current voltage this clock domain operates at.
Abstract superclass for simulation objects.
Tick clockPeriod() const
Get the clock period.