Go to the documentation of this file.
42 #ifndef __CPU_O3_THREAD_CONTEXT_IMPL_HH__
43 #define __CPU_O3_THREAD_CONTEXT_IMPL_HH__
46 #include "arch/registers.hh"
47 #include "config/the_isa.hh"
49 #include "debug/O3CPU.hh"
55 return thread->getVirtProxy();
64 this->getIsaPtr()->takeOverFrom(
this, old_context);
66 TheISA::Decoder *newDecoder = getDecoderPtr();
68 newDecoder->takeOverFrom(oldDecoder);
72 thread->noSquashFromTC =
false;
73 thread->trapPending =
false;
80 DPRINTF(
O3CPU,
"Calling activate on Thread Context %d\n",
86 thread->lastActivate =
curTick();
90 cpu->activateContext(thread->threadId());
103 if (cpu->isDraining()) {
104 DPRINTF(
O3CPU,
"Ignoring suspend on TC due to pending drain\n");
108 thread->lastActivate =
curTick();
109 thread->lastSuspend =
curTick();
112 cpu->suspendContext(thread->threadId());
115 template <
class Impl>
119 DPRINTF(
O3CPU,
"Calling halt on Thread Context %d\n", threadId());
132 cpu->addThreadToExitingList(thread->threadId());
135 template <
class Impl>
139 return thread->lastActivate;
142 template <
class Impl>
146 return thread->lastSuspend;
149 template <
class Impl>
157 thread->noSquashFromTC =
true;
159 thread->noSquashFromTC =
false;
165 template <
class Impl>
169 cpu->isa[thread->threadId()]->clear();
172 template <
class Impl>
176 return cpu->readArchIntReg(reg_idx, thread->threadId());
179 template <
class Impl>
183 return cpu->readArchFloatReg(reg_idx, thread->threadId());
186 template <
class Impl>
190 return cpu->readArchVecReg(reg_id, thread->threadId());
193 template <
class Impl>
197 return cpu->getWritableArchVecReg(reg_id, thread->threadId());
200 template <
class Impl>
205 return cpu->readArchVecElem(idx, elemIndex, thread->threadId());
208 template <
class Impl>
212 return cpu->readArchVecPredReg(reg_id, thread->threadId());
215 template <
class Impl>
219 return cpu->getWritableArchVecPredReg(reg_id, thread->threadId());
222 template <
class Impl>
226 return cpu->readArchCCReg(reg_idx, thread->threadId());
229 template <
class Impl>
233 cpu->setArchIntReg(reg_idx,
val, thread->threadId());
238 template <
class Impl>
242 cpu->setArchFloatReg(reg_idx,
val, thread->threadId());
247 template <
class Impl>
252 cpu->setArchVecReg(reg_idx,
val, thread->threadId());
257 template <
class Impl>
262 cpu->setArchVecElem(idx, elemIndex,
val, thread->threadId());
266 template <
class Impl>
271 cpu->setArchVecPredReg(reg_idx,
val, thread->threadId());
276 template <
class Impl>
280 cpu->setArchCCReg(reg_idx,
val, thread->threadId());
285 template <
class Impl>
289 cpu->pcState(
val, thread->threadId());
294 template <
class Impl>
298 cpu->pcState(
val, thread->threadId());
303 template <
class Impl>
307 return cpu->isa[thread->threadId()]->flattenRegId(regId);
310 template <
class Impl>
314 cpu->setMiscRegNoEffect(misc_reg,
val, thread->threadId());
319 template <
class Impl>
323 cpu->setMiscReg(misc_reg,
val, thread->threadId());
329 template <
class Impl>
334 cpu->htmSendAbortSignal(thread->threadId(), htmUid, cause);
339 template <
class Impl>
343 return thread->htmCheckpoint;
346 template <
class Impl>
350 thread->htmCheckpoint = std::move(new_cpt);
353 #endif //__CPU_O3_THREAD_CONTEXT_IMPL_HH__
void copyRegs(ThreadContext *src, ThreadContext *dest)
void setHtmCheckpointPtr(BaseHTMCheckpointPtr new_cpt) override
void pcStateNoRecord(const TheISA::PCState &val) override
VecPredRegContainer & getWritableVecPredRegFlat(RegIndex idx) override
Generic predicate register container.
VecReg::Container VecRegContainer
@ Halting
Trying to exit and waiting for an event to completely exit.
void setVecElemFlat(RegIndex idx, const ElemIndex &elemIdx, const VecElem &val) override
uint64_t Tick
Tick count type.
VecPredReg::Container VecPredRegContainer
virtual Counter readFuncExeInst() const =0
RegVal readFloatRegFlat(RegIndex idx) const override
void setCCRegFlat(RegIndex idx, RegVal val) override
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Helper structure to get the vector register mode for a given ISA.
void takeOverFrom(ThreadContext *old_context) override
Takes over execution of a thread from another CPU.
Register ID: describe an architectural register with its class and index.
void halt() override
Set the status to Halted.
void setMiscRegNoEffect(RegIndex misc_reg, RegVal val) override
Sets a misc.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
void setVecPredRegFlat(RegIndex idx, const VecPredRegContainer &val) override
void activate() override
Set the status to Active.
Tick readLastActivate() override
Reads the last tick that this thread was activated on.
@ Halted
Permanently shut down.
void htmAbortTransaction(uint64_t htm_uid, HtmFailureFaultCause cause) override
void setVecRegFlat(RegIndex idx, const VecRegContainer &val) override
RegId flattenRegId(const RegId ®Id) const override
void clearArchRegs() override
Resets all architectural registers to 0.
VecRegContainer & getWritableVecRegFlat(RegIndex idx) override
Read vector register operand for modification, flat indexing.
const VecElem & readVecElemFlat(RegIndex idx, const ElemIndex &elemIndex) const override
std::unique_ptr< BaseHTMCheckpoint > BaseHTMCheckpointPtr
RegVal readCCRegFlat(RegIndex idx) const override
const VecRegContainer & readVecRegFlat(RegIndex idx) const override
void setIntRegFlat(RegIndex idx, RegVal val) override
virtual TheISA::PCState pcState() const =0
BaseHTMCheckpointPtr & getHtmCheckpointPtr() override
RegVal readIntRegFlat(RegIndex idx) const override
Tick readLastSuspend() override
Reads the last tick that this thread was suspended on.
const VecPredRegContainer & readVecPredRegFlat(RegIndex idx) const override
@ Suspended
Temporarily inactive.
This object is a proxy for a port or other object which implements the functional response protocol,...
GenericISA::DelaySlotPCState< MachInst > PCState
PortProxy & getVirtProxy() override
uint16_t ElemIndex
Logical vector register elem index type.
void suspend() override
Set the status to Suspended.
virtual TheISA::Decoder * getDecoderPtr()=0
void setMiscReg(RegIndex misc_reg, RegVal val) override
Sets a misc.
void takeOverFrom(ThreadContext &ntc, ThreadContext &otc)
Copy state between thread contexts in preparation for CPU handover.
void setFloatRegFlat(RegIndex idx, RegVal val) override
void copyArchRegs(ThreadContext *tc) override
Copies the architectural registers from another TC into this TC.
TheISA::PCState pcState() const override
Reads this thread's PC state.
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17