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),
283 assert(byte_enable.size() == size);
293 assert(byte_enable.size() == size);
303 assert(byte_enable.size() == size);
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseMMU *mmu)
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
bool mwait(ThreadID tid, PacketPtr pkt)
gem5::BaseCPU::BaseCPUStats baseStats
std::vector< std::unique_ptr< ExecuteCPUStats > > executeStats
void armMonitor(ThreadID tid, Addr address)
virtual Fault initiateMemRead(Addr addr, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >())
virtual Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >())
virtual Fault initiateMemMgmtCmd(Request::Flags flags)=0
Memory management commands such as hardware transactional memory commands or TLB invalidation command...
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 >())
virtual Fault amoMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op)
virtual Fault initiateMemAMO(Addr addr, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op)
trace::InstRecord * traceData
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Register ID: describe an architectural register with its class and index.
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...
int threadId() const override
bool readPredicate() const
void setPredicate(bool val)
int64_t htmTransactionStops
bool readMemAccPredicate()
void setStCondFailures(unsigned sc_failures) override
const PCStateBase & pcState() const override
void setMiscReg(RegIndex misc_reg, RegVal val) override
void demapPage(Addr vaddr, uint64_t asn)
void * getWritableReg(const RegId &arch_reg) override
unsigned readStCondFailures() const override
void setReg(const RegId &arch_reg, RegVal val) override
int64_t htmTransactionStarts
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
RegVal readMiscReg(RegIndex misc_reg) override
void setMemAccPredicate(bool val)
RegVal getReg(const RegId &arch_reg) const override
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.
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
This is a simple scalar statistic, like a counter.
void setPredicate(bool val)
#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 - Pranith Kumar Copyright (c) 2020 Inria 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::Scalar numCycles
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