gem5
v21.1.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 () |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
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 |
void | initMemProxies (ThreadContext *tc) |
Initialise the physical and virtual port proxies and tie them to the data port of the CPU. More... | |
PortProxy & | getVirtProxy () |
Process * | getProcessPtr () |
void | setProcessPtr (Process *p) |
Status | status () const |
Returns the status of this thread. More... | |
void | setStatus (Status new_status) |
Sets the status of this thread. More... | |
![]() | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Attributes | |
Counter | numInst |
Number of instructions committed. More... | |
Counter | numOp |
Number of ops (including micro ops) committed. More... | |
gem5::ThreadState::ThreadStateStats | threadStats |
Counter | numLoad |
Number of simulated loads, used for tracking events based on the number of loads committed. More... | |
Counter | startNumLoad |
The number of simulated loads committed prior to this run. More... | |
Tick | lastActivate |
Last time activate was called on this thread. More... | |
Tick | lastSuspend |
Last time suspend was called on this thread. More... | |
unsigned | storeCondFailures |
Protected Attributes | |
ThreadContext::Status | _status |
BaseCPU * | baseCpu |
ContextID | _contextId |
ThreadID | _threadId |
Process * | process |
PortProxy * | virtProxy |
A translating port proxy, outgoing only, for functional accesse to virtual addresses. More... | |
Additional Inherited Members | |
![]() | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. More... | |
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.
|
virtual |
Definition at line 53 of file thread_state.cc.
References virtProxy.
|
inline |
Definition at line 63 of file thread_state.hh.
References _contextId.
Referenced by gem5::o3::ThreadContext::contextId(), gem5::SimpleThread::contextId(), and gem5::o3::DynInst::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 85 of file thread_state.hh.
References process.
Referenced by gem5::o3::ThreadContext::getProcessPtr(), and gem5::SimpleThread::getProcessPtr().
PortProxy & gem5::ThreadState::getVirtProxy | ( | ) |
Definition at line 88 of file thread_state.cc.
References virtProxy.
Referenced by gem5::o3::ThreadContext::getVirtProxy(), and gem5::SimpleThread::getVirtProxy().
void gem5::ThreadState::initMemProxies | ( | ThreadContext * | tc | ) |
Initialise the physical and virtual port proxies and tie them to the data port of the CPU.
tc | ThreadContext for the virtual-to-physical translation |
Definition at line 72 of file thread_state.cc.
References gem5::FullSystem, gem5::SETranslatingPortProxy::NextPage, and virtProxy.
Referenced by gem5::o3::ThreadContext::initMemProxies(), and gem5::SimpleThread::initMemProxies().
|
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 60 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 87 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 93 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 90 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::flattenRegId(), gem5::o3::ThreadContext::getDecoderPtr(), gem5::o3::ThreadContext::getIsaPtr(), gem5::o3::ThreadContext::getWritableVecPredRegFlat(), gem5::o3::ThreadContext::getWritableVecRegFlat(), gem5::o3::ThreadContext::halt(), gem5::o3::ThreadContext::htmAbortTransaction(), gem5::o3::ThreadContext::instAddr(), gem5::o3::ThreadContext::microPC(), gem5::o3::ThreadContext::nextInstAddr(), gem5::o3::ThreadContext::pcState(), gem5::o3::ThreadContext::pcStateNoRecord(), gem5::o3::ThreadContext::readCCRegFlat(), gem5::o3::ThreadContext::readFloatRegFlat(), gem5::o3::ThreadContext::readIntRegFlat(), gem5::o3::ThreadContext::readMiscReg(), gem5::o3::ThreadContext::readMiscRegNoEffect(), gem5::o3::ThreadContext::readVecElemFlat(), gem5::o3::ThreadContext::readVecPredRegFlat(), gem5::o3::ThreadContext::readVecRegFlat(), gem5::o3::ThreadContext::setCCRegFlat(), gem5::o3::ThreadContext::setFloatRegFlat(), gem5::o3::ThreadContext::setIntRegFlat(), gem5::o3::ThreadContext::setMiscReg(), gem5::o3::ThreadContext::setMiscRegNoEffect(), gem5::o3::ThreadContext::setVecElemFlat(), gem5::o3::ThreadContext::setVecPredRegFlat(), gem5::o3::ThreadContext::setVecRegFlat(), 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 66 of file thread_state.cc.
References _status, and UNSERIALIZE_ENUM.
Referenced by gem5::o3::ThreadState::unserialize(), and gem5::SimpleThread::unserialize().
|
protected |
Definition at line 128 of file thread_state.hh.
Referenced by contextId(), gem5::SimpleThread::copyState(), and setContextId().
|
protected |
Definition at line 122 of file thread_state.hh.
Referenced by gem5::SimpleThread::activate(), gem5::SimpleThread::copyState(), gem5::SimpleThread::halt(), serialize(), setStatus(), gem5::SimpleThread::setStatus(), status(), gem5::SimpleThread::status(), gem5::SimpleThread::suspend(), and unserialize().
|
protected |
Definition at line 131 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 125 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 135 of file thread_state.hh.
Referenced by gem5::o3::ThreadContext::activate(), gem5::SimpleThread::activate(), gem5::BaseKvmCPU::activateContext(), readLastActivate(), gem5::o3::ThreadContext::readLastActivate(), gem5::o3::ThreadContext::suspend(), and gem5::SimpleThread::suspend().
Tick gem5::ThreadState::lastSuspend |
Last time suspend was called on this thread.
Definition at line 138 of file thread_state.hh.
Referenced by gem5::BaseKvmCPU::activateContext(), readLastSuspend(), gem5::o3::ThreadContext::readLastSuspend(), gem5::o3::ThreadContext::suspend(), and gem5::SimpleThread::suspend().
Counter gem5::ThreadState::numInst |
Number of instructions committed.
Definition at line 98 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 116 of file thread_state.hh.
Counter gem5::ThreadState::numOp |
Number of ops (including micro ops) committed.
Definition at line 100 of file thread_state.hh.
Referenced by gem5::minor::Execute::doInstCommitAccounting().
|
protected |
Definition at line 141 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 119 of file thread_state.hh.
unsigned gem5::ThreadState::storeCondFailures |
Definition at line 152 of file thread_state.hh.
Referenced by gem5::o3::ThreadContext::readStCondFailures(), gem5::SimpleThread::readStCondFailures(), gem5::o3::DynInst::readStCondFailures(), gem5::o3::ThreadContext::setStCondFailures(), gem5::SimpleThread::setStCondFailures(), gem5::o3::DynInst::setStCondFailures(), and gem5::SimpleThread::takeOverFrom().
gem5::ThreadState::ThreadStateStats gem5::ThreadState::threadStats |
Referenced by gem5::minor::Execute::doInstCommitAccounting().
|
protected |
A translating port proxy, outgoing only, for functional accesse to virtual addresses.
Definition at line 145 of file thread_state.hh.
Referenced by getVirtProxy(), initMemProxies(), and ~ThreadState().