41#include "debug/EnergyCtrl.hh"
44#include "params/EnergyCtrl.hh"
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");
Addr pioAddr
Address that the device listens to.
BasicPioDevice(const Params &p, Addr size)
Tick pioDelay
Delay that the device experinces on an access.
Addr pioSize
Size that the device's address range.
static uint32_t toMicroVolt(double voltage)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
static uint32_t ticksTokHz(Tick period)
Tick read(PacketPtr pkt) override
Read command sent to the device.
void startup() override
startup() is the final initialization call before simulation.
DVFSHandler * dvfsHandler
EventFunctionWrapper updateAckEvent
EnergyCtrl(const Params &p)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Tick write(PacketPtr pkt) override
Write command sent to the device.
@ DVFS_HANDLER_TRANS_LATENCY
void updatePLAck()
Update the acknowledgment that is read back by the software to confirm newly requested performance le...
void serialize(CheckpointOut &cp) const override
Serialize an object.
uint32_t perfLevelAck
Acknowledgment (PERF_LEVEL_ACK) RO register, software polls this register to read back the status of ...
uint32_t domainIDIndexToRead
Index for getting the domain ID from the domain ID list available with the DVFS handler.
uint32_t domainID
Cluster ID (DOMAIN_ID) R/W register, programmed to ID of the domain for which the set/get performance...
void setLE(T v)
Set the value in the data pointer to v as little endian.
void makeAtomicResponse()
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
DVFSHandler and DomainConfig class declaration used for managing voltage and frequency scaling of the...
The energy controller is a device being used to manage power and energy related control operations wi...
void deschedule(Event &event)
void schedule(Event &event, Tick when)
#define panic(...)
This implements a cprintf based panic() function.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Copyright (c) 2024 Arm Limited All rights reserved.
Tick curTick()
The universal simulation clock.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
Declaration of the Packet class.
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)
const std::string & name()