Go to the documentation of this file.
47 printMnemonic(
ss,
"",
false);
57 printMnemonic(
ss,
"",
false);
58 printIntReg(
ss, dest);
70 printMnemonic(
ss,
"",
false);
71 printIntReg(
ss, dest);
94 if (
el <=
EL1 && checkEL1Trap(tc, misc_reg,
el,
ec, immediate)) {
95 return std::make_shared<SupervisorTrap>(machInst, immediate,
ec);
100 checkEL2Trap(tc, misc_reg,
el,
ec, immediate)) {
101 return std::make_shared<HypervisorTrap>(machInst, immediate,
ec);
106 checkEL3Trap(tc, misc_reg,
el,
ec, immediate)) {
107 return std::make_shared<SecureMonitorTrap>(machInst, immediate,
ec);
116 uint32_t &immediate)
const
123 bool trap_to_sup =
false;
126 trap_to_sup = !scr.ns && !scr.eel2 && !sctlr.uma &&
el ==
EL0;
127 trap_to_sup = trap_to_sup ||
128 (
el ==
EL0 && (scr.ns || scr.eel2) && !hcr.tge && !sctlr.uma);
137 trap_to_sup =
el ==
EL0 && !sctlr.uci;
142 if ((
el ==
EL0 && cpacr.fpen != 0x3) ||
143 (
el ==
EL1 && !(cpacr.fpen & 0x1))) {
146 immediate = 0x1E00000;
150 trap_to_sup = !sctlr.uci && (!hcr.tge || (!scr.ns && !scr.eel2)) &&
154 trap_to_sup =
el ==
EL0 && !sctlr.uct &&
155 (!hcr.tge || (!scr.ns && !scr.eel2));
160 trap_to_sup =
el ==
EL0 && mdscr.tdcc &&
161 (hcr.tge == 0x0 || ( scr.ns == 0x0));
165 trap_to_sup =
el ==
EL1 && ((cpacr.zen & 0x1) == 0x0);
169 trap_to_sup =
el ==
EL0 &&
181 uint32_t &immediate)
const
190 bool trap_to_hyp =
false;
200 if (isa->haveGICv3CpuIfc())
208 if (isa->haveGICv3CpuIfc())
216 bool from_el2 = (
el ==
EL2) && (scr.ns || scr.eel2) &&
218 ((!hcr.e2h && cptr.tfp) ||
219 (hcr.e2h && (cptr.fpen == 0x0 ||
221 bool from_el1 = (
el ==
EL1) && hcr.nv &&
222 (!hcr.e2h || (hcr.e2h && !hcr.tge));
223 trap_to_hyp = from_el2 || from_el1;
225 immediate = 0x1E00000;
243 bool tvm = miscRead? hcr.trvm: hcr.tvm;
263 (hcr.nv && (hcr.nv1 || !hcr.nv2));
305 if (
el ==
EL0 && el2_en) {
306 const bool in_host = hcr.e2h && hcr.tge;
307 const bool general_trap = el2_en && !in_host && hcr.tge &&
309 const bool tpu_trap = el2_en && !in_host && hcr.tpu;
310 const bool host_trap = el2_en && in_host && !sctlr2.uci;
311 trap_to_hyp = general_trap || tpu_trap || host_trap;
313 else if (
el ==
EL1 && el2_en) {
314 trap_to_hyp = hcr.tpu;
326 if (
el ==
EL0 && el2_en) {
328 const bool in_host = hcr.e2h && hcr.tge;
329 const bool general_trap = el2_en && !in_host && hcr.tge &&
331 const bool tpc_trap = el2_en && !in_host && hcr.tpc;
332 const bool host_trap = el2_en && in_host && !sctlr2.uci;
333 trap_to_hyp = general_trap || tpc_trap || host_trap;
334 }
else if (
el ==
EL1 && el2_en) {
335 trap_to_hyp = hcr.tpc;
394 if (
el ==
EL0 && el2_en) {
395 const bool in_host = hcr.e2h && hcr.tge;
396 const bool general_trap = el2_en && !in_host && hcr.tge &&
398 const bool tid_trap = el2_en && !in_host && hcr.tid2;
399 const bool host_trap = el2_en && in_host && !sctlr2.uct;
400 trap_to_hyp = general_trap || tid_trap || host_trap;
401 }
else if (
el ==
EL1 && el2_en) {
402 trap_to_hyp = hcr.tid2;
418 trap_to_hyp =
el <=
EL1 &&
423 (hcr.tge && (hcr.e2h || !sctlr.uma));
534 if (
el ==
EL0 && el2_en) {
535 const bool in_host = hcr.e2h && hcr.tge;
536 const bool general_trap = el2_en && !in_host && hcr.tge &&
538 const bool tdz_trap = el2_en && !in_host && hcr.tdz;
539 const bool host_trap = el2_en && in_host && !sctlr2.dze;
540 trap_to_hyp = general_trap || tdz_trap || host_trap;
541 }
else if (
el ==
EL1 && el2_en) {
542 trap_to_hyp = hcr.tdz;
616 ELIs64(tc,
EL2) && ((!hcr.e2h && cptr.tz) ||
617 (hcr.e2h && ((cptr.zen & 0x1) == 0x0)));
618 bool from_el2 = (
el ==
EL2) && ((!hcr.e2h && cptr.tz) ||
619 (hcr.e2h && ((cptr.zen & 0x1) == 0x0)));
620 trap_to_hyp = from_el1 || from_el2;
628 bool from_el2 = (
el ==
EL2) && ((!hcr.e2h && cptr.tz) ||
629 (hcr.e2h && ((cptr.zen & 0x1) == 0x0)));
630 trap_to_hyp = from_el1 || from_el2;
644 uint32_t &immediate)
const
650 bool trap_to_mon =
false;
657 trap_to_mon = cptr.tfp &&
ELIs64(tc,
EL3);
659 immediate = 0x1E00000;
665 (!hcr.nv2 || hcr.nv1 || !hcr.nv))) ;
672 trap_to_mon = cptr.tcpac;
696 trap_to_mon = (
el ==
EL1 ||
el ==
EL2) && scr.apk == 0 &&
701 trap_to_mon =
el ==
EL1 &&
774 trap_to_mon = !cptr.ez && ((
el ==
EL3) ||
780 trap_to_mon = !cptr.ez && ((
el ==
EL3) ||
786 trap_to_mon = !cptr.ez && (
el ==
EL3);
802 return (
imm & 0x1) << 22;
804 panic(
"Not a valid PSTATE field register\n");
812 std::stringstream
ss;
824 std::stringstream
ss;
836 std::stringstream
ss;
862 return std::make_shared<UndefinedInstruction>(
machInst,
false,
878 std::stringstream
ss;
bool isGenericTimerSystemAccessTrapEL3(const MiscRegIndex miscReg, ThreadContext *tc)
@ MISCREG_ID_AA64MMFR2_EL1
bool EL2Enabled(ThreadContext *tc)
@ MISCREG_TLBI_IPAS2E1IS_Xt
@ MISCREG_ID_AA64AFR1_EL1
@ MISCREG_ID_AA64ISAR1_EL1
@ MISCREG_TLBI_VAALE1IS_Xt
@ MISCREG_ID_AA64ISAR0_EL1
std::string generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
@ MISCREG_TLBI_VAAE1IS_Xt
@ MISCREG_TLBI_VMALLS12E1
@ MISCREG_TLBI_ASIDE1IS_Xt
@ MISCREG_TLBI_IPAS2LE1IS_Xt
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).
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
@ MISCREG_TLBI_VALE2IS_Xt
bool haveVirtualization() const
Returns true if this system implements the virtualization Extensions.
@ MISCREG_ID_AA64MMFR0_EL1
@ MISCREG_ID_AA64AFR0_EL1
bool ELIs64(ThreadContext *tc, ExceptionLevel el)
@ MISCREG_ID_AA64DFR1_EL1
std::string generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
virtual BaseISA * getIsaPtr()=0
std::string generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
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.
@ MISCREG_ID_AA64PFR0_EL1
bool haveSecurity() const
Returns true if this system implements the Security Extensions.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
bool checkEL3Trap(ThreadContext *tc, const ArmISA::MiscRegIndex misc_reg, ArmISA::ExceptionLevel el, ArmISA::ExceptionClass &ec, uint32_t &immediate) const
std::string generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::shared_ptr< FaultBase > Fault
@ MISCREG_ID_AA64MMFR1_EL1
void printMiscReg(std::ostream &os, RegIndex reg_idx) const
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
@ MISCREG_ID_AA64DFR0_EL1
@ MISCREG_TLBI_VMALLS12E1IS
const char * mnemonic
Base mnemonic (e.g., "add").
std::string generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
constexpr decltype(nullptr) NoFault
ArmISA::MiscRegIndex dest
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
@ MISCREG_CONTEXTIDR_EL12
bool isGenericTimerSystemAccessTrapEL1(const MiscRegIndex miscReg, ThreadContext *tc)
const std::string fullMnemonic
Fault trap(ThreadContext *tc, ArmISA::MiscRegIndex misc_reg, ArmISA::ExceptionLevel el, uint32_t immediate) const
virtual ThreadContext * tcBase() const =0
Returns a pointer to the ThreadContext.
Fault execute(ExecContext *xc, Trace::InstRecord *traceData) const override
@ MISCREG_TLBI_VALE1IS_Xt
const ExtMachInst machInst
The binary machine instruction.
RegVal miscRegImm() const
Returns the "register view" of the immediate field.
virtual RegVal readMiscReg(RegIndex misc_reg)=0
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
static bool haveEL(ThreadContext *tc, ArmISA::ExceptionLevel el)
Return true if the system implements a specific exception level.
void ccprintf(cp::Print &print)
const ArmISA::MiscRegIndex miscReg
ArmISA::MiscRegIndex dest
bool checkEL1Trap(ThreadContext *tc, const ArmISA::MiscRegIndex misc_reg, ArmISA::ExceptionLevel el, ArmISA::ExceptionClass &ec, uint32_t &immediate) const
@ MISCREG_TLBI_IPAS2E1_Xt
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.
Bitfield< 27, 25 > encoding
@ MISCREG_TLBI_IPAS2LE1_Xt
@ MISCREG_ID_AA64PFR1_EL1
std::string csprintf(const char *format, const Args &...args)
bool isGenericTimerSystemAccessTrapEL2(const MiscRegIndex miscReg, ThreadContext *tc)
bool checkEL2Trap(ThreadContext *tc, const ArmISA::MiscRegIndex misc_reg, ArmISA::ExceptionLevel el, ArmISA::ExceptionClass &ec, uint32_t &immediate) const
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:00 for gem5 by doxygen 1.8.17