44 #ifndef __CPU_STATIC_INST_HH__ 45 #define __CPU_STATIC_INST_HH__ 51 #include "arch/registers.hh" 52 #include "arch/types.hh" 56 #include "config/the_isa.hh" 61 #include "enums/StaticInstFlags.hh" 91 MaxInstDestRegs = TheISA::MaxInstDestRegs
132 int8_t numSrcRegs()
const {
return _numSrcRegs; }
156 bool isNop()
const {
return flags[IsNop]; }
159 bool isLoad()
const {
return flags[IsLoad]; }
160 bool isStore()
const {
return flags[IsStore]; }
171 bool isCC()
const {
return flags[IsCC]; }
174 bool isCall()
const {
return flags[IsCall]; }
184 flags[IsSerializeBefore] ||
185 flags[IsSerializeAfter]; }
263 StaticInst(
const char *_mnemonic, ExtMachInst _machInst, OpClass __opClass)
264 : _opClass(__opClass), _numSrcRegs(0), _numDestRegs(0),
265 _numFPDestRegs(0), _numIntDestRegs(0), _numCCDestRegs(0),
266 _numVecDestRegs(0), _numVecElemDestRegs(0), _numVecPredDestRegs(0),
267 machInst(_machInst), mnemonic(_mnemonic), cachedDisassembly(0)
279 panic(
"initiateAcc not defined!");
285 panic(
"completeAcc not defined!");
326 virtual const std::string &disassemble(
Addr pc,
333 void printFlags(std::ostream &outs,
const std::string &separator)
const;
343 size_t size =
sizeof(T);
344 if (size <= max_size)
345 *
reinterpret_cast<T *
>(buf) = htole<T>(t);
361 virtual size_t asBytes(
void *buf,
size_t max_size) {
return 0; }
364 #endif // __CPU_STATIC_INST_HH__ #define panic(...)
This implements a cprintf based panic() function.
int8_t _numVecElemDestRegs
bool isCondDelaySlot() const
std::string * cachedDisassembly
String representation of disassembly (lazily evaluated via disassemble()).
int8_t _numSrcRegs
See numSrcRegs().
bool isDelayedCommit() const
int8_t _numFPDestRegs
The following are used to track physical register usage for machines with separate int & FP reg files...
virtual Fault completeAcc(Packet *pkt, ExecContext *xc, Trace::InstRecord *traceData) const
int8_t numVecElemDestRegs() const
Number of vector element destination regs.
int8_t numVecPredDestRegs() const
Number of predicate destination regs.
int8_t numDestRegs() const
Number of destination registers.
bool isUnverifiable() const
const char * mnemonic
Base mnemonic (e.g., "add").
bool isDataPrefetch() const
bool isIndirectCtrl() const
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
std::string getName()
Return name of machine instruction.
bool isSerializeBefore() const
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...
int8_t numFPDestRegs() const
Number of floating-point destination regs.
int8_t _numVecPredDestRegs
OpClass _opClass
See opClass().
If you want a reference counting pointer to a mutable object, create it like this: ...
ThreadContext is the external interface to all thread state for anything outside of the CPU...
bool isMicroBranch() const
virtual Fault initiateAcc(ExecContext *xc, Trace::InstRecord *traceData) const
bool isDirectCtrl() const
bool isUncondCtrl() const
bool isMemBarrier() const
int8_t numVecDestRegs() const
Number of vector destination regs.
bool isSerializing() const
const ExtMachInst machInst
The binary machine instruction.
std::bitset< Num_Flags > flags
Flag values for this instruction.
Classes for managing reference counted objects.
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
bool isWriteBarrier() const
Derive from RefCounted if you want to enable reference counting of this class.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void advancePC(PCState &pc, const StaticInstPtr &inst)
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
static StaticInstPtr nopStaticInstPtr
Pointer to a statically allocated generic "nop" instruction object.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
bool isStoreConditional() const
bool isFirstMicroop() const
int8_t _numDestRegs
See numDestRegs().
GenericISA::SimplePCState< MachInst > PCState
int8_t _numVecDestRegs
To use in architectures with vector register file.
int8_t numCCDestRegs() const
Number of coprocesor destination regs.
bool isNonSpeculative() const
Base, ISA-independent static instruction class.
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
StaticInst(const char *_mnemonic, ExtMachInst _machInst, OpClass __opClass)
Constructor.
TheISA::ExtMachInst ExtMachInst
Binary extended machine instruction type.
bool isSquashAfter() const
Register ID: describe an architectural register with its class and index.
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
bool isSerializeAfter() const
std::shared_ptr< FaultBase > Fault
int8_t numIntDestRegs() const
Number of integer destination regs.
bool isThreadSync() const
size_t simpleAsBytes(void *buf, size_t max_size, const T &t)
bool isInstPrefetch() const
bool isLastMicroop() const