42 #ifndef __CPU_O3_DYN_INST_HH__ 43 #define __CPU_O3_DYN_INST_HH__ 47 #include "arch/isa_traits.hh" 48 #include "config/the_isa.hh" 62 typedef typename Impl::O3CPU
O3CPU;
127 int32_t dispatchTick;
129 int32_t completeTick;
156 if (_destMiscRegIdx[idx] == misc_reg) {
157 _destMiscRegVal[idx] =
val;
198 bool no_squash_from_TC = this->
thread->noSquashFromTC;
199 this->
thread->noSquashFromTC =
true;
202 this->
cpu->setMiscReg(
203 _destMiscRegIdx[
i], _destMiscRegVal[i], this->threadNumber);
205 this->
thread->noSquashFromTC = no_squash_from_TC;
211 for (
int idx = 0; idx < this->
numDestRegs(); idx++) {
213 const RegId& original_dest_reg =
218 this->
cpu->readIntReg(prev_phys_reg));
222 this->
cpu->readFloatReg(prev_phys_reg));
226 this->
cpu->readVecReg(prev_phys_reg));
230 this->
cpu->readVecElem(prev_phys_reg));
234 this->
cpu->readVecPredReg(prev_phys_reg));
238 this->
cpu->readCCReg(prev_phys_reg));
244 panic(
"Unknown register class: %d",
326 template <
typename LD>
429 #endif // __CPU_O3_ALPHA_DYN_INST_HH__ #define panic(...)
This implements a cprintf based panic() function.
void setFloatRegOperandBits(const StaticInst *si, int idx, RegVal val)
Records an fp register being set to an integer value.
bool isMiscReg() const
true if it is a condition-code physical register.
Vector Register Abstraction This generic class is the model in a particularization of MVC...
const VecPredRegContainer & readVecPredRegOperand(const StaticInst *si, int idx) const override
Predicate registers interface.
Fault fault
The kind of fault this instruction has generated.
void setVecPredRegOperand(const StaticInst *si, int idx, const VecPredRegContainer &val)
Record a vector register being set to a value.
void setCCRegOperand(const StaticInst *si, int idx, RegVal val) override
Records a CC register being set to a value.
std::array< PhysRegIdPtr, TheISA::MaxInstDestRegs > _destRegIdx
Physical register index of the destination registers of this instruction.
VecPredRegContainer & getWritableVecPredRegOperand(const StaticInst *si, int idx) override
Gets destination predicate register operand for modification.
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
const VecRegContainer & readVecRegOperand(const StaticInst *si, int idx) const override
Vector Register Interfaces.
void setVecLaneOperandT(const StaticInst *si, int idx, const LD &val)
Write a lane of the destination vector operand.
constexpr unsigned NumVecElemPerVecReg
Fault completeAcc(PacketPtr pkt)
Completes the access.
void setVecElemOperand(const StaticInst *si, int idx, const VecElem val) override
Record a vector register being set to a value.
void trap(const Fault &fault)
Traps to handle specified fault.
ConstVecLane8 readVec8BitLaneOperand(const StaticInst *si, int idx) const override
Vector Register Lane Interfaces.
RegVal readFloatRegOperandBits(const StaticInst *si, int idx) override
Reads a floating point register in its binary format, instead of by value.
void setVecElemOperand(const StaticInst *si, int idx, const VecElem val)
Record a vector register being set to a value.
VecRegContainer & getWritableVecRegOperand(const StaticInst *si, int idx) override
Read destination vector register operand for modification.
void syscall(Fault *fault) override
Emulates a syscall.
ConstVecLane16 readVec16BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 16bit operand.
LaneSize is an abstraction of a LS byte value for the execution and thread contexts to handle values ...
Vector Register Native Elem lane.
uint8_t _numDestMiscRegs
Number of destination misc.
void setVecRegOperand(const StaticInst *si, int idx, const VecRegContainer &val) override
Record a vector register being set to a value.
const int MaxMiscDestRegs
uint64_t Tick
Tick count type.
VecPredReg::Container VecPredRegContainer
void setIntRegOperand(const StaticInst *si, int idx, RegVal val) override
RegVal readMiscRegOperand(const StaticInst *si, int idx) override
Reads a misc.
std::array< PhysRegIdPtr, TheISA::MaxInstSrcRegs > _srcRegIdx
Physical register index of the source registers of this instruction.
RegVal readMiscReg(int misc_reg) override
Reads a misc.
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::EightByte > &val) override
std::array< short, TheISA::MaxMiscDestRegs > _destMiscRegIdx
Indexes of the destination misc.
BaseO3DynInst(const StaticInstPtr &staticInst, const StaticInstPtr ¯oop, TheISA::PCState pc, TheISA::PCState predPC, InstSeqNum seq_num, O3CPU *cpu)
BaseDynInst constructor given a binary instruction.
const StaticInstPtr staticInst
The StaticInst used by this BaseDynInst.
TheISA::PCState pc
PC state for this instruction.
Fault execute()
Executes the instruction.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
VecElem readVecElemOperand(const StaticInst *si, int idx) const override
Vector Elem Interfaces.
ConstVecLane32 readVec32BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 32bit operand.
void updateMiscRegs()
Called at the commit stage to update the misc.
static constexpr auto NumVecElemPerVecReg
void setIntRegOperand(const StaticInst *si, int idx, RegVal val)
Records an integer register being set to a value.
PhysRegIdPtr prevDestRegIdx(int idx) const
Returns the physical register index of the previous physical register that remapped to the same logic...
std::array< RegVal, TheISA::MaxMiscDestRegs > _destMiscRegVal
Values to be written to the destination misc.
void setMiscReg(int misc_reg, RegVal val) override
Sets a misc.
ImplCPU * cpu
Pointer to the Impl's CPU object.
VecReg::Container VecRegContainer
TheISA::MachInst MachInst
Binary machine instruction type.
Impl::O3CPU O3CPU
Typedef for the CPU.
const RegClass & classValue() const
Class accessor.
Generic predicate register container.
int8_t numDestRegs() const
Returns the number of destination registers.
void setVecPredRegOperand(const StaticInst *si, int idx, const VecPredRegContainer &val) override
Record a vector register being set to a value.
void setFloatRegOperandBits(const StaticInst *si, int idx, RegVal val) override
Records an fp register being set to an integer value.
Base, ISA-independent static instruction class.
const RegIndex & index() const
Index accessors.
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
Defines a dynamic instruction context.
const StaticInstPtr macroop
The Macroop if one exists.
Register ID: describe an architectural register with its class and index.
RegVal readIntRegOperand(const StaticInst *si, int idx) override
Reads an integer register.
ConstVecLane64 readVec64BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 64bit operand.
TheISA::PCState predPC
Predicted PC state after this instruction.
void setCCRegOperand(const StaticInst *si, int idx, RegVal val)
Records a CC register being set to a value.
ThreadID threadNumber
The thread this instruction is from.
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::FourByte > &val) override
Vector Lane abstraction Another view of a container.
void setVecRegOperand(const StaticInst *si, int idx, const VecRegContainer &val)
Record a vector register being set to a value.
GenericISA::DelaySlotPCState< MachInst > PCState
void setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
Sets a misc.
T * get() const
Directly access the pointer itself without taking a reference.
std::shared_ptr< FaultBase > Fault
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::TwoByte > &val) override
ImplState * thread
Pointer to the thread state.
void initVars()
Initializes variables.
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::Byte > &val) override
Write a lane of the destination vector operand.
RegVal readCCRegOperand(const StaticInst *si, int idx) override
Fault initiateAcc()
Initiates the access.