gem5  v20.0.0.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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_)
 
 ~ExecContext ()
 
Fault initiateMemRead (Addr addr, unsigned int size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >()) override
 Initiate a timing memory read operation. More...
 
Fault writeMem (uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable=std::vector< bool >()) override
 For atomic-mode contexts, perform an atomic memory write operation. More...
 
Fault initiateMemAMO (Addr addr, unsigned int size, Request::Flags flags, AtomicOpFunctorPtr amo_op) override
 For timing-mode contexts, initiate an atomic AMO (atomic read-modify-write memory operation) More...
 
RegVal readIntRegOperand (const StaticInst *si, int idx) override
 Reads an integer register. More...
 
RegVal readFloatRegOperandBits (const StaticInst *si, int idx) override
 Reads a floating point register in its binary format, instead of by value. More...
 
const TheISA::VecRegContainer & readVecRegOperand (const StaticInst *si, int idx) const override
 Vector Register Interfaces. More...
 
TheISA::VecRegContainer & getWritableVecRegOperand (const StaticInst *si, int idx) override
 Gets destination vector register operand for modification. More...
 
TheISA::VecElem readVecElemOperand (const StaticInst *si, int idx) const override
 Vector Elem Interfaces. More...
 
const TheISA::VecPredRegContainer & readVecPredRegOperand (const StaticInst *si, int idx) const override
 Predicate registers interface. More...
 
TheISA::VecPredRegContainer & getWritableVecPredRegOperand (const StaticInst *si, int idx) override
 Gets destination predicate register operand for modification. More...
 
void setIntRegOperand (const StaticInst *si, int idx, RegVal val) override
 Sets an integer register to a value. More...
 
void setFloatRegOperandBits (const StaticInst *si, int idx, RegVal val) override
 Sets the bits of a floating point register of single width to a binary value. More...
 
void setVecRegOperand (const StaticInst *si, int idx, const TheISA::VecRegContainer &val) override
 
void setVecPredRegOperand (const StaticInst *si, int idx, const TheISA::VecPredRegContainer &val) override
 
void setVecElemOperand (const StaticInst *si, int idx, const TheISA::VecElem val) override
 Sets a vector register to a value. More...
 
bool readPredicate () const override
 
void setPredicate (bool val) override
 
bool readMemAccPredicate () const override
 
void setMemAccPredicate (bool val) override
 
TheISA::PCState pcState () const override
 
void pcState (const TheISA::PCState &val) override
 
RegVal readMiscRegNoEffect (int misc_reg) const
 
RegVal 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, RegVal val) override
 Sets a miscellaneous register, handling any architectural side effects due to writing that register. More...
 
RegVal readMiscRegOperand (const StaticInst *si, int idx) override
 
void setMiscRegOperand (const StaticInst *si, int idx, RegVal val) override
 
void syscall (Fault *fault) override
 Executes a syscall. More...
 
ThreadContexttcBase () const 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...
 
RegVal readCCRegOperand (const StaticInst *si, int idx) override
 
void setCCRegOperand (const StaticInst *si, int idx, RegVal val) override
 
void demapInstPage (Addr vaddr, uint64_t asn)
 
void demapDataPage (Addr vaddr, uint64_t asn)
 
BaseCPUgetCpuPtr ()
 
void armMonitor (Addr address) override
 
bool mwait (PacketPtr pkt) override
 
void mwaitAtomic (ThreadContext *tc) override
 
AddressMonitorgetAddrMonitor () override
 
ConstVecLane8 readVec8BitLaneOperand (const StaticInst *si, int idx) const override
 Vector Register Lane Interfaces. More...
 
ConstVecLane16 readVec16BitLaneOperand (const StaticInst *si, int idx) const override
 Reads source vector 16bit operand. More...
 
ConstVecLane32 readVec32BitLaneOperand (const StaticInst *si, int idx) const override
 Reads source vector 32bit operand. More...
 
ConstVecLane64 readVec64BitLaneOperand (const StaticInst *si, int idx) const override
 Reads source vector 64bit operand. More...
 
template<typename LD >
void setVecLaneOperandT (const StaticInst *si, int idx, const LD &val)
 Write a lane of the destination vector operand. More...
 
virtual void setVecLaneOperand (const StaticInst *si, int idx, const LaneData< LaneSize::Byte > &val) override
 Write a lane of the destination vector operand. More...
 
virtual void setVecLaneOperand (const StaticInst *si, int idx, const LaneData< LaneSize::TwoByte > &val) override
 
virtual void setVecLaneOperand (const StaticInst *si, int idx, const LaneData< LaneSize::FourByte > &val) override
 
virtual void setVecLaneOperand (const StaticInst *si, int idx, const LaneData< LaneSize::EightByte > &val) override
 
- Public Member Functions inherited from ExecContext
virtual void setVecRegOperand (const StaticInst *si, int idx, const VecRegContainer &val)=0
 Sets a destination vector register operand to a value. More...
 
virtual void setVecPredRegOperand (const StaticInst *si, int idx, const VecPredRegContainer &val)=0
 Sets a destination predicate register operand to a value. More...
 
virtual Fault readMem (Addr addr, uint8_t *data, unsigned int size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >())
 Perform an atomic memory read operation. More...
 
virtual Fault amoMem (Addr addr, uint8_t *data, unsigned int size, Request::Flags flags, AtomicOpFunctorPtr amo_op)
 For atomic-mode contexts, perform an atomic AMO (a.k.a., Atomic Read-Modify-Write Memory Operation) More...
 

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::PCState PCState
 
using VecRegContainer = TheISA::VecRegContainer
 
using VecElem = TheISA::VecElem
 
using VecPredRegContainer = TheISA::VecPredRegContainer
 

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 69 of file exec_context.hh.

Constructor & Destructor Documentation

◆ ExecContext()

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

◆ ~ExecContext()

Minor::ExecContext::~ExecContext ( )
inline

Definition at line 99 of file exec_context.hh.

References readMemAccPredicate(), and readPredicate().

Member Function Documentation

◆ armMonitor()

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

Implements ExecContext.

Definition at line 437 of file exec_context.hh.

References BaseCPU::armMonitor(), and getCpuPtr().

◆ contextId()

ContextID Minor::ExecContext::contextId ( )
inline

Definition at line 394 of file exec_context.hh.

References SimpleThread::contextId().

◆ demapDataPage()

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

Definition at line 428 of file exec_context.hh.

References BaseTLB::demapPage(), and SimpleThread::getDTBPtr().

◆ demapInstPage()

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

Definition at line 422 of file exec_context.hh.

References BaseTLB::demapPage(), and SimpleThread::getITBPtr().

◆ demapPage()

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

Invalidate a page in the DTLB and ITLB.

Implements ExecContext.

Definition at line 399 of file exec_context.hh.

References BaseTLB::demapPage(), SimpleThread::getDTBPtr(), and SimpleThread::getITBPtr().

◆ getAddrMonitor()

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

Implements ExecContext.

Definition at line 446 of file exec_context.hh.

References BaseCPU::getCpuAddrMonitor(), and getCpuPtr().

◆ getCpuPtr()

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

Definition at line 433 of file exec_context.hh.

References cpu.

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

◆ getWritableVecPredRegOperand()

TheISA::VecPredRegContainer& Minor::ExecContext::getWritableVecPredRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual

Gets destination predicate register operand for modification.

Implements ExecContext.

Definition at line 185 of file exec_context.hh.

References StaticInst::destRegIdx(), SimpleThread::getWritableVecPredReg(), RegId::isVecPredReg(), and X86ISA::reg.

◆ getWritableVecRegOperand()

TheISA::VecRegContainer& Minor::ExecContext::getWritableVecRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual

Gets destination vector register operand for modification.

Implements ExecContext.

Definition at line 161 of file exec_context.hh.

References StaticInst::destRegIdx(), SimpleThread::getWritableVecReg(), RegId::isVecReg(), and X86ISA::reg.

◆ initiateMemAMO()

Fault Minor::ExecContext::initiateMemAMO ( Addr  addr,
unsigned int  size,
Request::Flags  flags,
AtomicOpFunctorPtr  amo_op 
)
inlineoverridevirtual

For timing-mode contexts, initiate an atomic AMO (atomic read-modify-write memory operation)

Reimplemented from ExecContext.

Definition at line 128 of file exec_context.hh.

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

◆ initiateMemRead()

Fault Minor::ExecContext::initiateMemRead ( Addr  addr,
unsigned int  size,
Request::Flags  flags,
const std::vector< bool > &  byte_enable = std::vector<bool>() 
)
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 106 of file exec_context.hh.

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

◆ mwait()

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

Implements ExecContext.

Definition at line 440 of file exec_context.hh.

References getCpuPtr(), and BaseCPU::mwait().

◆ mwaitAtomic()

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

Implements ExecContext.

Definition at line 443 of file exec_context.hh.

References SimpleThread::dtb, getCpuPtr(), and BaseCPU::mwaitAtomic().

◆ pcState() [1/2]

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

Implements ExecContext.

Definition at line 337 of file exec_context.hh.

References SimpleThread::pcState().

Referenced by ExecContext().

◆ pcState() [2/2]

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

Implements ExecContext.

Definition at line 343 of file exec_context.hh.

References SimpleThread::pcState().

◆ readCCRegOperand()

RegVal Minor::ExecContext::readCCRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual

◆ readFloatRegOperandBits()

RegVal 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 145 of file exec_context.hh.

References RegId::index(), RegId::isFloatReg(), SimpleThread::readFloatReg(), X86ISA::reg, and StaticInst::srcRegIdx().

◆ readIntRegOperand()

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

Reads an integer register.

Implements ExecContext.

Definition at line 137 of file exec_context.hh.

References RegId::index(), RegId::isIntReg(), SimpleThread::readIntReg(), X86ISA::reg, and StaticInst::srcRegIdx().

◆ readMemAccPredicate()

bool Minor::ExecContext::readMemAccPredicate ( ) const
inlineoverridevirtual

◆ readMiscReg()

RegVal 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 355 of file exec_context.hh.

References SimpleThread::readMiscReg().

◆ readMiscRegNoEffect()

RegVal Minor::ExecContext::readMiscRegNoEffect ( int  misc_reg) const
inline

Definition at line 349 of file exec_context.hh.

References SimpleThread::readMiscRegNoEffect().

◆ readMiscRegOperand()

RegVal Minor::ExecContext::readMiscRegOperand ( const StaticInst si,
int  idx 
)
inlineoverridevirtual

◆ readPredicate()

bool Minor::ExecContext::readPredicate ( ) const
inlineoverridevirtual

◆ readStCondFailures()

unsigned int Minor::ExecContext::readStCondFailures ( ) const
inlineoverridevirtual

Returns the number of consecutive store conditional failures.

Implements ExecContext.

Definition at line 391 of file exec_context.hh.

◆ readVec16BitLaneOperand()

ConstVecLane16 Minor::ExecContext::readVec16BitLaneOperand ( const StaticInst si,
int  idx 
) const
inlineoverridevirtual

Reads source vector 16bit operand.

Implements ExecContext.

Definition at line 240 of file exec_context.hh.

References RegId::isVecReg(), SimpleThread::readVec16BitLaneReg(), X86ISA::reg, and StaticInst::srcRegIdx().

◆ readVec32BitLaneOperand()

ConstVecLane32 Minor::ExecContext::readVec32BitLaneOperand ( const StaticInst si,
int  idx 
) const
inlineoverridevirtual

Reads source vector 32bit operand.

Implements ExecContext.

Definition at line 250 of file exec_context.hh.

References RegId::isVecReg(), SimpleThread::readVec32BitLaneReg(), X86ISA::reg, and StaticInst::srcRegIdx().

◆ readVec64BitLaneOperand()

ConstVecLane64 Minor::ExecContext::readVec64BitLaneOperand ( const StaticInst si,
int  idx 
) const
inlineoverridevirtual

Reads source vector 64bit operand.

Implements ExecContext.

Definition at line 260 of file exec_context.hh.

References RegId::isVecReg(), SimpleThread::readVec64BitLaneReg(), X86ISA::reg, and StaticInst::srcRegIdx().

◆ readVec8BitLaneOperand()

ConstVecLane8 Minor::ExecContext::readVec8BitLaneOperand ( const StaticInst si,
int  idx 
) const
inlineoverridevirtual

Vector Register Lane Interfaces.

Reads source vector 8bit operand.

Implements ExecContext.

Definition at line 230 of file exec_context.hh.

References RegId::isVecReg(), SimpleThread::readVec8BitLaneReg(), X86ISA::reg, and StaticInst::srcRegIdx().

◆ readVecElemOperand()

TheISA::VecElem Minor::ExecContext::readVecElemOperand ( const StaticInst si,
int  idx 
) const
inlineoverridevirtual

Vector Elem Interfaces.

Reads an element of a vector register.

Implements ExecContext.

Definition at line 169 of file exec_context.hh.

References RegId::isVecElem(), SimpleThread::readVecElem(), X86ISA::reg, and StaticInst::srcRegIdx().

◆ readVecPredRegOperand()

const TheISA::VecPredRegContainer& Minor::ExecContext::readVecPredRegOperand ( const StaticInst si,
int  idx 
) const
inlineoverridevirtual

Predicate registers interface.

Reads source predicate register operand.

Implements ExecContext.

Definition at line 177 of file exec_context.hh.

References RegId::isVecPredReg(), SimpleThread::readVecPredReg(), X86ISA::reg, and StaticInst::srcRegIdx().

◆ readVecRegOperand()

const TheISA::VecRegContainer& Minor::ExecContext::readVecRegOperand ( const StaticInst si,
int  idx 
) const
inlineoverridevirtual

Vector Register Interfaces.

Reads source vector register operand.

Implements ExecContext.

Definition at line 153 of file exec_context.hh.

References RegId::isVecReg(), SimpleThread::readVecReg(), X86ISA::reg, and StaticInst::srcRegIdx().

◆ setCCRegOperand()

void Minor::ExecContext::setCCRegOperand ( const StaticInst si,
int  idx,
RegVal  val 
)
inlineoverridevirtual

◆ setFloatRegOperandBits()

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

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

Implements ExecContext.

Definition at line 201 of file exec_context.hh.

References StaticInst::destRegIdx(), RegId::index(), RegId::isFloatReg(), X86ISA::reg, SimpleThread::setFloatReg(), and X86ISA::val.

◆ setIntRegOperand()

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

Sets an integer register to a value.

Implements ExecContext.

Definition at line 193 of file exec_context.hh.

References StaticInst::destRegIdx(), RegId::index(), RegId::isIntReg(), X86ISA::reg, SimpleThread::setIntReg(), and X86ISA::val.

◆ setMemAccPredicate()

void Minor::ExecContext::setMemAccPredicate ( bool  val)
inlineoverridevirtual

◆ setMiscReg()

void Minor::ExecContext::setMiscReg ( int  misc_reg,
RegVal  val 
)
inlineoverridevirtual

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

Implements ExecContext.

Definition at line 361 of file exec_context.hh.

References SimpleThread::setMiscReg().

◆ setMiscRegOperand()

void Minor::ExecContext::setMiscRegOperand ( const StaticInst si,
int  idx,
RegVal  val 
)
inlineoverridevirtual

◆ setPredicate()

void Minor::ExecContext::setPredicate ( bool  val)
inlineoverridevirtual

Implements ExecContext.

Definition at line 319 of file exec_context.hh.

References SimpleThread::setPredicate().

Referenced by ExecContext().

◆ setStCondFailures()

void Minor::ExecContext::setStCondFailures ( unsigned int  sc_failures)
inlineoverridevirtual

Sets the number of consecutive store conditional failures.

Implements ExecContext.

Definition at line 392 of file exec_context.hh.

◆ setVecElemOperand()

void Minor::ExecContext::setVecElemOperand ( const StaticInst si,
int  idx,
const TheISA::VecElem  val 
)
inlineoverridevirtual

Sets a vector register to a value.

Implements ExecContext.

Definition at line 304 of file exec_context.hh.

References StaticInst::destRegIdx(), RegId::isVecElem(), X86ISA::reg, and SimpleThread::setVecElem().

◆ setVecLaneOperand() [1/4]

virtual void Minor::ExecContext::setVecLaneOperand ( const StaticInst si,
int  idx,
const LaneData< LaneSize::Byte > &  val 
)
inlineoverridevirtual

Write a lane of the destination vector operand.

Implements ExecContext.

Definition at line 278 of file exec_context.hh.

References setVecLaneOperandT().

◆ setVecLaneOperand() [2/4]

virtual void Minor::ExecContext::setVecLaneOperand ( const StaticInst si,
int  idx,
const LaneData< LaneSize::TwoByte > &  val 
)
inlineoverridevirtual

Implements ExecContext.

Definition at line 284 of file exec_context.hh.

References setVecLaneOperandT().

◆ setVecLaneOperand() [3/4]

virtual void Minor::ExecContext::setVecLaneOperand ( const StaticInst si,
int  idx,
const LaneData< LaneSize::FourByte > &  val 
)
inlineoverridevirtual

Implements ExecContext.

Definition at line 290 of file exec_context.hh.

References setVecLaneOperandT().

◆ setVecLaneOperand() [4/4]

virtual void Minor::ExecContext::setVecLaneOperand ( const StaticInst si,
int  idx,
const LaneData< LaneSize::EightByte > &  val 
)
inlineoverridevirtual

Implements ExecContext.

Definition at line 296 of file exec_context.hh.

References setVecLaneOperandT().

◆ setVecLaneOperandT()

template<typename LD >
void Minor::ExecContext::setVecLaneOperandT ( const StaticInst si,
int  idx,
const LD &  val 
)
inline

Write a lane of the destination vector operand.

Definition at line 271 of file exec_context.hh.

References StaticInst::destRegIdx(), RegId::isVecReg(), X86ISA::reg, and SimpleThread::setVecLane().

Referenced by setVecLaneOperand().

◆ setVecPredRegOperand()

void Minor::ExecContext::setVecPredRegOperand ( const StaticInst si,
int  idx,
const TheISA::VecPredRegContainer &  val 
)
inlineoverride

◆ setVecRegOperand()

void Minor::ExecContext::setVecRegOperand ( const StaticInst si,
int  idx,
const TheISA::VecRegContainer &  val 
)
inlineoverride

◆ syscall()

void Minor::ExecContext::syscall ( Fault fault)
inlineoverridevirtual

Executes a syscall.

Implements ExecContext.

Definition at line 383 of file exec_context.hh.

References SimpleThread::syscall().

◆ tcBase()

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

Returns a pointer to the ThreadContext.

Implements ExecContext.

Definition at line 388 of file exec_context.hh.

References SimpleThread::getTC().

◆ writeMem()

Fault Minor::ExecContext::writeMem ( uint8_t *  data,
unsigned int  size,
Addr  addr,
Request::Flags  flags,
uint64_t *  res,
const std::vector< bool > &  byte_enable = std::vector< bool >() 
)
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 117 of file exec_context.hh.

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

Member Data Documentation

◆ cpu

MinorCPU& Minor::ExecContext::cpu

Definition at line 72 of file exec_context.hh.

Referenced by getCpuPtr().

◆ execute

Execute& Minor::ExecContext::execute

The execute stage so we can peek at its contents.

Definition at line 78 of file exec_context.hh.

◆ inst

MinorDynInstPtr Minor::ExecContext::inst

Instruction for the benefit of memory operations and for PC.

Definition at line 81 of file exec_context.hh.

◆ thread

SimpleThread& Minor::ExecContext::thread

ThreadState object, provides all the architectural state.

Definition at line 75 of file exec_context.hh.


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

Generated on Mon Jun 8 2020 15:45:58 for gem5 by doxygen 1.8.13