41#ifndef __ARCH_ARM_ISA_HH__
42#define __ARCH_ARM_ISA_HH__
56#include "debug/Checkpoint.hh"
57#include "enums/DecoderFlavor.hh"
64struct DummyArmISADeviceParams;
86 std::unique_ptr<BaseISADevice>
timer;
132 if (cpsr.width == 0) {
162 panic(
"Unrecognized mode setting in CPSR.\n");
171 void clear()
override;
213 warn(
"User mode does not have SPSR\n");
229 warn(
"User mode does not have SPSR\n");
254 warn(
"Trying to access SPSR in an invalid mode: %d\n",
297 if (pmselr.sel == 31)
304 panic(
"Unrecognized misc. register.\n");
310 flat_idx += secure_reg ? 2 : 1;
328 int reg_as_int =
static_cast<int>(
reg);
330 reg_as_int += (
release->
has(ArmExtension::SECURITY) && !
ns) ?
343 return std::make_pair(flat_idx, 0);
354 return std::make_pair(lower, upper);
373 template <
typename Elem>
377 static_assert(
sizeof(Elem) <=
sizeof(uint64_t),
378 "Elem type is too large.");
379 eCount *= (
sizeof(uint64_t) /
sizeof(Elem));
380 for (
int i = 16 /
sizeof(Elem);
i < eCount; ++
i) {
395 return new PCState(new_inst_addr);
426 Addr cacheBlockMask)
override;
428 Addr cacheBlockMask)
override;
432 Addr cacheBlockMask)
override;
Base class for devices that use the MiscReg interfaces.
Dummy device that prints a warning when it is accessed.
bool inSecureState() const
Return true if the PE is in Secure state.
const RegId & mapIntRegId(RegIndex idx) const
void setMiscRegReset(RegIndex, RegVal val)
unsigned getCurSveVecLenInBits() const
static SelfDebug * getSelfDebug(ThreadContext *tc)
ExceptionLevel currEL() const
Returns the current Exception Level (EL) of the ISA object.
void takeOverFrom(ThreadContext *new_tc, ThreadContext *old_tc) override
void serialize(CheckpointOut &cp) const override
Serialize an object.
void copyRegsFrom(ThreadContext *src) override
unsigned getCurSveVecLenInBitsAtReset() const
const enums::DecoderFlavor _decoderFlavor
DummyISADevice dummyDevice
Dummy device for to handle non-existing ISA devices.
RegVal readMiscRegReset(RegIndex) const
void setupThreadContext()
void setMiscRegNoEffect(RegIndex idx, RegVal val) override
void addressTranslation64(MMU::ArmTranslationType tran_type, BaseMMU::Mode mode, Request::Flags flags, RegVal val)
int snsBankedIndex64(MiscRegIndex reg, bool ns) const
void handleLockedSnoop(PacketPtr pkt, Addr cacheBlockMask) override
int flattenMiscIndex(int reg) const
std::pair< int, int > getMiscIndices(int misc_reg) const
PCStateBase * newPCState(Addr new_inst_addr=0) const override
RegVal miscRegs[NUM_MISCREGS]
unsigned smeVL
SME vector length in quadwords.
static void zeroSveVecRegUpperPart(Elem *v, unsigned eCount)
std::unique_ptr< BaseISADevice > timer
bool handleLockedWrite(const RequestPtr &req, Addr cacheBlockMask) override
uint64_t getExecutingAsid() const override
int64_t getVectorLengthInBytes() const override
This function returns the vector length of the Vector Length Agnostic extension of the ISA.
void globalClearExclusive() override
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void updateRegMap(CPSR cpsr)
void startup() override
startup() is the final initialization call before simulation.
int redirectRegVHE(int misc_reg)
Returns the enconcing equivalent when VHE is implemented and HCR_EL2.E2H is enabled and executing at ...
BaseISADevice & getGICv3CPUInterface()
BaseISADevice & getGenericTimer()
RegVal readMiscRegNoEffect(RegIndex idx) const override
const ArmRelease * getRelease() const
bool impdefAsNop
If true, accesses to IMPLEMENTATION DEFINED registers are treated as NOP hence not causing UNDEFINED ...
void setMiscReg(RegIndex, RegVal val) override
unsigned sveVL
SVE vector length in quadwords.
const MiscRegLUTEntryInitializer InitReg(uint32_t reg)
void handleLockedRead(const RequestPtr &req) override
enums::DecoderFlavor decoderFlavor() const
void addressTranslation(MMU::ArmTranslationType tran_type, BaseMMU::Mode mode, Request::Flags flags, RegVal val)
void initializeMiscRegMetadata()
const ArmRelease * release
This could be either a FS or a SE release.
RegVal readMiscReg(RegIndex idx) override
void handleLockedSnoopHit() override
SelfDebug * getSelfDebug() const
unsigned getCurSmeVecLenInBitsAtReset() const
std::unique_ptr< BaseISADevice > gicv3CpuInterface
bool inUserMode() const override
unsigned getCurSmeVecLenInBits() const
Metadata table accessible via the value of the register.
bool has(ArmExtension ext) const
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Register ID: describe an architectural register with its class and index.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual BaseISA * getIsaPtr() const =0
#define panic(...)
This implements a cprintf based panic() function.
@ MISCREG_PMXEVTYPER_PMCCFILTR
static bool inUserMode(CPSR cpsr)
std::vector< struct MiscRegLUTEntry > lookUpMiscReg(NUM_MISCREGS)
GenericISA::DelaySlotPCState< 4 > PCState
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< Request > RequestPtr
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.