Go to the documentation of this file.
43 #ifndef __CPU_BASE_DYN_INST_HH__
44 #define __CPU_BASE_DYN_INST_HH__
53 #include "arch/utility.hh"
55 #include "config/the_isa.hh"
64 #include "debug/HtmCpu.hh"
85 using LQIterator =
typename Impl::CPUPol::LSQUnit::LQIterator;
86 using SQIterator =
typename Impl::CPUPol::LSQUnit::SQIterator;
463 void dump(std::string &outstring);
519 return !(tempPC ==
predPC);
587 panic(
"Not yet implemented\n");
619 "clearing instuction's transactional state htmUid=%u\n",
811 return this->_readySrcRegIdx[idx];
1035 return thread->storeCondFailures;
1042 thread->storeCondFailures = sc_failures;
1069 template<
class Impl>
1075 assert(byte_enable.empty() || byte_enable.size() == size);
1076 return cpu->pushRequest(
1077 dynamic_cast<typename DynInstPtr::PtrType
>(
this),
1078 true,
nullptr, size,
addr, flags,
nullptr,
nullptr,
1082 template<
class Impl>
1086 return cpu->pushRequest(
1087 dynamic_cast<typename DynInstPtr::PtrType
>(
this),
1088 true,
nullptr, 8, 0x0ul, flags,
nullptr,
nullptr);
1091 template<
class Impl>
1097 assert(byte_enable.empty() || byte_enable.size() == size);
1098 return cpu->pushRequest(
1099 dynamic_cast<typename DynInstPtr::PtrType
>(
this),
1100 false,
data, size,
addr, flags, res,
nullptr,
1104 template<
class Impl>
1115 return cpu->pushRequest(
1116 dynamic_cast<typename DynInstPtr::PtrType
>(
this),
1117 false,
nullptr, size,
addr, flags,
nullptr,
1121 #endif // __CPU_BASE_DYN_INST_HH__
void setCCRegOperand(const StaticInst *si, int idx, RegVal val) override
Records a CC register being set to a value.
bool isSerializeAfter() const
bool isInROB() const
Returns whether or not this instruction is in the ROB.
TheISA::PCState predPC
Predicted PC state after this instruction.
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
ThreadContext * tcBase() const override
Returns the thread context.
@ AtCommit
Instruction can commit.
int8_t numCCDestRegs() const
Number of coprocesor destination regs.
@ Squashed
Instruction has committed.
int8_t numIntDestRegs() const
@ CanCommit
Instruction has executed.
@ SquashedInIQ
Instruction is squashed.
@ BlockingInst
Is a recover instruction.
bool isDirectCtrl() const
bool isMicroBranch() const
void translationStarted(bool f)
bool isReadySrcRegIdx(int idx) const
Returns if a source register is ready.
InstSeqNum seqNum
The sequence number of the instruction.
void setStCondFailures(unsigned int sc_failures) override
Sets the number of consecutive store conditional failures.
LSQRequestPtr savedReq
Saved memory request (needed when the DTB address translation is delayed due to a hw page table walk)...
void setVecPredResult(T &&t)
Predicate result.
bool isUnverifiable() const
void hitExternalSnoop(bool f)
Generic predicate register container.
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
void renameDestReg(int idx, PhysRegIdPtr renamed_dest, PhysRegIdPtr previous_rename)
Renames a destination register to a physical register.
bool isSquashed() const
Returns whether or not this instruction is squashed.
VecReg::Container VecRegContainer
ImplState * thread
Pointer to the thread state.
Fault & getFault()
TODO: This I added for the LSQRequest side to be able to modify the fault.
void clearSerializeBefore()
Clears the serializeBefore part of this instruction.
void demapDataPage(Addr vaddr, uint64_t asn)
void clearIssued()
Clears this instruction as being issued.
Base, ISA-independent static instruction class.
void setExecuted()
Sets this instruction as executed.
bool isSerializing() const
int16_t ThreadID
Thread index/ID type.
Fault fault
The kind of fault this instruction has generated.
uint8_t * memData
Pointer to the data for the memory access.
bool readyToCommit() const
Returns whether or not this instruction is ready to commit.
Addr nextInstAddr() const
Read the PC of the next instruction.
void setVecElemOperand(const StaticInst *si, int idx, const VecElem val) override
Record a vector register being set to a value.
int8_t numCCDestRegs() const
void pcState(const TheISA::PCState &val) override
Set the PC state of this instruction.
uint64_t newHtmTransactionUid() const override
void mwaitAtomic(ThreadContext *tc) override
int ContextID
Globally unique thread context ID.
@ ThreadsyncWait
Is a blocking instruction.
void setSquashed()
Sets this instruction as squashed.
bool isInstPrefetch() const
int8_t numIntDestRegs() const
Number of integer destination regs.
void renameSrcReg(int idx, PhysRegIdPtr renamed_src)
Renames a source logical register to the physical register which has/will produce that logical regist...
void setPredTarg(const TheISA::PCState &_predPC)
Set the predicted target of this current instruction.
bool hitExternalSnoop() const
True if the address hit a external snoop while sitting in the LSQ.
void setVecElemResult(T &&t)
Vector element result.
bool readPredTaken()
Returns whether the instruction was predicted taken or not.
bool hasRequest() const
Has this instruction generated a memory request.
unsigned int readStCondFailures() const override
Returns the number of consecutive store conditional failures.
bool possibleLoadViolation() const
True if this address was found to match a previous load and they issued out of order.
~BaseDynInst()
BaseDynInst destructor.
std::shared_ptr< Request > RequestPtr
bool isSquashedInIQ() const
Returns whether or not this instruction is squashed in the IQ.
std::bitset< NumStatus > status
The status of this BaseDynInst.
bool isIndirectCtrl() const
unsigned memReqFlags
The memory request flags (from translation).
@ MaxInstDestRegs
Max source regs.
Trace::InstRecord * traceData
InstRecord that tracks this instructions.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
bool isSerializeAfter() const
uint8_t readyRegs
How many source registers are ready.
Fault writeMem(uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable=std::vector< bool >()) override
bool isPinnedRegsRenamed() const
Returns whether pinned registers are renamed.
@ RobEntry
Instruction is in the IQ.
bool isSerializeBefore() const
int16_t lqIdx
Load queue index.
std::list< DynInstPtr >::iterator ListIt
void advancePC(PCState &pc, const StaticInstPtr &inst)
void clearSerializeAfter()
Clears the serializeAfter part of this instruction.
bool isTempSerializeAfter()
Checks if this serializeAfter is only temporarily set.
void setVecPredRegOperand(const StaticInst *si, int idx, const VecPredRegContainer &val) override
Record a vector register being set to a value.
void setTid(ThreadID tid)
Sets the thread id.
bool doneTargCalc()
Checks whether or not this instruction has had its branch target calculated yet.
void setThreadState(ImplState *state)
Sets the pointer to the thread state.
@ SerializeBefore
Is a thread synchronization instruction.
const RegId & destRegIdx(int i) const
Returns the logical register index of the i'th destination register.
Register ID: describe an architectural register with its class and index.
void setHtmTransactionalState(uint64_t htm_uid, uint64_t htm_depth)
void setCommitted()
Sets this instruction as committed.
void setPinnedRegsWritten()
Sets destination registers as written.
@ CanIssue
Instruction has its result.
bool readyToIssue() const
Returns whether or not this instruction is ready to issue.
void setInIQ()
Sets this instruction as a entry the IQ.
void setIntRegOperand(const StaticInst *si, int idx, RegVal val) override
Records an integer register being set to a value.
bool isUncondCtrl() const
bool isSquashedInLSQ() const
Returns whether or not this instruction is squashed in the LSQ.
std::array< PhysRegIdPtr, TheISA::MaxInstDestRegs > _destRegIdx
Physical register index of the destination registers of this instruction.
bool isDataPrefetch() const
std::queue< InstResult > instResult
The result of the instruction; assumes an instruction can have many destination registers.
void markSrcRegReady()
Records that one of the source registers is ready.
void strictlyOrdered(bool so)
bool isFirstMicroop() const
uint8_t resultSize()
Return the size of the instResult queue.
@ SerializeHandled
Needs to serialize instructions behind it.
bool translationStarted() const
True if the DTB address translation has started.
int8_t numSrcRegs() const
Returns the number of source registers.
int cpuId() const
Read this CPU's ID.
PhysRegIdPtr renamedSrcRegIdx(int idx) const
Returns the physical register index of the i'th source register.
uint64_t getHtmTransactionUid() const override
ThreadContext is the external interface to all thread state for anything outside of the CPU.
bool isDelayedCommit() const
bool isFirstMicroop() const
void setVecRegOperand(const StaticInst *si, int idx, const VecRegContainer &val) override
Record a vector register being set to a value.
virtual TheISA::PCState branchTarget(const TheISA::PCState &pc) const
Return the target address for a PC-relative branch.
std::array< PhysRegIdPtr, TheISA::MaxInstSrcRegs > _srcRegIdx
Physical register index of the source registers of this instruction.
TheISA::PCState pc
PC state for this instruction.
TheISA::PCState branchTarget() const
Returns the branch target address.
void setVecResult(T &&t)
Full vector result.
int8_t numDestRegs() const
Number of destination registers.
void setPinnedRegsRenamed()
Sets the destination registers as renamed.
RequestorID requestorId() const
Read this CPU's data requestor ID.
AddressMonitor * getAddrMonitor() override
void setScalarResult(T &&t)
Pushes a result onto the instResult queue.
std::shared_ptr< FaultBase > Fault
Fault initiateMemRead(Addr addr, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >()) override
bool isSerializeBefore() const
@ PinnedRegsWritten
Pinned registers are renamed.
PhysRegIdPtr renamedDestRegIdx(int idx) const
Returns the physical register index of the i'th destination register.
void setSerializeBefore()
Temporarily sets this instruction as a serialize before instruction.
bool mispredicted()
Returns whether the instruction mispredicted.
bool isSquashAfter() const
bool isDataPrefetch() const
Addr predMicroPC()
Returns the predicted micro PC after the branch.
ListIt & getInstListIt()
Returns iterator to this instruction in the list of all insts.
void setMemAccPredicate(bool val) override
const RegId & flattenedDestRegIdx(int idx) const
Returns the flattened register index of the i'th destination register.
ContextID contextId() const
Read this context's system-wide ID.
Addr predInstAddr()
Returns the predicted PC immediately after the branch.
bool isNonSpeculative() const
@ SquashedInROB
Instruction is squashed in the LSQ.
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
void setInLSQ()
Sets this instruction as a entry the LSQ.
void clearCanCommit()
Clears this instruction as being ready to commit.
void setCanCommit()
Sets this instruction as ready to commit.
bool isPinnedRegsWritten() const
Returns whether destination registers are written.
bool isResultReady() const
Returns whether or not the result is ready.
bool isNonSpeculative() const
ListIt instListIt
Iterator pointing to this BaseDynInst in the list of all insts.
bool isCondDelaySlot() const
bool isStoreConditional() const
unsigned effSize
The size of the request.
ImplCPU::ImplState ImplState
bool strictlyOrdered() const
Is this instruction's memory access strictly ordered?
InstResult popResult(InstResult dflt=InstResult())
Pops a result off the instResult queue.
ImplCPU * cpu
Pointer to the Impl's CPU object.
void setFloatRegOperandBits(const StaticInst *si, int idx, RegVal val) override
Records an fp register being set to an integer value.
int8_t numFPDestRegs() const
@ Executed
Instruction has issued.
bool isDelayedCommit() const
bool isExecuted() const
Returns whether or not this instruction has executed.
bool isIndirectCtrl() const
bool isThreadSync() const
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
@ RecoverInst
Regs pinning status updated after squash.
void effAddrValid(bool b)
bool readPredicate() const override
void setInstListIt(ListIt _instListIt)
Sets iterator for this instruction in the list of all insts.
void clearInIQ()
Sets this instruction as a entry the IQ.
void clearInROB()
Sets this instruction as a entry the ROB.
bool isSerializing() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int8_t numDestRegs() const
Returns the number of destination registers.
PhysRegIdPtr prevDestRegIdx(int idx) const
Returns the physical register index of the previous physical register that remapped to the same logic...
Fault initiateHtmCmd(Request::Flags flags) override
Initiate an HTM command, e.g.
bool translationCompleted() const
True if the DTB address translation has completed.
@ Issued
Instruction can issue and execute.
void demapInstPage(Addr vaddr, uint64_t asn)
Addr microPC() const
Read the micro PC of this instruction.
@ SquashedInLSQ
Instruction is squashed in the IQ.
void setSquashedInLSQ()
Sets this instruction as squashed in the LSQ.
BaseDynInst(const StaticInstPtr &staticInst, const StaticInstPtr ¯oop, TheISA::PCState pc, TheISA::PCState predPC, InstSeqNum seq_num, ImplCPU *cpu)
BaseDynInst constructor given a binary instruction.
bool isWriteBarrier() const
std::bitset< MaxFlags > instFlags
bool eaSrcsReady() const
Returns whether or not the eff.
int8_t numSrcRegs() const
Number of source registers.
bool mwait(PacketPtr pkt) override
bool effAddrValid() const
Is the effective virtual address valid.
bool isThreadSync() const
@ SerializeAfter
Needs to serialize on instructions ahead of it.
bool isTempSerializeBefore()
Checks if this serializeBefore is only temporarily set.
bool isMicroBranch() const
bool isInstPrefetch() const
@ ResultReady
Instruction has completed.
bool inHtmTransactionalState() const override
bool isLastMicroop() const
bool isTranslationDelayed() const
Returns true if the DTB address translation is being delayed due to a hw page table walk.
int16_t sqIdx
Store queue index.
TheISA::PCState pcState() const override
Read the PC state of this instruction.
void possibleLoadViolation(bool f)
void setSquashedInROB()
Sets this instruction as squashed in the ROB.
Derive from RefCounted if you want to enable reference counting of this class.
Impl::DynInstPtr DynInstPtr
typename Impl::CPUPol::LSQ::LSQRequest * LSQRequestPtr
int8_t numVecDestRegs() const
Number of vector destination regs.
bool isSquashAfter() const
const StaticInstPtr staticInst
The StaticInst used by this BaseDynInst.
void setPinnedRegsSquashDone()
Sets dest registers' status updated after squash.
Addr predNextInstAddr()
Returns the predicted PC two instructions after the branch.
bool memOpDone() const
Whether or not the memory operation is done.
void clearHtmTransactionalState()
bool isLastMicroop() const
GenericISA::DelaySlotPCState< MachInst > PCState
@ Committed
Instruction has reached commit.
void setCompleted()
Sets this instruction as completed.
std::bitset< MaxInstSrcRegs > _readySrcRegIdx
Whether or not the source register is ready.
bool isWriteBarrier() const
bool isCondDelaySlot() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
bool isCommitted() const
Returns whether or not this instruction is committed.
int8_t numVecPredDestRegs() const
void setIssued()
Sets this instruction as issued from the IQ.
std::array< PhysRegIdPtr, TheISA::MaxInstDestRegs > _prevDestRegIdx
Physical register index of the previous producers of the architected destinations.
void setCanIssue()
Sets this instruction as ready to issue.
OpClass opClass() const
Returns the opclass of this instruction.
void armMonitor(Addr address) override
int8_t numVecElemDestRegs() const
typename Impl::CPUPol::LSQUnit::LQIterator LQIterator
void setRequest()
Assert this instruction has generated a memory request.
void demapPage(Addr vaddr, uint64_t asn) override
Invalidate a page in the DTLB and ITLB.
typename Impl::CPUPol::LSQUnit::SQIterator SQIterator
bool isMemBarrier() const
bool readMemAccPredicate() const override
Addr instAddr() const
Read the PC of this instruction.
bool isDirectCtrl() const
const RegId & srcRegIdx(int i) const
Returns the logical register index of the i'th source register.
@ LsqEntry
Instruction is in the ROB.
void flattenDestReg(int idx, const RegId &flattened_dest)
Flattens a destination architectural register index into a logical index.
std::array< RegId, TheISA::MaxInstDestRegs > _flatDestRegIdx
Flattened register index of the destination registers of this instruction.
bool isPinnedRegsSquashDone() const
Return whether dest registers' pinning status updated after squash.
bool isSerializeHandled()
Checks if the serialization part of this instruction has been handled.
bool isCompleted() const
Returns whether or not this instruction is completed.
bool isUnverifiable() const
void setPredicate(bool val)
bool isIssued() const
Returns whether or not this instruction has issued.
@ PinnedRegsRenamed
Instruction is squashed in the ROB.
void recordResult(bool f)
Records changes to result?
ThreadID threadNumber
The thread this instruction is from.
int8_t numVecDestRegs() const
If you want a reference counting pointer to a mutable object, create it like this:
void setPredicate(bool val) override
@ Completed
Instruction is in the LSQ.
void translationCompleted(bool f)
void dump()
Dumps out contents of this BaseDynInst.
Fault initiateMemAMO(Addr addr, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op) override
void setSquashedInIQ()
Sets this instruction as squashed in the IQ.
Addr physEffAddr
The effective physical address.
bool isSquashedInROB() const
Returns whether or not this instruction is squashed in the ROB.
const StaticInstPtr macroop
The Macroop if one exists.
void setPredTaken(bool predicted_taken)
uint64_t getHtmTransactionalDepth() const override
void initVars()
Function to initialize variables in the constructors.
uint32_t socketId() const
Read this CPU's Socket ID.
void setInROB()
Sets this instruction as a entry the ROB.
void setResultReady()
Marks the result as ready.
void clearCanIssue()
Clears this instruction being able to issue.
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.
Fault getFault() const
Returns the fault type.
RefCountingPtr< BaseDynInst< Impl > > BaseDynInstPtr
void setSerializeAfter()
Temporarily sets this instruction as a serialize after instruction.
void setSerializeHandled()
Sets the serialization part of this instruction as handled.
@ NumStatus
Serialization has been handled.
@ PinnedRegsSquashDone
Pinned registers are written back.
const TheISA::PCState & readPredTarg()
bool isInLSQ() const
Returns whether or not this instruction is in the LSQ.
Addr effAddr
The effective virtual address (lds & stores only).
bool isUncondCtrl() const
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
bool isInIQ() const
Returns whether or not this instruction has issued.
bool isMemBarrier() const
#define panic(...)
This implements a cprintf based panic() function.
bool isStoreConditional() const
void removeInLSQ()
Sets this instruction as a entry the LSQ.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17