gem5
v20.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 & | getPhysProxy () |
PortProxy & | getVirtProxy () |
Process * | getProcessPtr () |
void | setProcessPtr (Process *p) |
Counter | readFuncExeInst () const |
Reads the number of instructions functionally executed and committed. More... | |
void | setFuncExeInst (Counter new_val) |
Sets the total number of instructions functionally executed and committed. More... | |
Status | status () const |
Returns the status of this thread. More... | |
void | setStatus (Status new_status) |
Sets the status of this thread. More... | |
Public Member Functions inherited from Serializable | |
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... | |
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... | |
Counter | funcExeInst |
unsigned | storeCondFailures |
Protected Attributes | |
ThreadContext::Status | _status |
BaseCPU * | baseCpu |
ContextID | _contextId |
ThreadID | _threadId |
Process * | process |
PortProxy * | physProxy |
A port proxy outgoing only for functional accesses to physical addresses. More... | |
PortProxy * | virtProxy |
A translating port proxy, outgoing only, for functional accesse to virtual addresses. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
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 46 of file thread_state.hh.
Definition at line 47 of file thread_state.hh.
Definition at line 41 of file thread_state.cc.
|
virtual |
Definition at line 51 of file thread_state.cc.
|
inline |
Definition at line 61 of file thread_state.hh.
References _contextId.
Referenced by SimpleThread::contextId().
|
inline |
Definition at line 57 of file thread_state.hh.
References baseCpu, and BaseCPU::cpuId().
Referenced by SimpleThread::cpuId().
PortProxy & ThreadState::getPhysProxy | ( | ) |
Definition at line 107 of file thread_state.cc.
References FullSystem, and physProxy.
Referenced by SimpleThread::getPhysProxy().
|
inline |
Definition at line 85 of file thread_state.hh.
References process.
Referenced by SimpleThread::getProcessPtr().
PortProxy & ThreadState::getVirtProxy | ( | ) |
Definition at line 115 of file thread_state.cc.
References virtProxy.
Referenced by SimpleThread::getVirtProxy().
void 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 83 of file thread_state.cc.
References baseCpu, BaseCPU::cacheLineSize(), FullSystem, BaseCPU::getSendFunctional(), SETranslatingPortProxy::NextPage, physProxy, and virtProxy.
Referenced by SimpleThread::initMemProxies().
|
inline |
Reads the number of instructions functionally executed and committed.
Definition at line 92 of file thread_state.hh.
References funcExeInst.
Referenced by SimpleThread::readFuncExeInst().
|
inline |
Definition at line 69 of file thread_state.hh.
References lastActivate.
Referenced by SimpleThread::readLastActivate().
|
inline |
Definition at line 71 of file thread_state.hh.
References lastSuspend.
Referenced by SimpleThread::readLastSuspend().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 60 of file thread_state.cc.
References _status, FullSystem, funcExeInst, SERIALIZE_ENUM, and SERIALIZE_SCALAR.
Referenced by O3ThreadState< Impl >::serialize(), and SimpleThread::serialize().
|
inline |
Definition at line 63 of file thread_state.hh.
References _contextId, and ArmISA::id.
Referenced by SimpleThread::setContextId().
|
inline |
Sets the total number of instructions functionally executed and committed.
Definition at line 97 of file thread_state.hh.
References funcExeInst.
|
inline |
Definition at line 87 of file thread_state.hh.
References MipsISA::p, and process.
Referenced by SimpleThread::setProcessPtr().
|
inline |
|
inline |
Definition at line 65 of file thread_state.hh.
References _threadId, and ArmISA::id.
Referenced by SimpleThread::setThreadId().
|
inline |
Definition at line 59 of file thread_state.hh.
References baseCpu, and BaseCPU::socketId().
Referenced by SimpleThread::socketId().
|
inline |
Returns the status of this thread.
Definition at line 100 of file thread_state.hh.
References _status.
|
inline |
Definition at line 67 of file thread_state.hh.
References _threadId.
Referenced by SimpleThread::threadId().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Definition at line 71 of file thread_state.cc.
References _status, FullSystem, funcExeInst, UNSERIALIZE_ENUM, and UNSERIALIZE_SCALAR.
Referenced by O3ThreadState< Impl >::unserialize(), and SimpleThread::unserialize().
|
protected |
Definition at line 138 of file thread_state.hh.
Referenced by contextId(), SimpleThread::copyState(), and setContextId().
|
protected |
Definition at line 132 of file thread_state.hh.
Referenced by SimpleThread::activate(), SimpleThread::copyState(), SimpleThread::halt(), serialize(), setStatus(), SimpleThread::setStatus(), status(), SimpleThread::status(), SimpleThread::suspend(), and unserialize().
|
protected |
Definition at line 141 of file thread_state.hh.
Referenced by SimpleThread::activate(), SimpleThread::copyState(), SimpleThread::halt(), setThreadId(), SimpleThread::suspend(), and threadId().
|
protected |
Definition at line 135 of file thread_state.hh.
Referenced by SimpleThread::activate(), cpuId(), SimpleThread::getCpuPtr(), SimpleThread::halt(), SimpleThread::htmAbortTransaction(), initMemProxies(), SimpleThread::name(), socketId(), and SimpleThread::suspend().
Counter ThreadState::funcExeInst |
Definition at line 166 of file thread_state.hh.
Referenced by SimpleThread::copyState(), BaseSimpleCPU::countInst(), readFuncExeInst(), serialize(), setFuncExeInst(), SimpleThread::takeOverFrom(), and unserialize().
Tick ThreadState::lastActivate |
Last time activate was called on this thread.
Definition at line 145 of file thread_state.hh.
Referenced by SimpleThread::activate(), BaseKvmCPU::activateContext(), readLastActivate(), and SimpleThread::suspend().
Tick ThreadState::lastSuspend |
Last time suspend was called on this thread.
Definition at line 148 of file thread_state.hh.
Referenced by BaseKvmCPU::activateContext(), readLastSuspend(), and SimpleThread::suspend().
Counter ThreadState::numInst |
Number of instructions committed.
Definition at line 108 of file thread_state.hh.
Referenced by Minor::Execute::doInstCommitAccounting().
Counter ThreadState::numLoad |
Number of simulated loads, used for tracking events based on the number of loads committed.
Definition at line 126 of file thread_state.hh.
Counter ThreadState::numOp |
Number of ops (including micro ops) committed.
Definition at line 110 of file thread_state.hh.
Referenced by Minor::Execute::doInstCommitAccounting().
|
protected |
A port proxy outgoing only for functional accesses to physical addresses.
Definition at line 155 of file thread_state.hh.
Referenced by getPhysProxy(), initMemProxies(), and ~ThreadState().
|
protected |
Definition at line 151 of file thread_state.hh.
Referenced by getProcessPtr(), setProcessPtr(), and SimpleThread::syscall().
Counter ThreadState::startNumLoad |
The number of simulated loads committed prior to this run.
Definition at line 129 of file thread_state.hh.
unsigned ThreadState::storeCondFailures |
Definition at line 171 of file thread_state.hh.
Referenced by SimpleThread::readStCondFailures(), SimpleThread::setStCondFailures(), and SimpleThread::takeOverFrom().
ThreadState::ThreadStateStats ThreadState::threadStats |
Referenced by Minor::Execute::doInstCommitAccounting().
|
protected |
A translating port proxy, outgoing only, for functional accesse to virtual addresses.
Definition at line 159 of file thread_state.hh.
Referenced by getVirtProxy(), initMemProxies(), and ~ThreadState().