45 NopStaticInst() :
StaticInst(
"gem5 nop", nopMachInst, No_OpClass)
78 if (cachedDisassembly)
79 delete cachedDisassembly;
87 tgt = branchTarget(pc);
91 if (isIndirectCtrl()) {
92 tgt = branchTarget(tc);
102 panic(
"StaticInst::fetchMicroop() called on instruction " 103 "that is not microcoded.");
109 panic(
"StaticInst::branchTarget() called on instruction " 110 "that is not a PC-relative branch.");
117 panic(
"StaticInst::branchTarget() called on instruction " 118 "that is not an indirect branch.");
125 if (!cachedDisassembly)
126 cachedDisassembly =
new string(generateDisassembly(pc, symtab));
128 return *cachedDisassembly;
133 const std::string &separator)
const 135 bool printed_a_flag =
false;
137 for (
unsigned int flag = IsNop; flag < Num_Flags; flag++) {
142 outs << FlagsStrings[flag];
143 printed_a_flag =
true;
#define panic(...)
This implements a cprintf based panic() function.
decltype(nullptr) constexpr NoFault
virtual const std::string & disassemble(Addr pc, const SymbolTable *symtab=0) const
Return string representation of disassembled instruction.
const char * mnemonic
Base mnemonic (e.g., "add").
virtual Fault execute(ExecContext *xc, Trace::InstRecord *traceData) const =0
Overload hash function for BasicBlockRange type.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
virtual StaticInstPtr fetchMicroop(MicroPC upc) const
Return the microop that goes with a particular micropc.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
static StaticInstPtr nopStaticInstPtr
Pointer to a statically allocated generic "nop" instruction object.
virtual TheISA::PCState branchTarget(const TheISA::PCState &pc) const
Return the target address for a PC-relative branch.
void printFlags(std::ostream &outs, const std::string &separator) const
Print a separator separated list of this instruction's set flag names on the given stream...
virtual std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const =0
Internal function to generate disassembly string.
virtual void advancePC(TheISA::PCState &pcState) const =0
GenericISA::SimplePCState< MachInst > PCState
Base, ISA-independent static instruction class.
bool hasBranchTarget(const TheISA::PCState &pc, ThreadContext *tc, TheISA::PCState &tgt) const
Return true if the instruction is a control transfer, and if so, return the target address as well...
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
std::shared_ptr< FaultBase > Fault