45#include "debug/FVPBasePwrCtrl.hh"
47#include "params/FVPBasePwrCtrl.hh"
59 "Base Power Controller does not support multi-threaded systems\n");
80 "asserted for core %d\n", tc->
contextId());
82 if (pwrs->l0 && (pwrs->pp || pwrs->pc))
93 "deasserted for core %d\n", tc->
contextId());
104 "asserted for core %d\n", tc->
contextId());
106 if (!pwrs->l0 && pwrs->wen) {
121 "WakeRequest deasserted for core %d\n", tc->
contextId());
129 const size_t size = pkt->
getSize();
130 panic_if(size != 4,
"FVPBasePwrCtrl::read: Invalid size %i\n", size);
150 warn(
"FVPBasePwrCtrl::read: Unexpected address (0x%x:%i), "
151 "assuming RAZ\n",
addr, size);
157 pkt->
setUintX(resp, ByteOrder::little);
166 const size_t size = pkt->
getSize();
167 panic_if(size != 4,
"FVPBasePwrCtrl::write: Invalid size %i\n", size);
179 }
else if (pwrs->l0) {
204 }
else if (pwrs->l0) {
207 if (tc->
socketId() == tco->socketId()) {
211 if (npwrs->l0 && npwrs->pwfi)
226 if (!pwrs->l0 && pwrs->wen && pwrs->pwk) {
241 warn(
"FVPBasePwrCtrl::write: Unexpected address (0x%x:%i), "
242 "assuming WI\n",
addr, size);
252FVPBasePwrCtrl::PwrStatus *
281 if (tc->
socketId() == tco->socketId()) {
308 "from the power controller\n", tc->
contextId());
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
void setPowerController(FVPBasePwrCtrl *pwr_ctrl)
Sets the pointer to the Power Controller.
Addr pioAddr
Address that the device listens to.
Tick pioDelay
Delay that the device experinces on an access.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
void clearStandByWfi(ThreadContext *const tc)
Triggered when an interrupt is posted to the core.
bool setWakeRequest(ThreadContext *const tc)
Triggered by the GIC when GICR_WAKER.ProcessorSleep is 1 and there are pending interrupts for the cor...
std::vector< PwrStatus > corePwrStatus
Per-core power status.
EndBitUnion(PwrStatus) enum Offset struct gem5::FVPBasePwrCtrl::Registers regs
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
ThreadContext * getThreadContextByMPID(uint32_t mpid) const
Retrieves the thread context reference for a CPU core by MPID.
std::unordered_map< uint32_t, size_t > poweredCoresPerCluster
Number of powered cores per cluster.
void powerCoreOff(ThreadContext *const tc, PwrStatus *const pwrs)
Powers off a core.
PwrStatus * getCorePwrStatus(ThreadContext *const tc)
Retrieves the power status of a certain core and resizes the entries if needed.
void setStandByWfi(ThreadContext *const tc)
Triggered by the ISA when a WFI instruction is executed and (1) there are no pending interrupts and (...
ArmSystem & system
Reference to the arm system.
void startup() override
startup() is the final initialization call before simulation.
FVPBasePwrCtrl(const FVPBasePwrCtrlParams ¶ms)
void powerCoreOn(ThreadContext *const tc, PwrStatus *const pwrs)
Powers on a core.
static constexpr uint32_t MPID_MSK
Mask for extracting the MPID from a 32-bit value.
void clearWakeRequest(ThreadContext *const tc)
Triggered by the GIC when GICR_WAKER.ProcessorSleep becomes 0.
void startCoreUp(ThreadContext *const tc)
Starts a core up.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
void set(enums::PwrState p)
Change the power state of this object to the power state p.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual void activate()=0
Set the status to Active.
virtual uint32_t socketId() const =0
virtual BaseCPU * getCpuPtr()=0
virtual ContextID contextId() const =0
This class implements the base power controller for FVP-based platforms.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
virtual void startup()
startup() is the final initialization call before simulation.
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
Affinity getAffinity(ArmSystem *arm_sys, ThreadContext *tc)
Retrieves MPIDR_EL1.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.