46#include "debug/ClockDomain.hh"
47#include "params/ClockDomain.hh"
48#include "params/DerivedClockDomain.hh"
49#include "params/SrcClockDomain.hh"
59 ADD_STAT(clock, statistics::units::
Tick::get(),
"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();
191 parent(*
p.clk_domain),
192 clockDivider(
p.clk_divider)
197 fatal(
"Clock divider param cannot be less than 1");
213 (*m)->updateClockPeriod();
221 "Setting clock period to %d ticks for derived clock %s\n",
226 (*c)->updateClockPeriod();
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain.
VoltageDomain * _voltageDomain
Voltage domain this clock domain belongs to.
std::vector< DerivedClockDomain * > children
Pointers to potential derived clock domains so we can propagate changes.
VoltageDomain * voltageDomain() const
Get the voltage domain.
ClockDomain(const Params &p, VoltageDomain *voltage_domain)
Tick _clockPeriod
Pre-computed clock period in ticks.
Tick clockPeriod() const
Get the clock period.
std::vector< Clocked * > members
Pointers to members of this clock domain, so that when the clock period changes, we can update each m...
void addDerivedDomain(DerivedClockDomain *clock_domain)
Add a derived domain.
double voltage() const
Get the current voltage this clock domain operates at.
gem5::ClockDomain::ClockDomainStats stats
DerivedClockDomainParams Params
const uint64_t clockDivider
Local clock divider of the domain.
DerivedClockDomain(const Params &p)
ClockDomain & parent
Reference to the parent clock domain this clock domain derives its clock period from.
void updateClockPeriod()
Called by the parent clock domain to propagate changes.
virtual std::string name() const
Abstract superclass for simulation objects.
bool validPerfLevel(PerfLevel perf_level) const
Checks whether the performance level requested exists in the current domain configuration.
Tick clkPeriodAtPerfLevel() const
const uint32_t _domainID
Software recognizable id number for the domain, should be unique for each domain.
const std::vector< Tick > freqOpPoints
List of possible frequency operational points, should be in descending order An empty list correspond...
SrcClockDomainParams Params
void signalPerfLevelUpdate()
Inform other components about the changed performance level.
uint32_t domainID() const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick clockPeriod() const
Get the clock period.
void startup() override
startup() is the final initialization call before simulation.
void serialize(CheckpointOut &cp) const override
Serialize an object.
PerfLevel _perfLevel
Current performance level the domain is set to.
SrcClockDomain(const Params &p)
PerfLevel perfLevel() const
A VoltageDomain is used to group clock domains that operate under the same voltage.
double voltage() const
Get the current voltage.
void registerSrcClockDom(SrcClockDomain *src_clock_dom)
Register a SrcClockDomain with this voltage domain.
uint32_t numVoltages() const
bool sanitiseVoltages()
Recomputes the highest (fastest, i.e., numerically lowest) requested performance level of all associa...
Derived & scalar(T &value)
ClockDomain declarations.
ClockedObject declaration and implementation.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define fatal(...)
This implements a cprintf based fatal() function.
virtual void unserialize(CheckpointIn &cp)=0
Unserialize an object.
virtual void serialize(CheckpointOut &cp) const =0
Serialize an object.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Tick
Tick count type.
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)
statistics::Value clock
Stat to report clock period of clock domain.
ClockDomainStats(ClockDomain &cd)