gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::DVFSHandler Class Reference

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

#include <dvfs_handler.hh>

Inheritance diagram for gem5::DVFSHandler:
gem5::SimObject gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named

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 gem5::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.
 
DomainID domainID (uint32_t index) const
 Get the n-th domain ID, from the domains managed by this handler.
 
bool validDomainID (DomainID domain_id) const
 Check whether a domain ID is known to the handler or not.
 
Tick transLatency () const
 Get transition latency to switch between performance levels.
 
bool perfLevel (DomainID domain_id, PerfLevel perf_level)
 Set a new performance level for the specified domain.
 
PerfLevel perfLevel (DomainID domain_id) const
 Get the current performance level of a domain.
 
Tick clkPeriodAtPerfLevel (DomainID domain_id, PerfLevel perf_level) const
 Read the clock period of the specified domain at the specified performance level.
 
double voltageAtPerfLevel (DomainID domain_id, PerfLevel perf_level) const
 Read the voltage of the specified domain at the specified performance level.
 
PerfLevel numPerfLevels (PerfLevel domain_id) const
 Get the total number of available performance levels.
 
bool isEnabled () const
 Check enable status of the DVFS handler, when the handler is disabled, no request should be sent to the handler.
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
- Public Member Functions inherited from gem5::SimObject
const Paramsparams () const
 
 SimObject (const Params &p)
 
virtual ~SimObject ()
 
virtual void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected.
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint.
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint.
 
virtual void regProbePoints ()
 Register probe points for this object.
 
virtual void regProbeListeners ()
 Register probe listeners for this object.
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object.
 
virtual PortgetPort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a port with a given name and index.
 
virtual void startup ()
 startup() is the final initialization call before simulation.
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining.
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes.
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers.
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
- Public Member Functions inherited from gem5::EventManager
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)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers.
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 Event manger manages events in the event queue.
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
- Public Member Functions inherited from gem5::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section.
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object.
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 
- Public Member Functions inherited from gem5::Drainable
DrainState drainState () const
 Return the current drain state of an object.
 
virtual void notifyFork ()
 Notify a child process of a fork.
 
- Public Member Functions inherited from gem5::statistics::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group.
 
virtual ~Group ()
 
virtual void regStats ()
 Callback to set stat parameters.
 
virtual void resetStats ()
 Callback to reset stats.
 
virtual void preDumpStats ()
 Callback before stats are dumped.
 
void addStat (statistics::Info *info)
 Register a stat with this group.
 
const std::map< std::string, Group * > & getStatGroups () const
 Get all child groups associated with this object.
 
const std::vector< Info * > & getStats () const
 Get all stats associated with this object.
 
void addStatGroup (const char *name, Group *block)
 Add a stat block as a child of this block.
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group.
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block.
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
- Public Member Functions inherited from gem5::Named
 Named (const std::string &name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 

Private Types

typedef std::map< DomainID, SrcClockDomain * > Domains
 
typedef std::map< DomainID, UpdateEventUpdatePerfLevelEvents
 

Private Member Functions

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

Private Attributes

Domains domains
 
std::vector< DomainIDdomainIDList
 List of IDs avaiable in the domain list.
 
SrcClockDomainsysClkDomain
 Clock domain of the system the handler is instantiated.
 
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 particular performance level to the other.
 
UpdatePerfLevelEvents updatePerfLevelEvents
 Map from domain IDs -> perf level update events, records in-flight change requests per domain ID.
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::SimObject
static void serializeAll (const std::string &cpt_dir)
 Create a checkpoint by serializing all SimObjects in the system.
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it.
 
static void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints.
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints.
 
- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section.
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it.
 
- Protected Member Functions inherited from gem5::Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain.
 
void signalDrainDone () const
 Signal that an object is drained.
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters.
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue.
 

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 74 of file dvfs_handler.hh.

Member Typedef Documentation

◆ DomainID

◆ Domains

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

Definition at line 184 of file dvfs_handler.hh.

◆ Params

typedef DVFSHandlerParams gem5::DVFSHandler::Params

Definition at line 77 of file dvfs_handler.hh.

◆ PerfLevel

◆ UpdatePerfLevelEvents

Definition at line 260 of file dvfs_handler.hh.

Constructor & Destructor Documentation

◆ DVFSHandler()

Member Function Documentation

◆ clkPeriodAtPerfLevel()

Tick gem5::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 138 of file dvfs_handler.hh.

References gem5::ArmISA::d, findDomain(), gem5::ArmISA::n, gem5::Named::name(), and warn.

Referenced by gem5::EnergyCtrl::read().

◆ domainID()

DVFSHandler::DomainID gem5::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 94 of file dvfs_handler.cc.

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

Referenced by gem5::EnergyCtrl::read().

◆ findDomain()

SrcClockDomain * gem5::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 203 of file dvfs_handler.hh.

References domains, gem5::SimObject::find(), and panic_if.

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

◆ isEnabled()

bool gem5::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 178 of file dvfs_handler.hh.

References enableHandler.

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

◆ numDomains()

uint32_t gem5::DVFSHandler::numDomains ( ) const
inline

Get the number of domains assigned to this DVFS handler.

Returns
Number of domains

Definition at line 87 of file dvfs_handler.hh.

References domainIDList.

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

◆ numPerfLevels()

PerfLevel gem5::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 168 of file dvfs_handler.hh.

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

Referenced by gem5::EnergyCtrl::read().

◆ perfLevel() [1/2]

PerfLevel gem5::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 125 of file dvfs_handler.hh.

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

◆ perfLevel() [2/2]

bool gem5::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 118 of file dvfs_handler.cc.

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

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

◆ serialize()

void gem5::DVFSHandler::serialize ( CheckpointOut & cp) const
overridevirtual

Serialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 197 of file dvfs_handler.cc.

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

◆ transLatency()

Tick gem5::DVFSHandler::transLatency ( ) const
inline

Get transition latency to switch between performance levels.

Returns
Transition latency

Definition at line 106 of file dvfs_handler.hh.

References _transLatency.

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

◆ unserialize()

void gem5::DVFSHandler::unserialize ( CheckpointIn & cp)
overridevirtual

Unserialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 224 of file dvfs_handler.cc.

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

◆ validDomainID()

bool gem5::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 105 of file dvfs_handler.cc.

References domains, isEnabled(), and warn.

Referenced by gem5::EnergyCtrl::write().

◆ voltageAtPerfLevel()

double gem5::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 173 of file dvfs_handler.cc.

References gem5::ArmISA::d, DPRINTF, findDomain(), gem5::ArmISA::n, gem5::Named::name(), gem5::ClockDomain::voltageDomain(), and warn.

Referenced by gem5::EnergyCtrl::read().

Member Data Documentation

◆ _transLatency

const Tick gem5::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 221 of file dvfs_handler.hh.

Referenced by perfLevel(), and transLatency().

◆ domainIDList

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

List of IDs avaiable in the domain list.

Definition at line 190 of file dvfs_handler.hh.

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

◆ domains

Domains gem5::DVFSHandler::domains
private

Definition at line 185 of file dvfs_handler.hh.

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

◆ enableHandler

bool gem5::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 214 of file dvfs_handler.hh.

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

◆ sysClkDomain

SrcClockDomain* gem5::DVFSHandler::sysClkDomain
private

Clock domain of the system the handler is instantiated.

Definition at line 195 of file dvfs_handler.hh.

Referenced by DVFSHandler().

◆ updatePerfLevelEvents

UpdatePerfLevelEvents gem5::DVFSHandler::updatePerfLevelEvents
private

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

Definition at line 265 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 Tue Jun 18 2024 16:24:11 for gem5 by doxygen 1.11.0