41#ifndef __CPU_SIMPLE_EXEC_CONTEXT_HH__
42#define __CPU_SIMPLE_EXEC_CONTEXT_HH__
88 thread->threadId()).c_str()),
90 "Number of matrix alu accesses"),
92 "Number of times a function call or return occured"),
94 "Number of matrix instructions"),
96 "Number of idle cycles"),
98 "Number of busy cycles"),
100 "Percentage of non-idle cycles"),
102 "Percentage of idle cycles"),
104 "Number of branches predicted as taken"),
106 "Number of branch mispredictions"),
108 &(
cpu->executeStats[
thread->threadId()]->numIntRegReads),
109 &(
cpu->executeStats[
thread->threadId()]->numFpRegReads),
110 &(
cpu->executeStats[
thread->threadId()]->numVecRegReads),
111 &(
cpu->executeStats[
thread->threadId()]->numVecRegReads),
112 &(
cpu->executeStats[
thread->threadId()]->numVecPredRegReads),
113 &(
cpu->executeStats[
thread->threadId()]->numCCRegReads),
117 &(
cpu->executeStats[
thread->threadId()]->numIntRegWrites),
118 &(
cpu->executeStats[
thread->threadId()]->numFpRegWrites),
119 &(
cpu->executeStats[
thread->threadId()]->numVecRegWrites),
120 &(
cpu->executeStats[
thread->threadId()]->numVecRegWrites),
122 ->numVecPredRegWrites),
123 &(
cpu->executeStats[
thread->threadId()]->numCCRegWrites),
228 cpu->executeStats[
thread->threadId()]->numMiscRegReads++;
237 cpu->executeStats[
thread->threadId()]->numMiscRegWrites++;
250 cpu->executeStats[
thread->threadId()]->numMiscRegReads++;
261 cpu->executeStats[
thread->threadId()]->numMiscRegWrites++;
283 assert(byte_enable.size() == size);
284 return cpu->readMem(
addr,
data, size, flags, byte_enable);
293 assert(byte_enable.size() == size);
294 return cpu->initiateMemRead(
addr, size, flags, byte_enable);
303 assert(byte_enable.size() == size);
312 return cpu->amoMem(
addr,
data, size, flags, std::move(amo_op));
320 return cpu->initiateMemAMO(
addr, size, flags, std::move(amo_op));
326 return cpu->initiateMemMgmtCmd(flags);
335 thread->setStCondFailures(sc_failures);
344 return thread->readStCondFailures();
353 return thread->readPredicate();
361 if (
cpu->traceData) {
362 cpu->traceData->setPredicate(
val);
369 return thread->readMemAccPredicate();
399 assert(
thread->htmTransactionStarts >=
thread->htmTransactionStops);
400 return (
thread->htmTransactionStarts -
thread->htmTransactionStops);
415 cpu->armMonitor(
thread->threadId(), address);
421 return cpu->mwait(
thread->threadId(), pkt);
433 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
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.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
double Counter
All counters are of 64-bit values.
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::Scalar numCallsReturns
statistics::Formula numIdleCycles
statistics::Scalar numPredictedBranches
statistics::Scalar numMatRegWrites
std::array< statistics::Scalar *, CCRegClass+1 > numRegWrites
ExecContextStats(BaseSimpleCPU *cpu, SimpleThread *thread)
statistics::Average notIdleFraction