51 #include "debug/ClockDomain.hh"
52 #include "params/ClockDomain.hh"
53 #include "params/DerivedClockDomain.hh"
54 #include "params/SrcClockDomain.hh"
63 using namespace Stats;
70 .
desc(
"Clock period in ticks")
82 freqOpPoints(p->clock),
83 _domainID(p->domain_id),
84 _perfLevel(p->init_perf_level)
91 fatal_if(!vdom,
"DVFS: Empty voltage domain specified for "\
96 "DVFS: Number of frequency and voltage scaling points do "\
97 "not match: %d:%d ID: %d %s.\n", vdom->
numVoltages(),
103 "DVFS: Frequency operation points not in descending order for "\
117 if (clock_period == 0) {
118 fatal(
"%s has a clock period of zero\n",
name());
123 (*m)->updateClockPeriod();
129 "Setting clock period to %d ticks for source clock %s\n",
134 (*c)->updateClockPeriod();
190 SrcClockDomainParams::create()
197 parent(*p->clk_domain),
198 clockDivider(p->clk_divider)
203 fatal(
"Clock divider param cannot be less than 1");
219 (*m)->updateClockPeriod();
227 "Setting clock period to %d ticks for derived clock %s\n",
232 (*c)->updateClockPeriod();
237 DerivedClockDomainParams::create()
uint32_t domainID() const
void registerSrcClockDom(SrcClockDomain *src_clock_dom)
Register a SrcClockDomain with this voltage domain.
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 Params * params() const
double voltage() const
Get the current voltage this clock domain operates at.
const uint64_t clockDivider
Local clock divider of the domain.
VoltageDomain * _voltageDomain
Voltage domain this clock domain belongs to.
virtual void regStats()
Register statistics for this object.
Derived & scalar(T &value)
VoltageDomain * voltageDomain() const
Get the voltage domain.
const uint32_t _domainID
Software recognizable id number for the domain, should be unique for each domain. ...
bool validPerfLevel(PerfLevel perf_level) const
Checks whether the performance level requested exists in the current domain configuration.
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 sanitiseVoltages()
Recomputes the highest (fastest, i.e., numerically lowest) requested performance level of all associa...
uint32_t numVoltages() const
uint64_t Tick
Tick count type.
ClockedObject declaration and implementation.
double voltage() const
Get the current voltage.
ClockDomain & parent
Reference to the parent clock domain this clock domain derives its clock period from.
ClockDomain declarations.
Stats::Value currentClock
Stat to report clock period of clock domain.
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...
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::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
PerfLevel perfLevel() const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick clkPeriodAtPerfLevel() const
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
DerivedClockDomain(const Params *p)
Tick _clockPeriod
Pre-computed clock period in ticks.
fatal_if(p->js_features.size() > 16,"Too many job slot feature registers specified (%i)\n", p->js_features.size())
void regStats()
Register statistics for this object.
PerfLevel _perfLevel
Current performance level the domain is set to.
Tick clockPeriod() const
Get the clock period.