Go to the documentation of this file.
42 #ifndef __CPU_O3_DYN_INST_HH__
43 #define __CPU_O3_DYN_INST_HH__
53 #include "config/the_isa.hh"
66 #include "debug/HtmCpu.hh"
98 static void *
operator new(
size_t count,
Arrays &arrays);
207 std::unique_ptr<PCStateBase>
pc;
306 return bits(
byte, idx % 8);
486 void dump(std::string &outstring);
531 std::unique_ptr<PCStateBase> next_pc(
pc->clone());
533 return *next_pc != *
predPC;
598 panic(
"Not yet implemented\n");
630 "clearing instuction's transactional state htmUid=%u\n",
671 std::unique_ptr<PCStateBase>
1001 Tick fetchTick = -1;
1002 int32_t decodeTick = -1;
1003 int32_t renameTick = -1;
1004 int32_t dispatchTick = -1;
1005 int32_t issueTick = -1;
1006 int32_t completeTick = -1;
1007 int32_t commitTick = -1;
1008 int32_t storeTick = -1;
1037 if (idx == misc_reg)
1121 panic(
"Unknown register class: %d",
1245 #endif // __CPU_O3_DYN_INST_HH__
ListIt & getInstListIt()
Returns iterator to this instruction in the list of all insts.
bool isInLSQ() const
Returns whether or not this instruction is in the LSQ.
void setSquashedInIQ()
Sets this instruction as squashed in the IQ.
void setVecElem(PhysRegIdPtr reg_idx, RegVal val)
@ PinnedRegsRenamed
Instruction is squashed in the ROB.
@ PinnedRegsSquashDone
Pinned registers are written back.
@ ThreadsyncWait
Is a blocking instruction.
Memory operation metadata.
constexpr decltype(nullptr) NoFault
void setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
Sets a misc.
bool isWriteBarrier() const
bool isSerializeBefore() const
std::unique_ptr< PCStateBase > predPC
Predicted PC state after this instruction.
@ Squashed
Instruction has committed.
void setVecRegOperand(const StaticInst *si, int idx, const TheISA::VecRegContainer &val) override
Sets a destination vector register operand to a value.
Fault initiateAcc()
Initiates the access.
RegVal readCCReg(PhysRegIdPtr phys_reg)
void setInIQ()
Sets this instruction as a entry the IQ.
bool readySrcIdx(int idx) const
ThreadID threadNumber
The thread this instruction is from.
uint64_t newHtmTransactionUid() const override
VecPredReg::Container VecPredRegContainer
void setCanCommit()
Sets this instruction as ready to commit.
bool isNonSpeculative() const
size_t numSrcRegs() const
Returns the number of source registers.
bool isCompleted() const
Returns whether or not this instruction is completed.
std::list< DynInstPtr >::iterator ListIt
uint32_t socketId() const
Read this CPU's Socket ID.
void renamedDestIdx(int idx, PhysRegIdPtr phys_reg_id)
LSQ::LSQRequest * savedRequest
Saved memory request (needed when the DTB address translation is delayed due to a hw page table walk)...
int8_t numCCDestRegs() const
Number of coprocesor destination regs.
const RegId & flattenedDestIdx(int idx) const
@ VecElemClass
Vector Register Native Elem lane.
bool isIndirectCtrl() const
bool isUnverifiable() const
void setCompleted()
Sets this instruction as completed.
void setCanIssue()
Sets this instruction as ready to issue.
bool isSerializeAfter() const
bool isIssued() const
Returns whether or not this instruction has issued.
unsigned memReqFlags
The memory request flags (from translation).
void setSerializeAfter()
Temporarily sets this instruction as a serialize after instruction.
@ CCRegClass
Condition-code register.
bool isTranslationDelayed() const
Returns true if the DTB address translation is being delayed due to a hw page table walk.
void setMiscReg(int misc_reg, RegVal val) override
Sets a misc.
ListIt instListIt
Iterator pointing to this BaseDynInst in the list of all insts.
void updateMiscRegs()
Called at the commit stage to update the misc.
PhysRegIdPtr prevDestIdx(int idx) const
PhysRegIdPtr * prevDestIdx
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
std::unique_ptr< PCStateBase > pc
PC state for this instruction.
std::queue< InstResult > instResult
The result of the instruction; assumes an instruction can have many destination registers.
bool isInROB() const
Returns whether or not this instruction is in the ROB.
int cpuId() const
Read this CPU's ID.
bool isStoreConditional() const
void setThreadState(ThreadState *state)
Sets the pointer to the thread state.
bool isDirectCtrl() const
bool isSquashedInIQ() const
Returns whether or not this instruction is squashed in the IQ.
void possibleLoadViolation(bool f)
TheISA::VecRegContainer & getWritableVecRegOperand(const StaticInst *si, int idx) override
Read destination vector register operand for modification.
std::vector< short > _destMiscRegIdx
Indexes of the destination misc.
RegVal readIntRegOperand(const StaticInst *si, int idx) override
Reads an integer register.
unsigned effSize
The size of the request.
bool isInstPrefetch() const
@ SerializeHandled
Needs to serialize instructions behind it.
RegVal readVecElem(PhysRegIdPtr reg_idx) const
void setRequest()
Assert this instruction has generated a memory request.
std::bitset< NumStatus > status
The status of this BaseDynInst.
void recordResult(bool f)
Records changes to result?
void setCCRegOperand(const StaticInst *si, int idx, RegVal val) override
AddressMonitor * getAddrMonitor() override
std::bitset< MaxFlags > instFlags
@ Completed
Instruction is in the LSQ.
bool isPinnedRegsRenamed() const
Returns whether pinned registers are renamed.
InstSeqNum seqNum
The sequence number of the instruction.
std::unique_ptr< PCStateBase > branchTarget() const
Returns the branch target address.
void renameSrcReg(int idx, PhysRegIdPtr renamed_src)
Renames a source logical register to the physical register which has/will produce that logical regist...
bool doneTargCalc()
Checks whether or not this instruction has had its branch target calculated yet.
uint64_t getHtmTransactionUid() const override
void setVecReg(PhysRegIdPtr reg_idx, const TheISA::VecRegContainer &val)
gem5::ThreadContext * tcBase() const override
Returns the thread context.
@ RecoverInst
Regs pinning status updated after squash.
void setMiscReg(int misc_reg, RegVal val, ThreadID tid)
Sets a misc.
TheISA::VecPredRegContainer & getWritableVecPredReg(PhysRegIdPtr reg_idx)
bool isDelayedCommit() const
void setPredicate(bool val)
T * get() const
Directly access the pointer itself without taking a reference.
size_t numDestRegs() const
Returns the number of destination registers.
int8_t numVecDestRegs() const
Number of vector destination regs.
bool isTempSerializeAfter()
Checks if this serializeAfter is only temporarily set.
void translationStarted(bool f)
bool isCommitted() const
Returns whether or not this instruction is committed.
const PCStateBase & pcState() const override
Read the PC state of this instruction.
bool isFirstMicroop() const
PhysRegIdPtr * _prevDestIdx
void setResultReady()
Marks the result as ready.
void setPinnedRegsWritten()
Sets destination registers as written.
RegVal readFloatReg(PhysRegIdPtr phys_reg)
@ SquashedInLSQ
Instruction is squashed in the IQ.
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.
ThreadState * thread
Pointer to the thread state.
int8_t numVecPredDestRegs() const
void setHtmTransactionalState(uint64_t htm_uid, uint64_t htm_depth)
void demapPage(Addr vaddr, uint64_t asn)
bool readMemAccPredicate() const override
const PCStateBase & readPredTarg()
bool translationStarted() const
True if the DTB address translation has started.
bool hasRequest() const
Has this instruction generated a memory request.
void clearInROB()
Sets this instruction as a entry the ROB.
InstResult popResult(InstResult dflt=InstResult())
Pops a result off the instResult queue.
int8_t numVecElemDestRegs() const
bool isInIQ() const
Returns whether or not this instruction has issued.
bool possibleLoadViolation() const
True if this address was found to match a previous load and they issued out of order.
bool readyToCommit() const
Returns whether or not this instruction is ready to commit.
void dump()
Dumps out contents of this BaseDynInst.
int8_t numVecPredDestRegs() const
Number of predicate destination regs.
Addr physEffAddr
The effective physical address.
CPU * cpu
Pointer to the Impl's CPU object.
int8_t numVecElemDestRegs() const
Number of vector element destination regs.
int8_t numFPDestRegs() const
Number of floating-point destination regs.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
const TheISA::VecRegContainer & readVecRegOperand(const StaticInst *si, int idx) const override
Vector Register Interfaces.
bool readyToIssue() const
Returns whether or not this instruction is ready to issue.
void setInstListIt(ListIt _instListIt)
Sets iterator for this instruction in the list of all insts.
void markSrcRegReady()
Records that one of the source registers is ready.
void setExecuted()
Sets this instruction as executed.
RegVal readCCRegOperand(const StaticInst *si, int idx) override
gem5::ThreadContext * getTC()
Returns a pointer to the TC of this thread.
@ FloatRegClass
Floating-point register.
void setVecPredRegOperand(const StaticInst *si, int idx, const TheISA::VecPredRegContainer &val) override
Sets a destination predicate register operand to a value.
TheISA::VecRegContainer & getWritableVecReg(PhysRegIdPtr reg_idx)
Read physical vector register for modification.
@ Committed
Instruction has reached commit.
void prevDestIdx(int idx, PhysRegIdPtr phys_reg_id)
const RegId & destRegIdx(int i) const
Returns the logical register index of the i'th destination register.
void renamedSrcIdx(int idx, PhysRegIdPtr phys_reg_id)
bool readPredTaken()
Returns whether the instruction was predicted taken or not.
bool isDataPrefetch() const
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
void setCCReg(PhysRegIdPtr phys_reg, RegVal val)
Base, ISA-independent static instruction class.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
ssize_t sqIdx
Store queue index.
RegVal readMiscReg(int misc_reg) override
Reads a misc.
bool isSerializeHandled()
Checks if the serialization part of this instruction has been handled.
void setIntReg(PhysRegIdPtr phys_reg, RegVal val)
std::shared_ptr< FaultBase > Fault
void trap(const Fault &fault)
Traps to handle specified fault.
void setPinnedRegsSquashDone()
Sets dest registers' status updated after squash.
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
void setFloatRegOperandBits(const StaticInst *si, int idx, RegVal val) override
Sets the bits of a floating point register of single width to a binary value.
void setIntRegOperand(const StaticInst *si, int idx, RegVal val) override
void pcState(const PCStateBase &val) override
Set the PC state of this instruction.
void setTid(ThreadID tid)
Sets the thread id.
void renameDestReg(int idx, PhysRegIdPtr renamed_dest, PhysRegIdPtr previous_rename)
Renames a destination register to a physical register.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Fault execute()
Executes the instruction.
unsigned storeCondFailures
ProbePointArg< PacketInfo > Packet
Packet probe point.
void removeInLSQ()
Sets this instruction as a entry the LSQ.
uint64_t Tick
Tick count type.
int8_t numIntDestRegs() const
bool isSquashedInROB() const
Returns whether or not this instruction is squashed in the ROB.
bool isResultReady() const
Returns whether or not the result is ready.
RequestorID requestorId() const
Read this CPU's data requestor ID.
void setInLSQ()
Sets this instruction as a entry the LSQ.
std::shared_ptr< Request > RequestPtr
void armMonitor(Addr address) override
RegVal readIntReg(PhysRegIdPtr phys_reg)
bool isLastMicroop() const
@ SerializeAfter
Needs to serialize on instructions ahead of it.
ContextID contextId() const
Read this context's system-wide ID.
bool isUnverifiable() const
const StaticInstPtr staticInst
The StaticInst used by this BaseDynInst.
void setCommitted()
Sets this instruction as committed.
int8_t numFPDestRegs() const
int8_t numCCDestRegs() const
RegVal readFloatRegOperandBits(const StaticInst *si, int idx) override
Reads a floating point register in its binary format, instead of by value.
bool isSquashAfter() const
const TheISA::VecRegContainer & readVecReg(PhysRegIdPtr reg_idx) const
void hitExternalSnoop(bool f)
bool isFullMemBarrier() const
gem5::VecRegContainer< NumVecElemPerVecReg *sizeof(VecElem)> VecRegContainer
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
uint8_t readyRegs
How many source registers are ready.
void setPredTaken(bool predicted_taken)
Fault writeMem(uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable) override
bool isDirectCtrl() const
@ RobEntry
Instruction is in the IQ.
CircularQueue< LQEntry >::iterator LQIterator
@ ResultReady
Instruction has completed.
RegClassType classValue() const
Class accessor.
@ PinnedRegsWritten
Pinned registers are renamed.
int8_t numIntDestRegs() const
Number of integer destination regs.
bool translationCompleted() const
True if the DTB address translation has completed.
void clearCanIssue()
Clears this instruction being able to issue.
bool readPredicate() const override
bool isFirstMicroop() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
DynInst(const StaticInstPtr &staticInst, const StaticInstPtr ¯oop, InstSeqNum seq_num, CPU *cpu)
void setSerializeBefore()
Temporarily sets this instruction as a serialize before instruction.
std::vector< RegVal > _destMiscRegVal
Values to be written to the destination misc.
OpClass opClass() const
Returns the opclass of this instruction.
bool isLastMicroop() const
bool isSquashedInLSQ() const
Returns whether or not this instruction is squashed in the LSQ.
void setSerializeHandled()
Sets the serialization part of this instruction as handled.
CircularQueue< SQEntry >::iterator SQIterator
Fault completeAcc(PacketPtr pkt)
Completes the access.
bool mispredicted()
Returns whether the instruction mispredicted.
@ Executed
Instruction has issued.
void setSquashed()
Sets this instruction as squashed.
bool isSerializing() const
bool mwait(PacketPtr pkt) override
bool inHtmTransactionalState() const override
@ NumStatus
Serialization has been handled.
ContextID contextId() const
RegVal readVecElemOperand(const StaticInst *si, int idx) const override
Vector Elem Interfaces.
void setFloatReg(PhysRegIdPtr phys_reg, RegVal val)
void setVecPredReg(PhysRegIdPtr reg_idx, const TheISA::VecPredRegContainer &val)
@ Issued
Instruction can issue and execute.
void clearSerializeAfter()
Clears the serializeAfter part of this instruction.
bool isPinnedRegsSquashDone() const
Return whether dest registers' pinning status updated after squash.
@ IntRegClass
Integer register.
bool isReadBarrier() const
Class that has various thread state, such as the status, the current instruction being processed,...
Fault initiateMemAMO(Addr addr, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op) override
Derive from RefCounted if you want to enable reference counting of this class.
bool isTempSerializeBefore()
Checks if this serializeBefore is only temporarily set.
bool strictlyOrdered() const
Is this instruction's memory access strictly ordered?
uint8_t resultSize()
Return the size of the instResult queue.
Fault & getFault()
TODO: This I added for the LSQRequest side to be able to modify the fault.
void setResult(T &&t)
Pushes a result onto the instResult queue.
bool isNonSpeculative() const
bool isInstPrefetch() const
void flattenedDestIdx(int idx, const RegId ®_id)
void clearInIQ()
Sets this instruction as a entry the IQ.
uint64_t getHtmTransactionalDepth() const override
void clearSerializeBefore()
Clears the serializeBefore part of this instruction.
void setPredTarg(const PCStateBase &pred_pc)
Set the predicted target of this current instruction.
@ SquashedInROB
Instruction is squashed in the LSQ.
void translationCompleted(bool f)
@ CanCommit
Instruction has executed.
RegVal readMiscRegOperand(const StaticInst *si, int idx) override
Reads a misc.
@ MiscRegClass
Control (misc) register.
void readySrcIdx(int idx, bool ready)
@ SerializeBefore
Is a thread synchronization instruction.
@ AtCommit
Instruction can commit.
void clearHtmTransactionalState()
void mwaitAtomic(gem5::ThreadContext *tc) override
bool isDataPrefetch() const
Fault getFault() const
Returns the fault type.
void setSquashedInLSQ()
Sets this instruction as squashed in the LSQ.
TheISA::VecPredRegContainer & getWritableVecPredRegOperand(const StaticInst *si, int idx) override
Gets destination predicate register operand for modification.
bool isSquashAfter() const
int ContextID
Globally unique thread context ID.
void clearIssued()
Clears this instruction as being issued.
const RegId & srcRegIdx(int i) const
Returns the logical register index of the i'th source register.
Trace::InstRecord * traceData
InstRecord that tracks this instructions.
bool isSerializing() const
RegVal readMiscReg(int misc_reg, ThreadID tid)
Reads a misc.
void setPinnedRegsRenamed()
Sets the destination registers as renamed.
Fault initiateMemRead(Addr addr, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable) override
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
void setIssued()
Sets this instruction as issued from the IQ.
virtual std::unique_ptr< PCStateBase > branchTarget(const PCStateBase &pc) const
Return the target address for a PC-relative branch.
bool memOpDone() const
Whether or not the memory operation is done.
bool isWriteBarrier() const
Fault initiateHtmCmd(Request::Flags flags) override
Initiate an HTM command, e.g.
bool isExecuted() const
Returns whether or not this instruction has executed.
void clearCanCommit()
Clears this instruction as being ready to commit.
bool isPinnedRegsWritten() const
Returns whether destination registers are written.
const StaticInstPtr macroop
The Macroop if one exists.
void setVecElemOperand(const StaticInst *si, int idx, RegVal val) override
Sets a vector register to a value.
bool isIndirectCtrl() const
Addr effAddr
The effective virtual address (lds & stores only).
bool isFullMemBarrier() const
bool isUncondCtrl() const
void effAddrValid(bool b)
bool isReadBarrier() const
@ VecRegClass
Vector Register.
unsigned int readStCondFailures() const override
Returns the number of consecutive store conditional failures.
bool isStoreConditional() const
bool isDelayedCommit() const
PhysRegIdPtr renamedDestIdx(int idx) const
@ SquashedInIQ
Instruction is squashed.
void setMemAccPredicate(bool val) override
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Fault fault
The kind of fault this instruction has generated.
PhysRegIdPtr renamedSrcIdx(int idx) const
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
const TheISA::VecPredRegContainer & readVecPredReg(PhysRegIdPtr reg_idx) const
void demapPage(Addr vaddr, uint64_t asn) override
Invalidate a page in the DTLB and ITLB.
void strictlyOrdered(bool so)
@ CanIssue
Instruction has its result.
int8_t numVecDestRegs() const
bool isUncondCtrl() const
@ LsqEntry
Instruction is in the ROB.
void setSquashedInROB()
Sets this instruction as squashed in the ROB.
bool effAddrValid() const
Is the effective virtual address valid.
const TheISA::VecPredRegContainer & readVecPredRegOperand(const StaticInst *si, int idx) const override
Predicate registers interface.
ssize_t lqIdx
Load queue index.
bool isSquashed() const
Returns whether or not this instruction is squashed.
void setStCondFailures(unsigned int sc_failures) override
Sets the number of consecutive store conditional failures.
@ BlockingInst
Is a recover instruction.
int16_t ThreadID
Thread index/ID type.
void setPredicate(bool val) override
uint8_t * memData
Pointer to the data for the memory access.
bool hitExternalSnoop() const
True if the address hit a external snoop while sitting in the LSQ.
Register ID: describe an architectural register with its class and index.
#define panic(...)
This implements a cprintf based panic() function.
bool isSerializeAfter() const
bool isSerializeBefore() const
void setInROB()
Sets this instruction as a entry the ROB.
Generated on Tue Feb 8 2022 11:47:03 for gem5 by doxygen 1.8.17