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>
991 int32_t decodeTick = -1;
992 int32_t renameTick = -1;
993 int32_t dispatchTick = -1;
994 int32_t issueTick = -1;
995 int32_t completeTick = -1;
996 int32_t commitTick = -1;
997 int32_t storeTick = -1;
1026 if (idx == misc_reg)
1111 panic(
"Unknown register class: %d",
1183 #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.
@ 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.
RegVal getReg(PhysRegIdPtr phys_reg)
Fault initiateAcc()
Initiates the access.
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)...
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.
void setReg(PhysRegIdPtr phys_reg, RegVal val)
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)
std::vector< short > _destMiscRegIdx
Indexes of the destination misc.
unsigned effSize
The size of the request.
bool isInstPrefetch() const
@ SerializeHandled
Needs to serialize instructions behind it.
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?
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
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.
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.
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 setRegOperand(const StaticInst *si, int idx, const void *val) override
void setResultReady()
Marks the result as ready.
void setPinnedRegsWritten()
Sets destination registers as written.
@ 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.
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.
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.
Addr physEffAddr
The effective physical address.
CPU * cpu
Pointer to the Impl's CPU object.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
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.
gem5::ThreadContext * getTC()
Returns a pointer to the TC of this thread.
@ FloatRegClass
Floating-point register.
@ 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...
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.
RegVal getRegOperand(const StaticInst *si, int idx) override
bool isSerializeHandled()
Checks if the serialization part of this instruction has been handled.
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 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.
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
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.
void * getWritableReg(PhysRegIdPtr phys_reg)
bool isSquashAfter() 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.
@ PinnedRegsWritten
Pinned registers are renamed.
bool translationCompleted() const
True if the DTB address translation has completed.
void clearCanIssue()
Clears this instruction being able to issue.
bool readPredicate() const override
void setRegOperand(const StaticInst *si, int idx, RegVal val) 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
Fault initiateMemMgmtCmd(Request::Flags flags) override
Initiate a memory management command with no valid address.
@ 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,...
void getRegOperand(const StaticInst *si, int idx, void *val) override
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 * getWritableRegOperand(const StaticInst *si, int idx) 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)
RegClassType
Enumerate the classes of registers.
@ 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.
bool isSquashAfter() const
int ContextID
Globally unique thread context ID.
size_t numDestRegs(RegClassType type) const
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.
uint8_t numDestRegs() const
Number of destination registers.
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
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.
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....
constexpr RegClassType classValue() const
Class accessor.
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.
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.
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 Wed Jul 13 2022 10:39:15 for gem5 by doxygen 1.8.17