gem5  v22.0.0.1
Public Member Functions | Private Attributes | List of all members
gem5::CheckerThreadContext< TC > Class Template Reference

Derived ThreadContext class for use with the Checker. More...

#include <thread_context.hh>

Inheritance diagram for gem5::CheckerThreadContext< TC >:
gem5::ThreadContext gem5::PCEventScope

Public Member Functions

 CheckerThreadContext (TC *actual_tc, CheckerCPU *checker_cpu)
 
bool schedule (PCEvent *e) override
 
bool remove (PCEvent *e) override
 
void scheduleInstCountEvent (Event *event, Tick count) override
 
void descheduleInstCountEvent (Event *event) override
 
Tick getCurrentInstCount () override
 
BaseCPU * getCpuPtr () override
 
uint32_t socketId () const override
 
int cpuId () const override
 
ContextID contextId () const override
 
void setContextId (ContextID id) override
 
int threadId () const override
 Returns this thread's ID number. More...
 
void setThreadId (int id) override
 
BaseMMUgetMMUPtr () override
 
CheckerCPUgetCheckerCpuPtr () override
 
BaseISAgetIsaPtr () const override
 
InstDecodergetDecoderPtr () override
 
SystemgetSystemPtr () override
 
ProcessgetProcessPtr () override
 
void setProcessPtr (Process *p) override
 
void connectMemPorts (ThreadContext *tc)
 
Status status () const override
 
void setStatus (Status new_status) override
 
void activate () override
 Set the status to Active. More...
 
void suspend () override
 Set the status to Suspended. More...
 
void halt () override
 Set the status to Halted. More...
 
void takeOverFrom (ThreadContext *oldContext) override
 
void regStats (const std::string &name) override
 
Tick readLastActivate () override
 
Tick readLastSuspend () override
 
void copyArchRegs (ThreadContext *tc) override
 
void clearArchRegs () override
 
RegVal getReg (const RegId &reg) const override
 
void getReg (const RegId &reg, void *val) const override
 
void * getWritableReg (const RegId &reg) override
 
void setReg (const RegId &reg, RegVal val) override
 
void setReg (const RegId &reg, const void *val) override
 
const PCStateBasepcState () const override
 Reads this thread's PC state. More...
 
void pcState (const PCStateBase &val) override
 Sets this thread's PC state. More...
 
void pcStateNoRecord (const PCStateBase &val) override
 
RegVal readMiscRegNoEffect (RegIndex misc_reg) const override
 
RegVal readMiscReg (RegIndex misc_reg) override
 
void setMiscRegNoEffect (RegIndex misc_reg, RegVal val) override
 
void setMiscReg (RegIndex misc_reg, RegVal val) override
 
RegId flattenRegId (const RegId &regId) const override
 
unsigned readStCondFailures () const override
 
void setStCondFailures (unsigned sc_failures) override
 
RegVal getRegFlat (const RegId &reg) const override
 Flat register interfaces. More...
 
void getRegFlat (const RegId &reg, void *val) const override
 
void * getWritableRegFlat (const RegId &reg) override
 
void setRegFlat (const RegId &reg, RegVal val) override
 
void setRegFlat (const RegId &reg, const void *val) override
 
void htmAbortTransaction (uint64_t htm_uid, HtmFailureFaultCause cause) override
 
BaseHTMCheckpointPtrgetHtmCheckpointPtr () override
 
void setHtmCheckpointPtr (BaseHTMCheckpointPtr new_cpt) override
 
- Public Member Functions inherited from gem5::ThreadContext
bool getUseForClone ()
 
void setUseForClone (bool new_val)
 
virtual ~ThreadContext ()
 
virtual void sendFunctional (PacketPtr pkt)
 
void quiesce ()
 Quiesce thread context. More...
 
void quiesceTick (Tick resume)
 Quiesce, suspend, and schedule activate at resume. More...
 
RegVal readIntReg (RegIndex reg_idx) const
 
RegVal readFloatReg (RegIndex reg_idx) const
 
TheISA::VecRegContainer readVecReg (const RegId &reg) const
 
TheISA::VecRegContainer & getWritableVecReg (const RegId &reg)
 
RegVal readVecElem (const RegId &reg) const
 
RegVal readCCReg (RegIndex reg_idx) const
 
void setIntReg (RegIndex reg_idx, RegVal val)
 
void setFloatReg (RegIndex reg_idx, RegVal val)
 
void setVecReg (const RegId &reg, const TheISA::VecRegContainer &val)
 
void setVecElem (const RegId &reg, RegVal val)
 
void setCCReg (RegIndex reg_idx, RegVal val)
 
void pcState (Addr addr)
 
virtual int exit ()
 
RegVal readIntRegFlat (RegIndex idx) const
 
void setIntRegFlat (RegIndex idx, RegVal val)
 
RegVal readFloatRegFlat (RegIndex idx) const
 
void setFloatRegFlat (RegIndex idx, RegVal val)
 
TheISA::VecRegContainer readVecRegFlat (RegIndex idx) const
 
TheISA::VecRegContainer & getWritableVecRegFlat (RegIndex idx)
 
void setVecRegFlat (RegIndex idx, const TheISA::VecRegContainer &val)
 
RegVal readVecElemFlat (RegIndex idx) const
 
void setVecElemFlat (RegIndex idx, RegVal val)
 
RegVal readCCRegFlat (RegIndex idx) const
 
void setCCRegFlat (RegIndex idx, RegVal val)
 

Private Attributes

TC * actualTC
 The main CPU's ThreadContext, or class that implements the ThreadContext interface. More...
 
SimpleThreadcheckerTC
 The checker's own SimpleThread. More...
 
CheckerCPUcheckerCPU
 Pointer to the checker CPU. More...
 

Additional Inherited Members

- Public Types inherited from gem5::ThreadContext
enum  Status { Active, Suspended, Halting, Halted }
 
- Static Public Member Functions inherited from gem5::ThreadContext
static void compare (ThreadContext *one, ThreadContext *two)
 function to compare two thread contexts (for debugging) More...
 
- Public Attributes inherited from gem5::ThreadContext
int intResult = DefaultIntResult
 
double floatResult = DefaultFloatResult
 
int intOffset = 0
 
- Static Public Attributes inherited from gem5::ThreadContext
static const int ints []
 
static const double floats []
 
static const int DefaultIntResult = 0
 
static const double DefaultFloatResult = 0.0
 
- Protected Attributes inherited from gem5::ThreadContext
bool useForClone = false
 

Detailed Description

template<class TC>
class gem5::CheckerThreadContext< TC >

Derived ThreadContext class for use with the Checker.

The template parameter is the ThreadContext class used by the specific CPU being verified. This CheckerThreadContext is then used by the main CPU in place of its usual ThreadContext class. It handles updating the checker's state any time state is updated externally through the ThreadContext.

Definition at line 69 of file thread_context.hh.

Constructor & Destructor Documentation

◆ CheckerThreadContext()

template<class TC >
gem5::CheckerThreadContext< TC >::CheckerThreadContext ( TC *  actual_tc,
CheckerCPU checker_cpu 
)
inline

Definition at line 72 of file thread_context.hh.

Member Function Documentation

◆ activate()

template<class TC >
void gem5::CheckerThreadContext< TC >::activate ( )
inlineoverridevirtual

Set the status to Active.

Implements gem5::ThreadContext.

Definition at line 186 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ clearArchRegs()

template<class TC >
void gem5::CheckerThreadContext< TC >::clearArchRegs ( )
inlineoverridevirtual

◆ connectMemPorts()

template<class TC >
void gem5::CheckerThreadContext< TC >::connectMemPorts ( ThreadContext tc)
inline

Definition at line 171 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ contextId()

template<class TC >
ContextID gem5::CheckerThreadContext< TC >::contextId ( ) const
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 130 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ copyArchRegs()

template<class TC >
void gem5::CheckerThreadContext< TC >::copyArchRegs ( ThreadContext tc)
inlineoverridevirtual

◆ cpuId()

template<class TC >
int gem5::CheckerThreadContext< TC >::cpuId ( ) const
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 128 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ descheduleInstCountEvent()

template<class TC >
void gem5::CheckerThreadContext< TC >::descheduleInstCountEvent ( Event event)
inlineoverridevirtual

◆ flattenRegId()

template<class TC >
RegId gem5::CheckerThreadContext< TC >::flattenRegId ( const RegId regId) const
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 312 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ getCheckerCpuPtr()

template<class TC >
CheckerCPU* gem5::CheckerThreadContext< TC >::getCheckerCpuPtr ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 151 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::checkerCPU.

◆ getCpuPtr()

template<class TC >
BaseCPU* gem5::CheckerThreadContext< TC >::getCpuPtr ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 124 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ getCurrentInstCount()

template<class TC >
Tick gem5::CheckerThreadContext< TC >::getCurrentInstCount ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 119 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ getDecoderPtr()

template<class TC >
InstDecoder* gem5::CheckerThreadContext< TC >::getDecoderPtr ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 159 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ getHtmCheckpointPtr()

template<class TC >
BaseHTMCheckpointPtr& gem5::CheckerThreadContext< TC >::getHtmCheckpointPtr ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 369 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ getIsaPtr()

template<class TC >
BaseISA* gem5::CheckerThreadContext< TC >::getIsaPtr ( ) const
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 156 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ getMMUPtr()

template<class TC >
BaseMMU* gem5::CheckerThreadContext< TC >::getMMUPtr ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 148 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ getProcessPtr()

template<class TC >
Process* gem5::CheckerThreadContext< TC >::getProcessPtr ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 166 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ getReg() [1/2]

template<class TC >
RegVal gem5::CheckerThreadContext< TC >::getReg ( const RegId reg) const
inlineoverridevirtual

Reimplemented from gem5::ThreadContext.

Definition at line 230 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC, and gem5::X86ISA::reg.

◆ getReg() [2/2]

template<class TC >
void gem5::CheckerThreadContext< TC >::getReg ( const RegId reg,
void *  val 
) const
inlineoverridevirtual

◆ getRegFlat() [1/2]

template<class TC >
RegVal gem5::CheckerThreadContext< TC >::getRegFlat ( const RegId reg) const
inlineoverridevirtual

Flat register interfaces.

Some architectures have different registers visible in different modes. Such architectures "flatten" a register (see flattenRegId()) to map it into the gem5 register file. This interface provides a flat interface to the underlying register file, which allows for example serialization code to access all registers.

Reimplemented from gem5::ThreadContext.

Definition at line 330 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC, and gem5::X86ISA::reg.

◆ getRegFlat() [2/2]

template<class TC >
void gem5::CheckerThreadContext< TC >::getRegFlat ( const RegId reg,
void *  val 
) const
inlineoverridevirtual

◆ getSystemPtr()

template<class TC >
System* gem5::CheckerThreadContext< TC >::getSystemPtr ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 164 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ getWritableReg()

template<class TC >
void* gem5::CheckerThreadContext< TC >::getWritableReg ( const RegId reg)
inlineoverridevirtual

Reimplemented from gem5::ThreadContext.

Definition at line 242 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC, and gem5::X86ISA::reg.

◆ getWritableRegFlat()

template<class TC >
void* gem5::CheckerThreadContext< TC >::getWritableRegFlat ( const RegId reg)
inlineoverridevirtual

◆ halt()

template<class TC >
void gem5::CheckerThreadContext< TC >::halt ( )
inlineoverridevirtual

Set the status to Halted.

Implements gem5::ThreadContext.

Definition at line 192 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ htmAbortTransaction()

template<class TC >
void gem5::CheckerThreadContext< TC >::htmAbortTransaction ( uint64_t  htm_uid,
HtmFailureFaultCause  cause 
)
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 363 of file thread_context.hh.

References panic.

◆ pcState() [1/2]

template<class TC >
const PCStateBase& gem5::CheckerThreadContext< TC >::pcState ( ) const
inlineoverridevirtual

Reads this thread's PC state.

Implements gem5::ThreadContext.

Definition at line 262 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ pcState() [2/2]

template<class TC >
void gem5::CheckerThreadContext< TC >::pcState ( const PCStateBase val)
inlineoverridevirtual

◆ pcStateNoRecord()

template<class TC >
void gem5::CheckerThreadContext< TC >::pcStateNoRecord ( const PCStateBase val)
inlineoverridevirtual

◆ readLastActivate()

template<class TC >
Tick gem5::CheckerThreadContext< TC >::readLastActivate ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 208 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ readLastSuspend()

template<class TC >
Tick gem5::CheckerThreadContext< TC >::readLastSuspend ( )
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 209 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ readMiscReg()

template<class TC >
RegVal gem5::CheckerThreadContext< TC >::readMiscReg ( RegIndex  misc_reg)
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 288 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ readMiscRegNoEffect()

template<class TC >
RegVal gem5::CheckerThreadContext< TC >::readMiscRegNoEffect ( RegIndex  misc_reg) const
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 282 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ readStCondFailures()

template<class TC >
unsigned gem5::CheckerThreadContext< TC >::readStCondFailures ( ) const
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 318 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ regStats()

template<class TC >
void gem5::CheckerThreadContext< TC >::regStats ( const std::string &  name)
inlineoverridevirtual

◆ remove()

template<class TC >
bool gem5::CheckerThreadContext< TC >::remove ( PCEvent e)
inlineoverridevirtual

◆ schedule()

template<class TC >
bool gem5::CheckerThreadContext< TC >::schedule ( PCEvent e)
inlineoverridevirtual

◆ scheduleInstCountEvent()

template<class TC >
void gem5::CheckerThreadContext< TC >::scheduleInstCountEvent ( Event event,
Tick  count 
)
inlineoverridevirtual

◆ setContextId()

template<class TC >
void gem5::CheckerThreadContext< TC >::setContextId ( ContextID  id)
inlineoverridevirtual

◆ setHtmCheckpointPtr()

template<class TC >
void gem5::CheckerThreadContext< TC >::setHtmCheckpointPtr ( BaseHTMCheckpointPtr  new_cpt)
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 375 of file thread_context.hh.

References panic.

◆ setMiscReg()

template<class TC >
void gem5::CheckerThreadContext< TC >::setMiscReg ( RegIndex  misc_reg,
RegVal  val 
)
inlineoverridevirtual

◆ setMiscRegNoEffect()

template<class TC >
void gem5::CheckerThreadContext< TC >::setMiscRegNoEffect ( RegIndex  misc_reg,
RegVal  val 
)
inlineoverridevirtual

◆ setProcessPtr()

template<class TC >
void gem5::CheckerThreadContext< TC >::setProcessPtr ( Process p)
inlineoverridevirtual

◆ setReg() [1/2]

template<class TC >
void gem5::CheckerThreadContext< TC >::setReg ( const RegId reg,
const void *  val 
)
inlineoverridevirtual

◆ setReg() [2/2]

template<class TC >
void gem5::CheckerThreadContext< TC >::setReg ( const RegId reg,
RegVal  val 
)
inlineoverridevirtual

◆ setRegFlat() [1/2]

template<class TC >
void gem5::CheckerThreadContext< TC >::setRegFlat ( const RegId reg,
const void *  val 
)
inlineoverridevirtual

◆ setRegFlat() [2/2]

template<class TC >
void gem5::CheckerThreadContext< TC >::setRegFlat ( const RegId reg,
RegVal  val 
)
inlineoverridevirtual

◆ setStatus()

template<class TC >
void gem5::CheckerThreadContext< TC >::setStatus ( Status  new_status)
inlineoverridevirtual

◆ setStCondFailures()

template<class TC >
void gem5::CheckerThreadContext< TC >::setStCondFailures ( unsigned  sc_failures)
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 324 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ setThreadId()

template<class TC >
void gem5::CheckerThreadContext< TC >::setThreadId ( int  id)
inlineoverridevirtual

◆ socketId()

template<class TC >
uint32_t gem5::CheckerThreadContext< TC >::socketId ( ) const
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 126 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ status()

template<class TC >
Status gem5::CheckerThreadContext< TC >::status ( ) const
inlineoverridevirtual

Implements gem5::ThreadContext.

Definition at line 176 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ suspend()

template<class TC >
void gem5::CheckerThreadContext< TC >::suspend ( )
inlineoverridevirtual

Set the status to Suspended.

Implements gem5::ThreadContext.

Definition at line 189 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

◆ takeOverFrom()

template<class TC >
void gem5::CheckerThreadContext< TC >::takeOverFrom ( ThreadContext oldContext)
inlineoverridevirtual

◆ threadId()

template<class TC >
int gem5::CheckerThreadContext< TC >::threadId ( ) const
inlineoverridevirtual

Returns this thread's ID number.

Implements gem5::ThreadContext.

Definition at line 140 of file thread_context.hh.

References gem5::CheckerThreadContext< TC >::actualTC.

Member Data Documentation

◆ actualTC

template<class TC >
TC* gem5::CheckerThreadContext< TC >::actualTC
private

The main CPU's ThreadContext, or class that implements the ThreadContext interface.

Definition at line 81 of file thread_context.hh.

Referenced by gem5::CheckerThreadContext< TC >::activate(), gem5::CheckerThreadContext< TC >::clearArchRegs(), gem5::CheckerThreadContext< TC >::connectMemPorts(), gem5::CheckerThreadContext< TC >::contextId(), gem5::CheckerThreadContext< TC >::copyArchRegs(), gem5::CheckerThreadContext< TC >::cpuId(), gem5::CheckerThreadContext< TC >::descheduleInstCountEvent(), gem5::CheckerThreadContext< TC >::flattenRegId(), gem5::CheckerThreadContext< TC >::getCpuPtr(), gem5::CheckerThreadContext< TC >::getCurrentInstCount(), gem5::CheckerThreadContext< TC >::getDecoderPtr(), gem5::CheckerThreadContext< TC >::getHtmCheckpointPtr(), gem5::CheckerThreadContext< TC >::getIsaPtr(), gem5::CheckerThreadContext< TC >::getMMUPtr(), gem5::CheckerThreadContext< TC >::getProcessPtr(), gem5::CheckerThreadContext< TC >::getReg(), gem5::CheckerThreadContext< TC >::getRegFlat(), gem5::CheckerThreadContext< TC >::getSystemPtr(), gem5::CheckerThreadContext< TC >::getWritableReg(), gem5::CheckerThreadContext< TC >::getWritableRegFlat(), gem5::CheckerThreadContext< TC >::halt(), gem5::CheckerThreadContext< TC >::pcState(), gem5::CheckerThreadContext< TC >::pcStateNoRecord(), gem5::CheckerThreadContext< TC >::readLastActivate(), gem5::CheckerThreadContext< TC >::readLastSuspend(), gem5::CheckerThreadContext< TC >::readMiscReg(), gem5::CheckerThreadContext< TC >::readMiscRegNoEffect(), gem5::CheckerThreadContext< TC >::readStCondFailures(), gem5::CheckerThreadContext< TC >::regStats(), gem5::CheckerThreadContext< TC >::remove(), gem5::CheckerThreadContext< TC >::schedule(), gem5::CheckerThreadContext< TC >::scheduleInstCountEvent(), gem5::CheckerThreadContext< TC >::setContextId(), gem5::CheckerThreadContext< TC >::setMiscReg(), gem5::CheckerThreadContext< TC >::setMiscRegNoEffect(), gem5::CheckerThreadContext< TC >::setProcessPtr(), gem5::CheckerThreadContext< TC >::setReg(), gem5::CheckerThreadContext< TC >::setRegFlat(), gem5::CheckerThreadContext< TC >::setStatus(), gem5::CheckerThreadContext< TC >::setStCondFailures(), gem5::CheckerThreadContext< TC >::setThreadId(), gem5::CheckerThreadContext< TC >::socketId(), gem5::CheckerThreadContext< TC >::status(), gem5::CheckerThreadContext< TC >::suspend(), gem5::CheckerThreadContext< TC >::takeOverFrom(), and gem5::CheckerThreadContext< TC >::threadId().

◆ checkerCPU

template<class TC >
CheckerCPU* gem5::CheckerThreadContext< TC >::checkerCPU
private

Pointer to the checker CPU.

Definition at line 87 of file thread_context.hh.

Referenced by gem5::CheckerThreadContext< TC >::getCheckerCpuPtr(), and gem5::CheckerThreadContext< TC >::pcState().

◆ checkerTC

template<class TC >
SimpleThread* gem5::CheckerThreadContext< TC >::checkerTC
private

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

Generated on Sat Jun 18 2022 08:13:07 for gem5 by doxygen 1.8.17