gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
ThreadState Struct Reference

Struct for holding general thread state that is needed across CPU models. More...

#include <thread_state.hh>

Inheritance diagram for ThreadState:
Serializable O3ThreadState< class > O3ThreadState< Impl > SimpleThread

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 ()
 
EndQuiesceEventgetQuiesceEvent ()
 
void profileClear ()
 
void profileSample ()
 
TheISA::Kernel::Statistics * getKernelStats ()
 
PortProxygetPhysProxy ()
 
FSTranslatingPortProxygetVirtProxy ()
 
ProcessgetProcessPtr ()
 
void setProcessPtr (Process *p)
 
SETranslatingPortProxygetMemProxy ()
 
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...
 
FunctionProfileprofile
 
ProfileNodeprofileNode
 
Addr profilePC
 
EndQuiesceEventquiesceEvent
 
TheISA::Kernel::Statistics * kernelStats
 
Counter funcExeInst
 
unsigned storeCondFailures
 

Protected Attributes

ThreadContext::Status _status
 
BaseCPUbaseCpu
 
ContextID _contextId
 
ThreadID _threadId
 
Processprocess
 
PortProxyphysProxy
 A port proxy outgoing only for functional accesses to physical addresses. More...
 
FSTranslatingPortProxyvirtProxy
 A translating port proxy, outgoing only, for functional accesse to virtual addresses. More...
 
SETranslatingPortProxyproxy
 

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
 

Detailed Description

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.

Member Typedef Documentation

Definition at line 60 of file thread_state.hh.

Constructor & Destructor Documentation

ThreadState::ThreadState ( BaseCPU cpu,
ThreadID  _tid,
Process _process 
)

Definition at line 46 of file thread_state.cc.

ThreadState::~ThreadState ( )
virtual

Definition at line 56 of file thread_state.cc.

References physProxy, proxy, and virtProxy.

Member Function Documentation

ContextID ThreadState::contextId ( ) const
inline
int ThreadState::cpuId ( ) const
inline

Definition at line 70 of file thread_state.hh.

References baseCpu.

void ThreadState::dumpFuncProfile ( )
TheISA::Kernel::Statistics* ThreadState::getKernelStats ( )
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().

Process* ThreadState::getProcessPtr ( )
inline

Definition at line 108 of file thread_state.hh.

References process.

Referenced by O3ThreadContext< class >::getProcessPtr().

EndQuiesceEvent* ThreadState::getQuiesceEvent ( )
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.

Parameters
tcThreadContext 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().

Counter ThreadState::readFuncExeInst ( )
inline

Reads the number of instructions functionally executed and committed.

Definition at line 130 of file thread_state.hh.

References funcExeInst.

Tick ThreadState::readLastActivate ( ) const
inline

Definition at line 82 of file thread_state.hh.

References lastActivate.

Tick ThreadState::readLastSuspend ( ) const
inline

Definition at line 84 of file thread_state.hh.

References lastSuspend.

void ThreadState::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint 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().

void ThreadState::setContextId ( ContextID  id)
inline
void ThreadState::setFuncExeInst ( Counter  new_val)
inline

Sets the total number of instructions functionally executed and committed.

Definition at line 135 of file thread_state.hh.

References funcExeInst.

void ThreadState::setProcessPtr ( Process p)
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().

void ThreadState::setStatus ( Status  new_status)
inline

Sets the status of this thread.

Definition at line 141 of file thread_state.hh.

References _status.

Referenced by O3ThreadContext< class >::setStatus().

void ThreadState::setThreadId ( ThreadID  id)
inline
uint32_t ThreadState::socketId ( ) const
inline

Definition at line 72 of file thread_state.hh.

References baseCpu.

Status ThreadState::status ( ) const
inline

Returns the status of this thread.

Definition at line 138 of file thread_state.hh.

References _status.

Referenced by O3ThreadContext< class >::status().

ThreadID ThreadState::threadId ( ) const
inline
void ThreadState::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint 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().

Member Data Documentation

ContextID ThreadState::_contextId
protected

Definition at line 171 of file thread_state.hh.

Referenced by contextId(), SimpleThread::copyState(), and setContextId().

ThreadContext::Status ThreadState::_status
protected
ThreadID ThreadState::_threadId
protected
BaseCPU* ThreadState::baseCpu
protected
Counter ThreadState::funcExeInst
TheISA::Kernel::Statistics* ThreadState::kernelStats
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.

PortProxy* ThreadState::physProxy
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().

Process* ThreadState::process
protected
FunctionProfile* ThreadState::profile
ProfileNode* ThreadState::profileNode
Addr ThreadState::profilePC
SETranslatingPortProxy* ThreadState::proxy
protected

Definition at line 201 of file thread_state.hh.

Referenced by getMemProxy(), initMemProxies(), setProcessPtr(), and ~ThreadState().

EndQuiesceEvent* ThreadState::quiesceEvent
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
FSTranslatingPortProxy* ThreadState::virtProxy
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().


The documentation for this struct was generated from the following files:

Generated on Fri Jun 9 2017 13:04:21 for gem5 by doxygen 1.8.6