49 #include "debug/DVFS.hh"
50 #include "params/DVFSHandler.hh"
63 sysClkDomain(p->sys_clk_domain),
65 _transLatency(p->transition_latency)
69 for (
auto dit = p->domains.begin(); dit != p->domains.end(); ++dit) {
74 "system clk domain entry");
76 "DVFS: Controlled domain %s needs to have a properly "\
77 " assigned ID.\n", d->
name());
79 auto entry = std::make_pair(domain_id, d);
80 bool new_elem =
domains.insert(entry).second;
81 fatal_if(!new_elem,
"DVFS: Domain %s with ID %d does not have a "\
82 "unique ID.\n", d->
name(), domain_id);
86 event->domainIDToSet = d->
domainID();
115 warn(
"DVFS: invalid domain ID %d, the DVFS handler does not handle this "\
116 "domain\n", domain_id);
125 DPRINTF(DVFS,
"DVFS: setPerfLevel domain %d -> %d\n", domain_id, perf_level);
128 if (!
d->validPerfLevel(perf_level)) {
129 warn(
"DVFS: invalid performance level %d for domain ID %d, request "\
130 "ignored\n", perf_level, domain_id);
138 DPRINTF(DVFS,
"DVFS: Overwriting the previous DVFS event.\n");
146 if (
d->perfLevel() == perf_level) {
147 DPRINTF(DVFS,
"DVFS: Ignoring ineffective performance level change "\
148 "%d -> %d\n",
d->perfLevel(), perf_level);
154 DPRINTF(DVFS,
"DVFS: Update for perf event scheduled for %ld\n", when);
186 DPRINTF(DVFS,
"DVFS: Request for perf-level %i for single-point "\
187 "voltage domain %s. Returning voltage at level 0: %.2f "\
194 warn(
"DVFSHandler %s reads illegal voltage level %u from "\
195 "VoltageDomain %s. Returning 0 V\n",
name(), perf_level, d->
name());
216 assert(
id ==
event->domainIDToSet);
217 domain_ids.push_back(
id);
218 perf_levels.push_back(
event->perfLevelToSet);
219 whens.push_back(
event->scheduled() ?
event->when() : 0);
234 warn(
"DVFS: Forcing enable handler status to unserialized value of %d",
246 for (
size_t i = 0;
i < domain_ids.size(); ++
i) {;
249 event->domainIDToSet = domain_ids[
i];
250 event->perfLevelToSet = perf_levels[
i];
260 DVFSHandlerParams::create()
uint32_t domainID() const
SrcClockDomain * findDomain(DomainID domain_id) const
Search for a domain based on the domain ID.
bool perfLevel(DomainID domain_id, PerfLevel perf_level)
Set a new performance level for the specified domain.
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.
bool scheduled() const
Determine if the current event is scheduled.
bool validDomainID(DomainID domain_id) const
Check whether a domain ID is known to the handler or not.
SrcClockDomain * sysClkDomain
Clock domain of the system the handler is instantiated.
bool isEnabled() const
Check enable status of the DVFS handler, when the handler is disabled, no request should be sent to t...
VoltageDomain * voltageDomain() const
Get the voltage domain.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void deschedule(Event &event)
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_CONTAINER(member)
void updatePerfLevel()
Updates the performance level by modifying the clock and the voltage of the associated clocked object...
Tick curTick()
The current simulated tick.
UpdatePerfLevelEvents updatePerfLevelEvents
Map from domain IDs -> perf level update events, records in-flight change requests per domain ID...
uint32_t numVoltages() const
uint64_t Tick
Tick count type.
void serialize(CheckpointOut &cp) const override
Serialize an object.
double voltage() const
Get the current voltage.
ClockDomain declarations.
#define UNSERIALIZE_CONTAINER(member)
A VoltageDomain is used to group clock domains that operate under the same voltage.
DomainID domainIDToSet
ID of the domain that will be changed by the in-flight event.
DVFSHandler and DomainConfig class declaration used for managing voltage and frequency scaling of the...
double voltageAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
Read the voltage of the specified domain at the specified performance level.
#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 numDomains() const
Get the number of domains assigned to this DVFS handler.
static const DomainID emptyDomainID
DVFS Handler class, maintains a list of all the domains it can handle.
virtual const std::string name() const
std::vector< DomainID > domainIDList
List of IDs avaiable in the domain list.
DVFSHandler(const Params *p)
std::ostream CheckpointOut
SrcClockDomain::DomainID DomainID
void schedule(Event &event, Tick when)
SrcClockDomain::PerfLevel PerfLevel
void dump()
Dump all statistics data to the registered outputs.
DomainID domainID(uint32_t index) const
Get the n-th domain ID, from the domains managed by this handler.
fatal_if(p->js_features.size() > 16,"Too many job slot feature registers specified (%i)\n", p->js_features.size())
static DVFSHandler * dvfsHandler
Static pointer to the single DVFS hander for all the update events.
const Tick _transLatency
This corresponds to the maximum transition latency associated with the hardware transitioning from a ...
Abstract superclass for simulation objects.
Update performance level event, encapsulates all the required information for a future call to change...