Go to the documentation of this file.
45 #include "debug/DVFS.hh"
46 #include "params/DVFSHandler.hh"
59 sysClkDomain(
p->sys_clk_domain),
61 _transLatency(
p->transition_latency)
65 for (
auto dit =
p->domains.begin();
dit !=
p->domains.end(); ++
dit) {
70 "system clk domain entry");
72 "DVFS: Controlled domain %s needs to have a properly "\
73 " assigned ID.\n",
d->name());
75 auto entry = std::make_pair(domain_id,
d);
76 bool new_elem =
domains.insert(entry).second;
77 fatal_if(!new_elem,
"DVFS: Domain %s with ID %d does not have a "\
78 "unique ID.\n",
d->name(), domain_id);
82 event->domainIDToSet =
d->domainID();
111 warn(
"DVFS: invalid domain ID %d, the DVFS handler does not handle this "\
112 "domain\n", domain_id);
121 DPRINTF(DVFS,
"DVFS: setPerfLevel domain %d -> %d\n", domain_id, perf_level);
124 if (!
d->validPerfLevel(perf_level)) {
125 warn(
"DVFS: invalid performance level %d for domain ID %d, request "\
126 "ignored\n", perf_level, domain_id);
134 DPRINTF(DVFS,
"DVFS: Overwriting the previous DVFS event.\n");
142 if (
d->perfLevel() == perf_level) {
143 DPRINTF(DVFS,
"DVFS: Ignoring ineffective performance level change "\
144 "%d -> %d\n",
d->perfLevel(), perf_level);
150 DPRINTF(DVFS,
"DVFS: Update for perf event scheduled for %ld\n", when);
178 return d->voltage(perf_level);
182 DPRINTF(DVFS,
"DVFS: Request for perf-level %i for single-point "\
183 "voltage domain %s. Returning voltage at level 0: %.2f "\
184 "V\n", perf_level,
d->name(),
d->voltage(0));
187 return d->voltage(0);
190 warn(
"DVFSHandler %s reads illegal voltage level %u from "\
191 "VoltageDomain %s. Returning 0 V\n",
name(), perf_level,
d->name());
212 assert(
id ==
event->domainIDToSet);
213 domain_ids.push_back(
id);
214 perf_levels.push_back(
event->perfLevelToSet);
215 whens.push_back(
event->scheduled() ?
event->when() : 0);
230 warn(
"DVFS: Forcing enable handler status to unserialized value of %d",
242 for (
size_t i = 0;
i < domain_ids.size(); ++
i) {;
245 event->domainIDToSet = domain_ids[
i];
246 event->perfLevelToSet = perf_levels[
i];
256 DVFSHandlerParams::create()
bool scheduled() const
Determine if the current event is scheduled.
Update performance level event, encapsulates all the required information for a future call to change...
SrcClockDomain * sysClkDomain
Clock domain of the system the handler is instantiated.
#define UNSERIALIZE_SCALAR(scalar)
#define UNSERIALIZE_CONTAINER(member)
SrcClockDomain * findDomain(DomainID domain_id) const
Search for a domain based on the domain ID.
uint64_t Tick
Tick count type.
The source clock domains provides the notion of a clock domain that is connected to a tunable clock s...
double voltageAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
Read the voltage of the specified domain at the specified performance level.
void deschedule(Event &event)
static const DomainID emptyDomainID
bool validDomainID(DomainID domain_id) const
Check whether a domain ID is known to the handler or not.
UpdatePerfLevelEvents updatePerfLevelEvents
Map from domain IDs -> perf level update events, records in-flight change requests per domain ID.
bool isEnabled() const
Check enable status of the DVFS handler, when the handler is disabled, no request should be sent to t...
static DVFSHandler * dvfsHandler
Static pointer to the single DVFS hander for all the update events.
bool enableHandler
Disabling the DVFS handler ensures that all the DVFS migration requests are ignored.
void schedule(Event &event, Tick when)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
DomainID domainIDToSet
ID of the domain that will be changed by the in-flight event.
PerfLevel perfLevelToSet
Target performance level of the in-flight event.
uint32_t numDomains() const
Get the number of domains assigned to this DVFS handler.
DomainID domainID(uint32_t index) const
Get the n-th domain ID, from the domains managed by this handler.
A VoltageDomain is used to group clock domains that operate under the same voltage.
void serialize(CheckpointOut &cp) const override
Serialize an object.
std::vector< DomainID > domainIDList
List of IDs avaiable in the domain list.
#define SERIALIZE_SCALAR(scalar)
VoltageDomain * voltageDomain() const
Get the voltage domain.
virtual const std::string name() const
void dump()
Dump all statistics data to the registered outputs.
#define SERIALIZE_CONTAINER(member)
SrcClockDomain::DomainID DomainID
std::ostream CheckpointOut
const Tick _transLatency
This corresponds to the maximum transition latency associated with the hardware transitioning from a ...
SrcClockDomain::PerfLevel PerfLevel
DVFSHandler(const Params *p)
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...
bool perfLevel(DomainID domain_id, PerfLevel perf_level)
Set a new performance level for the specified domain.
DVFS Handler class, maintains a list of all the domains it can handle.
Tick curTick()
The current simulated tick.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17