45 #include "debug/FVPBasePwrCtrl.hh" 47 #include "params/FVPBasePwrCtrl.hh" 56 "Base Power Controller does not support multi-threaded systems\n");
77 "asserted for core %d\n", tc->
contextId());
79 if (pwrs->l0 && (pwrs->pp || pwrs->pc))
90 "deasserted for core %d\n", tc->
contextId());
101 "asserted for core %d\n", tc->
contextId());
103 if (!pwrs->l0 && pwrs->wen) {
118 "WakeRequest deasserted for core %d\n", tc->
contextId());
126 const size_t size = pkt->
getSize();
127 panic_if(size != 4,
"FVPBasePwrCtrl::read: Invalid size %i\n", size);
147 warn(
"FVPBasePwrCtrl::read: Unexpected address (0x%x:%i), " 148 "assuming RAZ\n", addr, size);
163 const size_t size = pkt->
getSize();
164 panic_if(size != 4,
"FVPBasePwrCtrl::write: Invalid size %i\n", size);
176 }
else if (pwrs->l0) {
201 }
else if (pwrs->l0) {
204 if (tc->
socketId() == tco->socketId()) {
208 if (npwrs->l0 && npwrs->pwfi)
221 pwrs->wen =
bits(data, 31);
223 if (!pwrs->l0 && pwrs->wen && pwrs->pwk) {
238 warn(
"FVPBasePwrCtrl::write: Unexpected address (0x%x:%i), " 239 "assuming WI\n", addr, size);
249 FVPBasePwrCtrl::PwrStatus *
278 if (tc->
socketId() == tco->socketId()) {
305 "from the power controller\n", tc->
contextId());
315 FVPBasePwrCtrlParams::create()
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 ...
RegVal getAffinity(ArmSystem *arm_sys, ThreadContext *tc)
Retrieves MPIDR_EL1.
ThreadContext * getThreadContextByMPID(uint32_t mpid) const
Retrieves the thread context reference for a CPU core by MPID.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
std::vector< PwrStatus > corePwrStatus
Per-core power status.
bool setWakeRequest(ThreadContext *const tc)
Triggered by the GIC when GICR_WAKER.ProcessorSleep is 1 and there are pending interrupts for the cor...
void setPowerController(FVPBasePwrCtrl *pwr_ctrl)
Sets the pointer to the Power Controller.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
virtual BaseCPU * getCpuPtr()=0
static constexpr uint32_t MPID_MSK
Mask for extracting the MPID from a 32-bit value.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
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 powerCoreOn(ThreadContext *const tc, PwrStatus *const pwrs)
Powers on a core.
FVPBasePwrCtrl(FVPBasePwrCtrlParams *const params)
void powerCoreOff(ThreadContext *const tc, PwrStatus *const pwrs)
Powers off a core.
uint64_t Tick
Tick count type.
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
std::vector< ThreadContext * > threadContexts
unsigned numContexts() const
void startCoreUp(ThreadContext *const tc)
Starts a core up.
void setStandByWfi(ThreadContext *const tc)
Triggered by the ISA when a WFI instruction is executed and (1) there are no pending interrupts and (...
void set(Enums::PwrState p)
Change the power state of this object to the power state p.
virtual void activate()=0
Set the status to Active.
void clearWakeRequest(ThreadContext *const tc)
Triggered by the GIC when GICR_WAKER.ProcessorSleep becomes 0.
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...
EndBitUnion(PwrStatus) enum Offset struct FVPBasePwrCtrl::Registers regs
void clearStandByWfi(ThreadContext *const tc)
Triggered when an interrupt is posted to the core.
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
This class implements the base power controller for FVP-based platforms.
PwrStatus * getCorePwrStatus(ThreadContext *const tc)
Retrieves the power status of a certain core and resizes the entries if needed.
Tick pioDelay
Delay that the device experinces on an access.
virtual uint32_t socketId() const =0
virtual ContextID contextId() const =0
ArmSystem & system
Reference to the arm system.
std::unordered_map< uint32_t, size_t > poweredCoresPerCluster
Number of powered cores per cluster.
T bits(T val, int first, int 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...
Addr pioAddr
Address that the device listens to.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.