44 #include "debug/EnergyCtrl.hh"
47 #include "params/EnergyCtrl.hh"
52 dvfsHandler(p->dvfs_handler),
54 domainIDIndexToRead(0),
59 fatal_if(!p->dvfs_handler,
"EnergyCtrl: Needs a DVFSHandler for a "
60 "functioning system.\n");
70 assert((daddr & 3) == 0);
75 pkt->
set<uint32_t>(0);
76 warn_once(
"EnergyCtrl: Disabled handler, ignoring read from reg %i\n",
141 panic(
"Tried to read EnergyCtrl at offset %#x / reg %i\n", daddr,
144 pkt->
set<uint32_t>(result);
156 data = pkt->
get<uint32_t>();
159 assert((daddr & 3) == 0);
164 warn_once(
"EnergyCtrl: Disabled handler, ignoring write %u to "\
165 "reg %i\n", data, reg);
167 "reg %i\n", data, reg);
211 panic(
"Tried to write EnergyCtrl at offset %#x\n", daddr);
242 if (next_event != 0) {
256 warn(
"Existing EnergyCtrl, but no enabled DVFSHandler found.\n");
bool perfLevel(DomainID domain_id, PerfLevel perf_level)
Set a new performance level for the specified domain.
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
uint32_t perfLevelAck
Acknowledgment (PERF_LEVEL_ACK) RO register, software polls this register to read back the status of ...
Tick write(PacketPtr pkt) override
Write command sent to the device.
bool scheduled() const
Determine if the current event is scheduled.
static uint32_t toMicroVolt(double voltage)
bool validDomainID(DomainID domain_id) const
Check whether a domain ID is known to the handler or not.
Tick clkPeriodAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
Read the clock period of the specified domain at the specified performance level. ...
Registers
Discovery flows:
bool isEnabled() const
Check enable status of the DVFS handler, when the handler is disabled, no request should be sent to t...
void deschedule(Event &event)
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
uint32_t domainIDIndexToRead
Index for getting the domain ID from the domain ID list available with the DVFS handler.
DVFSHandler * dvfsHandler
#define UNSERIALIZE_SCALAR(scalar)
EnergyCtrl(const Params *p)
uint32_t domainID
Cluster ID (DOMAIN_ID) R/W register, programmed to ID of the domain for which the set/get performance...
Tick curTick()
The current simulated tick.
EventWrapper< EnergyCtrl,&EnergyCtrl::updatePLAck > updateAckEvent
Tick transLatency() const
Get transition latency to switch between performance levels.
Addr pioSize
Size that the device's address range.
Tick when() const
Get the time that the event is scheduled.
void makeAtomicResponse()
uint64_t Tick
Tick count type.
void serialize(CheckpointOut &cp) const override
Serialize an object.
PerfLevel numPerfLevels(PerfLevel domain_id) const
Get the total number of available performance levels.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
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...
double voltageAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
Read the voltage of the specified domain at the specified performance level.
#define SERIALIZE_SCALAR(scalar)
uint32_t numDomains() const
Get the number of domains assigned to this DVFS handler.
static uint32_t ticksTokHz(Tick period)
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
Declaration of the Packet class.
std::ostream CheckpointOut
The energy controller is a device being used to manage power and energy related control operations wi...
Tick pioDelay
Delay that the device experinces on an access.
void schedule(Event &event, Tick when)
Tick read(PacketPtr pkt) override
Read command sent to the device.
void startup() override
startup() is the final initialization call before simulation.
DomainID domainID(uint32_t index) const
Get the n-th domain ID, from the domains managed by this handler.
fatal_if(p->js_features.size() > 16,"Too many job slot feature registers specified (%i)\n", p->js_features.size())
Addr pioAddr
Address that the device listens to.