gem5  v21.1.0.2
Classes | Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
gem5::ThreadState Struct Reference

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

#include <thread_state.hh>

Inheritance diagram for gem5::ThreadState:
gem5::Serializable gem5::o3::ThreadState gem5::SimpleThread

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...
 
PortProxygetVirtProxy ()
 
ProcessgetProcessPtr ()
 
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...
 
- 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. 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
 
BaseCPUbaseCpu
 
ContextID _contextId
 
ThreadID _threadId
 
Processprocess
 
PortProxyvirtProxy
 A translating port proxy, outgoing only, for functional accesse to virtual addresses. More...
 

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. 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...
 

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 47 of file thread_state.hh.

Member Typedef Documentation

◆ Status

Definition at line 49 of file thread_state.hh.

Constructor & Destructor Documentation

◆ ThreadState()

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

Definition at line 44 of file thread_state.cc.

◆ ~ThreadState()

gem5::ThreadState::~ThreadState ( )
virtual

Definition at line 53 of file thread_state.cc.

References virtProxy.

Member Function Documentation

◆ contextId()

ContextID gem5::ThreadState::contextId ( ) const
inline

◆ cpuId()

int gem5::ThreadState::cpuId ( ) const
inline

Definition at line 59 of file thread_state.hh.

References baseCpu, and gem5::BaseCPU::cpuId().

Referenced by gem5::SimpleThread::cpuId().

◆ getProcessPtr()

Process* gem5::ThreadState::getProcessPtr ( )
inline

Definition at line 85 of file thread_state.hh.

References process.

Referenced by gem5::o3::ThreadContext::getProcessPtr(), and gem5::SimpleThread::getProcessPtr().

◆ getVirtProxy()

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

◆ initMemProxies()

void gem5::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 72 of file thread_state.cc.

References gem5::FullSystem, gem5::SETranslatingPortProxy::NextPage, and virtProxy.

Referenced by gem5::o3::ThreadContext::initMemProxies(), and gem5::SimpleThread::initMemProxies().

◆ readLastActivate()

Tick gem5::ThreadState::readLastActivate ( ) const
inline

Definition at line 71 of file thread_state.hh.

References lastActivate.

Referenced by gem5::SimpleThread::readLastActivate().

◆ readLastSuspend()

Tick gem5::ThreadState::readLastSuspend ( ) const
inline

Definition at line 73 of file thread_state.hh.

References lastSuspend.

Referenced by gem5::SimpleThread::readLastSuspend().

◆ serialize()

void gem5::ThreadState::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

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

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

◆ setContextId()

void gem5::ThreadState::setContextId ( ContextID  id)
inline

◆ setProcessPtr()

void gem5::ThreadState::setProcessPtr ( Process p)
inline

◆ setStatus()

void gem5::ThreadState::setStatus ( Status  new_status)
inline

◆ setThreadId()

void gem5::ThreadState::setThreadId ( ThreadID  id)
inline

◆ socketId()

uint32_t gem5::ThreadState::socketId ( ) const
inline

Definition at line 61 of file thread_state.hh.

References baseCpu, and gem5::BaseCPU::socketId().

Referenced by gem5::SimpleThread::socketId().

◆ status()

Status gem5::ThreadState::status ( ) const
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().

◆ threadId()

ThreadID gem5::ThreadState::threadId ( ) const
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().

◆ unserialize()

void gem5::ThreadState::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

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

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

Member Data Documentation

◆ _contextId

ContextID gem5::ThreadState::_contextId
protected

Definition at line 128 of file thread_state.hh.

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

◆ _status

ThreadContext::Status gem5::ThreadState::_status
protected

◆ _threadId

ThreadID gem5::ThreadState::_threadId
protected

◆ baseCpu

BaseCPU* gem5::ThreadState::baseCpu
protected

◆ lastActivate

Tick gem5::ThreadState::lastActivate

◆ lastSuspend

Tick gem5::ThreadState::lastSuspend

◆ numInst

Counter gem5::ThreadState::numInst

Number of instructions committed.

Definition at line 98 of file thread_state.hh.

Referenced by gem5::minor::Execute::doInstCommitAccounting().

◆ numLoad

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.

◆ numOp

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

◆ process

Process* gem5::ThreadState::process
protected

Definition at line 141 of file thread_state.hh.

Referenced by getProcessPtr(), and setProcessPtr().

◆ startNumLoad

Counter gem5::ThreadState::startNumLoad

The number of simulated loads committed prior to this run.

Definition at line 119 of file thread_state.hh.

◆ storeCondFailures

unsigned gem5::ThreadState::storeCondFailures

◆ threadStats

gem5::ThreadState::ThreadStateStats gem5::ThreadState::threadStats

◆ virtProxy

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


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

Generated on Tue Sep 21 2021 12:28:15 for gem5 by doxygen 1.8.17