Go to the documentation of this file.
41 #include "debug/EnergyCtrl.hh"
44 #include "params/EnergyCtrl.hh"
53 dvfsHandler(
p.dvfs_handler),
55 domainIDIndexToRead(0),
60 fatal_if(!
p.dvfs_handler,
"EnergyCtrl: Needs a DVFSHandler for a "
61 "functioning system.\n");
71 assert((daddr & 3) == 0);
76 pkt->
setLE<uint32_t>(0);
77 warn_once(
"EnergyCtrl: Disabled handler, ignoring read from reg %i\n",
142 panic(
"Tried to read EnergyCtrl at offset %#x / reg %i\n", daddr,
145 pkt->
setLE<uint32_t>(result);
160 assert((daddr & 3) == 0);
165 warn_once(
"EnergyCtrl: Disabled handler, ignoring write %u to "\
212 panic(
"Tried to write EnergyCtrl at offset %#x\n", daddr);
243 if (next_event != 0) {
252 warn(
"Existing EnergyCtrl, but no enabled DVFSHandler found.\n");
Tick curTick()
The universal simulation clock.
Tick read(PacketPtr pkt) override
Read command sent to the device.
uint32_t perfLevelAck
Acknowledgment (PERF_LEVEL_ACK) RO register, software polls this register to read back the status of ...
double voltageAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
Read the voltage of the specified domain at the specified performance level.
Tick when() const
Get the time that the event is scheduled.
static uint32_t toMicroVolt(double voltage)
Addr pioAddr
Address that the device listens to.
DVFSHandler * dvfsHandler
#define UNSERIALIZE_SCALAR(scalar)
EnergyCtrl(const Params &p)
void schedule(Event &event, Tick when)
void makeAtomicResponse()
PerfLevel numPerfLevels(PerfLevel domain_id) const
Get the total number of available performance levels.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool validDomainID(DomainID domain_id) const
Check whether a domain ID is known to the handler or not.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint64_t Tick
Tick count type.
Tick transLatency() const
Get transition latency to switch between performance levels.
Tick pioDelay
Delay that the device experinces on an access.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
EventFunctionWrapper updateAckEvent
const std::string & name()
void startup() override
startup() is the final initialization call before simulation.
#define SERIALIZE_SCALAR(scalar)
uint32_t domainIDIndexToRead
Index for getting the domain ID from the domain ID list available with the DVFS handler.
static uint32_t ticksTokHz(Tick period)
void deschedule(Event &event)
@ DVFS_HANDLER_TRANS_LATENCY
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void updatePLAck()
Update the acknowledgment that is read back by the software to confirm newly requested performance le...
uint32_t domainID
Cluster ID (DOMAIN_ID) R/W register, programmed to ID of the domain for which the set/get performance...
DomainID domainID(uint32_t index) const
Get the n-th domain ID, from the domains managed by this handler.
Tick write(PacketPtr pkt) override
Write command sent to the device.
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Addr pioSize
Size that the device's address range.
bool isEnabled() const
Check enable status of the DVFS handler, when the handler is disabled, no request should be sent to t...
std::ostream CheckpointOut
void setLE(T v)
Set the value in the data pointer to v as little endian.
Tick clkPeriodAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
Read the clock period of the specified domain at the specified performance level.
uint32_t numDomains() const
Get the number of domains assigned to this DVFS handler.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
bool perfLevel(DomainID domain_id, PerfLevel perf_level)
Set a new performance level for the specified domain.
bool scheduled() const
Determine if the current event is scheduled.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Sun Jul 30 2023 01:56:54 for gem5 by doxygen 1.8.17