47using namespace ArmISA;
56 bool foundPsr =
false;
84 bool foundPsr =
false;
135 std::stringstream
ss;
144 std::stringstream
ss;
154 std::stringstream
ss;
167 std::stringstream
ss;
180 std::stringstream
ss;
189 std::stringstream
ss;
199 std::stringstream
ss;
210 std::stringstream
ss;
220 std::stringstream
ss;
235 std::stringstream
ss;
251 std::stringstream
ss;
265 std::stringstream
ss;
278 std::stringstream
ss;
290 std::stringstream
ss;
302 std::stringstream
ss;
313 std::stringstream
ss;
326 std::stringstream
ss;
338 std::stringstream
ss;
358 flags[IsNonSpeculative] =
true;
389 return std::make_shared<UndefinedInstruction>(
machInst,
false,
414 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
419 TLBIALL tlbiOp(TranslationRegime::EL10, secure);
432 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
433 TLBIALL tlbiOp(TranslationRegime::EL10, secure);
443 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
448 ITLBIALL tlbiOp(TranslationRegime::EL10, secure);
462 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
467 DTLBIALL tlbiOp(TranslationRegime::EL10, secure);
481 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
486 TLBIMVA tlbiOp(TranslationRegime::EL10,
488 mbits(value, 31, 12),
505 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
510 TLBIMVA tlbiOp(TranslationRegime::EL10,
512 mbits(value, 31, 12),
528 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
529 TLBIMVA tlbiOp(TranslationRegime::EL10,
531 mbits(value, 31, 12),
543 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
544 TLBIMVA tlbiOp(TranslationRegime::EL10,
546 mbits(value, 31, 12),
559 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
564 TLBIASID tlbiOp(TranslationRegime::EL10,
580 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
581 TLBIASID tlbiOp(TranslationRegime::EL10,
594 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
598 TLBIMVAA tlbiOp(TranslationRegime::EL10, secure,
599 mbits(value, 31, 12),
false);
614 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
619 TLBIMVAA tlbiOp(TranslationRegime::EL10, secure,
620 mbits(value, 31, 12),
true);
634 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
635 TLBIMVAA tlbiOp(TranslationRegime::EL10, secure,
636 mbits(value, 31, 12),
false);
646 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
647 TLBIMVAA tlbiOp(TranslationRegime::EL10, secure,
648 mbits(value, 31, 12),
true);
658 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
659 TLBIMVAA tlbiOp(TranslationRegime::EL2, secure,
660 mbits(value, 31, 12),
false);
670 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
671 TLBIMVAA tlbiOp(TranslationRegime::EL2, secure,
672 mbits(value, 31, 12),
true);
682 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
683 TLBIMVAA tlbiOp(TranslationRegime::EL2, secure,
684 mbits(value, 31, 12),
false);
694 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
695 TLBIMVAA tlbiOp(TranslationRegime::EL2, secure,
696 mbits(value, 31, 12),
true);
706 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
707 TLBIIPA tlbiOp(TranslationRegime::EL10,
709 static_cast<Addr>(
bits(value, 35, 0)) << 12,
721 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
722 TLBIIPA tlbiOp(TranslationRegime::EL10,
724 static_cast<Addr>(
bits(value, 35, 0)) << 12,
736 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
737 TLBIIPA tlbiOp(TranslationRegime::EL10,
739 static_cast<Addr>(
bits(value, 35, 0)) << 12,
751 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
752 TLBIIPA tlbiOp(TranslationRegime::EL10,
754 static_cast<Addr>(
bits(value, 35, 0)) << 12,
766 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
770 ITLBIMVA tlbiOp(TranslationRegime::EL10,
772 mbits(value, 31, 12),
788 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
793 DTLBIMVA tlbiOp(TranslationRegime::EL10,
795 mbits(value, 31, 12),
811 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
816 ITLBIASID tlbiOp(TranslationRegime::EL10,
833 bool secure = release->has(ArmExtension::SECURITY) && !scr.ns;
838 DTLBIASID tlbiOp(TranslationRegime::EL10,
852 TLBIALLN tlbiOp(TranslationRegime::EL10);
859 TLBIALLN tlbiOp(TranslationRegime::EL10);
866 TLBIALLN tlbiOp(TranslationRegime::EL2);
873 TLBIALLN tlbiOp(TranslationRegime::EL2);
878 panic(
"Unrecognized TLBIOp\n");
void printMiscReg(std::ostream &os, RegIndex reg_idx) const
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
void printIntReg(std::ostream &os, RegIndex reg_idx, uint8_t opWidth=0) const
Print a register name for disassembly given the unique dependence tag number (FP or int).
void printShiftOperand(std::ostream &os, RegIndex rm, bool immShift, uint32_t shiftAmt, RegIndex rs, ArmShiftType type) const
Data TLB Invalidate by ASID match.
Data TLB Invalidate by VA.
const ArmRelease * getRelease() const
Instruction TLB Invalidate All.
Instruction TLB Invalidate by ASID match.
Instruction TLB Invalidate by VA.
TLB Invalidate All, Non-Secure.
TLB Invalidate by ASID match.
TLB Invalidate by Intermediate Physical Address.
TLB Invalidate by VA, All ASID.
void broadcast(ThreadContext *tc)
Broadcast the TLB Invalidate operation to all TLBs in the Arm system.
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
virtual ThreadContext * tcBase() const =0
Returns a pointer to the ThreadContext.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
McrMrcImplDefined(const char *_mnemonic, ArmISA::ExtMachInst _machInst, uint64_t _iss, ArmISA::MiscRegIndex _miscReg)
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
Certain mrc/mcr instructions act as nops or flush the pipe based on what register the instruction is ...
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
McrMrcMiscInst(const char *_mnemonic, ArmISA::ExtMachInst _machInst, uint64_t _iss, ArmISA::MiscRegIndex _miscReg)
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
ArmISA::MiscRegIndex miscReg
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
ArmISA::MiscRegIndex dest
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
ArmISA::MiscRegIndex dest
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
void printMsrBase(std::ostream &os) const
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Register ID: describe an architectural register with its class and index.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
ArmISA::ArmShiftType shiftType
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
uint8_t numSrcRegs() const
Number of source registers.
uint8_t numDestRegs() const
Number of destination registers.
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
const char * mnemonic
Base mnemonic (e.g., "add").
std::bitset< Num_Flags > flags
Flag values for this instruction.
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal readMiscReg(RegIndex misc_reg)=0
virtual BaseISA * getIsaPtr() const =0
void performTlbi(ExecContext *xc, ArmISA::MiscRegIndex dest_idx, RegVal value) const
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
constexpr T mbits(T val, unsigned first, unsigned last)
Mask off the given bits in place like bits() but without shifting.
#define panic(...)
This implements a cprintf based panic() function.
ExceptionLevel currEL(const ThreadContext *tc)
Returns the current Exception Level (EL) of the provided ThreadContext.
Fault mcrMrc15Trap(const MiscRegIndex misc_reg, ExtMachInst mach_inst, ThreadContext *tc, uint32_t imm)
bool EL2Enabled(ThreadContext *tc)
Bitfield< 27, 25 > encoding
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< FaultBase > Fault
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::string csprintf(const char *format, const Args &...args)
constexpr decltype(nullptr) NoFault
@ MiscRegClass
Control (misc) register.
void ccprintf(cp::Print &print)
The file contains the definition of a set of TLB Invalidate Instructions.