48using namespace ArmISA;
57 flags[IsNonSpeculative] = (
faultId == DecoderFault::PANIC);
66 case DecoderFault::UNALIGNED:
68 return std::make_shared<PCAlignmentFault>(
pc);
72 return std::make_shared<PrefetchAbort>(
76 case DecoderFault::PANIC:
77 panic(
"Internal error in instruction decoder\n");
79 case DecoderFault::OK:
80 panic(
"Decoder fault instruction without decoder fault.\n");
83 panic(
"Unhandled fault type");
90 case DecoderFault::OK:
93 case DecoderFault::UNALIGNED:
94 return "UnalignedInstruction";
96 case DecoderFault::PANIC:
97 return "DecoderPanic";
100 panic(
"Unhandled fault type");
118 flags[IsNonSpeculative] =
true;
119 flags[IsInvalid] =
true;
124 const std::string& _fullMnemonic)
125 : ArmStaticInst(_mnemonic, _machInst, No_OpClass),
126 fullMnemonic(_fullMnemonic)
130 flags[IsNonSpeculative] =
true;
131 flags[IsInvalid] =
true;
144 return csprintf(
"%-10s (unimplemented)",
152 :
ArmStaticInst(_mnemonic, _machInst, No_OpClass), warned(false)
156 flags[IsNonSpeculative] =
true;
161 const std::string& _fullMnemonic)
162 : ArmStaticInst(_mnemonic, _machInst, No_OpClass), warned(false),
163 fullMnemonic(_fullMnemonic)
167 flags[IsNonSpeculative] =
true;
174 warn(
"\tinstruction '%s' unimplemented\n",
186 return csprintf(
"%-10s (unimplemented)",
197 return std::make_shared<IllegalInstSetStateFault>();
208 pc_state.debugStep(
false);
213 bool ldx =
sd->getSstep()->getLdx();
215 return std::make_shared<SoftwareStepFault>(
machInst, ldx,
SelfDebug * getSelfDebug() const
DebugStep(ArmISA::ExtMachInst _machInst)
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
DecoderFaultInst(ArmISA::ExtMachInst _machInst)
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
const char * faultName() const
ArmISA::DecoderFault faultId
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.
virtual const PCStateBase & pcState() const =0
std::string fullMnemonic
Full mnemonic for MRC and MCR instructions including the coproc.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
FailUnimplemented(const char *_mnemonic, ArmISA::ExtMachInst _machInst)
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
IllegalExecInst(ArmISA::ExtMachInst _machInst)
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
const char * mnemonic
Base mnemonic (e.g., "add").
std::bitset< Num_Flags > flags
Flag values for this instruction.
std::string fullMnemonic
Full mnemonic for MRC and MCR instructions including the coproc.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
WarnUnimplemented(const char *_mnemonic, ArmISA::ExtMachInst _machInst)
bool warned
Have we warned on this instruction yet?
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
#define panic(...)
This implements a cprintf based panic() function.
DecoderFault
Instruction decoder fault codes in ExtMachInst.
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