44#include "debug/O3CPU.hh"
70 DPRINTF(O3CPU,
"Calling activate on Thread Context %d\n",
86 DPRINTF(O3CPU,
"Calling suspend on Thread Context %d\n",
93 DPRINTF(O3CPU,
"Ignoring suspend on TC due to pending drain\n");
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
std::vector< BaseISA * > isa
void htmSendAbortSignal(ThreadID tid, uint64_t htm_uid, HtmFailureFaultCause cause) override
This function is used to instruct the memory subsystem that a transaction should be aborted and the s...
void setArchReg(const RegId ®, RegVal val, ThreadID tid)
void activateContext(ThreadID tid) override
Add Thread to Active Threads List.
void setMiscReg(int misc_reg, RegVal val, ThreadID tid)
Sets a misc.
void setMiscRegNoEffect(int misc_reg, RegVal val, ThreadID tid)
Sets a miscellaneous register.
bool isDraining() const
Is the CPU draining?
void suspendContext(ThreadID tid) override
Remove Thread from Active Threads List.
RegVal getArchReg(const RegId ®, ThreadID tid)
Architectural register accessors.
void addThreadToExitingList(ThreadID tid)
Insert tid to the list of threads trying to exit.
void pcState(const PCStateBase &new_pc_state, ThreadID tid)
Sets the commit PC state of a specific thread.
void * getWritableArchReg(const RegId ®, ThreadID tid)
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.
bool trapPending
Whether or not the thread is currently waiting on a trap, and thus able to be externally updated with...
std::unique_ptr< BaseHTMCheckpoint > htmCheckpoint
Pointer to the hardware transactional memory checkpoint.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria 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
ThreadID threadId() const
void setStatus(Status new_status)
Sets the status of this thread.
Tick lastSuspend
Last time suspend was called on this thread.
Tick lastActivate
Last time activate was called on this thread.
Status status() const
Returns the status of this thread.