gem5 v24.0.0.0
|
Struct for holding general thread state that is needed across CPU models. More...
#include <thread_state.hh>
Classes | |
struct | ThreadStateStats |
Public Types | |
typedef ThreadContext::Status | Status |
Public Member Functions | |
ThreadState (BaseCPU *cpu, ThreadID _tid, Process *_process) | |
virtual | ~ThreadState ()=default |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
int | cpuId () const |
uint32_t | socketId () const |
ContextID | contextId () const |
void | setContextId (ContextID id) |
void | setThreadId (ThreadID id) |
ThreadID | threadId () const |
Tick | readLastActivate () const |
Tick | readLastSuspend () const |
Process * | getProcessPtr () |
void | setProcessPtr (Process *p) |
Status | status () const |
Returns the status of this thread. | |
void | setStatus (Status new_status) |
Sets the status of this thread. | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Attributes | |
Counter | numInst |
Number of instructions committed. | |
Counter | numOp |
Number of ops (including micro ops) committed. | |
gem5::ThreadState::ThreadStateStats | threadStats |
Counter | numLoad |
Number of simulated loads, used for tracking events based on the number of loads committed. | |
Counter | startNumLoad |
The number of simulated loads committed prior to this run. | |
Tick | lastActivate |
Last time activate was called on this thread. | |
Tick | lastSuspend |
Last time suspend was called on this thread. | |
unsigned | storeCondFailures |
Protected Attributes | |
ThreadContext::Status | _status |
BaseCPU * | baseCpu |
ContextID | _contextId |
ThreadID | _threadId |
Process * | process |
Additional Inherited Members | |
Static Public Member Functions inherited from gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Struct for holding general thread state that is needed across CPU models.
This includes things such as pointers to the process, memory, quiesce events, and certain stats. This can be expanded to hold more thread-specific stats within it.
Definition at line 47 of file thread_state.hh.
Definition at line 49 of file thread_state.hh.
Definition at line 44 of file thread_state.cc.
|
virtualdefault |
|
inline |
Definition at line 63 of file thread_state.hh.
References _contextId.
Referenced by gem5::o3::DynInst::contextId(), gem5::o3::ThreadContext::contextId(), and gem5::SimpleThread::contextId().
|
inline |
Definition at line 59 of file thread_state.hh.
References baseCpu, and gem5::BaseCPU::cpuId().
Referenced by gem5::SimpleThread::cpuId().
|
inline |
Definition at line 75 of file thread_state.hh.
References process.
Referenced by gem5::o3::ThreadContext::getProcessPtr(), and gem5::SimpleThread::getProcessPtr().
|
inline |
Definition at line 71 of file thread_state.hh.
References lastActivate.
Referenced by gem5::SimpleThread::readLastActivate().
|
inline |
Definition at line 73 of file thread_state.hh.
References lastSuspend.
Referenced by gem5::SimpleThread::readLastSuspend().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements gem5::Serializable.
Definition at line 54 of file thread_state.cc.
References _status, and SERIALIZE_ENUM.
Referenced by gem5::o3::ThreadState::serialize(), and gem5::SimpleThread::serialize().
|
inline |
Definition at line 65 of file thread_state.hh.
References _contextId, and gem5::ArmISA::id.
Referenced by gem5::o3::ThreadContext::setContextId(), and gem5::SimpleThread::setContextId().
|
inline |
Definition at line 77 of file thread_state.hh.
References gem5::MipsISA::p, and process.
Referenced by gem5::o3::ThreadContext::setProcessPtr(), and gem5::SimpleThread::setProcessPtr().
|
inline |
Sets the status of this thread.
Definition at line 83 of file thread_state.hh.
References _status.
Referenced by gem5::o3::ThreadContext::activate(), gem5::o3::ThreadContext::halt(), gem5::o3::ThreadContext::setStatus(), and gem5::o3::ThreadContext::suspend().
|
inline |
Definition at line 67 of file thread_state.hh.
References _threadId, and gem5::ArmISA::id.
Referenced by gem5::o3::ThreadContext::setThreadId(), and gem5::SimpleThread::setThreadId().
|
inline |
Definition at line 61 of file thread_state.hh.
References baseCpu, and gem5::BaseCPU::socketId().
Referenced by gem5::SimpleThread::socketId().
|
inline |
Returns the status of this thread.
Definition at line 80 of file thread_state.hh.
References _status.
Referenced by gem5::o3::ThreadContext::activate(), gem5::o3::ThreadContext::halt(), gem5::o3::ThreadContext::status(), and gem5::o3::ThreadContext::suspend().
|
inline |
Definition at line 69 of file thread_state.hh.
References _threadId.
Referenced by gem5::o3::ThreadContext::activate(), gem5::o3::ThreadContext::clearArchRegs(), gem5::o3::ThreadContext::conditionalSquash(), gem5::o3::ThreadContext::getDecoderPtr(), gem5::o3::ThreadContext::getIsaPtr(), gem5::o3::ThreadContext::getReg(), gem5::o3::ThreadContext::getReg(), gem5::o3::ThreadContext::getWritableReg(), gem5::o3::ThreadContext::halt(), gem5::o3::ThreadContext::htmAbortTransaction(), gem5::o3::ThreadContext::pcState(), gem5::o3::ThreadContext::pcState(), gem5::o3::ThreadContext::pcStateNoRecord(), gem5::o3::ThreadContext::readMiscReg(), gem5::o3::ThreadContext::readMiscRegNoEffect(), gem5::o3::ThreadContext::setMiscReg(), gem5::o3::ThreadContext::setMiscRegNoEffect(), gem5::o3::ThreadContext::setReg(), gem5::o3::ThreadContext::setReg(), gem5::o3::ThreadContext::suspend(), gem5::o3::ThreadContext::threadId(), and gem5::SimpleThread::threadId().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements gem5::Serializable.
Definition at line 60 of file thread_state.cc.
References _status, and UNSERIALIZE_ENUM.
Referenced by gem5::o3::ThreadState::unserialize(), and gem5::SimpleThread::unserialize().
|
protected |
Definition at line 118 of file thread_state.hh.
Referenced by contextId(), gem5::SimpleThread::copyState(), and setContextId().
|
protected |
Definition at line 112 of file thread_state.hh.
Referenced by gem5::SimpleThread::activate(), gem5::SimpleThread::copyState(), gem5::SimpleThread::halt(), serialize(), gem5::SimpleThread::setStatus(), setStatus(), gem5::SimpleThread::status(), status(), gem5::SimpleThread::suspend(), and unserialize().
|
protected |
Definition at line 121 of file thread_state.hh.
Referenced by gem5::SimpleThread::activate(), gem5::SimpleThread::copyState(), gem5::SimpleThread::halt(), setThreadId(), gem5::SimpleThread::suspend(), and threadId().
|
protected |
Definition at line 115 of file thread_state.hh.
Referenced by gem5::SimpleThread::activate(), cpuId(), gem5::SimpleThread::getCpuPtr(), gem5::SimpleThread::halt(), gem5::SimpleThread::htmAbortTransaction(), gem5::SimpleThread::name(), socketId(), and gem5::SimpleThread::suspend().
Tick gem5::ThreadState::lastActivate |
Last time activate was called on this thread.
Definition at line 125 of file thread_state.hh.
Referenced by gem5::o3::ThreadContext::activate(), gem5::SimpleThread::activate(), gem5::BaseKvmCPU::activateContext(), gem5::o3::ThreadContext::readLastActivate(), readLastActivate(), gem5::o3::ThreadContext::suspend(), and gem5::SimpleThread::suspend().
Tick gem5::ThreadState::lastSuspend |
Last time suspend was called on this thread.
Definition at line 128 of file thread_state.hh.
Referenced by gem5::BaseKvmCPU::activateContext(), gem5::o3::ThreadContext::readLastSuspend(), readLastSuspend(), gem5::o3::ThreadContext::suspend(), and gem5::SimpleThread::suspend().
Counter gem5::ThreadState::numInst |
Number of instructions committed.
Definition at line 88 of file thread_state.hh.
Referenced by gem5::minor::Execute::doInstCommitAccounting().
Counter gem5::ThreadState::numLoad |
Number of simulated loads, used for tracking events based on the number of loads committed.
Definition at line 106 of file thread_state.hh.
Counter gem5::ThreadState::numOp |
Number of ops (including micro ops) committed.
Definition at line 90 of file thread_state.hh.
Referenced by gem5::minor::Execute::doInstCommitAccounting().
|
protected |
Definition at line 131 of file thread_state.hh.
Referenced by getProcessPtr(), and setProcessPtr().
Counter gem5::ThreadState::startNumLoad |
The number of simulated loads committed prior to this run.
Definition at line 109 of file thread_state.hh.
unsigned gem5::ThreadState::storeCondFailures |
Definition at line 138 of file thread_state.hh.
Referenced by gem5::o3::DynInst::readStCondFailures(), gem5::o3::ThreadContext::readStCondFailures(), gem5::SimpleThread::readStCondFailures(), gem5::o3::DynInst::setStCondFailures(), gem5::o3::ThreadContext::setStCondFailures(), gem5::SimpleThread::setStCondFailures(), and gem5::SimpleThread::takeOverFrom().
gem5::ThreadState::ThreadStateStats gem5::ThreadState::threadStats |
Referenced by gem5::minor::Execute::doInstCommitAccounting().