43 #ifndef __CPU_O3_DYN_INST_IMPL_HH__
44 #define __CPU_O3_DYN_INST_IMPL_HH__
49 #include "debug/O3PipeView.hh"
56 :
BaseDynInst<Impl>(staticInst, macroop, pc, predPC, seq_num, cpu)
73 Tick fetch = this->fetchTick;
78 DPRINTFR(O3PipeView,
"O3PipeView:fetch:%llu:0x%08llx:%d:%llu:%s\n",
83 this->staticInst->disassemble(this->instAddr()));
85 val = (this->decodeTick == -1) ? 0 : fetch + this->decodeTick;
86 DPRINTFR(O3PipeView,
"O3PipeView:decode:%llu\n", val);
87 val = (this->renameTick == -1) ? 0 : fetch + this->renameTick;
88 DPRINTFR(O3PipeView,
"O3PipeView:rename:%llu\n", val);
89 val = (this->dispatchTick == -1) ? 0 : fetch + this->dispatchTick;
90 DPRINTFR(O3PipeView,
"O3PipeView:dispatch:%llu\n", val);
91 val = (this->issueTick == -1) ? 0 : fetch + this->issueTick;
92 DPRINTFR(O3PipeView,
"O3PipeView:issue:%llu\n", val);
93 val = (this->completeTick == -1) ? 0 : fetch + this->completeTick;
94 DPRINTFR(O3PipeView,
"O3PipeView:complete:%llu\n", val);
95 val = (this->commitTick == -1) ? 0 : fetch + this->commitTick;
97 Tick valS = (this->storeTick == -1) ? 0 : fetch + this->storeTick;
98 DPRINTFR(O3PipeView,
"O3PipeView:retire:%llu:store:%llu\n", val, valS);
105 template <
class Impl>
112 for (
int i = 0;
i < this->staticInst->numDestRegs();
i++) {
113 this->_destRegIdx[
i] = this->staticInst->destRegIdx(
i);
116 for (
int i = 0;
i < this->staticInst->numSrcRegs();
i++) {
117 this->_srcRegIdx[
i] = this->staticInst->srcRegIdx(
i);
120 this->_readySrcRegIdx.reset();
122 _numDestMiscRegs = 0;
138 template <
class Impl>
146 bool no_squash_from_TC = this->thread->noSquashFromTC;
147 this->thread->noSquashFromTC =
true;
149 this->fault = this->staticInst->execute(
this, this->traceData);
151 this->thread->noSquashFromTC = no_squash_from_TC;
156 template <
class Impl>
164 bool no_squash_from_TC = this->thread->noSquashFromTC;
165 this->thread->noSquashFromTC =
true;
167 this->fault = this->staticInst->initiateAcc(
this, this->traceData);
169 this->thread->noSquashFromTC = no_squash_from_TC;
174 template <
class Impl>
182 bool no_squash_from_TC = this->thread->noSquashFromTC;
183 this->thread->noSquashFromTC =
true;
185 if (this->cpu->checker) {
186 if (this->isStoreConditional()) {
191 this->fault = this->staticInst->completeAcc(pkt,
this, this->traceData);
193 this->thread->noSquashFromTC = no_squash_from_TC;
198 template <
class Impl>
202 #if THE_ISA == ALPHA_ISA
204 if (!(this->instAddr() & 0x3))
205 return std::make_shared<AlphaISA::UnimplementedOpcodeFault>();
210 this->threadNumber));
218 this->cpu->hwrei(this->threadNumber);
226 template <
class Impl>
230 this->cpu->trap(fault, this->threadNumber, this->staticInst);
233 template <
class Impl>
237 #if THE_ISA != ALPHA_ISA
238 panic(
"simPalCheck called, but PAL only exists in Alpha!\n");
240 return this->cpu->simPalCheck(palFunc, this->threadNumber);
243 template <
class Impl>
248 panic(
"Syscall emulation isn't available in FS mode.\n");
254 this->cpu->syscall(callnum, this->threadNumber, fault);
256 if (!(curPC == newPC)) {
257 this->pcState(newPC);
261 #endif//__CPU_O3_DYN_INST_IMPL_HH__
bool simPalCheck(int palFunc)
Check for special simulator handling of specific PAL calls.
decltype(nullptr) constexpr NoFault
uint64_t getExtraData() const
Accessor function for store conditional return value.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Fault completeAcc(PacketPtr pkt)
Completes the access.
void trap(const Fault &fault)
Traps to handle specified fault.
Fault hwrei()
Calls hardware return from error interrupt.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
void swAutoBegin(ThreadContext *tc, Addr next_pc)
uint64_t Tick
Tick count type.
void syscall(int64_t callnum, Fault *fault)
Emulates a syscall.
const RequestPtr req
A pointer to the original request.
BaseO3DynInst(const StaticInstPtr &staticInst, const StaticInstPtr ¯oop, TheISA::PCState pc, TheISA::PCState predPC, InstSeqNum seq_num, O3CPU *cpu)
BaseDynInst constructor given a binary instruction.
Fault execute()
Executes the instruction.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Impl::O3CPU O3CPU
Typedef for the CPU.
GenericISA::SimplePCState< MachInst > PCState
std::shared_ptr< FaultBase > Fault
void initVars()
Initializes variables.
Fault initiateAcc()
Initiates the access.