Go to the documentation of this file.
42 #ifndef __CPU_STATIC_INST_HH__
43 #define __CPU_STATIC_INST_HH__
57 #include "enums/StaticInstFlags.hh"
169 flags[IsSerializeBefore] ||
170 flags[IsSerializeAfter]; }
177 return flags[IsReadBarrier] &&
flags[IsWriteBarrier];
236 virtual uint64_t
getEMI()
const {
return 0; }
291 panic(
"initiateAcc not defined!");
298 panic(
"completeAcc not defined!");
304 virtual std::unique_ptr<PCStateBase>
307 panic(
"buildRetPC not defined!");
348 void printFlags(std::ostream &outs,
const std::string &separator)
const;
358 size_t size =
sizeof(T);
359 if (size <= max_size)
360 *
reinterpret_cast<T *
>(buf) = htole<T>(
t);
376 virtual size_t asBytes(
void *buf,
size_t max_size) {
return 0; }
381 #endif // __CPU_STATIC_INST_HH__
bool isWriteBarrier() const
bool isSerializeBefore() const
bool isNonSpeculative() const
bool isIndirectCtrl() const
bool isUnverifiable() const
virtual std::unique_ptr< PCStateBase > buildRetPC(const PCStateBase &cur_pc, const PCStateBase &call_pc) const
RegId(StaticInst::*)[] RegIdArrayPtr
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...
bool isSerializeAfter() const
uint8_t numDestRegs(RegClassType type) const
Number of destination registers of a particular type.
void setSrcRegIdx(int i, const RegId &val)
size_t simpleAsBytes(void *buf, size_t max_size, const T &t)
uint8_t _numSrcRegs
See numSrcRegs().
StaticInst(const char *_mnemonic, OpClass op_class)
Constructor.
virtual Fault initiateAcc(ExecContext *xc, trace::InstRecord *traceData) const
bool isDelayedCommit() const
void setDestRegIdx(int i, const RegId &val)
std::array< uint8_t, MiscRegClass+1 > _numTypedDestRegs
bool isFirstMicroop() const
virtual void advancePC(PCStateBase &pc_state) const =0
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
OpClass _opClass
See opClass().
virtual StaticInstPtr fetchMicroop(MicroPC upc) const
Return the microop that goes with a particular micropc.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
Wrapper that groups a few flag bits under the same undelying container.
bool isDataPrefetch() const
Base, ISA-independent static instruction class.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
std::shared_ptr< FaultBase > Fault
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
virtual Fault execute(ExecContext *xc, trace::InstRecord *traceData) const =0
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
ProbePointArg< PacketInfo > Packet
Packet probe point.
std::string getName()
Return name of machine instruction.
uint8_t _numDestRegs
See numDestRegs().
std::bitset< Num_Flags > flags
Flag values for this instruction.
RegIdArrayPtr _destRegIdxPtr
See destRegIdx().
bool isDirectCtrl() const
RegIdArrayPtr _srcRegIdxPtr
See srcRegIdx().
virtual std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const =0
Internal function to generate disassembly string.
void setRegIdxArrays(RegIdArrayPtr src, RegIdArrayPtr dest)
Set the pointers which point to the arrays of source and destination register indices.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool isLastMicroop() const
virtual Fault completeAcc(Packet *pkt, ExecContext *xc, trace::InstRecord *trace_data) const
bool isReadBarrier() const
Derive from RefCounted if you want to enable reference counting of this class.
virtual uint64_t getEMI() const
bool isInstPrefetch() const
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
virtual const std::string & disassemble(Addr pc, const loader::SymbolTable *symtab=nullptr) const
Return string representation of disassembled instruction.
RegClassType
Enumerate the classes of registers.
bool isSquashAfter() const
uint8_t numDestRegs() const
Number of destination registers.
std::unique_ptr< std::string > cachedDisassembly
String representation of disassembly (lazily evaluated via disassemble()).
bool isSerializing() const
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
virtual std::unique_ptr< PCStateBase > branchTarget(const PCStateBase &pc) const
Return the target address for a PC-relative branch.
uint8_t numSrcRegs() const
Number of source registers.
bool isFullMemBarrier() const
bool isUncondCtrl() const
bool isStoreConditional() const
const char * mnemonic
Base mnemonic (e.g., "add").
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
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.
Register ID: describe an architectural register with its class and index.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Sun Jul 30 2023 01:56:48 for gem5 by doxygen 1.8.17