Go to the documentation of this file.
42 #ifndef __CPU_STATIC_INST_HH__
43 #define __CPU_STATIC_INST_HH__
49 #include "arch/registers.hh"
50 #include "arch/types.hh"
54 #include "config/the_isa.hh"
59 #include "enums/StaticInstFlags.hh"
188 flags[IsSerializeBefore] ||
189 flags[IsSerializeAfter]; }
196 return flags[IsReadBarrier] &&
flags[IsWriteBarrier];
261 virtual uint64_t
getEMI()
const {
return 0; }
321 panic(
"initiateAcc not defined!");
327 panic(
"completeAcc not defined!");
375 void printFlags(std::ostream &outs,
const std::string &separator)
const;
385 size_t size =
sizeof(T);
386 if (size <= max_size)
387 *
reinterpret_cast<T *
>(buf) = htole<T>(
t);
403 virtual size_t asBytes(
void *buf,
size_t max_size) {
return 0; }
406 #endif // __CPU_STATIC_INST_HH__
int8_t numCCDestRegs() const
Number of coprocesor destination regs.
int8_t _numVecDestRegs
To use in architectures with vector register file.
std::bitset< Num_Flags > flags
Flag values for this instruction.
bool isDirectCtrl() const
virtual Fault initiateAcc(ExecContext *xc, Trace::InstRecord *traceData) const
virtual uint64_t getEMI() const
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
virtual void advancePC(TheISA::PCState &pcState) const =0
RegIdArrayPtr _destRegIdxPtr
See destRegIdx().
Base, ISA-independent static instruction class.
bool isSerializing() const
Wrapper that groups a few flag bits under the same undelying container.
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.
int8_t numIntDestRegs() const
Number of integer destination regs.
void setSrcRegIdx(int i, const RegId &val)
virtual const std::string & disassemble(Addr pc, const Loader::SymbolTable *symtab=nullptr) const
Return string representation of disassembled instruction.
StaticInst(const char *_mnemonic, TheISA::ExtMachInst _machInst, OpClass __opClass)
Constructor.
const TheISA::ExtMachInst machInst
The binary machine instruction.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
bool isSerializeAfter() const
bool isFullMemBarrier() const
Register ID: describe an architectural register with its class and index.
int8_t _numVecElemDestRegs
bool isFirstMicroop() const
std::string * cachedDisassembly
String representation of disassembly (lazily evaluated via disassemble()).
ThreadContext is the external interface to all thread state for anything outside of the CPU.
bool isDelayedCommit() const
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.
void setRegIdxArrays(RegIdArrayPtr src, RegIdArrayPtr dest)
Set the pointers which point to the arrays of source and destination register indices.
int8_t numDestRegs() const
Number of destination registers.
std::shared_ptr< FaultBase > Fault
bool isSerializeBefore() const
bool isSquashAfter() const
void setDestRegIdx(int i, const RegId &val)
std::string getName()
Return name of machine instruction.
bool isDataPrefetch() const
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
bool isNonSpeculative() const
RegId(StaticInst::*)[] RegIdArrayPtr
OpClass _opClass
See opClass().
const char * mnemonic
Base mnemonic (e.g., "add").
RegIdArrayPtr _srcRegIdxPtr
See srcRegIdx().
bool isIndirectCtrl() const
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
virtual size_t asBytes(void *buf, size_t max_size)
Instruction classes can override this function to return a a representation of themselves as a blob o...
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
int8_t _numVecPredDestRegs
bool isWriteBarrier() const
int8_t numSrcRegs() const
Number of source registers.
size_t simpleAsBytes(void *buf, size_t max_size, const T &t)
bool isInstPrefetch() const
bool isLastMicroop() const
Derive from RefCounted if you want to enable reference counting of this class.
int8_t numVecDestRegs() const
Number of vector destination regs.
virtual StaticInstPtr fetchMicroop(MicroPC upc) const
Return the microop that goes with a particular micropc.
GenericISA::DelaySlotPCState< MachInst > PCState
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
virtual Fault completeAcc(Packet *pkt, ExecContext *xc, Trace::InstRecord *traceData) const
bool isReadBarrier() const
int8_t _numSrcRegs
See numSrcRegs().
bool isUnverifiable() const
If you want a reference counting pointer to a mutable object, create it like this:
int8_t _numFPDestRegs
The following are used to track physical register usage for machines with separate int & FP reg files...
virtual Fault execute(ExecContext *xc, Trace::InstRecord *traceData) const =0
static StaticInstPtr nopStaticInstPtr
Pointer to a statically allocated generic "nop" instruction object.
int8_t numFPDestRegs() const
Number of floating-point destination regs.
int8_t numVecElemDestRegs() const
Number of vector element destination regs.
int8_t numVecPredDestRegs() const
Number of predicate destination regs.
virtual std::string generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const =0
Internal function to generate disassembly string.
bool isUncondCtrl() const
int8_t _numDestRegs
See numDestRegs().
#define panic(...)
This implements a cprintf based panic() function.
bool isStoreConditional() const
Generated on Tue Jun 22 2021 15:28:20 for gem5 by doxygen 1.8.17