gem5
|
Struct for holding general thread state that is needed across CPU models. More...
#include <thread_state.hh>
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... | |
void | dumpFuncProfile () |
EndQuiesceEvent * | getQuiesceEvent () |
void | profileClear () |
void | profileSample () |
TheISA::Kernel::Statistics * | getKernelStats () |
PortProxy & | getPhysProxy () |
FSTranslatingPortProxy & | getVirtProxy () |
Process * | getProcessPtr () |
void | setProcessPtr (Process *p) |
SETranslatingPortProxy & | getMemProxy () |
Counter | readFuncExeInst () |
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... | |
Stats::Scalar | numInsts |
Stat for number instructions committed. More... | |
Counter | numOp |
Number of ops (including micro ops) committed. More... | |
Stats::Scalar | numOps |
Stat for number ops (including micro ops) committed. More... | |
Stats::Scalar | numMemRefs |
Stat for number of memory references. More... | |
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... | |
FunctionProfile * | profile |
ProfileNode * | profileNode |
Addr | profilePC |
EndQuiesceEvent * | quiesceEvent |
TheISA::Kernel::Statistics * | kernelStats |
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... | |
FSTranslatingPortProxy * | virtProxy |
A translating port proxy, outgoing only, for functional accesse to virtual addresses. More... | |
SETranslatingPortProxy * | proxy |
Additional Inherited Members | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Get the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
static void | unserializeGlobals (CheckpointIn &cp) |
Static Public Attributes inherited from Serializable | |
static int | ckptCount = 0 |
static int | ckptMaxCount = 0 |
static int | ckptPrevCount = -1 |
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 59 of file thread_state.hh.
Definition at line 60 of file thread_state.hh.
Definition at line 46 of file thread_state.cc.
|
virtual |
Definition at line 56 of file thread_state.cc.
|
inline |
Definition at line 74 of file thread_state.hh.
References _contextId.
Referenced by O3ThreadContext< class >::contextId(), Minor::ExecContext::contextId(), TimingSimpleCPU::fetch(), TimingSimpleCPU::initiateMemRead(), and TimingSimpleCPU::writeMem().
|
inline |
Definition at line 70 of file thread_state.hh.
References baseCpu.
void ThreadState::dumpFuncProfile | ( | ) |
|
inline |
Definition at line 102 of file thread_state.hh.
References kernelStats.
SETranslatingPortProxy & ThreadState::getMemProxy | ( | ) |
Definition at line 145 of file thread_state.cc.
References FullSystem, and proxy.
Referenced by O3ThreadContext< class >::getMemProxy().
PortProxy & ThreadState::getPhysProxy | ( | ) |
Definition at line 129 of file thread_state.cc.
References FullSystem, and physProxy.
Referenced by O3ThreadContext< class >::getPhysProxy().
|
inline |
Definition at line 108 of file thread_state.hh.
References process.
Referenced by O3ThreadContext< class >::getProcessPtr().
|
inline |
Definition at line 96 of file thread_state.hh.
References quiesceEvent.
FSTranslatingPortProxy & ThreadState::getVirtProxy | ( | ) |
Definition at line 137 of file thread_state.cc.
References FullSystem, and virtProxy.
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 104 of file thread_state.cc.
References baseCpu, FullSystem, SETranslatingPortProxy::NextPage, physProxy, process, proxy, and virtProxy.
Referenced by O3ThreadContext< class >::initMemProxies(), and setProcessPtr().
void ThreadState::profileClear | ( | ) |
Definition at line 153 of file thread_state.cc.
References FunctionProfile::clear(), and profile.
void ThreadState::profileSample | ( | ) |
Definition at line 160 of file thread_state.cc.
References profile, profileNode, profilePC, and FunctionProfile::sample().
|
inline |
Reads the number of instructions functionally executed and committed.
Definition at line 130 of file thread_state.hh.
References funcExeInst.
|
inline |
Definition at line 82 of file thread_state.hh.
References lastActivate.
|
inline |
Definition at line 84 of file thread_state.hh.
References lastSuspend.
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Reimplemented in O3ThreadState< Impl >.
Definition at line 67 of file thread_state.cc.
References _status, FullSystem, funcExeInst, kernelStats, quiesceEvent, Event::scheduled(), SERIALIZE_ENUM, SERIALIZE_SCALAR, and Event::when().
Referenced by O3ThreadState< Impl >::serialize(), and SimpleThread::serialize().
|
inline |
Definition at line 76 of file thread_state.hh.
References _contextId, and SparcISA::id.
Referenced by CheckerThreadContext< TC >::setContextId(), and O3ThreadContext< class >::setContextId().
|
inline |
Sets the total number of instructions functionally executed and committed.
Definition at line 135 of file thread_state.hh.
References funcExeInst.
|
inline |
When the process pointer changes while operating in SE Mode, the se translating port proxy needs to be reinitialized since it holds a pointer to the process class.
Definition at line 110 of file thread_state.hh.
References initMemProxies(), MipsISA::p, process, and proxy.
Referenced by O3ThreadContext< class >::setProcessPtr().
|
inline |
Sets the status of this thread.
Definition at line 141 of file thread_state.hh.
References _status.
Referenced by O3ThreadContext< class >::setStatus().
|
inline |
Definition at line 78 of file thread_state.hh.
References _threadId, and SparcISA::id.
Referenced by CheckerThreadContext< TC >::setThreadId(), and O3ThreadContext< class >::setThreadId().
|
inline |
Definition at line 72 of file thread_state.hh.
References baseCpu.
|
inline |
Returns the status of this thread.
Definition at line 138 of file thread_state.hh.
References _status.
Referenced by O3ThreadContext< class >::status().
|
inline |
Definition at line 80 of file thread_state.hh.
References _threadId.
Referenced by SimpleExecContext::armMonitor(), O3ThreadContext< class >::conditionalSquash(), SimpleExecContext::getAddrMonitor(), O3ThreadContext< class >::getDecoderPtr(), O3ThreadContext< class >::instAddr(), O3ThreadContext< class >::microPC(), SimpleExecContext::mwait(), SimpleExecContext::mwaitAtomic(), O3ThreadContext< class >::nextInstAddr(), O3ThreadContext< class >::pcState(), O3ThreadContext< class >::readMiscReg(), O3ThreadContext< class >::readMiscRegNoEffect(), O3ThreadContext< class >::syscall(), and O3ThreadContext< class >::threadId().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Reimplemented in O3ThreadState< Impl >.
Definition at line 85 of file thread_state.cc.
References _status, baseCpu, FullSystem, funcExeInst, kernelStats, quiesceEvent, UNSERIALIZE_ENUM, and UNSERIALIZE_SCALAR.
Referenced by O3ThreadState< Impl >::unserialize(), and SimpleThread::unserialize().
|
protected |
Definition at line 171 of file thread_state.hh.
Referenced by contextId(), SimpleThread::copyState(), and setContextId().
|
protected |
Definition at line 165 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 174 of file thread_state.hh.
Referenced by SimpleThread::activate(), SimpleThread::copyState(), SimpleThread::halt(), setThreadId(), SimpleThread::suspend(), and threadId().
|
protected |
Definition at line 168 of file thread_state.hh.
Referenced by SimpleThread::activate(), cpuId(), SimpleThread::dumpFuncProfile(), SimpleThread::getCpuPtr(), SimpleThread::halt(), initMemProxies(), SimpleThread::name(), SimpleThread::SimpleThread(), socketId(), SimpleThread::suspend(), and unserialize().
Counter ThreadState::funcExeInst |
Definition at line 208 of file thread_state.hh.
Referenced by SimpleThread::copyState(), BaseSimpleCPU::countInst(), readFuncExeInst(), O3ThreadContext< class >::readFuncExeInst(), serialize(), setFuncExeInst(), SimpleThread::takeOverFrom(), and unserialize().
TheISA::Kernel::Statistics* ThreadState::kernelStats |
Definition at line 189 of file thread_state.hh.
Referenced by getKernelStats(), O3ThreadContext< class >::getKernelStats(), SimpleThread::regStats(), serialize(), CheckerCPU::setSystem(), SimpleThread::SimpleThread(), SimpleThread::takeOverFrom(), and unserialize().
Tick ThreadState::lastActivate |
Last time activate was called on this thread.
Definition at line 178 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 181 of file thread_state.hh.
Referenced by BaseKvmCPU::activateContext(), readLastSuspend(), and SimpleThread::suspend().
Counter ThreadState::numInst |
Number of instructions committed.
Definition at line 146 of file thread_state.hh.
Stats::Scalar ThreadState::numInsts |
Stat for number instructions committed.
Definition at line 148 of file thread_state.hh.
Counter ThreadState::numLoad |
Number of simulated loads, used for tracking events based on the number of loads committed.
Definition at line 159 of file thread_state.hh.
Stats::Scalar ThreadState::numMemRefs |
Stat for number of memory references.
Definition at line 154 of file thread_state.hh.
Counter ThreadState::numOp |
Number of ops (including micro ops) committed.
Definition at line 150 of file thread_state.hh.
Stats::Scalar ThreadState::numOps |
Stat for number ops (including micro ops) committed.
Definition at line 152 of file thread_state.hh.
|
protected |
A port proxy outgoing only for functional accesses to physical addresses.
Definition at line 196 of file thread_state.hh.
Referenced by getPhysProxy(), initMemProxies(), and ~ThreadState().
|
protected |
Definition at line 192 of file thread_state.hh.
Referenced by getProcessPtr(), initMemProxies(), setProcessPtr(), O3ThreadState< Impl >::syscall(), and SimpleThread::syscall().
FunctionProfile* ThreadState::profile |
Definition at line 184 of file thread_state.hh.
Referenced by O3ThreadState< Impl >::dumpFuncProfile(), SimpleThread::dumpFuncProfile(), O3ThreadState< Impl >::O3ThreadState(), BaseSimpleCPU::postExecute(), profileClear(), profileSample(), and SimpleThread::SimpleThread().
ProfileNode* ThreadState::profileNode |
Definition at line 185 of file thread_state.hh.
Referenced by O3ThreadState< Impl >::O3ThreadState(), BaseSimpleCPU::postExecute(), profileSample(), and SimpleThread::SimpleThread().
Addr ThreadState::profilePC |
Definition at line 186 of file thread_state.hh.
Referenced by O3ThreadState< Impl >::O3ThreadState(), BaseSimpleCPU::postExecute(), profileSample(), and SimpleThread::SimpleThread().
|
protected |
Definition at line 201 of file thread_state.hh.
Referenced by getMemProxy(), initMemProxies(), setProcessPtr(), and ~ThreadState().
EndQuiesceEvent* ThreadState::quiesceEvent |
Definition at line 187 of file thread_state.hh.
Referenced by getQuiesceEvent(), O3ThreadContext< class >::getQuiesceEvent(), serialize(), SimpleThread::SimpleThread(), and unserialize().
Counter ThreadState::startNumLoad |
The number of simulated loads committed prior to this run.
Definition at line 162 of file thread_state.hh.
unsigned ThreadState::storeCondFailures |
Definition at line 213 of file thread_state.hh.
Referenced by O3ThreadContext< class >::readStCondFailures(), SimpleThread::readStCondFailures(), O3ThreadContext< class >::setStCondFailures(), SimpleThread::setStCondFailures(), and SimpleThread::takeOverFrom().
|
protected |
A translating port proxy, outgoing only, for functional accesse to virtual addresses.
Definition at line 200 of file thread_state.hh.
Referenced by getVirtProxy(), initMemProxies(), and ~ThreadState().