gem5
|
Derived ThreadContext class for use with the Checker. More...
#include <thread_context.hh>
Public Member Functions | |
CheckerThreadContext (TC *actual_tc, CheckerCPU *checker_cpu) | |
BaseCPU * | getCpuPtr () |
uint32_t | socketId () const |
int | cpuId () const |
ContextID | contextId () const |
void | setContextId (ContextID id) |
int | threadId () const |
Returns this thread's ID number. More... | |
void | setThreadId (int id) |
TheISA::TLB * | getITBPtr () |
TheISA::TLB * | getDTBPtr () |
CheckerCPU * | getCheckerCpuPtr () |
TheISA::Decoder * | getDecoderPtr () |
System * | getSystemPtr () |
TheISA::Kernel::Statistics * | getKernelStats () |
Process * | getProcessPtr () |
void | setProcessPtr (Process *p) |
PortProxy & | getPhysProxy () |
FSTranslatingPortProxy & | getVirtProxy () |
void | initMemProxies (ThreadContext *tc) |
Initialise the physical and virtual port proxies and tie them to the data port of the CPU. More... | |
void | connectMemPorts (ThreadContext *tc) |
SETranslatingPortProxy & | getMemProxy () |
void | syscall (int64_t callnum, Fault *fault) |
Executes a syscall in SE mode. More... | |
Status | status () const |
void | setStatus (Status new_status) |
void | activate () |
Set the status to Active. More... | |
void | suspend () |
Set the status to Suspended. More... | |
void | halt () |
Set the status to Halted. More... | |
void | dumpFuncProfile () |
void | takeOverFrom (ThreadContext *oldContext) |
void | regStats (const std::string &name) |
EndQuiesceEvent * | getQuiesceEvent () |
Tick | readLastActivate () |
Tick | readLastSuspend () |
void | profileClear () |
void | profileSample () |
void | copyArchRegs (ThreadContext *tc) |
void | clearArchRegs () |
uint64_t | readIntReg (int reg_idx) |
FloatReg | readFloatReg (int reg_idx) |
FloatRegBits | readFloatRegBits (int reg_idx) |
CCReg | readCCReg (int reg_idx) |
void | setIntReg (int reg_idx, uint64_t val) |
void | setFloatReg (int reg_idx, FloatReg val) |
void | setFloatRegBits (int reg_idx, FloatRegBits val) |
void | setCCReg (int reg_idx, CCReg val) |
TheISA::PCState | pcState () |
Reads this thread's PC state. More... | |
void | pcState (const TheISA::PCState &val) |
Sets this thread's PC state. More... | |
void | setNPC (Addr val) |
void | pcStateNoRecord (const TheISA::PCState &val) |
Addr | instAddr () |
Reads this thread's PC. More... | |
Addr | nextInstAddr () |
Reads this thread's next PC. More... | |
MicroPC | microPC () |
Reads this thread's next PC. More... | |
MiscReg | readMiscRegNoEffect (int misc_reg) const |
MiscReg | readMiscReg (int misc_reg) |
void | setMiscRegNoEffect (int misc_reg, const MiscReg &val) |
void | setMiscReg (int misc_reg, const MiscReg &val) |
int | flattenIntIndex (int reg) |
int | flattenFloatIndex (int reg) |
int | flattenCCIndex (int reg) |
int | flattenMiscIndex (int reg) |
unsigned | readStCondFailures () |
void | setStCondFailures (unsigned sc_failures) |
Counter | readFuncExeInst () |
uint64_t | readIntRegFlat (int idx) |
Flat register interfaces. More... | |
void | setIntRegFlat (int idx, uint64_t val) |
FloatReg | readFloatRegFlat (int idx) |
void | setFloatRegFlat (int idx, FloatReg val) |
FloatRegBits | readFloatRegBitsFlat (int idx) |
void | setFloatRegBitsFlat (int idx, FloatRegBits val) |
CCReg | readCCRegFlat (int idx) |
void | setCCRegFlat (int idx, CCReg val) |
Public Member Functions inherited from ThreadContext | |
virtual | ~ThreadContext () |
void | quiesce () |
Quiesce thread context. More... | |
void | quiesceTick (Tick resume) |
Quiesce, suspend, and schedule activate at resume. More... | |
void | setNPC (Addr val) |
virtual uint64_t | readRegOtherThread (int misc_reg, ThreadID tid) |
virtual void | setRegOtherThread (int misc_reg, const MiscReg &val, ThreadID tid) |
virtual int | exit () |
Private Attributes | |
TC * | actualTC |
The main CPU's ThreadContext, or class that implements the ThreadContext interface. More... | |
SimpleThread * | checkerTC |
The checker's own SimpleThread. More... | |
CheckerCPU * | checkerCPU |
Pointer to the checker CPU. More... | |
Additional Inherited Members | |
Public Types inherited from ThreadContext | |
enum | Status { Active, Suspended, Halted } |
Static Public Member Functions inherited from ThreadContext | |
static void | compare (ThreadContext *one, ThreadContext *two) |
function to compare two thread contexts (for debugging) More... | |
Protected Types inherited from ThreadContext | |
typedef TheISA::MachInst | MachInst |
typedef TheISA::IntReg | IntReg |
typedef TheISA::FloatReg | FloatReg |
typedef TheISA::FloatRegBits | FloatRegBits |
typedef TheISA::CCReg | CCReg |
typedef TheISA::MiscReg | MiscReg |
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 71 of file thread_context.hh.
|
inline |
Definition at line 74 of file thread_context.hh.
|
inlinevirtual |
Set the status to Active.
Implements ThreadContext.
Definition at line 163 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 200 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::clearArchRegs().
|
inline |
Definition at line 143 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 99 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 194 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::copyArchRegs().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 97 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 171 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 306 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 305 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 304 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 307 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 119 of file thread_context.hh.
References CheckerThreadContext< TC >::checkerCPU.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 93 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 124 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 117 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 115 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 128 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 148 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 135 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 131 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 185 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 126 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 137 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Set the status to Halted.
Implements ThreadContext.
Definition at line 169 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Initialise the physical and virtual port proxies and tie them to the data port of the CPU.
tc ThreadContext for the virtual-to-physical translation
Implements ThreadContext.
Definition at line 140 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Reads this thread's PC.
Implements ThreadContext.
Definition at line 271 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Reads this thread's next PC.
Implements ThreadContext.
Definition at line 279 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Reads this thread's next PC.
Implements ThreadContext.
Definition at line 275 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Reads this thread's PC state.
Implements ThreadContext.
Definition at line 246 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Sets this thread's PC state.
Implements ThreadContext.
Definition at line 250 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerCPU, CheckerThreadContext< TC >::checkerTC, DPRINTF, SimpleThread::pcState(), and CheckerCPU::recordPCChange().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 265 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 190 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 191 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 218 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 337 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 212 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 215 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 331 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 325 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 317 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 209 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Flat register interfaces.
Some architectures have different registers visible in different modes. Such architectures "flatten" a register (see flattenIntIndex() and flattenFloatIndex()) 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.
Implements ThreadContext.
Definition at line 319 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 187 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 188 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 285 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 282 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 309 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 179 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::regStats().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 239 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::setCCReg().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 340 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 101 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and ThreadState::setContextId().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 227 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::setFloatReg().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 233 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::setFloatRegBits().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 334 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 328 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 221 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::setIntReg().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 322 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 296 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, DPRINTF, and SimpleThread::setMiscReg().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 288 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, DPRINTF, and SimpleThread::setMiscRegNoEffect().
|
inline |
Definition at line 259 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::setNPC().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 133 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 156 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::setStatus().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 312 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 109 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and ThreadState::setThreadId().
|
inlinevirtual |
Implements ThreadContext.
Definition at line 95 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 154 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Set the status to Suspended.
Implements ThreadContext.
Definition at line 166 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Executes a syscall in SE mode.
Implements ThreadContext.
Definition at line 151 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
inlinevirtual |
Implements ThreadContext.
Definition at line 173 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC, CheckerThreadContext< TC >::checkerTC, and SimpleThread::copyState().
|
inlinevirtual |
Returns this thread's ID number.
Implements ThreadContext.
Definition at line 108 of file thread_context.hh.
References CheckerThreadContext< TC >::actualTC.
|
private |
The main CPU's ThreadContext, or class that implements the ThreadContext interface.
Definition at line 83 of file thread_context.hh.
Referenced by CheckerThreadContext< TC >::activate(), CheckerThreadContext< TC >::clearArchRegs(), CheckerThreadContext< TC >::connectMemPorts(), CheckerThreadContext< TC >::contextId(), CheckerThreadContext< TC >::copyArchRegs(), CheckerThreadContext< TC >::cpuId(), CheckerThreadContext< TC >::dumpFuncProfile(), CheckerThreadContext< TC >::flattenCCIndex(), CheckerThreadContext< TC >::flattenFloatIndex(), CheckerThreadContext< TC >::flattenIntIndex(), CheckerThreadContext< TC >::flattenMiscIndex(), CheckerThreadContext< TC >::getCpuPtr(), CheckerThreadContext< TC >::getDecoderPtr(), CheckerThreadContext< TC >::getDTBPtr(), CheckerThreadContext< TC >::getITBPtr(), CheckerThreadContext< TC >::getKernelStats(), CheckerThreadContext< TC >::getMemProxy(), CheckerThreadContext< TC >::getPhysProxy(), CheckerThreadContext< TC >::getProcessPtr(), CheckerThreadContext< TC >::getQuiesceEvent(), CheckerThreadContext< TC >::getSystemPtr(), CheckerThreadContext< TC >::getVirtProxy(), CheckerThreadContext< TC >::halt(), CheckerThreadContext< TC >::initMemProxies(), CheckerThreadContext< TC >::instAddr(), CheckerThreadContext< TC >::microPC(), CheckerThreadContext< TC >::nextInstAddr(), CheckerThreadContext< TC >::pcState(), CheckerThreadContext< TC >::pcStateNoRecord(), CheckerThreadContext< TC >::profileClear(), CheckerThreadContext< TC >::profileSample(), CheckerThreadContext< TC >::readCCReg(), CheckerThreadContext< TC >::readCCRegFlat(), CheckerThreadContext< TC >::readFloatReg(), CheckerThreadContext< TC >::readFloatRegBits(), CheckerThreadContext< TC >::readFloatRegBitsFlat(), CheckerThreadContext< TC >::readFloatRegFlat(), CheckerThreadContext< TC >::readFuncExeInst(), CheckerThreadContext< TC >::readIntReg(), CheckerThreadContext< TC >::readIntRegFlat(), CheckerThreadContext< TC >::readLastActivate(), CheckerThreadContext< TC >::readLastSuspend(), CheckerThreadContext< TC >::readMiscReg(), CheckerThreadContext< TC >::readMiscRegNoEffect(), CheckerThreadContext< TC >::readStCondFailures(), CheckerThreadContext< TC >::regStats(), CheckerThreadContext< TC >::setCCReg(), CheckerThreadContext< TC >::setCCRegFlat(), CheckerThreadContext< TC >::setContextId(), CheckerThreadContext< TC >::setFloatReg(), CheckerThreadContext< TC >::setFloatRegBits(), CheckerThreadContext< TC >::setFloatRegBitsFlat(), CheckerThreadContext< TC >::setFloatRegFlat(), CheckerThreadContext< TC >::setIntReg(), CheckerThreadContext< TC >::setIntRegFlat(), CheckerThreadContext< TC >::setMiscReg(), CheckerThreadContext< TC >::setMiscRegNoEffect(), CheckerThreadContext< TC >::setNPC(), CheckerThreadContext< TC >::setProcessPtr(), CheckerThreadContext< TC >::setStatus(), CheckerThreadContext< TC >::setStCondFailures(), CheckerThreadContext< TC >::setThreadId(), CheckerThreadContext< TC >::socketId(), CheckerThreadContext< TC >::status(), CheckerThreadContext< TC >::suspend(), CheckerThreadContext< TC >::syscall(), CheckerThreadContext< TC >::takeOverFrom(), and CheckerThreadContext< TC >::threadId().
|
private |
Pointer to the checker CPU.
Definition at line 89 of file thread_context.hh.
Referenced by CheckerThreadContext< TC >::getCheckerCpuPtr(), and CheckerThreadContext< TC >::pcState().
|
private |
The checker's own SimpleThread.
Will be updated any time anything uses this ThreadContext to externally update a thread's state.
Definition at line 87 of file thread_context.hh.
Referenced by CheckerThreadContext< TC >::clearArchRegs(), CheckerThreadContext< TC >::copyArchRegs(), CheckerThreadContext< TC >::pcState(), CheckerThreadContext< TC >::regStats(), CheckerThreadContext< TC >::setCCReg(), CheckerThreadContext< TC >::setContextId(), CheckerThreadContext< TC >::setFloatReg(), CheckerThreadContext< TC >::setFloatRegBits(), CheckerThreadContext< TC >::setIntReg(), CheckerThreadContext< TC >::setMiscReg(), CheckerThreadContext< TC >::setMiscRegNoEffect(), CheckerThreadContext< TC >::setNPC(), CheckerThreadContext< TC >::setStatus(), CheckerThreadContext< TC >::setThreadId(), and CheckerThreadContext< TC >::takeOverFrom().