|
gem5 v23.0.0.1
|
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>
Public Member Functions | |
| ThreadState (CPU *_cpu, int _thread_num, Process *_process) | |
| void | serialize (CheckpointOut &cp) const override |
| Serialize an object. | |
| void | unserialize (CheckpointIn &cp) override |
| Unserialize an object. | |
| gem5::ThreadContext * | getTC () |
| Returns a pointer to the TC of this thread. | |
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. | |
| void | unserialize (CheckpointIn &cp) override |
| Unserialize an object. | |
| 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 |
| Process * | getProcessPtr () |
| void | setProcessPtr (Process *p) |
| Status | status () const |
| Returns the status of this thread. | |
| void | setStatus (Status new_status) |
| Sets the status of this thread. | |
Public Member Functions inherited from gem5::Serializable | |
| Serializable () | |
| virtual | ~Serializable () |
| virtual void | serialize (CheckpointOut &cp) const =0 |
| Serialize an object. | |
| virtual void | unserialize (CheckpointIn &cp)=0 |
| Unserialize an object. | |
| void | serializeSection (CheckpointOut &cp, const char *name) const |
| Serialize an object into a new section. | |
| void | serializeSection (CheckpointOut &cp, const std::string &name) const |
| void | unserializeSection (CheckpointIn &cp, const char *name) |
| Unserialize an a child object. | |
| void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Attributes | |
| PCEventQueue | pcEventQueue |
| EventQueue | comInstEventQueue |
| An instruction-based event queue. | |
| 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. | |
| std::unique_ptr< BaseHTMCheckpoint > | htmCheckpoint |
| Pointer to the hardware transactional memory checkpoint. | |
| gem5::ThreadContext * | tc = nullptr |
| Pointer to the ThreadContext of this thread. | |
Public Attributes inherited from gem5::ThreadState | |
| Counter | numInst |
| Number of instructions committed. | |
| Counter | numOp |
| Number of ops (including micro ops) committed. | |
| gem5::ThreadState::ThreadStateStats | threadStats |
| Counter | numLoad |
| Number of simulated loads, used for tracking events based on the number of loads committed. | |
| Counter | startNumLoad |
| The number of simulated loads committed prior to this run. | |
| Tick | lastActivate |
| Last time activate was called on this thread. | |
| Tick | lastSuspend |
| Last time suspend was called on this thread. | |
| 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. | |
| static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
| Generate a checkpoint file so that the serialization can be routed to it. | |
Protected Attributes inherited from gem5::ThreadState | |
| ThreadContext::Status | _status |
| BaseCPU * | baseCpu |
| ContextID | _contextId |
| ThreadID | _threadId |
| Process * | process |
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.
Definition at line 51 of file thread_state.cc.
|
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().
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
| cp | Checkpoint state |
Implements gem5::Serializable.
Definition at line 57 of file thread_state.cc.
References gem5::ThreadState::serialize(), gem5::serialize(), and tc.
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
| cp | Checkpoint state |
Implements gem5::Serializable.
Definition at line 66 of file thread_state.cc.
References noSquashFromTC, tc, gem5::ThreadState::unserialize(), and gem5::unserialize().
| 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().
| 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().
| bool gem5::o3::ThreadState::noSquashFromTC = false |
Definition at line 84 of file thread_state.hh.
Referenced by gem5::o3::DynInst::completeAcc(), gem5::o3::ThreadContext::conditionalSquash(), gem5::o3::ThreadContext::copyArchRegs(), gem5::o3::DynInst::execute(), gem5::o3::DynInst::initiateAcc(), gem5::o3::ThreadContext::takeOverFrom(), unserialize(), and gem5::o3::DynInst::updateMiscRegs().
| PCEventQueue gem5::o3::ThreadState::pcEventQueue |
Definition at line 69 of file thread_state.hh.
Referenced by gem5::o3::ThreadContext::remove(), and gem5::o3::ThreadContext::schedule().
| 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().
| 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().