Go to the documentation of this file.
41 #ifndef __CPU_SIMPLE_EXEC_CONTEXT_HH__
42 #define __CPU_SIMPLE_EXEC_CONTEXT_HH__
44 #include "arch/vecregs.hh"
46 #include "config/the_isa.hh"
90 thread->threadId()).c_str()),
92 "Number of instructions committed"),
94 "Number of ops (including micro ops) committed"),
96 "Number of integer alu accesses"),
98 "Number of float alu accesses"),
100 "Number of vector alu accesses"),
102 "Number of times a function call or return occured"),
104 "Number of instructions that are conditional controls"),
106 "Number of integer instructions"),
108 "Number of float instructions"),
110 "Number of vector instructions"),
112 "Number of times the integer registers were read"),
114 "Number of times the integer registers were written"),
116 "Number of times the floating registers were read"),
118 "Number of times the floating registers were written"),
120 "Number of times the vector registers were read"),
122 "Number of times the vector registers were written"),
124 "Number of times the predicate registers were read"),
126 "Number of times the predicate registers were written"),
128 "Number of times the CC registers were read"),
130 "Number of times the CC registers were written"),
132 "Number of times the Misc registers were read"),
134 "Number of times the Misc registers were written"),
136 "Number of memory refs"),
138 "Number of load instructions"),
140 "Number of store instructions"),
142 "Number of idle cycles"),
144 "Number of busy cycles"),
146 "Percentage of non-idle cycles"),
148 "Percentage of idle cycles"),
150 "ICache total stall cycles"),
152 "DCache total stall cycles"),
154 "Number of branches fetched"),
156 "Number of branches predicted as taken"),
158 "Number of branch mispredictions"),
160 "Class of executed instruction.")
175 .
init(enums::Num_OpClass)
488 assert(byte_enable.size() == size);
498 assert(byte_enable.size() == size);
508 assert(byte_enable.size() == size);
641 #endif // __CPU_EXEC_CONTEXT_HH__
This is a simple scalar statistic, like a counter.
virtual Fault initiateMemAMO(Addr addr, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op)
RegVal readMiscReg(RegIndex misc_reg) override
void setMiscReg(int misc_reg, RegVal val) override
Sets a miscellaneous register, handling any architectural side effects due to writing that register.
RegVal readIntReg(RegIndex reg_idx) const override
TheISA::VecPredRegContainer & getWritableVecPredRegOperand(const StaticInst *si, int idx) override
Gets destination predicate register operand for modification.
statistics::Scalar numMiscRegReads
statistics::Scalar numIntRegWrites
int64_t htmTransactionStops
void setCCRegOperand(const StaticInst *si, int idx, RegVal val) override
void setIntReg(RegIndex reg_idx, RegVal val) override
VecPredReg::Container VecPredRegContainer
const TheISA::VecRegContainer & readVecReg(const RegId ®) const override
ExecContextStats(BaseSimpleCPU *cpu, SimpleThread *thread)
Trace::InstRecord * traceData
bool readMemAccPredicate() const override
@ VecElemClass
Vector Register Native Elem lane.
statistics::Scalar icacheStallCycles
RegVal readFloatRegOperandBits(const StaticInst *si, int idx) override
Reads a floating point register in its binary format, instead of by value.
statistics::Scalar numCallsReturns
@ CCRegClass
Condition-code register.
statistics::Scalar numVecPredRegWrites
const TheISA::VecRegContainer & readVecRegOperand(const StaticInst *si, int idx) const override
Reads a vector register.
statistics::Scalar numVecRegReads
const FlagsType nozero
Don't print if this is zero.
virtual Fault amoMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op)
void setMiscReg(RegIndex misc_reg, RegVal val) override
gem5::SimpleExecContext::ExecContextStats execContextStats
void setStCondFailures(unsigned sc_failures) override
uint64_t newHtmTransactionUid() const override
RegVal readMiscReg(int misc_reg) override
Reads a miscellaneous register, handling any architectural side effects due to reading that register.
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.
A stat that calculates the per tick average of a value.
RegVal readCCRegOperand(const StaticInst *si, int idx) override
unsigned int readStCondFailures() const override
Returns the number of consecutive store conditional failures.
A vector of scalar stats.
void setVecReg(const RegId ®, const TheISA::VecRegContainer &val) override
RegVal readCCReg(RegIndex reg_idx) const override
std::string csprintf(const char *format, const Args &...args)
void setPredicate(bool val)
int64_t htmTransactionStarts
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
statistics::Scalar numPredictedBranches
Number of branches predicted as taken.
statistics::Scalar numVecInsts
uint64_t getHtmTransactionalDepth() const override
void setVecPredReg(const RegId ®, const TheISA::VecPredRegContainer &val) override
const FlagsType dist
Print the distribution.
void setPredicate(bool val) override
const PCStateBase & pcState() const override
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)
const FlagsType pdf
Print the percent of the total that this entry represents.
unsigned readStCondFailures() const override
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 >())
@ FloatRegClass
Floating-point register.
statistics::Scalar numMiscRegWrites
bool mwait(PacketPtr pkt) override
statistics::Scalar numCCRegReads
void setStCondFailures(unsigned int sc_failures) override
Sets the number of consecutive store conditional failures.
void setIntRegOperand(const StaticInst *si, int idx, RegVal val) override
Sets an integer register to a value.
bool readMemAccPredicate()
statistics::Formula numIdleCycles
Fault initiateHtmCmd(Request::Flags flags) override
Initiate an HTM command, e.g.
virtual Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >())
void demapPage(Addr vaddr, uint64_t asn) override
Invalidate a page in the DTLB and ITLB.
void setVecElemOperand(const StaticInst *si, int idx, RegVal val) override
Sets an element of a vector register to a value.
Base, ISA-independent static instruction class.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
statistics::Scalar numInsts
std::shared_ptr< FaultBase > Fault
bool readPredicate() const
bool inHtmTransactionalState() const override
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
statistics::Scalar numFpRegReads
void mwaitAtomic(ThreadContext *tc) override
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
statistics::Scalar numCCRegWrites
statistics::Scalar numCondCtrlInsts
bool readPredicate() const override
void setMemAccPredicate(bool val)
statistics::Average notIdleFraction
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.
RegVal readVecElemOperand(const StaticInst *si, int idx) const override
Reads an element of a vector register.
TheISA::VecRegContainer & getWritableVecRegOperand(const StaticInst *si, int idx) override
Reads a vector register for modification.
statistics::Vector statExecutedInstType
int threadId() const override
statistics::Formula numBusyCycles
statistics::Scalar dcacheStallCycles
gem5::VecRegContainer< NumVecElemPerVecReg *sizeof(VecElem)> VecRegContainer
Counter numInst
PER-THREAD STATS.
virtual BaseHTMCheckpointPtr & getHtmCheckpointPtr()=0
RegVal readIntRegOperand(const StaticInst *si, int idx) override
Reads an integer register.
const PCStateBase & pcState() const override
RegVal readVecElem(const RegId ®) const override
void setVecPredRegOperand(const StaticInst *si, int idx, const TheISA::VecPredRegContainer &val) override
Sets a destination predicate register operand to a value.
const TheISA::VecPredRegContainer & readVecPredRegOperand(const StaticInst *si, int idx) const override
Predicate registers interface.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void setFloatReg(RegIndex reg_idx, RegVal val) override
statistics::Formula idleFraction
statistics::Scalar numFpInsts
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.
RegVal readFloatReg(RegIndex reg_idx) const override
void pcState(const PCStateBase &val) override
statistics::Scalar numVecAluAccesses
void setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
statistics::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.
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
TheISA::VecPredRegContainer & getWritableVecPredReg(const RegId ®) override
statistics::Scalar numLoadInsts
@ IntRegClass
Integer register.
TheISA::VecRegContainer & getWritableVecReg(const RegId ®) override
const TheISA::VecPredRegContainer & readVecPredReg(const RegId ®) const override
statistics::Scalar numIntInsts
statistics::Scalar numIntAluAccesses
void setMemAccPredicate(bool val) override
@ MiscRegClass
Control (misc) register.
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
virtual Fault initiateMemRead(Addr addr, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >())
void setVecElem(const RegId ®, RegVal val) override
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)
void demapPage(Addr vaddr, uint64_t asn)
AddressMonitor * getAddrMonitor() override
double Counter
All counters are of 64-bit values.
ThreadContext * tcBase() const override
Returns a pointer to the ThreadContext.
statistics::Scalar numFpAluAccesses
RegVal readMiscRegOperand(const StaticInst *si, int idx) override
statistics::Scalar numVecRegWrites
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
statistics::Scalar numIntRegReads
statistics::Scalar numBranches
statistics::Scalar numOps
statistics::Scalar numFpRegWrites
static const OpClass Num_OpClasses
void armMonitor(Addr address) override
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
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.
@ VecRegClass
Vector Register.
statistics::Scalar numBranchMispred
Number of misprediced branches.
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
const FlagsType total
Print the total.
std::unique_ptr< PCStateBase > predPC
Derived & init(size_type size)
Set this vector to have the given size.
uint64_t getHtmTransactionUid() const override
statistics::Scalar numVecPredRegReads
void setVecRegOperand(const StaticInst *si, int idx, const TheISA::VecRegContainer &val) override
Sets a vector register to a value.
virtual Fault initiateHtmCmd(Request::Flags flags)=0
Hardware transactional memory commands (HtmCmds), e.g.
void setPredicate(bool val)
statistics::Scalar numMemRefs
SimpleExecContext(BaseSimpleCPU *_cpu, SimpleThread *_thread)
Constructor.
void setCCReg(RegIndex reg_idx, RegVal val) override
Register ID: describe an architectural register with its class and index.
Generated on Tue Feb 8 2022 11:47:02 for gem5 by doxygen 1.8.17