Go to the documentation of this file.
41 #ifndef __CPU_SIMPLE_EXEC_CONTEXT_HH__
42 #define __CPU_SIMPLE_EXEC_CONTEXT_HH__
44 #include "arch/registers.hh"
46 #include "config/the_isa.hh"
87 thread->threadId()).c_str()),
89 "Number of instructions committed"),
91 "Number of ops (including micro ops) committed"),
93 "Number of integer alu accesses"),
95 "Number of float alu accesses"),
97 "Number of vector alu accesses"),
99 "Number of times a function call or return occured"),
101 "Number of instructions that are conditional controls"),
103 "Number of integer instructions"),
106 "Number of vector instructions"),
108 "Number of times the integer registers were read"),
110 "Number of times the integer registers were written"),
112 "Number of times the floating registers were read"),
114 "Number of times the floating registers were written"),
116 "Number of times the vector registers were read"),
118 "Number of times the vector registers were written"),
120 "Number of times the predicate registers were read"),
122 "Number of times the predicate registers were written"),
124 "Number of times the CC registers were read"),
126 "Number of times the CC registers were written"),
129 "Number of load instructions"),
131 "Number of store instructions"),
135 "Percentage of non-idle cycles"),
138 "ICache total stall cycles"),
140 "DCache total stall cycles"),
143 "Number of branches predicted as taken"),
145 "Number of branch mispredictions"),
147 "Class of executed instruction.")
162 .
init(Enums::Num_OpClass)
280 assert(
reg.isIntReg());
290 assert(
reg.isIntReg());
301 assert(
reg.isFloatReg());
312 assert(
reg.isFloatReg());
322 assert(
reg.isVecReg());
332 assert(
reg.isVecReg());
343 assert(
reg.isVecReg());
350 template <
typename VE>
356 assert(
reg.isVecReg());
363 {
return readVecLaneOperand<uint8_t>(
si, idx); }
369 {
return readVecLaneOperand<uint16_t>(
si, idx); }
375 {
return readVecLaneOperand<uint32_t>(
si, idx); }
381 {
return readVecLaneOperand<uint64_t>(
si, idx); }
384 template <
typename LD>
391 assert(
reg.isVecReg());
422 assert(
reg.isVecElem());
433 assert(
reg.isVecElem());
442 assert(
reg.isVecPredReg());
451 assert(
reg.isVecPredReg());
461 assert(
reg.isVecPredReg());
470 assert(
reg.isCCReg());
479 assert(
reg.isCCReg());
488 assert(
reg.isMiscReg());
497 assert(
reg.isMiscReg());
541 assert(byte_enable.size() == size);
551 assert(byte_enable.size() == size);
561 assert(byte_enable.size() == size);
692 #endif // __CPU_EXEC_CONTEXT_HH__
static const OpClass Num_OpClasses
RegVal readIntRegOperand(const StaticInst *si, int idx) override
Reads an integer register.
void setMiscReg(int misc_reg, RegVal val) override
Sets a miscellaneous register, handling any architectural side effects due to writing that register.
bool mwait(ThreadID tid, PacketPtr pkt)
Stats::Scalar numVecPredRegWrites
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
void setVecReg(const RegId ®, const TheISA::VecRegContainer &val) override
void armMonitor(Addr address) override
void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseMMU *mmu)
Stats::Formula numBusyCycles
void setVecElemOperand(const StaticInst *si, int idx, const TheISA::VecElem val) override
Sets an element of a vector register to a value.
Stats::Scalar numIntAluAccesses
TheISA::VecPredRegContainer & getWritableVecPredReg(const RegId ®) override
TheISA::PCState pcState() const override
Trace::InstRecord * traceData
void setMemAccPredicate(bool val)
bool readPredicate() const override
TheISA::VecElem readVecElemOperand(const StaticInst *si, int idx) const override
Reads an element of a vector register.
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::FourByte > &val) override
Write a lane of the destination vector operand.
virtual ConstVecLane64 readVec64BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 64bit operand.
Fault readMem(Addr addr, uint8_t *data, unsigned int size, Request::Flags flags, const std::vector< bool > &byte_enable) override
Perform an atomic memory read operation.
VecReg::Container VecRegContainer
Fault initiateHtmCmd(Request::Flags flags) override
Initiate an HTM command, e.g.
unsigned int readStCondFailures() const override
Returns the number of consecutive store conditional failures.
void setStCondFailures(unsigned int sc_failures) override
Sets the number of consecutive store conditional failures.
Base, ISA-independent static instruction class.
VecLaneT< VE, true > readVecLaneOperand(const StaticInst *si, int idx) const
Vector Register Lane Interfaces.
Stats::Scalar numVecAluAccesses
void setVecPredRegOperand(const StaticInst *si, int idx, const TheISA::VecPredRegContainer &val) override
Sets a destination predicate register operand to a value.
Stats::Scalar numIntRegReads
ExecContextStats(BaseSimpleCPU *cpu, SimpleThread *thread)
virtual ConstVecLane16 readVec16BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 16bit operand.
Stats::Scalar numBranches
void setPredicate(bool val)
void armMonitor(ThreadID tid, Addr address)
VecPredReg::Container VecPredRegContainer
virtual Fault initiateHtmCmd(Request::Flags flags)=0
Hardware transactional memory commands (HtmCmds), e.g.
void setIntReg(RegIndex reg_idx, RegVal val) override
Stats::Scalar numCondCtrlInsts
void setCCReg(RegIndex reg_idx, RegVal val) override
TheISA::PCState pcState() const override
BaseCPU::BaseCPUStats baseStats
void setVecLaneOperandT(const StaticInst *si, int idx, const LD &val)
Write a lane of the destination vector operand.
const TheISA::VecPredRegContainer & readVecPredReg(const RegId ®) const override
Stats::Scalar icacheStallCycles
RegVal readCCReg(RegIndex reg_idx) const override
A vector of scalar stats.
void pcState(const TheISA::PCState &val) override
void setMemAccPredicate(bool val) override
TheISA::VecPredRegContainer & getWritableVecPredRegOperand(const StaticInst *si, int idx) override
Gets destination predicate register operand for modification.
TheISA::VecRegContainer & getWritableVecRegOperand(const StaticInst *si, int idx) override
Reads a vector register for modification.
Stats::Scalar numFpRegWrites
unsigned readStCondFailures() const override
Register ID: describe an architectural register with its class and index.
TheISA::VecRegContainer & getWritableVecReg(const RegId ®) override
void setPredicate(bool val) override
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
void setMiscReg(RegIndex misc_reg, RegVal val) override
Stats::Scalar numIntInsts
void mwaitAtomic(ThreadContext *tc) override
This is a simple scalar statistic, like a counter.
void demapPage(Addr vaddr, uint64_t asn)
Fault amoMem(Addr addr, uint8_t *data, unsigned int size, Request::Flags flags, AtomicOpFunctorPtr amo_op) override
For atomic-mode contexts, perform an atomic AMO (a.k.a., Atomic Read-Modify-Write Memory Operation)
int64_t Counter
Statistics counter type.
Stats::Scalar numCCRegReads
Stats::Scalar numVecPredRegReads
Stats::Average notIdleFraction
int64_t htmTransactionStops
ThreadContext is the external interface to all thread state for anything outside of the CPU.
SimpleExecContext::ExecContextStats execContextStats
AddressMonitor * getAddrMonitor() override
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
Vector Lane abstraction Another view of a container.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
virtual Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >())
Fault writeMem(uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable) override
For atomic-mode contexts, perform an atomic memory write operation.
void setStCondFailures(unsigned sc_failures) override
std::shared_ptr< FaultBase > Fault
virtual ConstVecLane32 readVec32BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 32bit operand.
void setVecElem(const RegId ®, const TheISA::VecElem &val) override
Stats::Scalar numFpRegReads
RegVal readMiscReg(RegIndex misc_reg) override
bool readMemAccPredicate() const override
void demapPage(Addr vaddr, uint64_t asn) override
Invalidate a page in the DTLB and ITLB.
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
virtual Fault amoMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op)
virtual ConstVecLane8 readVec8BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 8bit operand.
void setVecPredReg(const RegId ®, const TheISA::VecPredRegContainer &val) override
Stats::Scalar numPredictedBranches
Number of branches predicted as taken.
virtual Fault initiateMemAMO(Addr addr, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op)
virtual Fault initiateMemRead(Addr addr, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >())
VecLaneT< T, true > readVecLane(const RegId ®) const
Vector Register Lane Interfaces.
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
RegVal readMiscRegOperand(const StaticInst *si, int idx) override
bool readMemAccPredicate()
Stats::Scalar numCallsReturns
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)
RegVal readIntReg(RegIndex reg_idx) const override
uint64_t getHtmTransactionalDepth() const override
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
RegVal readFloatReg(RegIndex reg_idx) const override
Stats::Scalar numCCRegWrites
const FlagsType dist
Print the distribution.
Derived & init(size_type size)
Set this vector to have the given size.
void setFloatReg(RegIndex reg_idx, RegVal val) override
bool mwait(PacketPtr pkt) override
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::TwoByte > &val) override
Write a lane of the destination vector operand.
const FlagsType nozero
Don't print if this is zero.
Stats::Scalar numVecRegWrites
Stats::Scalar numVecRegReads
A stat that calculates the per tick average of a value.
Stats::Scalar numLoadInsts
RegVal readMiscReg(int misc_reg) override
Reads a miscellaneous register, handling any architectural side effects due to reading that register.
const TheISA::VecPredRegContainer & readVecPredRegOperand(const StaticInst *si, int idx) const override
Predicate registers interface.
Counter numInst
PER-THREAD STATS.
uint64_t newHtmTransactionUid() const override
int64_t htmTransactionStarts
Stats::Scalar numFpAluAccesses
GenericISA::DelaySlotPCState< MachInst > PCState
void setIntRegOperand(const StaticInst *si, int idx, RegVal val) override
Sets an integer register to a value.
const TheISA::VecRegContainer & readVecReg(const RegId ®) const override
const FlagsType pdf
Print the percent of the total that this entry represents.
virtual Fault writeMem(uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable=std::vector< bool >())
Stats::Formula idleFraction
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setCCRegOperand(const StaticInst *si, int idx, RegVal val) override
int threadId() const override
#define UNIT_CYCLE
Convenience macros to declare the unit of a stat.
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation.
RegVal readFloatRegOperandBits(const StaticInst *si, int idx) override
Reads a floating point register in its binary format, instead of by value.
void setPredicate(bool val)
void setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
Stats::Scalar numStoreInsts
Fault initiateMemRead(Addr addr, unsigned int size, Request::Flags flags, const std::vector< bool > &byte_enable) override
Initiate a timing memory read operation.
void setVecRegOperand(const StaticInst *si, int idx, const TheISA::VecRegContainer &val) override
Sets a vector register to a value.
virtual void setVecLane(const RegId ®, const LaneData< LaneSize::Byte > &val) override
Write a lane of the destination vector register.
Stats::Vector statExecutedInstType
virtual BaseHTMCheckpointPtr & getHtmCheckpointPtr()=0
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::EightByte > &val) override
Write a lane of the destination vector operand.
Stats::Scalar numVecInsts
const FlagsType total
Print the total.
bool inHtmTransactionalState() const override
uint64_t getHtmTransactionUid() const override
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::Byte > &val) override
Write a lane of the destination vector operand.
Stats::Formula numIdleCycles
const TheISA::VecElem & readVecElem(const RegId ®) const override
std::string csprintf(const char *format, const Args &...args)
Stats::Scalar dcacheStallCycles
Stats::Scalar numBranchMispred
Number of misprediced branches.
LaneSize is an abstraction of a LS byte value for the execution and thread contexts to handle values ...
RegVal readCCRegOperand(const StaticInst *si, int idx) override
const TheISA::VecRegContainer & readVecRegOperand(const StaticInst *si, int idx) const override
Reads a vector register.
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.
bool readPredicate() const
ThreadContext * tcBase() const override
Returns a pointer to the ThreadContext.
Stats::Scalar numIntRegWrites
SimpleExecContext(BaseSimpleCPU *_cpu, SimpleThread *_thread)
Constructor.
Generated on Tue Jun 22 2021 15:28:26 for gem5 by doxygen 1.8.17