gem5  v22.1.0.0
Public Member Functions | Public Attributes | List of all members
gem5::o3::ThreadState Class Reference

Class that has various thread state, such as the status, the current instruction being processed, whether or not the thread has a trap pending or is being externally updated, the ThreadContext pointer, etc. More...

#include <thread_state.hh>

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

Public Member Functions

 ThreadState (CPU *_cpu, int _thread_num, Process *_process)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
gem5::ThreadContextgetTC ()
 Returns a pointer to the TC of this thread. More...
 
- Public Member Functions inherited from gem5::ThreadState
 ThreadState (BaseCPU *cpu, ThreadID _tid, Process *_process)
 
virtual ~ThreadState ()=default
 
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
 
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

PCEventQueue pcEventQueue
 
EventQueue comInstEventQueue
 An instruction-based event queue. More...
 
bool noSquashFromTC = false
 
bool trapPending = false
 Whether or not the thread is currently waiting on a trap, and thus able to be externally updated without squashing. More...
 
std::unique_ptr< BaseHTMCheckpointhtmCheckpoint
 Pointer to the hardware transactional memory checkpoint. More...
 
gem5::ThreadContexttc = nullptr
 Pointer to the ThreadContext of this thread. More...
 
- Public Attributes inherited from gem5::ThreadState
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
 

Additional Inherited Members

- Public Types inherited from gem5::ThreadState
typedef ThreadContext::Status Status
 
- 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...
 
- Protected Attributes inherited from gem5::ThreadState
ThreadContext::Status _status
 
BaseCPUbaseCpu
 
ContextID _contextId
 
ThreadID _threadId
 
Processprocess
 

Detailed Description

Class that has various thread state, such as the status, the current instruction being processed, whether or not the thread has a trap pending or is being externally updated, the ThreadContext pointer, etc.

It also handles anything related to a specific thread's process, such as syscalls and checking valid addresses.

Definition at line 66 of file thread_state.hh.

Constructor & Destructor Documentation

◆ ThreadState()

gem5::o3::ThreadState::ThreadState ( CPU _cpu,
int  _thread_num,
Process _process 
)

Definition at line 51 of file thread_state.cc.

Member Function Documentation

◆ getTC()

gem5::ThreadContext* gem5::o3::ThreadState::getTC ( )
inline

Returns a pointer to the TC of this thread.

Definition at line 103 of file thread_state.hh.

References tc.

Referenced by gem5::o3::DynInst::tcBase().

◆ serialize()

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

References gem5::ThreadState::serialize(), gem5::serialize(), and tc.

◆ unserialize()

void gem5::o3::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 noSquashFromTC, tc, gem5::ThreadState::unserialize(), and gem5::unserialize().

Member Data Documentation

◆ comInstEventQueue

EventQueue gem5::o3::ThreadState::comInstEventQueue

An instruction-based event queue.

Used for scheduling events based on number of instructions committed.

Definition at line 74 of file thread_state.hh.

Referenced by gem5::o3::ThreadContext::descheduleInstCountEvent(), gem5::o3::ThreadContext::getCurrentInstCount(), and gem5::o3::ThreadContext::scheduleInstCountEvent().

◆ htmCheckpoint

std::unique_ptr<BaseHTMCheckpoint> gem5::o3::ThreadState::htmCheckpoint

Pointer to the hardware transactional memory checkpoint.

Definition at line 92 of file thread_state.hh.

Referenced by gem5::o3::ThreadContext::getHtmCheckpointPtr(), and gem5::o3::ThreadContext::setHtmCheckpointPtr().

◆ noSquashFromTC

bool gem5::o3::ThreadState::noSquashFromTC = false

◆ pcEventQueue

PCEventQueue gem5::o3::ThreadState::pcEventQueue

◆ tc

gem5::ThreadContext* gem5::o3::ThreadState::tc = nullptr

Pointer to the ThreadContext of this thread.

Definition at line 100 of file thread_state.hh.

Referenced by getTC(), serialize(), and unserialize().

◆ trapPending

bool gem5::o3::ThreadState::trapPending = false

Whether or not the thread is currently waiting on a trap, and thus able to be externally updated without squashing.

Definition at line 89 of file thread_state.hh.

Referenced by gem5::o3::ThreadContext::conditionalSquash(), and gem5::o3::ThreadContext::takeOverFrom().


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

Generated on Wed Dec 21 2022 10:24:18 for gem5 by doxygen 1.9.1