Go to the documentation of this file.
44 #include "debug/DVFS.hh"
45 #include "params/DVFSHandler.hh"
60 sysClkDomain(
p.sys_clk_domain),
62 _transLatency(
p.transition_latency)
66 for (
auto dit =
p.domains.begin();
dit !=
p.domains.end(); ++
dit) {
71 "system clk domain entry");
73 "DVFS: Controlled domain %s needs to have a properly "\
74 " assigned ID.\n",
d->name());
76 auto entry = std::make_pair(domain_id,
d);
77 bool new_elem =
domains.insert(entry).second;
78 fatal_if(!new_elem,
"DVFS: Domain %s with ID %d does not have a "\
79 "unique ID.\n",
d->name(), domain_id);
83 event->domainIDToSet =
d->domainID();
112 warn(
"DVFS: invalid domain ID %d, the DVFS handler does not handle this "\
113 "domain\n", domain_id);
122 DPRINTF(DVFS,
"DVFS: setPerfLevel domain %d -> %d\n", domain_id, perf_level);
125 if (!
d->validPerfLevel(perf_level)) {
126 warn(
"DVFS: invalid performance level %d for domain ID %d, request "\
127 "ignored\n", perf_level, domain_id);
135 DPRINTF(DVFS,
"DVFS: Overwriting the previous DVFS event.\n");
143 if (
d->perfLevel() == perf_level) {
144 DPRINTF(DVFS,
"DVFS: Ignoring ineffective performance level change "\
145 "%d -> %d\n",
d->perfLevel(), perf_level);
151 DPRINTF(DVFS,
"DVFS: Update for perf event scheduled for %ld\n", when);
179 return d->voltage(perf_level);
183 DPRINTF(DVFS,
"DVFS: Request for perf-level %i for single-point "\
184 "voltage domain %s. Returning voltage at level 0: %.2f "\
185 "V\n", perf_level,
d->name(),
d->voltage(0));
188 return d->voltage(0);
191 warn(
"DVFSHandler %s reads illegal voltage level %u from "\
192 "VoltageDomain %s. Returning 0 V\n",
name(), perf_level,
d->name());
213 assert(
id ==
event->domainIDToSet);
214 domain_ids.push_back(
id);
215 perf_levels.push_back(
event->perfLevelToSet);
216 whens.push_back(
event->scheduled() ?
event->when() : 0);
231 warn(
"DVFS: Forcing enable handler status to unserialized value of %d",
243 for (
size_t i = 0;
i < domain_ids.size(); ++
i) {;
246 event->domainIDToSet = domain_ids[
i];
247 event->perfLevelToSet = perf_levels[
i];
Tick curTick()
The universal simulation clock.
double voltageAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
Read the voltage of the specified domain at the specified performance level.
VoltageDomain * voltageDomain() const
Get the voltage domain.
void serialize(CheckpointOut &cp) const override
Serialize an object.
#define UNSERIALIZE_SCALAR(scalar)
#define UNSERIALIZE_CONTAINER(member)
SrcClockDomain::PerfLevel PerfLevel
void schedule(Event &event, Tick when)
DVFSHandler(const Params &p)
SrcClockDomain * sysClkDomain
Clock domain of the system the handler is instantiated.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
SrcClockDomain * findDomain(DomainID domain_id) const
Search for a domain based on the domain ID.
bool validDomainID(DomainID domain_id) const
Check whether a domain ID is known to the handler or not.
virtual std::string name() const
DomainID domainIDToSet
ID of the domain that will be changed by the in-flight event.
static const DomainID emptyDomainID
std::vector< DomainID > domainIDList
List of IDs avaiable in the domain list.
uint64_t Tick
Tick count type.
void dump()
Dump all statistics data to the registered outputs.
The source clock domains provides the notion of a clock domain that is connected to a tunable clock s...
Abstract superclass for simulation objects.
PerfLevel perfLevelToSet
Target performance level of the in-flight event.
bool enableHandler
Disabling the DVFS handler ensures that all the DVFS migration requests are ignored.
const Tick _transLatency
This corresponds to the maximum transition latency associated with the hardware transitioning from a ...
#define SERIALIZE_SCALAR(scalar)
SrcClockDomain::DomainID DomainID
void deschedule(Event &event)
DVFS Handler class, maintains a list of all the domains it can handle.
DomainID domainID(uint32_t index) const
Get the n-th domain ID, from the domains managed by this handler.
#define SERIALIZE_CONTAINER(member)
static DVFSHandler * dvfsHandler
Static pointer to the single DVFS hander for all the update events.
bool isEnabled() const
Check enable status of the DVFS handler, when the handler is disabled, no request should be sent to t...
std::ostream CheckpointOut
UpdatePerfLevelEvents updatePerfLevelEvents
Map from domain IDs -> perf level update events, records in-flight change requests per domain ID.
A VoltageDomain is used to group clock domains that operate under the same voltage.
uint32_t numDomains() const
Get the number of domains assigned to this DVFS handler.
void updatePerfLevel()
Updates the performance level by modifying the clock and the voltage of the associated clocked object...
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
bool perfLevel(DomainID domain_id, PerfLevel perf_level)
Set a new performance level for the specified domain.
Update performance level event, encapsulates all the required information for a future call to change...
bool scheduled() const
Determine if the current event is scheduled.
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17