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

ExecContext bears the exec_context interface for Minor. More...

#include <exec_context.hh>

Inheritance diagram for Minor::ExecContext:
ExecContext

Public Member Functions

 ExecContext (MinorCPU &cpu_, SimpleThread &thread_, Execute &execute_, MinorDynInstPtr inst_)
 
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...
 
IntReg readIntRegOperand (const StaticInst *si, int idx) override
 Reads an integer register. More...
 
TheISA::FloatReg readFloatRegOperand (const StaticInst *si, int idx) override
 Reads a floating point register of single register width. More...
 
TheISA::FloatRegBits readFloatRegOperandBits (const StaticInst *si, int idx) override
 Reads a floating point register in its binary format, instead of by value. More...
 
void setIntRegOperand (const StaticInst *si, int idx, IntReg val) override
 Sets an integer register to a value. More...
 
void setFloatRegOperand (const StaticInst *si, int idx, TheISA::FloatReg val) override
 Sets a floating point register of single width to a value. More...
 
void setFloatRegOperandBits (const StaticInst *si, int idx, TheISA::FloatRegBits val) override
 Sets the bits of a floating point register of single width to a binary value. More...
 
bool readPredicate () override
 
void setPredicate (bool val) override
 
TheISA::PCState pcState () const override
 
void pcState (const TheISA::PCState &val) override
 
TheISA::MiscReg readMiscRegNoEffect (int misc_reg) const
 
TheISA::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 TheISA::MiscReg &val) override
 Sets a miscellaneous register, handling any architectural side effects due to writing that register. More...
 
TheISA::MiscReg readMiscRegOperand (const StaticInst *si, int idx) override
 
void setMiscRegOperand (const StaticInst *si, int idx, const TheISA::MiscReg &val) override
 
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...
 
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...
 
unsigned int readStCondFailures () const override
 Returns the number of consecutive store conditional failures. More...
 
void setStCondFailures (unsigned int st_cond_failures) override
 Sets the number of consecutive store conditional failures. More...
 
ContextID contextId ()
 
void demapPage (Addr vaddr, uint64_t asn) override
 Invalidate a page in the DTLB and ITLB. More...
 
TheISA::CCReg readCCRegOperand (const StaticInst *si, int idx) override
 
void setCCRegOperand (const StaticInst *si, int idx, TheISA::CCReg val) override
 
void demapInstPage (Addr vaddr, uint64_t asn)
 
void demapDataPage (Addr vaddr, uint64_t asn)
 
void setEA (Addr ea) override
 Record the effective address of the instruction. More...
 
BaseCPUgetCpuPtr ()
 
Addr getEA () const override
 Get the effective address of the instruction. More...
 
uint64_t readRegOtherThread (int idx, ThreadID tid=InvalidThreadID)
 
void setRegOtherThread (int idx, const TheISA::MiscReg &val, ThreadID tid=InvalidThreadID)
 
void armMonitor (Addr address) override
 
bool mwait (PacketPtr pkt) override
 
void mwaitAtomic (ThreadContext *tc) override
 
AddressMonitor * getAddrMonitor () override
 
- Public Member Functions inherited from ExecContext
virtual Fault readMem (Addr addr, uint8_t *data, unsigned int size, Request::Flags flags)
 Perform an atomic memory read operation. More...
 
virtual void setRegOtherThread (int regIdx, MiscReg val, ThreadID tid=InvalidThreadID)=0
 

Public Attributes

MinorCPUcpu
 
SimpleThreadthread
 ThreadState object, provides all the architectural state. More...
 
Executeexecute
 The execute stage so we can peek at its contents. More...
 
MinorDynInstPtr inst
 Instruction for the benefit of memory operations and for PC. More...
 

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

ExecContext bears the exec_context interface for Minor.

This nicely separates that interface from other classes such as Pipeline, MinorCPU and DynMinorInst and makes it easier to see what state is accessed by it.

Definition at line 74 of file exec_context.hh.

Constructor & Destructor Documentation

Minor::ExecContext::ExecContext ( MinorCPU cpu_,
SimpleThread thread_,
Execute execute_,
MinorDynInstPtr  inst_ 
)
inline

Member Function Documentation

void Minor::ExecContext::armMonitor ( Addr  address)
inlineoverridevirtual

Implements ExecContext.

Definition at line 347 of file exec_context.hh.

References getCpuPtr(), and inst.

ContextID Minor::ExecContext::contextId ( )
inline

Definition at line 258 of file exec_context.hh.

References ThreadState::contextId(), and thread.

void Minor::ExecContext::demapDataPage ( Addr  vaddr,
uint64_t  asn 
)
inline

Definition at line 290 of file exec_context.hh.

References SimpleThread::getDTBPtr(), and thread.

void Minor::ExecContext::demapInstPage ( Addr  vaddr,
uint64_t  asn 
)
inline

Definition at line 284 of file exec_context.hh.

References SimpleThread::getITBPtr(), and thread.

void Minor::ExecContext::demapPage ( Addr  vaddr,
uint64_t  asn 
)
inlineoverridevirtual

Invalidate a page in the DTLB and ITLB.

Implements ExecContext.

Definition at line 263 of file exec_context.hh.

References SimpleThread::getDTBPtr(), SimpleThread::getITBPtr(), and thread.

AddressMonitor* Minor::ExecContext::getAddrMonitor ( )
inlineoverridevirtual

Implements ExecContext.

Definition at line 356 of file exec_context.hh.

References getCpuPtr(), and inst.

BaseCPU* Minor::ExecContext::getCpuPtr ( )
inline

Definition at line 301 of file exec_context.hh.

References cpu.

Referenced by armMonitor(), getAddrMonitor(), mwait(), and mwaitAtomic().

Addr Minor::ExecContext::getEA ( ) const
inlineoverridevirtual

Get the effective address of the instruction.

Note
Only valid for memory ops.

Implements ExecContext.

Definition at line 304 of file exec_context.hh.

References inst.

Fault Minor::ExecContext::hwrei ( )
inlineoverridevirtual

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

Implements ExecContext.

Definition at line 224 of file exec_context.hh.

References SimpleThread::hwrei(), NoFault, and thread.

Fault Minor::ExecContext::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 107 of file exec_context.hh.

References execute, Minor::Execute::getLSQ(), inst, NoFault, and Minor::LSQ::pushRequest().

bool Minor::ExecContext::mwait ( PacketPtr  pkt)
inlineoverridevirtual

Implements ExecContext.

Definition at line 350 of file exec_context.hh.

References getCpuPtr(), and inst.

void Minor::ExecContext::mwaitAtomic ( ThreadContext tc)
inlineoverridevirtual

Implements ExecContext.

Definition at line 353 of file exec_context.hh.

References SimpleThread::dtb, getCpuPtr(), inst, and thread.

TheISA::PCState Minor::ExecContext::pcState ( ) const
inlineoverridevirtual

Implements ExecContext.

Definition at line 179 of file exec_context.hh.

References SimpleThread::pcState(), and thread.

Referenced by ExecContext().

void Minor::ExecContext::pcState ( const TheISA::PCState &  val)
inlineoverridevirtual

Implements ExecContext.

Definition at line 185 of file exec_context.hh.

References SimpleThread::pcState(), and thread.

TheISA::CCReg Minor::ExecContext::readCCRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual
TheISA::FloatReg Minor::ExecContext::readFloatRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual

Reads a floating point register of single register width.

Implements ExecContext.

Definition at line 131 of file exec_context.hh.

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

TheISA::FloatRegBits Minor::ExecContext::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 138 of file exec_context.hh.

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

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

Reads an integer register.

Implements ExecContext.

Definition at line 125 of file exec_context.hh.

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

TheISA::MiscReg Minor::ExecContext::readMiscReg ( int  misc_reg)
inlineoverridevirtual

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

Implements ExecContext.

Definition at line 197 of file exec_context.hh.

References SimpleThread::readMiscReg(), and thread.

TheISA::MiscReg Minor::ExecContext::readMiscRegNoEffect ( int  misc_reg) const
inline

Definition at line 191 of file exec_context.hh.

References SimpleThread::readMiscRegNoEffect(), and thread.

TheISA::MiscReg Minor::ExecContext::readMiscRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual
bool Minor::ExecContext::readPredicate ( )
inlineoverridevirtual
uint64_t Minor::ExecContext::readRegOtherThread ( int  idx,
ThreadID  tid = InvalidThreadID 
)
inlinevirtual
unsigned int Minor::ExecContext::readStCondFailures ( ) const
inlineoverridevirtual

Returns the number of consecutive store conditional failures.

Implements ExecContext.

Definition at line 255 of file exec_context.hh.

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

Record the effective address of the instruction.

Note
Only valid for memory ops.

Implements ExecContext.

Definition at line 296 of file exec_context.hh.

References ArmISA::ea, and inst.

void Minor::ExecContext::setFloatRegOperand ( const StaticInst si,
int  idx,
TheISA::FloatReg  val 
)
inlineoverridevirtual

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

Implements ExecContext.

Definition at line 151 of file exec_context.hh.

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

void Minor::ExecContext::setFloatRegOperandBits ( const StaticInst si,
int  idx,
TheISA::FloatRegBits  val 
)
inlineoverridevirtual

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

Implements ExecContext.

Definition at line 159 of file exec_context.hh.

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

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

Sets an integer register to a value.

Implements ExecContext.

Definition at line 145 of file exec_context.hh.

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

void Minor::ExecContext::setMiscReg ( int  misc_reg,
const TheISA::MiscReg &  val 
)
inlineoverridevirtual

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

Implements ExecContext.

Definition at line 203 of file exec_context.hh.

References SimpleThread::setMiscReg(), and thread.

void Minor::ExecContext::setMiscRegOperand ( const StaticInst si,
int  idx,
const TheISA::MiscReg &  val 
)
inlineoverridevirtual
void Minor::ExecContext::setPredicate ( bool  val)
inlineoverridevirtual

Implements ExecContext.

Definition at line 173 of file exec_context.hh.

References SimpleThread::setPredicate(), and thread.

Referenced by ExecContext().

void Minor::ExecContext::setRegOtherThread ( int  idx,
const TheISA::MiscReg &  val,
ThreadID  tid = InvalidThreadID 
)
inline
void Minor::ExecContext::setStCondFailures ( unsigned int  sc_failures)
inlineoverridevirtual

Sets the number of consecutive store conditional failures.

Implements ExecContext.

Definition at line 256 of file exec_context.hh.

bool Minor::ExecContext::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 234 of file exec_context.hh.

References SimpleThread::simPalCheck(), and thread.

void Minor::ExecContext::syscall ( int64_t  callnum,
Fault fault 
)
inlineoverridevirtual

Executes a syscall specified by the callnum.

Implements ExecContext.

Definition at line 244 of file exec_context.hh.

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

ThreadContext* Minor::ExecContext::tcBase ( )
inlineoverridevirtual

Returns a pointer to the ThreadContext.

Implements ExecContext.

Definition at line 252 of file exec_context.hh.

References SimpleThread::getTC(), and thread.

Fault Minor::ExecContext::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 116 of file exec_context.hh.

References execute, Minor::Execute::getLSQ(), inst, NoFault, and Minor::LSQ::pushRequest().

Member Data Documentation

MinorCPU& Minor::ExecContext::cpu

Definition at line 77 of file exec_context.hh.

Referenced by getCpuPtr(), readRegOtherThread(), and setRegOtherThread().

Execute& Minor::ExecContext::execute

The execute stage so we can peek at its contents.

Definition at line 83 of file exec_context.hh.

Referenced by initiateMemRead(), and writeMem().

MinorDynInstPtr Minor::ExecContext::inst

Instruction for the benefit of memory operations and for PC.

Definition at line 86 of file exec_context.hh.

Referenced by armMonitor(), ExecContext(), getAddrMonitor(), getEA(), initiateMemRead(), mwait(), mwaitAtomic(), setEA(), and writeMem().

SimpleThread& Minor::ExecContext::thread

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

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