gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Protected Types | List of all members
SimpleExecContext Class Reference

#include <exec_context.hh>

Inheritance diagram for SimpleExecContext:
ExecContext

Public Member Functions

 SimpleExecContext (BaseSimpleCPU *_cpu, SimpleThread *_thread)
 Constructor. More...
 
IntReg readIntRegOperand (const StaticInst *si, int idx) override
 Reads an integer register. More...
 
void setIntRegOperand (const StaticInst *si, int idx, IntReg val) override
 Sets an integer register to a value. More...
 
FloatReg readFloatRegOperand (const StaticInst *si, int idx) override
 Reads a floating point register of single register width. More...
 
FloatRegBits readFloatRegOperandBits (const StaticInst *si, int idx) override
 Reads a floating point register in its binary format, instead of by value. More...
 
void setFloatRegOperand (const StaticInst *si, int idx, FloatReg val) override
 Sets a floating point register of single width to a value. More...
 
void setFloatRegOperandBits (const StaticInst *si, int idx, FloatRegBits val) override
 Sets the bits of a floating point register of single width to a binary value. More...
 
CCReg readCCRegOperand (const StaticInst *si, int idx) override
 
void setCCRegOperand (const StaticInst *si, int idx, CCReg val) override
 
MiscReg readMiscRegOperand (const StaticInst *si, int idx) override
 
void setMiscRegOperand (const StaticInst *si, int idx, const MiscReg &val) override
 
MiscReg readMiscReg (int misc_reg) override
 Reads a miscellaneous register, handling any architectural side effects due to reading that register. More...
 
void setMiscReg (int misc_reg, const MiscReg &val) override
 Sets a miscellaneous register, handling any architectural side effects due to writing that register. More...
 
PCState pcState () const override
 
void pcState (const PCState &val) override
 
void setEA (Addr EA) override
 Record the effective address of the instruction. More...
 
Addr getEA () const override
 Get the effective address of the instruction. More...
 
Fault readMem (Addr addr, uint8_t *data, unsigned int size, Request::Flags flags) override
 Perform an atomic memory read operation. More...
 
Fault initiateMemRead (Addr addr, unsigned int size, Request::Flags flags) override
 Initiate a timing memory read operation. More...
 
Fault writeMem (uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res) override
 For atomic-mode contexts, perform an atomic memory write operation. More...
 
void setStCondFailures (unsigned int sc_failures) override
 Sets the number of consecutive store conditional failures. More...
 
unsigned int readStCondFailures () const override
 Returns the number of consecutive store conditional failures. More...
 
void syscall (int64_t callnum, Fault *fault) override
 Executes a syscall specified by the callnum. More...
 
ThreadContexttcBase () override
 Returns a pointer to the ThreadContext. More...
 
Fault hwrei () override
 Somewhat Alpha-specific function that handles returning from an error or interrupt. More...
 
bool simPalCheck (int palFunc) override
 Check for special simulator handling of specific PAL calls. More...
 
bool readPredicate () override
 
void setPredicate (bool val) override
 
void demapPage (Addr vaddr, uint64_t asn) override
 Invalidate a page in the DTLB and ITLB. More...
 
void armMonitor (Addr address) override
 
bool mwait (PacketPtr pkt) override
 
void mwaitAtomic (ThreadContext *tc) override
 
AddressMonitor * getAddrMonitor () override
 
MiscReg readRegOtherThread (int regIdx, ThreadID tid=InvalidThreadID) override
 
void setRegOtherThread (int regIdx, MiscReg val, ThreadID tid=InvalidThreadID) override
 
Integer Register Interfaces
Floating Point Register Interfaces
Condition Code Registers
Misc Register Interfaces
PC Control
Memory Interface
SysCall Emulation Interfaces
Alpha-Specific Interfaces
ARM-Specific Interfaces
X86-Specific Interfaces
MIPS-Specific Interfaces

Public Attributes

BaseSimpleCPUcpu
 
SimpleThreadthread
 
Addr fetchOffset
 
bool stayAtPC
 
TheISA::PCState predPC
 
Counter numInst
 PER-THREAD STATS. More...
 
Stats::Scalar numInsts
 
Counter numOp
 
Stats::Scalar numOps
 
Stats::Scalar numIntAluAccesses
 
Stats::Scalar numFpAluAccesses
 
Stats::Scalar numCallsReturns
 
Stats::Scalar numCondCtrlInsts
 
Stats::Scalar numIntInsts
 
Stats::Scalar numFpInsts
 
Stats::Scalar numIntRegReads
 
Stats::Scalar numIntRegWrites
 
Stats::Scalar numFpRegReads
 
Stats::Scalar numFpRegWrites
 
Stats::Scalar numCCRegReads
 
Stats::Scalar numCCRegWrites
 
Stats::Scalar numMemRefs
 
Stats::Scalar numLoadInsts
 
Stats::Scalar numStoreInsts
 
Stats::Formula numIdleCycles
 
Stats::Formula numBusyCycles
 
Counter numLoad
 
Stats::Average notIdleFraction
 
Stats::Formula idleFraction
 
Stats::Scalar icacheStallCycles
 
Counter lastIcacheStall
 
Stats::Scalar dcacheStallCycles
 
Counter lastDcacheStall
 
Stats::Vector statExecutedInstType
 
Stats::Scalar numBranches
 
Stats::Scalar numPredictedBranches
 Number of branches predicted as taken. More...
 
Stats::Scalar numBranchMispred
 Number of misprediced branches. More...
 

Protected Types

typedef TheISA::MiscReg MiscReg
 
typedef TheISA::FloatReg FloatReg
 
typedef TheISA::FloatRegBits FloatRegBits
 
typedef TheISA::CCReg CCReg
 

Additional Inherited Members

- Public Types inherited from ExecContext
typedef TheISA::IntReg IntReg
 
typedef TheISA::PCState PCState
 
typedef TheISA::FloatReg FloatReg
 
typedef TheISA::FloatRegBits FloatRegBits
 
typedef TheISA::MiscReg MiscReg
 
typedef TheISA::CCReg CCReg
 

Detailed Description

Definition at line 60 of file exec_context.hh.

Member Typedef Documentation

typedef TheISA::CCReg SimpleExecContext::CCReg
protected

Definition at line 65 of file exec_context.hh.

typedef TheISA::FloatReg SimpleExecContext::FloatReg
protected

Definition at line 63 of file exec_context.hh.

typedef TheISA::FloatRegBits SimpleExecContext::FloatRegBits
protected

Definition at line 64 of file exec_context.hh.

typedef TheISA::MiscReg SimpleExecContext::MiscReg
protected

Definition at line 62 of file exec_context.hh.

Constructor & Destructor Documentation

SimpleExecContext::SimpleExecContext ( BaseSimpleCPU _cpu,
SimpleThread _thread 
)
inline

Constructor.

Definition at line 158 of file exec_context.hh.

Member Function Documentation

void SimpleExecContext::armMonitor ( Addr  address)
inlineoverridevirtual

Implements ExecContext.

Definition at line 380 of file exec_context.hh.

References cpu, thread, and ThreadState::threadId().

void SimpleExecContext::demapPage ( Addr  vaddr,
uint64_t  asn 
)
inlineoverridevirtual

Invalidate a page in the DTLB and ITLB.

Implements ExecContext.

Definition at line 375 of file exec_context.hh.

References SimpleThread::demapPage(), and thread.

AddressMonitor* SimpleExecContext::getAddrMonitor ( )
inlineoverridevirtual

Implements ExecContext.

Definition at line 395 of file exec_context.hh.

References cpu, thread, and ThreadState::threadId().

Addr SimpleExecContext::getEA ( ) const
inlineoverridevirtual

Get the effective address of the instruction.

Note
Only valid for memory ops.

Implements ExecContext.

Definition at line 286 of file exec_context.hh.

References panic.

Fault SimpleExecContext::hwrei ( )
inlineoverridevirtual

Somewhat Alpha-specific function that handles returning from an error or interrupt.

Implements ExecContext.

Definition at line 344 of file exec_context.hh.

References SimpleThread::hwrei(), and thread.

Fault SimpleExecContext::initiateMemRead ( Addr  addr,
unsigned int  size,
Request::Flags  flags 
)
inlineoverridevirtual

Initiate a timing memory read operation.

Must be overridden for exec contexts that support timing memory mode. Not pure virtual since exec contexts that only support atomic memory mode need not override (though in that case this function should never be called).

Reimplemented from ExecContext.

Definition at line 295 of file exec_context.hh.

References cpu, and BaseSimpleCPU::initiateMemRead().

bool SimpleExecContext::mwait ( PacketPtr  pkt)
inlineoverridevirtual

Implements ExecContext.

Definition at line 385 of file exec_context.hh.

References cpu, thread, and ThreadState::threadId().

void SimpleExecContext::mwaitAtomic ( ThreadContext tc)
inlineoverridevirtual

Implements ExecContext.

Definition at line 390 of file exec_context.hh.

References cpu, SimpleThread::dtb, thread, and ThreadState::threadId().

PCState SimpleExecContext::pcState ( ) const
inlineoverridevirtual

Implements ExecContext.

Definition at line 262 of file exec_context.hh.

References SimpleThread::pcState(), and thread.

void SimpleExecContext::pcState ( const PCState val)
inlineoverridevirtual

Implements ExecContext.

Definition at line 267 of file exec_context.hh.

References SimpleThread::pcState(), and thread.

CCReg SimpleExecContext::readCCRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual
FloatReg SimpleExecContext::readFloatRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual

Reads a floating point register of single register width.

Implements ExecContext.

Definition at line 178 of file exec_context.hh.

References AlphaISA::FP_Reg_Base, numFpRegReads, SimpleThread::readFloatReg(), StaticInst::srcRegIdx(), and thread.

FloatRegBits SimpleExecContext::readFloatRegOperandBits ( const StaticInst si,
int  idx 
)
inlineoverridevirtual

Reads a floating point register in its binary format, instead of by value.

Implements ExecContext.

Definition at line 187 of file exec_context.hh.

References AlphaISA::FP_Reg_Base, numFpRegReads, SimpleThread::readFloatRegBits(), StaticInst::srcRegIdx(), and thread.

IntReg SimpleExecContext::readIntRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual

Reads an integer register.

Implements ExecContext.

Definition at line 164 of file exec_context.hh.

References numIntRegReads, SimpleThread::readIntReg(), StaticInst::srcRegIdx(), and thread.

Fault SimpleExecContext::readMem ( Addr  addr,
uint8_t *  data,
unsigned int  size,
Request::Flags  flags 
)
inlineoverridevirtual

Perform an atomic memory read operation.

Must be overridden for exec contexts that support atomic memory mode. Not pure virtual since exec contexts that only support timing memory mode need not override (though in that case this function should never be called).

Reimplemented from ExecContext.

Definition at line 289 of file exec_context.hh.

References cpu, and BaseSimpleCPU::readMem().

MiscReg SimpleExecContext::readMiscReg ( int  misc_reg)
inlineoverridevirtual

Reads a miscellaneous register, handling any architectural side effects due to reading that register.

Implements ExecContext.

Definition at line 246 of file exec_context.hh.

References numIntRegReads, SimpleThread::readMiscReg(), and thread.

MiscReg SimpleExecContext::readMiscRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual
bool SimpleExecContext::readPredicate ( )
inlineoverridevirtual

Implements ExecContext.

Definition at line 358 of file exec_context.hh.

References SimpleThread::readPredicate(), and thread.

MiscReg SimpleExecContext::readRegOtherThread ( int  regIdx,
ThreadID  tid = InvalidThreadID 
)
inlineoverridevirtual

Implements ExecContext.

Definition at line 401 of file exec_context.hh.

References panic.

unsigned int SimpleExecContext::readStCondFailures ( ) const
inlineoverridevirtual

Returns the number of consecutive store conditional failures.

Implements ExecContext.

Definition at line 318 of file exec_context.hh.

References SimpleThread::readStCondFailures(), and thread.

void SimpleExecContext::setCCRegOperand ( const StaticInst si,
int  idx,
CCReg  val 
)
inlineoverridevirtual
void SimpleExecContext::setEA ( Addr  EA)
inlineoverridevirtual

Record the effective address of the instruction.

Note
Only valid for memory ops.

Implements ExecContext.

Definition at line 278 of file exec_context.hh.

References panic.

void SimpleExecContext::setFloatRegOperand ( const StaticInst si,
int  idx,
FloatReg  val 
)
inlineoverridevirtual

Sets a floating point register of single width to a value.

Implements ExecContext.

Definition at line 195 of file exec_context.hh.

References StaticInst::destRegIdx(), AlphaISA::FP_Reg_Base, numFpRegWrites, SimpleThread::setFloatReg(), and thread.

void SimpleExecContext::setFloatRegOperandBits ( const StaticInst si,
int  idx,
FloatRegBits  val 
)
inlineoverridevirtual

Sets the bits of a floating point register of single width to a binary value.

Implements ExecContext.

Definition at line 205 of file exec_context.hh.

References StaticInst::destRegIdx(), AlphaISA::FP_Reg_Base, numFpRegWrites, SimpleThread::setFloatRegBits(), and thread.

void SimpleExecContext::setIntRegOperand ( const StaticInst si,
int  idx,
IntReg  val 
)
inlineoverridevirtual

Sets an integer register to a value.

Implements ExecContext.

Definition at line 171 of file exec_context.hh.

References StaticInst::destRegIdx(), numIntRegWrites, SimpleThread::setIntReg(), thread, and X86ISA::val.

void SimpleExecContext::setMiscReg ( int  misc_reg,
const MiscReg val 
)
inlineoverridevirtual

Sets a miscellaneous register, handling any architectural side effects due to writing that register.

Implements ExecContext.

Definition at line 256 of file exec_context.hh.

References numIntRegWrites, SimpleThread::setMiscReg(), and thread.

void SimpleExecContext::setMiscRegOperand ( const StaticInst si,
int  idx,
const MiscReg val 
)
inlineoverridevirtual
void SimpleExecContext::setPredicate ( bool  val)
inlineoverridevirtual
void SimpleExecContext::setRegOtherThread ( int  regIdx,
MiscReg  val,
ThreadID  tid = InvalidThreadID 
)
inlineoverridevirtual

Implements ExecContext.

Definition at line 408 of file exec_context.hh.

References panic.

void SimpleExecContext::setStCondFailures ( unsigned int  sc_failures)
inlineoverridevirtual

Sets the number of consecutive store conditional failures.

Implements ExecContext.

Definition at line 310 of file exec_context.hh.

References SimpleThread::setStCondFailures(), and thread.

bool SimpleExecContext::simPalCheck ( int  palFunc)
inlineoverridevirtual

Check for special simulator handling of specific PAL calls.

If return value is false, actual PAL call will be suppressed.

Implements ExecContext.

Definition at line 353 of file exec_context.hh.

References SimpleThread::simPalCheck(), and thread.

void SimpleExecContext::syscall ( int64_t  callnum,
Fault fault 
)
inlineoverridevirtual

Executes a syscall specified by the callnum.

Implements ExecContext.

Definition at line 326 of file exec_context.hh.

References FullSystem, panic, SimpleThread::syscall(), and thread.

ThreadContext* SimpleExecContext::tcBase ( )
inlineoverridevirtual

Returns a pointer to the ThreadContext.

Implements ExecContext.

Definition at line 335 of file exec_context.hh.

References SimpleThread::getTC(), and thread.

Fault SimpleExecContext::writeMem ( uint8_t *  data,
unsigned int  size,
Addr  addr,
Request::Flags  flags,
uint64_t *  res 
)
inlineoverridevirtual

For atomic-mode contexts, perform an atomic memory write operation.

For timing-mode contexts, initiate a timing memory write operation.

Implements ExecContext.

Definition at line 301 of file exec_context.hh.

References cpu, and BaseSimpleCPU::writeMem().

Member Data Documentation

BaseSimpleCPU* SimpleExecContext::cpu
Stats::Scalar SimpleExecContext::dcacheStallCycles

Definition at line 141 of file exec_context.hh.

Referenced by BaseSimpleCPU::regStats().

Addr SimpleExecContext::fetchOffset
Stats::Scalar SimpleExecContext::icacheStallCycles

Definition at line 137 of file exec_context.hh.

Referenced by BaseSimpleCPU::regStats().

Stats::Formula SimpleExecContext::idleFraction

Definition at line 134 of file exec_context.hh.

Referenced by BaseSimpleCPU::regStats().

Counter SimpleExecContext::lastDcacheStall

Definition at line 142 of file exec_context.hh.

Counter SimpleExecContext::lastIcacheStall

Definition at line 138 of file exec_context.hh.

Stats::Average SimpleExecContext::notIdleFraction

Definition at line 133 of file exec_context.hh.

Referenced by BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numBranches

Total number of branches fetched

Definition at line 146 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numBranchMispred

Number of misprediced branches.

Definition at line 150 of file exec_context.hh.

Referenced by BaseSimpleCPU::advancePC(), and BaseSimpleCPU::regStats().

Stats::Formula SimpleExecContext::numBusyCycles

Definition at line 127 of file exec_context.hh.

Referenced by BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numCallsReturns

Definition at line 95 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numCCRegReads

Definition at line 115 of file exec_context.hh.

Referenced by readCCRegOperand(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numCCRegWrites

Definition at line 116 of file exec_context.hh.

Referenced by BaseSimpleCPU::regStats(), and setCCRegOperand().

Stats::Scalar SimpleExecContext::numCondCtrlInsts

Definition at line 98 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numFpAluAccesses

Definition at line 92 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numFpInsts

Definition at line 104 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numFpRegReads
Stats::Scalar SimpleExecContext::numFpRegWrites
Stats::Formula SimpleExecContext::numIdleCycles

Definition at line 124 of file exec_context.hh.

Referenced by BaseSimpleCPU::regStats().

Counter SimpleExecContext::numInst

PER-THREAD STATS.

Definition at line 83 of file exec_context.hh.

Referenced by BaseSimpleCPU::countInst(), and BaseSimpleCPU::preExecute().

Stats::Scalar SimpleExecContext::numInsts

Definition at line 84 of file exec_context.hh.

Referenced by BaseSimpleCPU::countInst(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numIntAluAccesses

Definition at line 89 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numIntInsts

Definition at line 101 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numIntRegReads
Stats::Scalar SimpleExecContext::numIntRegWrites
Counter SimpleExecContext::numLoad

Definition at line 130 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute().

Stats::Scalar SimpleExecContext::numLoadInsts

Definition at line 120 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numMemRefs

Definition at line 119 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

Counter SimpleExecContext::numOp

Definition at line 85 of file exec_context.hh.

Referenced by BaseSimpleCPU::countInst().

Stats::Scalar SimpleExecContext::numOps

Definition at line 86 of file exec_context.hh.

Referenced by BaseSimpleCPU::countInst(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numPredictedBranches

Number of branches predicted as taken.

Definition at line 148 of file exec_context.hh.

Referenced by BaseSimpleCPU::preExecute(), and BaseSimpleCPU::regStats().

Stats::Scalar SimpleExecContext::numStoreInsts

Definition at line 121 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

TheISA::PCState SimpleExecContext::predPC

Definition at line 78 of file exec_context.hh.

Referenced by BaseSimpleCPU::advancePC(), and BaseSimpleCPU::preExecute().

Stats::Vector SimpleExecContext::statExecutedInstType

Definition at line 154 of file exec_context.hh.

Referenced by BaseSimpleCPU::postExecute(), and BaseSimpleCPU::regStats().

bool SimpleExecContext::stayAtPC
SimpleThread* SimpleExecContext::thread

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

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