43 #ifndef __ARCH_ARM_ISA_HH__ 44 #define __ARCH_ARM_ISA_HH__ 54 #include "debug/Checkpoint.hh" 55 #include "enums/VecRegRenameMode.hh" 57 #include "enums/DecoderFlavour.hh" 60 struct DummyArmISADeviceParams;
84 std::unique_ptr<BaseISADevice>
timer;
125 _reset(0), _res0(0), _res1(0), _raz(0), _rao(0) {}
132 uint64_t
wi()
const {
return _raz |
_rao; }
140 std::bitset<NUM_MISCREG_INFOS> &
info;
169 return implemented(
false);
212 userNonSecureRead(
v);
213 userNonSecureWrite(
v);
227 privNonSecureRead(
v);
228 privNonSecureWrite(
v);
251 privNonSecureRead(
v);
277 chain
hyp(
bool v =
true)
const {
315 chain
mon(
bool v =
true)
const {
319 monNonSecureWrite(
v);
329 monNonSecureWrite(
v);
333 userNonSecureRead(
v);
334 userNonSecureWrite(
v);
337 privNonSecureRead(
v);
338 privNonSecureWrite(
v);
346 monNonSecureWrite(
v);
350 userNonSecureRead(
v);
351 userNonSecureWrite(
v);
352 privNonSecureRead(
v);
353 privNonSecureWrite(
v);
357 monNonSecureWrite(
v);
370 userNonSecureRead(v);
372 privNonSecureRead(v);
380 userNonSecureWrite(v);
382 privNonSecureWrite(v);
386 monNonSecureWrite(v);
393 chain highest(
ArmSystem *
const sys)
const;
395 std::bitset<NUM_MISCREG_INFOS> &
i)
417 if (cpsr.width == 0) {
447 panic(
"Unrecognized mode setting in CPSR.\n");
471 void clear32(
const ArmISAParams *
p,
const SCTLR &sctlr_rst);
472 void clear64(
const ArmISAParams *p);
473 void initID32(
const ArmISAParams *p);
474 void initID64(
const ArmISAParams *p);
511 return intRegMap[
reg];
518 if (!cpsr.sp && el !=
EL0)
530 panic(
"Invalid exception level");
583 warn(
"User mode does not have SPSR\n");
599 warn(
"User mode does not have SPSR\n");
624 warn(
"Trying to access SPSR in an invalid mode: %d\n",
667 if (pmselr.sel == 31)
674 panic(
"Unrecognized misc. register.\n");
679 bool secureReg = haveSecurity && !highestELIs64 &&
682 flat_idx += secureReg ? 2 : 1;
695 int reg_as_int =
static_cast<int>(
reg);
697 reg_as_int += (haveSecurity && !
ns) ? 2 : 1;
707 if (lookUpMiscReg[flat_idx].
lower == 0) {
708 return std::make_pair(flat_idx, 0);
712 bool S = haveSecurity && !highestELIs64 &&
715 int lower = lookUpMiscReg[flat_idx].lower;
716 int upper = lookUpMiscReg[flat_idx].upper;
720 return std::make_pair(lower, upper);
733 DPRINTF(Checkpoint,
"Serializing Arm Misc Registers\n");
740 DPRINTF(Checkpoint,
"Unserializing Arm Misc Registers\n");
756 assert(afterStartup);
760 Enums::VecRegRenameMode
771 const Params *
params()
const;
780 static Enums::VecRegRenameMode
786 static Enums::VecRegRenameMode
#define panic(...)
This implements a cprintf based panic() function.
const IntRegMap IntRegSvcMap
chain secure(bool v=true) const
std::bitset< NUM_MISCREG_INFOS > & info
unsigned sveVL
SVE vector length in quadwords.
bitset< NUM_MISCREG_INFOS > miscRegInfo[NUM_MISCREGS]
BaseISADevice & getGenericTimer(ThreadContext *tc)
bool haveGICv3CPUInterface
chain allPrivileges(bool v=true) const
const MiscRegLUTEntryInitializer InitReg(uint32_t reg)
chain monNonSecureRead(bool v=true) const
void clear32(const ArmISAParams *p, const SCTLR &sctlr_rst)
chain userSecureRead(bool v=true) const
Vector Register Abstraction This generic class is the model in a particularization of MVC...
struct MiscRegLUTEntry & entry
chain hypE2HWrite(bool v=true) const
const IntRegMap IntReg64Map
RegVal readMiscRegNoEffect(int misc_reg) const
Enums::VecRegRenameMode vecRegRenameMode() const
void unserialize(CheckpointIn &cp)
Unserialize an object.
chain userNonSecureRead(bool v=true) const
static Enums::VecRegRenameMode mode(const ArmISA::PCState &pc)
chain res0(uint64_t mask) const
Base class for devices that use the MiscReg interfaces.
chain privSecure(bool v=true) const
int flattenIntIndex(int reg) const
RegId flattenRegId(const RegId ®Id) const
void serialize(CheckpointOut &cp) const
Serialize an object.
MiscRegLUTEntryInitializer(struct MiscRegLUTEntry &e, std::bitset< NUM_MISCREG_INFOS > &i)
Dummy device that prints a warning when it is accessed.
static std::vector< struct MiscRegLUTEntry > lookUpMiscReg
Metadata table accessible via the value of the register.
const MiscRegLUTEntryInitializer & chain
chain hypRead(bool v=true) const
void clear64(const ArmISAParams *p)
chain unimplemented() const
bool haveGICv3CpuIfc() const
Getter for haveGICv3CPUInterface.
const IntRegMap IntRegHypMap
ThreadContext is the external interface to all thread state for anything outside of the CPU...
unsigned getCurSveVecLenInBits(ThreadContext *tc) const
chain privSecureRead(bool v=true) const
chain reads(bool v) const
chain banked64(bool v=true) const
void setMiscRegNoEffect(int misc_reg, RegVal val)
int flattenCCIndex(int reg) const
chain monE2H(bool v=true) const
int flattenMiscIndex(int reg) const
const RegIndex & elemIndex() const
Elem accessor.
const IntRegMap IntRegFiqMap
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
chain banked(bool v=true) const
Vector Register Native Elem lane.
chain hypWrite(bool v=true) const
chain user(bool v=true) const
int flattenVecIndex(int reg) const
int snsBankedIndex64(MiscRegIndex reg, bool ns) const
void initializeMiscRegMetadata()
bool impdefAsNop
If true, accesses to IMPLEMENTATION DEFINED registers are treated as NOP hence not causing UNDEFINED ...
unsigned getCurSveVecLenInBitsAtReset() const
const Enums::VecRegRenameMode _vecRegRenameMode
RegVal miscRegs[NumMiscRegs]
void initID64(const ArmISAParams *p)
chain bankedChild(bool v=true) const
chain monNonSecure(bool v=true) const
static ExceptionLevel opModeToEL(OperatingMode mode)
chain mutex(bool v=true) const
#define SERIALIZE_ARRAY(member, size)
std::pair< int, int > getMiscIndices(int misc_reg) const
BaseISADevice & getGICv3CPUInterface(ThreadContext *tc)
chain privNonSecureRead(bool v=true) const
const IntRegMap IntRegUndMap
chain hyp(bool v=true) const
int flattenFloatIndex(int reg) const
chain unverifiable(bool v=true) const
chain monNonSecureWrite(bool v=true) const
const IntRegMap IntRegAbtMap
std::unique_ptr< BaseISADevice > timer
std::unique_ptr< BaseISADevice > gicv3CpuInterface
chain priv(bool v=true) const
static int flattenIntRegModeIndex(int reg)
void initID32(const ArmISAParams *p)
const IntRegIndex * intRegMap
#define UNSERIALIZE_ARRAY(member, size)
chain privNonSecure(bool v=true) const
chain implemented(bool v=true) const
chain userNonSecureWrite(bool v=true) const
void assert32(ThreadContext *tc)
const Params * params() const
chain privRead(bool v=true) const
DummyISADevice dummyDevice
Dummy device for to handle non-existing ISA devices.
chain exceptUserMode() const
const IntRegMap IntRegUsrMap
Enums::DecoderFlavour decoderFlavour() const
chain nonSecure(bool v=true) const
const IntRegMap IntRegMonMap
chain rao(uint64_t mask) const
std::ostream CheckpointOut
GenericISA::SimplePCState< MachInst > PCState
chain res1(uint64_t mask) const
chain monSecure(bool v=true) const
const RegClass & classValue() const
Class accessor.
void setMiscReg(int misc_reg, RegVal val, ThreadContext *tc)
int flattenVecElemIndex(int reg) const
chain monSecureWrite(bool v=true) const
Helper structure to get the vector register mode for a given ISA.
const RegIndex & index() const
Index accessors.
const Enums::DecoderFlavour _decoderFlavour
chain privSecureWrite(bool v=true) const
chain raz(uint64_t mask) const
Register ID: describe an architectural register with its class and index.
void assert64(ThreadContext *tc)
chain monE2HWrite(bool v=true) const
chain hypE2H(bool v=true) const
int flattenVecPredIndex(int reg) const
static Enums::VecRegRenameMode init(const ArmISA::ISA *isa)
chain warnNotFail(bool v=true) const
RegVal readMiscReg(int misc_reg, ThreadContext *tc)
bool inSecureState(ThreadContext *tc)
static const int NumArgumentRegs M5_VAR_USED
chain monSecureRead(bool v=true) const
chain privNonSecureWrite(bool v=true) const
chain userSecureWrite(bool v=true) const
const IntRegMap IntRegIrqMap
void updateRegMap(CPSR cpsr)
chain hypE2HRead(bool v=true) const
static void zeroSveVecRegUpperPart(VecRegContainer &vc, unsigned eCount)
chain mapsTo(uint32_t l, uint32_t u=0) const
chain monE2HRead(bool v=true) const
chain mon(bool v=true) const
chain writes(bool v) const
static bool equalsInit(const ArmISA::ISA *isa1, const ArmISA::ISA *isa2)
virtual void startup()
startup() is the final initialization call before simulation.