gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DVFSHandler Class Reference

DVFS Handler class, maintains a list of all the domains it can handle. More...

#include <dvfs_handler.hh>

Inheritance diagram for DVFSHandler:
SimObject EventManager Serializable Drainable

Classes

struct  UpdateEvent
 Update performance level event, encapsulates all the required information for a future call to change a domain's performance level. More...
 

Public Types

typedef DVFSHandlerParams Params
 
typedef SrcClockDomain::DomainID DomainID
 
typedef SrcClockDomain::PerfLevel PerfLevel
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

 DVFSHandler (const Params *p)
 
uint32_t numDomains () const
 Get the number of domains assigned to this DVFS handler. More...
 
DomainID domainID (uint32_t index) const
 Get the n-th domain ID, from the domains managed by this handler. More...
 
bool validDomainID (DomainID domain_id) const
 Check whether a domain ID is known to the handler or not. More...
 
Tick transLatency () const
 Get transition latency to switch between performance levels. More...
 
bool perfLevel (DomainID domain_id, PerfLevel perf_level)
 Set a new performance level for the specified domain. More...
 
PerfLevel perfLevel (DomainID domain_id) const
 Get the current performance level of a domain. More...
 
Tick clkPeriodAtPerfLevel (DomainID domain_id, PerfLevel perf_level) const
 Read the clock period of the specified domain at the specified performance level. More...
 
double voltageAtPerfLevel (DomainID domain_id, PerfLevel perf_level) const
 Read the voltage of the specified domain at the specified performance level. More...
 
PerfLevel numPerfLevels (PerfLevel domain_id) const
 Get the total number of available performance levels. More...
 
bool isEnabled () const
 Check enable status of the DVFS handler, when the handler is disabled, no request should be sent to the handler. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from SimObject
const Paramsparams () const
 
 SimObject (const Params *_params)
 
virtual ~SimObject ()
 
virtual const std::string name () const
 
virtual void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint. More...
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint. More...
 
virtual void regStats ()
 Register statistics for this object. More...
 
virtual void resetStats ()
 Reset statistics associated with this object. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
virtual void startup ()
 startup() is the final initialization call before simulation. More...
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining. More...
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes. More...
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from EventManager
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick)-1)
 
void setCurTick (Tick newVal)
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 
- Public Member Functions inherited from Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 

Private Types

typedef std::map< DomainID,
SrcClockDomain * > 
Domains
 
typedef std::map< DomainID,
UpdateEvent
UpdatePerfLevelEvents
 

Private Member Functions

SrcClockDomainfindDomain (DomainID domain_id) const
 Search for a domain based on the domain ID. More...
 

Private Attributes

Domains domains
 
std::vector< DomainIDdomainIDList
 List of IDs avaiable in the domain list. More...
 
SrcClockDomainsysClkDomain
 Clock domain of the system the handler is instantiated. More...
 
bool enableHandler
 Disabling the DVFS handler ensures that all the DVFS migration requests are ignored. More...
 
const Tick _transLatency
 This corresponds to the maximum transition latency associated with the hardware transitioning from a particular performance level to the other. More...
 
UpdatePerfLevelEvents updatePerfLevelEvents
 Map from domain IDs -> perf level update events, records in-flight change requests per domain ID. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize all SimObjects in the system. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain. More...
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

DVFS Handler class, maintains a list of all the domains it can handle.

Each entry of that list is an object of the DomainConfig class, and the handler uses the methods provided by that class to get access to the configuration of each domain. The handler is responsible for setting/getting clock periods and voltages from clock/voltage domains. The handler acts the bridge between software configurable information for each domain as provided to the controller and the hardware implementation details for those domains.

Definition at line 71 of file dvfs_handler.hh.

Member Typedef Documentation

Definition at line 77 of file dvfs_handler.hh.

typedef std::map<DomainID, SrcClockDomain*> DVFSHandler::Domains
private

Definition at line 181 of file dvfs_handler.hh.

typedef DVFSHandlerParams DVFSHandler::Params

Definition at line 74 of file dvfs_handler.hh.

Definition at line 78 of file dvfs_handler.hh.

Definition at line 256 of file dvfs_handler.hh.

Constructor & Destructor Documentation

DVFSHandler::DVFSHandler ( const Params p)

Member Function Documentation

Tick DVFSHandler::clkPeriodAtPerfLevel ( DomainID  domain_id,
PerfLevel  perf_level 
) const
inline

Read the clock period of the specified domain at the specified performance level.

Parameters
domain_idDomain ID to query
perf_levelPerformance level of interest
Returns
Clock period in ticks for the requested performance level of the respective domain

Definition at line 135 of file dvfs_handler.hh.

References SrcClockDomain::clkPeriodAtPerfLevel(), ArmISA::d, findDomain(), ArmISA::n, SimObject::name(), SrcClockDomain::numPerfLevels(), and warn.

Referenced by EnergyCtrl::read().

DVFSHandler::DomainID DVFSHandler::domainID ( uint32_t  index) const

Get the n-th domain ID, from the domains managed by this handler.

Returns
Domain ID

Definition at line 97 of file dvfs_handler.cc.

References domainIDList, domains, fatal_if(), MipsISA::index, and numDomains().

Referenced by EnergyCtrl::read().

SrcClockDomain* DVFSHandler::findDomain ( DomainID  domain_id) const
inlineprivate

Search for a domain based on the domain ID.

Parameters
domain_idDomain ID to search for
Returns
Pointer to the source clock domain with matching ID.

Definition at line 200 of file dvfs_handler.hh.

References domains, and panic_if().

Referenced by clkPeriodAtPerfLevel(), numPerfLevels(), perfLevel(), DVFSHandler::UpdateEvent::updatePerfLevel(), and voltageAtPerfLevel().

bool DVFSHandler::isEnabled ( ) const
inline

Check enable status of the DVFS handler, when the handler is disabled, no request should be sent to the handler.

Returns
True, if the handler is enabled

Definition at line 175 of file dvfs_handler.hh.

References enableHandler.

Referenced by perfLevel(), EnergyCtrl::read(), EnergyCtrl::startup(), validDomainID(), and EnergyCtrl::write().

uint32_t DVFSHandler::numDomains ( ) const
inline

Get the number of domains assigned to this DVFS handler.

Returns
Number of domains

Definition at line 84 of file dvfs_handler.hh.

References domainIDList.

Referenced by domainID(), and EnergyCtrl::read().

PerfLevel DVFSHandler::numPerfLevels ( PerfLevel  domain_id) const
inline

Get the total number of available performance levels.

Parameters
domain_idDomain ID to query
Returns
Number of performance levels that where configured for the respective domain

Definition at line 165 of file dvfs_handler.hh.

References findDomain(), and SrcClockDomain::numPerfLevels().

Referenced by EnergyCtrl::read().

bool DVFSHandler::perfLevel ( DomainID  domain_id,
PerfLevel  perf_level 
)

Set a new performance level for the specified domain.

The actual update will be delayed by transLatency().

Parameters
domain_idSoftware visible ID of the domain to be configured
perf_levelRequested performance level (0 - fast, >0 slower)
Returns
status whether the setting was successful

Definition at line 121 of file dvfs_handler.cc.

References _transLatency, curTick(), ArmISA::d, EventManager::deschedule(), DPRINTF, findDomain(), isEnabled(), DVFSHandler::UpdateEvent::perfLevelToSet, EventManager::schedule(), Event::scheduled(), updatePerfLevelEvents, and warn.

Referenced by EnergyCtrl::read(), and EnergyCtrl::write().

PerfLevel DVFSHandler::perfLevel ( DomainID  domain_id) const
inline

Get the current performance level of a domain.

While a change request is in-flight, will return the current (i.e. old, unmodified) value.

Parameters
domain_idDomain ID to query
Returns
Current performance level of the specified domain

Definition at line 122 of file dvfs_handler.hh.

References findDomain(), isEnabled(), and SrcClockDomain::perfLevel().

void DVFSHandler::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 200 of file dvfs_handler.cc.

References enableHandler, MipsISA::event, SERIALIZE_CONTAINER, SERIALIZE_SCALAR, and updatePerfLevelEvents.

Tick DVFSHandler::transLatency ( ) const
inline

Get transition latency to switch between performance levels.

Returns
Transition latency

Definition at line 103 of file dvfs_handler.hh.

References _transLatency.

Referenced by EnergyCtrl::read(), and EnergyCtrl::write().

void DVFSHandler::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 227 of file dvfs_handler.cc.

References DVFSHandler::UpdateEvent::dvfsHandler, enableHandler, MipsISA::event, ArmISA::i, EventManager::schedule(), UNSERIALIZE_CONTAINER, UNSERIALIZE_SCALAR, updatePerfLevelEvents, and warn.

bool DVFSHandler::validDomainID ( DomainID  domain_id) const

Check whether a domain ID is known to the handler or not.

Parameters
domain_idDomain ID to check
Returns
Domain ID known to handler?

Definition at line 108 of file dvfs_handler.cc.

References domains, isEnabled(), and warn.

Referenced by EnergyCtrl::write().

double DVFSHandler::voltageAtPerfLevel ( DomainID  domain_id,
PerfLevel  perf_level 
) const

Read the voltage of the specified domain at the specified performance level.

Parameters
domain_idDomain ID to query
perf_levelPerformance level of interest
Returns
Voltage for the requested performance level of the respective domain

Definition at line 176 of file dvfs_handler.cc.

References ArmISA::d, DPRINTF, findDomain(), ArmISA::n, SimObject::name(), VoltageDomain::numVoltages(), VoltageDomain::voltage(), ClockDomain::voltageDomain(), and warn.

Referenced by EnergyCtrl::read().

Member Data Documentation

const Tick DVFSHandler::_transLatency
private

This corresponds to the maximum transition latency associated with the hardware transitioning from a particular performance level to the other.

Definition at line 218 of file dvfs_handler.hh.

Referenced by perfLevel(), and transLatency().

std::vector<DomainID> DVFSHandler::domainIDList
private

List of IDs avaiable in the domain list.

Definition at line 187 of file dvfs_handler.hh.

Referenced by domainID(), DVFSHandler(), and numDomains().

Domains DVFSHandler::domains
private

Definition at line 182 of file dvfs_handler.hh.

Referenced by domainID(), DVFSHandler(), findDomain(), and validDomainID().

bool DVFSHandler::enableHandler
private

Disabling the DVFS handler ensures that all the DVFS migration requests are ignored.

Domains remain at their default frequency and voltage.

Definition at line 211 of file dvfs_handler.hh.

Referenced by isEnabled(), serialize(), and unserialize().

SrcClockDomain* DVFSHandler::sysClkDomain
private

Clock domain of the system the handler is instantiated.

Definition at line 192 of file dvfs_handler.hh.

Referenced by DVFSHandler().

UpdatePerfLevelEvents DVFSHandler::updatePerfLevelEvents
private

Map from domain IDs -> perf level update events, records in-flight change requests per domain ID.

Definition at line 261 of file dvfs_handler.hh.

Referenced by DVFSHandler(), perfLevel(), serialize(), and unserialize().


The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:09 for gem5 by doxygen 1.8.6