41#ifndef __CPU_SIMPLE_EXEC_CONTEXT_HH__
42#define __CPU_SIMPLE_EXEC_CONTEXT_HH__
90 "Number of matrix alu accesses"),
92 "Number of matrix instructions"),
94 "Number of idle cycles"),
96 "Number of busy cycles"),
98 "Percentage of non-idle cycles"),
100 "Percentage of idle cycles"),
102 "Number of branches predicted as taken"),
104 "Number of branch mispredictions"),
106 &(
cpu->executeStats[
thread->threadId()]->numIntRegReads),
107 &(
cpu->executeStats[
thread->threadId()]->numFpRegReads),
108 &(
cpu->executeStats[
thread->threadId()]->numVecRegReads),
109 &(
cpu->executeStats[
thread->threadId()]->numVecRegReads),
110 &(
cpu->executeStats[
thread->threadId()]->numVecPredRegReads),
112 &(
cpu->executeStats[
thread->threadId()]->numCCRegReads)},
114 &(
cpu->executeStats[
thread->threadId()]->numIntRegWrites),
115 &(
cpu->executeStats[
thread->threadId()]->numFpRegWrites),
116 &(
cpu->executeStats[
thread->threadId()]->numVecRegWrites),
117 &(
cpu->executeStats[
thread->threadId()]->numVecRegWrites),
119 ->numVecPredRegWrites),
121 &(
cpu->executeStats[
thread->threadId()]->numCCRegWrites)}
171 "Number of insts issued per FU, per thread")
244 cpu->executeStats[
thread->threadId()]->numMiscRegReads++;
253 cpu->executeStats[
thread->threadId()]->numMiscRegWrites++;
266 cpu->executeStats[
thread->threadId()]->numMiscRegReads++;
277 cpu->executeStats[
thread->threadId()]->numMiscRegWrites++;
299 assert(byte_enable.size() == size);
300 return cpu->readMem(
addr,
data, size, flags, byte_enable);
309 assert(byte_enable.size() == size);
310 return cpu->initiateMemRead(
addr, size, flags, byte_enable);
319 assert(byte_enable.size() == size);
328 return cpu->amoMem(
addr,
data, size, flags, std::move(amo_op));
336 return cpu->initiateMemAMO(
addr, size, flags, std::move(amo_op));
342 return cpu->initiateMemMgmtCmd(flags);
351 thread->setStCondFailures(sc_failures);
360 return thread->readStCondFailures();
369 return thread->readPredicate();
377 if (
cpu->traceData) {
378 cpu->traceData->setPredicate(
val);
385 return thread->readMemAccPredicate();
415 assert(
thread->htmTransactionStarts >=
thread->htmTransactionStops);
416 return (
thread->htmTransactionStarts -
thread->htmTransactionStops);
431 cpu->armMonitor(
thread->threadId(), address);
437 return cpu->mwait(
thread->threadId(), pkt);
449 return cpu->getCpuAddrMonitor(
thread->threadId());
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
Register ID: describe an architectural register with its class and index.
gem5::Flags< FlagsType > Flags
Fault initiateMemRead(Addr addr, unsigned int size, Request::Flags flags, const std::vector< bool > &byte_enable) override
Initiate a timing memory read operation.
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.
void setStCondFailures(unsigned int sc_failures) override
Sets the number of consecutive store conditional failures.
unsigned int readStCondFailures() const override
Returns the number of consecutive store conditional failures.
bool readPredicate() const override
uint64_t getHtmTransactionalDepth() const override
void demapPage(Addr vaddr, uint64_t asn) override
Invalidate a page in the DTLB and ITLB.
void mwaitAtomic(ThreadContext *tc) override
Counter numInst
PER-THREAD STATS.
AddressMonitor * getAddrMonitor() override
void setMemAccPredicate(bool val) override
void getRegOperand(const StaticInst *si, int idx, void *val) override
void setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
RegVal getRegOperand(const StaticInst *si, int idx) override
RegVal readMiscReg(int misc_reg) override
Reads a miscellaneous register, handling any architectural side effects due to reading that register.
void setPredicate(bool val) override
SimpleExecContext(BaseSimpleCPU *_cpu, SimpleThread *_thread)
Constructor.
void setRegOperand(const StaticInst *si, int idx, RegVal val) override
std::unique_ptr< PCStateBase > predPC
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)
bool readMemAccPredicate() const override
uint64_t newHtmTransactionUid() const override
void setRegOperand(const StaticInst *si, int idx, const void *val) override
bool inHtmTransactionalState() const override
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.
bool mwait(PacketPtr pkt) override
void setMiscReg(int misc_reg, RegVal val) override
Sets a miscellaneous register, handling any architectural side effects due to writing that register.
Fault initiateMemMgmtCmd(Request::Flags flags) override
Initiate a memory management command with no valid address.
void pcState(const PCStateBase &val) override
gem5::SimpleExecContext::ExecContextStats execContextStats
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)
RegVal readMiscRegOperand(const StaticInst *si, int idx) override
uint64_t getHtmTransactionUid() const override
const PCStateBase & pcState() const override
gem5::SimpleExecContext::IssueStats issueStats
ThreadContext * tcBase() const override
Returns a pointer to the ThreadContext.
void armMonitor(Addr address) override
void * getWritableRegOperand(const StaticInst *si, int idx) override
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
Base, ISA-independent static instruction class.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual BaseHTMCheckpointPtr & getHtmCheckpointPtr()=0
A stat that calculates the per tick average of a value.
This is a simple scalar statistic, like a counter.
A 2-Dimensional vecto of scalar stats.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
const FlagsType pdf
Print the percent of the total that this entry represents.
const FlagsType total
Print the total.
double Counter
All counters are of 64-bit values.
const FlagsType dist
Print the distribution.
Copyright (c) 2024 Arm Limited All rights reserved.
std::shared_ptr< FaultBase > Fault
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::string csprintf(const char *format, const Args &...args)
@ MiscRegClass
Control (misc) register.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
statistics::Formula idleFraction
statistics::Scalar numMatInsts
statistics::Scalar numMatAluAccesses
statistics::Formula numBusyCycles
statistics::Scalar numMatRegReads
std::array< statistics::Scalar *, CCRegClass+1 > numRegReads
statistics::Scalar numBranchMispred
Number of misprediced branches.
statistics::Formula numIdleCycles
statistics::Scalar numPredictedBranches
statistics::Scalar numMatRegWrites
std::array< statistics::Scalar *, CCRegClass+1 > numRegWrites
ExecContextStats(BaseSimpleCPU *cpu, SimpleThread *thread)
statistics::Average notIdleFraction
IssueStats(BaseSimpleCPU *cpu)
statistics::Vector2d issuedInstType