46#ifndef __SIM_DVFS_HANDLER_HH__
47#define __SIM_DVFS_HANDLER_HH__
55#include "debug/DVFS.hh"
56#include "params/DVFSHandler.hh"
144 return d->clkPeriodAtPerfLevel(perf_level);
146 warn(
"DVFSHandler %s reads illegal frequency level %u from "\
147 "SrcClockDomain %s. Returning 0\n",
name(), perf_level,
d->name());
184 typedef std::map<DomainID, SrcClockDomain*>
Domains;
206 "DVFS: Could not find a domain for ID %d.\n",domain_id );
207 return domains.find(domain_id)->second;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
DVFS Handler class, maintains a list of all the domains it can handle.
SrcClockDomain * sysClkDomain
Clock domain of the system the handler is instantiated.
Tick transLatency() const
Get transition latency to switch between performance levels.
SrcClockDomain::PerfLevel PerfLevel
PerfLevel perfLevel(DomainID domain_id) const
Get the current performance level of a domain.
std::map< DomainID, SrcClockDomain * > Domains
Tick clkPeriodAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
Read the clock period of the specified domain at the specified performance level.
std::map< DomainID, UpdateEvent > UpdatePerfLevelEvents
DVFSHandler(const Params &p)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
bool perfLevel(DomainID domain_id, PerfLevel perf_level)
Set a new performance level for the specified domain.
bool isEnabled() const
Check enable status of the DVFS handler, when the handler is disabled, no request should be sent to t...
std::vector< DomainID > domainIDList
List of IDs avaiable in the domain list.
DomainID domainID(uint32_t index) const
Get the n-th domain ID, from the domains managed by this handler.
double voltageAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
Read the voltage of the specified domain at the specified performance level.
SrcClockDomain * findDomain(DomainID domain_id) const
Search for a domain based on the domain ID.
uint32_t numDomains() const
Get the number of domains assigned to this DVFS handler.
SrcClockDomain::DomainID DomainID
void serialize(CheckpointOut &cp) const override
Serialize an object.
PerfLevel numPerfLevels(PerfLevel domain_id) const
Get the total number of available performance levels.
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.
const Tick _transLatency
This corresponds to the maximum transition latency associated with the hardware transitioning from a ...
bool enableHandler
Disabling the DVFS handler ensures that all the DVFS migration requests are ignored.
virtual std::string name() const
Abstract superclass for simulation objects.
The source clock domains provides the notion of a clock domain that is connected to a tunable clock s...
PerfLevel numPerfLevels() const
Get the number of available performance levels for this clock domain.
void perfLevel(PerfLevel perf_level)
Sets the current performance level of the domain.
ClockDomain declarations.
static const Priority DVFS_Update_Pri
DVFS update event leads to stats dump therefore given a lower priority to ensure all relevant states ...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
static SimObject * find(const char *name)
Find the SimObject with the given name and return a pointer to it.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Tick
Tick count type.
Update performance level event, encapsulates all the required information for a future call to change...
void updatePerfLevel()
Updates the performance level by modifying the clock and the voltage of the associated clocked object...
DomainID domainIDToSet
ID of the domain that will be changed by the in-flight event.
static DVFSHandler * dvfsHandler
Static pointer to the single DVFS hander for all the update events.
PerfLevel perfLevelToSet
Target performance level of the in-flight event.