44#include "debug/O3CPU.hh"
63 thread->noSquashFromTC =
false;
64 thread->trapPending =
false;
70 DPRINTF(O3CPU,
"Calling activate on Thread Context %d\n",
86 DPRINTF(O3CPU,
"Calling suspend on Thread Context %d\n",
92 if (
cpu->isDraining()) {
93 DPRINTF(O3CPU,
"Ignoring suspend on TC due to pending drain\n");
120 cpu->addThreadToExitingList(
thread->threadId());
126 return thread->lastActivate;
132 return thread->lastSuspend;
139 thread->noSquashFromTC =
true;
141 thread->noSquashFromTC =
false;
159 return cpu->getWritableArchReg(
reg,
thread->threadId());
219 cpu->htmSendAbortSignal(
thread->threadId(), htmUid, cause);
227 return thread->htmCheckpoint;
233 thread->htmCheckpoint = std::move(new_cpt);
virtual void copyRegsFrom(ThreadContext *src)=0
virtual void takeOverFrom(ThreadContext *new_tc, ThreadContext *old_tc)
virtual void takeOverFrom(InstDecoder *old)
Take over the state from an old decoder when switching CPUs.
Register ID: describe an architectural register with its class and index.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
@ Halted
Permanently shut down.
@ Halting
Trying to exit and waiting for an event to completely exit.
@ Suspended
Temporarily inactive.
virtual InstDecoder * getDecoderPtr()=0
void setHtmCheckpointPtr(BaseHTMCheckpointPtr new_cpt) override
void conditionalSquash()
check if the cpu is currently in state update mode and squash if not.
ThreadState * thread
Pointer to the thread state that this TC corrseponds to.
void pcStateNoRecord(const PCStateBase &val) override
void clearArchRegs() override
Resets all architectural registers to 0.
void htmAbortTransaction(uint64_t htm_uid, HtmFailureFaultCause cause) override
Tick readLastActivate() override
Reads the last tick that this thread was activated on.
void * getWritableReg(const RegId ®) override
void setMiscReg(RegIndex misc_reg, RegVal val) override
Sets a misc.
void activate() override
Set the status to Active.
void suspend() override
Set the status to Suspended.
int threadId() const override
Returns this thread's ID number.
void halt() override
Set the status to Halted.
void takeOverFrom(gem5::ThreadContext *old_context) override
Takes over execution of a thread from another CPU.
const PCStateBase & pcState() const override
Reads this thread's PC state.
Tick readLastSuspend() override
Reads the last tick that this thread was suspended on.
CPU * cpu
Pointer to the CPU.
void setReg(const RegId ®, RegVal val) override
RegVal getReg(const RegId ®) const override
BaseHTMCheckpointPtr & getHtmCheckpointPtr() override
void setMiscRegNoEffect(RegIndex misc_reg, RegVal val) override
Sets a misc.
BaseISA * getIsaPtr() const override
InstDecoder * getDecoderPtr() override
void copyArchRegs(gem5::ThreadContext *tc) override
Copies the architectural registers from another TC into this TC.
Copyright (c) 2024 Arm Limited All rights reserved.
Tick curTick()
The universal simulation clock.
uint64_t Tick
Tick count type.
void takeOverFrom(ThreadContext &ntc, ThreadContext &otc)
Copy state between thread contexts in preparation for CPU handover.
std::unique_ptr< BaseHTMCheckpoint > BaseHTMCheckpointPtr