gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
ProxyThreadContext< TC > Class Template Reference

ProxyThreadContext class that provides a way to implement a ThreadContext without having to derive from it. More...

#include <thread_context.hh>

Inheritance diagram for ProxyThreadContext< TC >:
ThreadContext

Public Member Functions

 ProxyThreadContext (TC *actual_tc)
 
BaseCPUgetCpuPtr ()
 
int cpuId () const
 
uint32_t socketId () const
 
int threadId () const
 
void setThreadId (int id)
 
int contextId () const
 
void setContextId (int id)
 
TheISA::TLB * getITBPtr ()
 
TheISA::TLB * getDTBPtr ()
 
CheckerCPUgetCheckerCpuPtr ()
 
TheISA::Decoder * getDecoderPtr ()
 
SystemgetSystemPtr ()
 
TheISA::Kernel::Statistics * getKernelStats ()
 
PortProxygetPhysProxy ()
 
FSTranslatingPortProxygetVirtProxy ()
 
void initMemProxies (ThreadContext *tc)
 Initialise the physical and virtual port proxies and tie them to the data port of the CPU. More...
 
SETranslatingPortProxygetMemProxy ()
 
ProcessgetProcessPtr ()
 
void setProcessPtr (Process *p)
 
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 quiesce ()
 Quiesce thread context. More...
 
void quiesceTick (Tick resume)
 Quiesce, suspend, and schedule activate at resume. More...
 
void dumpFuncProfile ()
 
void takeOverFrom (ThreadContext *oldContext)
 
void regStats (const std::string &name)
 
EndQuiesceEventgetQuiesceEvent ()
 
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 ()
 
void pcState (const TheISA::PCState &val)
 
void pcStateNoRecord (const TheISA::PCState &val)
 
Addr instAddr ()
 
Addr nextInstAddr ()
 
MicroPC microPC ()
 
bool readPredicate ()
 
void setPredicate (bool val)
 
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)
 
void syscall (int64_t callnum, Fault *fault)
 
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
 

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
 

Detailed Description

template<class TC>
class ProxyThreadContext< TC >

ProxyThreadContext class that provides a way to implement a ThreadContext without having to derive from it.

ThreadContext is an abstract class, so anything that derives from it and uses its interface will pay the overhead of virtual function calls. This class is created to enable a user-defined Thread object to be used wherever ThreadContexts are used, without paying the overhead of virtual function calls when it is used by itself. See simple_thread.hh for an example of this.

Definition at line 325 of file thread_context.hh.

Constructor & Destructor Documentation

template<class TC>
ProxyThreadContext< TC >::ProxyThreadContext ( TC *  actual_tc)
inline

Definition at line 328 of file thread_context.hh.

Member Function Documentation

template<class TC>
void ProxyThreadContext< TC >::activate ( )
inlinevirtual

Set the status to Active.

Implements ThreadContext.

Definition at line 380 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::clearArchRegs ( )
inlinevirtual

Implements ThreadContext.

Definition at line 412 of file thread_context.hh.

template<class TC>
int ProxyThreadContext< TC >::contextId ( ) const
inlinevirtual

Implements ThreadContext.

Definition at line 346 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::copyArchRegs ( ThreadContext tc)
inlinevirtual

Implements ThreadContext.

Definition at line 410 of file thread_context.hh.

template<class TC>
int ProxyThreadContext< TC >::cpuId ( ) const
inlinevirtual

Implements ThreadContext.

Definition at line 338 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::dumpFuncProfile ( )
inlinevirtual

Implements ThreadContext.

Definition at line 394 of file thread_context.hh.

template<class TC>
int ProxyThreadContext< TC >::flattenCCIndex ( int  reg)
inlinevirtual

Implements ThreadContext.

Definition at line 474 of file thread_context.hh.

template<class TC>
int ProxyThreadContext< TC >::flattenFloatIndex ( int  reg)
inlinevirtual

Implements ThreadContext.

Definition at line 471 of file thread_context.hh.

template<class TC>
int ProxyThreadContext< TC >::flattenIntIndex ( int  reg)
inlinevirtual

Implements ThreadContext.

Definition at line 468 of file thread_context.hh.

template<class TC>
int ProxyThreadContext< TC >::flattenMiscIndex ( int  reg)
inlinevirtual

Implements ThreadContext.

Definition at line 477 of file thread_context.hh.

template<class TC>
CheckerCPU* ProxyThreadContext< TC >::getCheckerCpuPtr ( )
inlinevirtual

Implements ThreadContext.

Definition at line 354 of file thread_context.hh.

template<class TC>
BaseCPU* ProxyThreadContext< TC >::getCpuPtr ( )
inlinevirtual

Implements ThreadContext.

Definition at line 336 of file thread_context.hh.

template<class TC>
TheISA::Decoder* ProxyThreadContext< TC >::getDecoderPtr ( )
inlinevirtual

Implements ThreadContext.

Definition at line 356 of file thread_context.hh.

template<class TC>
TheISA::TLB* ProxyThreadContext< TC >::getDTBPtr ( )
inlinevirtual

Implements ThreadContext.

Definition at line 352 of file thread_context.hh.

template<class TC>
TheISA::TLB* ProxyThreadContext< TC >::getITBPtr ( )
inlinevirtual

Implements ThreadContext.

Definition at line 350 of file thread_context.hh.

template<class TC>
TheISA::Kernel::Statistics* ProxyThreadContext< TC >::getKernelStats ( )
inlinevirtual

Implements ThreadContext.

Definition at line 360 of file thread_context.hh.

template<class TC>
SETranslatingPortProxy& ProxyThreadContext< TC >::getMemProxy ( )
inlinevirtual

Implements ThreadContext.

Definition at line 369 of file thread_context.hh.

template<class TC>
PortProxy& ProxyThreadContext< TC >::getPhysProxy ( )
inlinevirtual

Implements ThreadContext.

Definition at line 363 of file thread_context.hh.

template<class TC>
Process* ProxyThreadContext< TC >::getProcessPtr ( )
inlinevirtual

Implements ThreadContext.

Definition at line 371 of file thread_context.hh.

template<class TC>
EndQuiesceEvent* ProxyThreadContext< TC >::getQuiesceEvent ( )
inlinevirtual

Implements ThreadContext.

Definition at line 401 of file thread_context.hh.

template<class TC>
System* ProxyThreadContext< TC >::getSystemPtr ( )
inlinevirtual

Implements ThreadContext.

Definition at line 358 of file thread_context.hh.

template<class TC>
FSTranslatingPortProxy& ProxyThreadContext< TC >::getVirtProxy ( )
inlinevirtual

Implements ThreadContext.

Definition at line 365 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::halt ( )
inlinevirtual

Set the status to Halted.

Implements ThreadContext.

Definition at line 386 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::initMemProxies ( ThreadContext tc)
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 367 of file thread_context.hh.

template<class TC>
Addr ProxyThreadContext< TC >::instAddr ( )
inlinevirtual

Implements ThreadContext.

Definition at line 447 of file thread_context.hh.

template<class TC>
MicroPC ProxyThreadContext< TC >::microPC ( )
inlinevirtual

Implements ThreadContext.

Definition at line 449 of file thread_context.hh.

template<class TC>
Addr ProxyThreadContext< TC >::nextInstAddr ( )
inlinevirtual

Implements ThreadContext.

Definition at line 448 of file thread_context.hh.

template<class TC>
TheISA::PCState ProxyThreadContext< TC >::pcState ( )
inlinevirtual

Implements ThreadContext.

Definition at line 441 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::pcState ( const TheISA::PCState &  val)
inlinevirtual

Implements ThreadContext.

Definition at line 443 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::pcStateNoRecord ( const TheISA::PCState &  val)
inlinevirtual

Implements ThreadContext.

Definition at line 445 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::profileClear ( )
inlinevirtual

Implements ThreadContext.

Definition at line 406 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::profileSample ( )
inlinevirtual

Implements ThreadContext.

Definition at line 407 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::quiesce ( )
inline

Quiesce thread context.

Definition at line 389 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::quiesceTick ( Tick  resume)
inline

Quiesce, suspend, and schedule activate at resume.

Definition at line 392 of file thread_context.hh.

template<class TC>
CCReg ProxyThreadContext< TC >::readCCReg ( int  reg_idx)
inlinevirtual

Implements ThreadContext.

Definition at line 426 of file thread_context.hh.

template<class TC>
CCReg ProxyThreadContext< TC >::readCCRegFlat ( int  idx)
inlinevirtual

Implements ThreadContext.

Definition at line 509 of file thread_context.hh.

template<class TC>
FloatReg ProxyThreadContext< TC >::readFloatReg ( int  reg_idx)
inlinevirtual

Implements ThreadContext.

Definition at line 420 of file thread_context.hh.

template<class TC>
FloatRegBits ProxyThreadContext< TC >::readFloatRegBits ( int  reg_idx)
inlinevirtual

Implements ThreadContext.

Definition at line 423 of file thread_context.hh.

template<class TC>
FloatRegBits ProxyThreadContext< TC >::readFloatRegBitsFlat ( int  idx)
inlinevirtual

Implements ThreadContext.

Definition at line 503 of file thread_context.hh.

template<class TC>
FloatReg ProxyThreadContext< TC >::readFloatRegFlat ( int  idx)
inlinevirtual

Implements ThreadContext.

Definition at line 497 of file thread_context.hh.

template<class TC>
Counter ProxyThreadContext< TC >::readFuncExeInst ( )
inlinevirtual

Implements ThreadContext.

Definition at line 489 of file thread_context.hh.

template<class TC>
uint64_t ProxyThreadContext< TC >::readIntReg ( int  reg_idx)
inlinevirtual

Implements ThreadContext.

Definition at line 417 of file thread_context.hh.

template<class TC>
uint64_t ProxyThreadContext< TC >::readIntRegFlat ( int  idx)
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 491 of file thread_context.hh.

template<class TC>
Tick ProxyThreadContext< TC >::readLastActivate ( )
inlinevirtual

Implements ThreadContext.

Definition at line 403 of file thread_context.hh.

template<class TC>
Tick ProxyThreadContext< TC >::readLastSuspend ( )
inlinevirtual

Implements ThreadContext.

Definition at line 404 of file thread_context.hh.

template<class TC>
MiscReg ProxyThreadContext< TC >::readMiscReg ( int  misc_reg)
inlinevirtual

Implements ThreadContext.

Definition at line 459 of file thread_context.hh.

template<class TC>
MiscReg ProxyThreadContext< TC >::readMiscRegNoEffect ( int  misc_reg) const
inlinevirtual

Implements ThreadContext.

Definition at line 456 of file thread_context.hh.

template<class TC>
bool ProxyThreadContext< TC >::readPredicate ( )
inline

Definition at line 451 of file thread_context.hh.

template<class TC>
unsigned ProxyThreadContext< TC >::readStCondFailures ( )
inlinevirtual

Implements ThreadContext.

Definition at line 480 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::regStats ( const std::string &  name)
inlinevirtual

Implements ThreadContext.

Definition at line 399 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setCCReg ( int  reg_idx,
CCReg  val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 438 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setCCRegFlat ( int  idx,
CCReg  val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 512 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setContextId ( int  id)
inlinevirtual

Implements ThreadContext.

Definition at line 348 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setFloatReg ( int  reg_idx,
FloatReg  val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 432 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setFloatRegBits ( int  reg_idx,
FloatRegBits  val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 435 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setFloatRegBitsFlat ( int  idx,
FloatRegBits  val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 506 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setFloatRegFlat ( int  idx,
FloatReg  val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 500 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setIntReg ( int  reg_idx,
uint64_t  val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 429 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setIntRegFlat ( int  idx,
uint64_t  val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 494 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setMiscReg ( int  misc_reg,
const MiscReg val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 465 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setMiscRegNoEffect ( int  misc_reg,
const MiscReg val 
)
inlinevirtual

Implements ThreadContext.

Definition at line 462 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setPredicate ( bool  val)
inline

Definition at line 453 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setProcessPtr ( Process p)
inlinevirtual

Implements ThreadContext.

Definition at line 373 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setStatus ( Status  new_status)
inlinevirtual

Implements ThreadContext.

Definition at line 377 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setStCondFailures ( unsigned  sc_failures)
inlinevirtual

Implements ThreadContext.

Definition at line 483 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::setThreadId ( int  id)
inlinevirtual

Implements ThreadContext.

Definition at line 344 of file thread_context.hh.

template<class TC>
uint32_t ProxyThreadContext< TC >::socketId ( ) const
inlinevirtual

Implements ThreadContext.

Definition at line 340 of file thread_context.hh.

template<class TC>
Status ProxyThreadContext< TC >::status ( ) const
inlinevirtual

Implements ThreadContext.

Definition at line 375 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::suspend ( )
inlinevirtual

Set the status to Suspended.

Implements ThreadContext.

Definition at line 383 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::syscall ( int64_t  callnum,
Fault fault 
)
inlinevirtual

Implements ThreadContext.

Definition at line 486 of file thread_context.hh.

template<class TC>
void ProxyThreadContext< TC >::takeOverFrom ( ThreadContext oldContext)
inlinevirtual

Implements ThreadContext.

Definition at line 396 of file thread_context.hh.

template<class TC>
int ProxyThreadContext< TC >::threadId ( ) const
inlinevirtual

Implements ThreadContext.

Definition at line 342 of file thread_context.hh.

Referenced by SimpleThread::name().

Member Data Documentation

template<class TC>
TC* ProxyThreadContext< TC >::actualTC
private

Definition at line 332 of file thread_context.hh.

Referenced by ProxyThreadContext< SimpleThread >::activate(), ProxyThreadContext< SimpleThread >::clearArchRegs(), ProxyThreadContext< SimpleThread >::contextId(), ProxyThreadContext< SimpleThread >::copyArchRegs(), ProxyThreadContext< SimpleThread >::cpuId(), ProxyThreadContext< SimpleThread >::dumpFuncProfile(), ProxyThreadContext< SimpleThread >::flattenCCIndex(), ProxyThreadContext< SimpleThread >::flattenFloatIndex(), ProxyThreadContext< SimpleThread >::flattenIntIndex(), ProxyThreadContext< SimpleThread >::flattenMiscIndex(), ProxyThreadContext< SimpleThread >::getCheckerCpuPtr(), ProxyThreadContext< SimpleThread >::getCpuPtr(), ProxyThreadContext< SimpleThread >::getDecoderPtr(), ProxyThreadContext< SimpleThread >::getDTBPtr(), ProxyThreadContext< SimpleThread >::getITBPtr(), ProxyThreadContext< SimpleThread >::getKernelStats(), ProxyThreadContext< SimpleThread >::getMemProxy(), ProxyThreadContext< SimpleThread >::getPhysProxy(), ProxyThreadContext< SimpleThread >::getProcessPtr(), ProxyThreadContext< SimpleThread >::getQuiesceEvent(), ProxyThreadContext< SimpleThread >::getSystemPtr(), ProxyThreadContext< SimpleThread >::getVirtProxy(), ProxyThreadContext< SimpleThread >::halt(), ProxyThreadContext< SimpleThread >::initMemProxies(), ProxyThreadContext< SimpleThread >::instAddr(), ProxyThreadContext< SimpleThread >::microPC(), ProxyThreadContext< SimpleThread >::nextInstAddr(), ProxyThreadContext< SimpleThread >::pcState(), ProxyThreadContext< SimpleThread >::pcStateNoRecord(), ProxyThreadContext< SimpleThread >::profileClear(), ProxyThreadContext< SimpleThread >::profileSample(), ProxyThreadContext< SimpleThread >::ProxyThreadContext(), ProxyThreadContext< SimpleThread >::quiesce(), ProxyThreadContext< SimpleThread >::quiesceTick(), ProxyThreadContext< SimpleThread >::readCCReg(), ProxyThreadContext< SimpleThread >::readCCRegFlat(), ProxyThreadContext< SimpleThread >::readFloatReg(), ProxyThreadContext< SimpleThread >::readFloatRegBits(), ProxyThreadContext< SimpleThread >::readFloatRegBitsFlat(), ProxyThreadContext< SimpleThread >::readFloatRegFlat(), ProxyThreadContext< SimpleThread >::readFuncExeInst(), ProxyThreadContext< SimpleThread >::readIntReg(), ProxyThreadContext< SimpleThread >::readIntRegFlat(), ProxyThreadContext< SimpleThread >::readLastActivate(), ProxyThreadContext< SimpleThread >::readLastSuspend(), ProxyThreadContext< SimpleThread >::readMiscReg(), ProxyThreadContext< SimpleThread >::readMiscRegNoEffect(), ProxyThreadContext< SimpleThread >::readPredicate(), ProxyThreadContext< SimpleThread >::readStCondFailures(), ProxyThreadContext< SimpleThread >::regStats(), ProxyThreadContext< SimpleThread >::setCCReg(), ProxyThreadContext< SimpleThread >::setCCRegFlat(), ProxyThreadContext< SimpleThread >::setContextId(), ProxyThreadContext< SimpleThread >::setFloatReg(), ProxyThreadContext< SimpleThread >::setFloatRegBits(), ProxyThreadContext< SimpleThread >::setFloatRegBitsFlat(), ProxyThreadContext< SimpleThread >::setFloatRegFlat(), ProxyThreadContext< SimpleThread >::setIntReg(), ProxyThreadContext< SimpleThread >::setIntRegFlat(), ProxyThreadContext< SimpleThread >::setMiscReg(), ProxyThreadContext< SimpleThread >::setMiscRegNoEffect(), ProxyThreadContext< SimpleThread >::setPredicate(), ProxyThreadContext< SimpleThread >::setProcessPtr(), ProxyThreadContext< SimpleThread >::setStatus(), ProxyThreadContext< SimpleThread >::setStCondFailures(), ProxyThreadContext< SimpleThread >::setThreadId(), ProxyThreadContext< SimpleThread >::socketId(), ProxyThreadContext< SimpleThread >::status(), ProxyThreadContext< SimpleThread >::suspend(), ProxyThreadContext< SimpleThread >::syscall(), ProxyThreadContext< SimpleThread >::takeOverFrom(), and ProxyThreadContext< SimpleThread >::threadId().


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

Generated on Fri Jun 9 2017 13:04:17 for gem5 by doxygen 1.8.6