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"
245 sizeof(uint8_t) * ((num + 7) / 8);
252 ptr =
new (cur) T[
count];
253 cur +=
sizeof(T) *
count;
342 return bits(
byte, idx % 8);
526 void dump(std::string &outstring);
582 return !(tempPC ==
predPC);
647 panic(
"Not yet implemented\n");
679 "clearing instuction's transactional state htmUid=%u\n",
1090 Tick fetchTick = -1;
1091 int32_t decodeTick = -1;
1092 int32_t renameTick = -1;
1093 int32_t dispatchTick = -1;
1094 int32_t issueTick = -1;
1095 int32_t completeTick = -1;
1096 int32_t commitTick = -1;
1097 int32_t storeTick = -1;
1110 return this->cpu->
readMiscReg(misc_reg, this->threadNumber);
1126 if (idx == misc_reg)
1178 for (
int idx = 0; idx < this->
numDestRegs(); idx++) {
1184 this->cpu->readIntReg(prev_phys_reg));
1188 this->cpu->readFloatReg(prev_phys_reg));
1192 this->cpu->readVecReg(prev_phys_reg));
1196 this->cpu->readVecElem(prev_phys_reg));
1200 this->cpu->readVecPredReg(prev_phys_reg));
1204 this->cpu->readCCReg(prev_phys_reg));
1210 panic(
"Unknown register class: %d",
1336 #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 readySrcIdx(int idx, bool ready)
@ VecElemClass
Vector Register Native Elem lane.
@ PinnedRegsRenamed
Instruction is squashed in the ROB.
@ PinnedRegsSquashDone
Pinned registers are written back.
@ CCRegClass
Condition-code register.
@ ThreadsyncWait
Is a blocking instruction.
const TheISA::VecElem & readVecElem(PhysRegIdPtr reg_idx) const
void armMonitor(ThreadID tid, Addr address)
Memory operation metadata.
constexpr decltype(nullptr) NoFault
void setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
Sets a misc.
void setVecElem(PhysRegIdPtr reg_idx, const TheISA::VecElem &val)
bool isWriteBarrier() const
bool isSerializeBefore() const
@ 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.
Addr microPC() const
Read the micro PC of this instruction.
Fault initiateAcc()
Initiates the access.
RegVal readCCReg(PhysRegIdPtr phys_reg)
void setInIQ()
Sets this instruction as a entry the IQ.
ThreadID threadNumber
The thread this instruction is from.
uint64_t newHtmTransactionUid() const override
void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseMMU *mmu)
void setPredTarg(const TheISA::PCState &_predPC)
Set the predicted target of this current instruction.
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.
TheISA::PCState pc
PC state for this instruction.
std::list< DynInstPtr >::iterator ListIt
uint32_t socketId() const
Read this CPU's Socket ID.
int8_t numCCDestRegs() const
Number of coprocesor destination regs.
bool isIndirectCtrl() const
void setVecElemOperand(const StaticInst *si, int idx, const TheISA::VecElem val) override
Sets a vector register to a value.
bool isUnverifiable() const
void setCompleted()
Sets this instruction as completed.
void setCanIssue()
Sets this instruction as ready to issue.
std::unique_ptr< uint8_t[]> BackingStorePtr
void renamedSrcIdx(int idx, PhysRegIdPtr phys_reg_id)
bool isSerializeAfter() const
bool isIssued() const
Returns whether or not this instruction has issued.
Addr predNextInstAddr()
Returns the predicted PC two instructions after the branch.
unsigned memReqFlags
The memory request flags (from translation).
void setSerializeAfter()
Temporarily sets this instruction as a serialize after instruction.
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.
TheISA::VecElem readVecElemOperand(const StaticInst *si, int idx) const override
Vector Elem Interfaces.
void updateMiscRegs()
Called at the commit stage to update the misc.
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::queue< InstResult > instResult
The result of the instruction; assumes an instruction can have many destination registers.
@ FloatRegClass
Floating-point register.
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.
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
@ MiscRegClass
Control (misc) register.
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.
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)
Regs(size_t srcs, size_t dests)
gem5::ThreadContext * tcBase() const override
Returns the thread context.
@ RecoverInst
Regs pinning status updated after squash.
void flattenedDestIdx(int idx, const RegId ®_id)
static size_t bytesForSources(size_t num)
void setMiscReg(int misc_reg, RegVal val, ThreadID tid)
Sets a misc.
TheISA::VecPredRegContainer & getWritableVecPredReg(PhysRegIdPtr reg_idx)
const RegId & flattenedDestIdx(int idx) const
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)
RegClass classValue() const
Class accessor.
bool isCommitted() const
Returns whether or not this instruction is committed.
bool isFirstMicroop() const
void setResultReady()
Marks the result as ready.
uint32_t socketId() const
Reads this CPU's Socket ID.
void setPinnedRegsWritten()
Sets destination registers as written.
RegVal readFloatReg(PhysRegIdPtr phys_reg)
@ SquashedInLSQ
Instruction is squashed in the IQ.
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 setVecPredResult(T &&t)
Predicate result.
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
Collect register related information into a single struct.
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.
LSQ::LSQRequest * savedReq
Saved memory request (needed when the DTB address translation is delayed due to a hw page table walk)...
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.
const TheISA::PCState & readPredTarg()
PhysRegIdPtr prevDestIdx(int idx) const
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.
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.
const RegId & destRegIdx(int i) const
Returns the logical register index of the i'th destination register.
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...
virtual TheISA::PCState branchTarget(const TheISA::PCState &pc) const
Return the target address for a PC-relative branch.
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.
BackingStorePtr::pointer BufCursor
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.
PhysRegIdPtr renamedSrcIdx(int idx) const
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
static void allocate(T *&ptr, BufCursor &cur, size_t count)
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 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
GenericISA::DelaySlotPCState< 4 > PCState
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.
Addr nextInstAddr() const
Read the PC of the next instruction.
void setCommitted()
Sets this instruction as committed.
TheISA::PCState branchTarget() const
Returns the branch target address.
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.
@ 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
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
bool isFirstMicroop() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void setSerializeBefore()
Temporarily sets this instruction as a serialize before instruction.
std::vector< RegVal > _destMiscRegVal
Values to be written to the destination misc.
bool readySrcIdx(int idx) const
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
static size_t bytesForDests(size_t num)
bool mwait(PacketPtr pkt) override
bool inHtmTransactionalState() const override
@ NumStatus
Serialization has been handled.
ContextID contextId() const
PhysRegIdPtr renamedDestIdx(int idx) const
void setFloatReg(PhysRegIdPtr phys_reg, RegVal val)
void setVecPredReg(PhysRegIdPtr reg_idx, const TheISA::VecPredRegContainer &val)
@ Issued
Instruction can issue and execute.
Addr predMicroPC()
Returns the predicted micro PC after the branch.
void clearSerializeAfter()
Clears the serializeAfter part of this instruction.
bool isPinnedRegsSquashDone() const
Return whether dest registers' pinning status updated after squash.
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.
@ VecRegClass
Vector Register.
bool isNonSpeculative() const
bool isInstPrefetch() const
void clearInIQ()
Sets this instruction as a entry the IQ.
uint64_t getHtmTransactionalDepth() const override
void clearSerializeBefore()
Clears the serializeBefore part of this instruction.
@ SquashedInROB
Instruction is squashed in the LSQ.
void translationCompleted(bool f)
void prevDestIdx(int idx, PhysRegIdPtr phys_reg_id)
TheISA::PCState predPC
Predicted PC state after this instruction.
void setVecElemResult(T &&t)
Vector element result.
@ CanCommit
Instruction has executed.
RegVal readMiscRegOperand(const StaticInst *si, int idx) override
Reads a misc.
@ 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.
int cpuId() const
Reads this CPU's ID.
TheISA::PCState pcState() const override
Read the PC state of this instruction.
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
Addr predInstAddr()
Returns the predicted PC immediately after the branch.
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.
bool memOpDone() const
Whether or not the memory operation is done.
DynInst(const StaticInstPtr &staticInst, const StaticInstPtr ¯oop, TheISA::PCState pc, TheISA::PCState predPC, InstSeqNum seq_num, CPU *cpu)
BaseDynInst constructor given a binary instruction.
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.
PhysRegIdPtr * _prevDestIdx
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).
RequestorID dataRequestorId() const
Reads this CPU's unique data requestor ID.
bool isFullMemBarrier() const
bool isUncondCtrl() const
void effAddrValid(bool b)
bool isReadBarrier() const
bool mwait(ThreadID tid, PacketPtr pkt)
unsigned int readStCondFailures() const override
Returns the number of consecutive store conditional failures.
bool isStoreConditional() const
bool isDelayedCommit() 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.
void renamedDestIdx(int idx, PhysRegIdPtr phys_reg_id)
@ IntRegClass
Integer register.
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)
void setVecResult(T &&t)
Full vector result.
@ CanIssue
Instruction has its result.
int8_t numVecDestRegs() const
bool isUncondCtrl() const
Addr instAddr() const
Read the PC of this instruction.
@ 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.
void pcState(const TheISA::PCState &val) override
Set the PC state of this instruction.
ssize_t lqIdx
Load queue index.
bool isSquashed() const
Returns whether or not this instruction is squashed.
virtual void advancePC(TheISA::PCState &pc_state) const =0
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.
void setScalarResult(T &&t)
Pushes a result onto the instResult queue.
Generated on Tue Sep 21 2021 12:25:01 for gem5 by doxygen 1.8.17