Go to the documentation of this file.
42 #ifndef __CPU_BASE_HH__
43 #define __CPU_BASE_HH__
50 #include "debug/Mwait.hh"
269 static const uint32_t
invldPid = std::numeric_limits<uint32_t>::max();
309 void init()
override;
614 for (
int i = 0;
i < size; ++
i)
626 for (
int i = 0;
i < size; ++
i)
676 panic(
"htmSendAbortSignal not implemented");
826 #endif // __CPU_BASE_HH__
statistics::Scalar numBranches
This is a simple scalar statistic, like a counter.
CPUProgressEvent(BaseCPU *_cpu, Tick ival=0)
statistics::Scalar numInsts
statistics::Scalar numInstsNotNOP
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
statistics::Formula instRate
statistics::Scalar numVecRegReads
Addr currentFunctionStart
void armMonitor(ThreadID tid, Addr address)
statistics::Scalar dcacheStallCycles
std::ostream * functionTraceStream
void notify(const Arg &arg)
called at the ProbePoint call site, passes arg to each listener.
statistics::Scalar numInsts
bool switchedOut() const
Determine if the CPU is switched out.
std::vector< BaseInterrupts * > interrupts
statistics::Scalar numWorkItemsCompleted
virtual Port & getInstPort()=0
Purely virtual method that returns a reference to the instruction port.
void scheduleInstStop(ThreadID tid, Counter insts, std::string cause)
Schedule an event that exits the simulation loops after a predefined number of instructions.
statistics::Scalar numCCRegWrites
void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseMMU *mmu)
ProbePointArg< bool > * ppSleeping
ProbePoint that signals transitions of threadContexts sets.
virtual void htmSendAbortSignal(ThreadID tid, uint64_t htm_uid, HtmFailureFaultCause cause)
This function is used to instruct the memory subsystem that a transaction should be aborted and the s...
statistics::Scalar numFpRegWrites
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
void startup() override
startup() is the final initialization call before simulation.
BaseCPUStats(statistics::Group *parent)
void enableFunctionTrace()
statistics::Scalar numMemRefs
virtual void unserializeThread(CheckpointIn &cp, ThreadID tid)
Unserialize one thread.
BaseInterrupts * getInterruptController(ThreadID tid)
unsigned numContexts()
Get the number of thread contexts available.
statistics::Scalar numFpRegReads
statistics::Formula hostOpRate
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
statistics::Formula numStoreInsts
statistics::Scalar numMiscRegReads
probing::PMUUPtr ppRetiredInsts
Instruction commit probe point.
probing::PMUUPtr pmuProbePoint(const char *name)
Helper method to instantiate probe points belonging to this object.
unsigned int cacheLineSize() const
Get the cache line size of the system.
bool doMonitor(PacketPtr pkt)
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
Global CPU statistics that are merged into the Root object.
BaseCPU(const Params ¶ms, bool is_checker=false)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
statistics::Scalar numIntAluAccesses
static const uint32_t invldPid
Invalid or unknown Pid.
ExecuteCPUStats(statistics::Group *parent, int thread_id)
A vector of scalar stats.
static std::vector< BaseCPU * > cpuList
Static global cpu list.
static Counter numSimulatedOps()
std::vector< std::unique_ptr< CommitCPUStats > > commitStats
statistics::Scalar numFetchSuspends
statistics::Vector committedInstType
const PortID InvalidPortID
uint32_t socketId() const
Reads this CPU's Socket ID.
void schedulePowerGatingEvent()
statistics::Scalar numFpInsts
SignalSinkPort< bool > modelResetPort
void setPid(uint32_t pid)
uint32_t _taskId
An intrenal representation of a task identifier within gem5.
statistics::Scalar numOps
virtual Counter totalInsts() const =0
statistics::Scalar numDiscardedOps
probing::PMUUPtr ppAllCycles
CPU cycle counter even if any thread Context is suspended.
Cycles is a wrapper class for representing cycle counts, i.e.
statistics::Scalar numNop
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const
Serialize a single thread.
void regStats() override
Callback to set stat parameters.
probing::PMUUPtr ppRetiredInstsPC
virtual void wakeup(ThreadID tid)=0
statistics::Scalar numMemRefs
virtual Port & getDataPort()=0
Purely virtual method that returns a reference to the data port.
void deschedulePowerGatingEvent()
statistics::Scalar numVecPredRegReads
virtual const char * description() const
Return a C string describing the event.
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
gem5::BaseCPU::BaseCPUStats baseStats
void taskId(uint32_t id)
Set cpu task id.
CommitCPUStats(statistics::Group *parent, int thread_id)
void registerThreadContexts()
statistics::Scalar numIntRegWrites
statistics::Formula fetchRate
uint32_t taskId() const
Get cpu task id.
statistics::Value simInsts
probing::PMUUPtr ppRetiredStores
Retired store instructions.
RequestorID _dataRequestorId
data side request id that must be placed in all requests
ThreadContext is the external interface to all thread state for anything outside of the CPU.
statistics::Scalar numVecInsts
virtual std::string name() const
void flushTLBs()
Flush all TLBs in the CPU.
const Params & params() const
std::unique_ptr< PMU > PMUUPtr
const Cycles pwrGatingLatency
statistics::Scalar numCCRegReads
statistics::Scalar numOps
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
statistics::Scalar numStoreInsts
statistics::Scalar numCycles
statistics::Scalar numIntRegReads
statistics::Vector committedControl
FetchCPUStats(statistics::Group *parent, int thread_id)
void scheduleSimpointsInstStop(std::vector< Counter > inst_starts)
Schedule simpoint events using the scheduleInstStop function.
uint64_t Tick
Tick count type.
virtual void haltContext(ThreadID thread_num)
Notify the CPU that the indicated context is now halted.
statistics::Formula hostInstRate
void scheduleInstStopAnyThread(Counter max_insts)
Schedule an exit event when any threads in the core reach the max_insts instructions using the schedu...
RequestorID instRequestorId() const
Reads this CPU's unique instruction requestor ID.
void clearInterrupt(ThreadID tid, int int_num, int index)
void regProbePoints() override
Register probe points for this object.
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
statistics::Scalar numIntInsts
RequestorID _instRequestorId
instruction side request id that must be placed in all requests
virtual void setReset(bool state)
Set the reset of the CPU to be either asserted or deasserted.
virtual Counter totalOps() const =0
int findContext(ThreadContext *tc)
Given a Thread Context pointer return the thread num.
static Counter numSimulatedInsts()
ThreadID contextToThread(ContextID cid)
Convert ContextID to threadID.
bool functionTracingEnabled
const uint32_t _socketId
Each cpu will have a socket ID that corresponds to its physical location in the system.
virtual ThreadContext * getContext(int tn)
Given a thread num get tho thread context for it.
statistics::Scalar numInsts
void postInterrupt(ThreadID tid, int int_num, int index)
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
EventFunctionWrapper enterPwrGatingEvent
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
statistics::Scalar numBranches
Tick instCnt
Instruction count used for SPARC misc register.
std::vector< std::unique_ptr< ExecuteCPUStats > > executeStats
statistics::Scalar numVecPredRegWrites
GlobalStats(statistics::Group *parent)
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
bool _switchedOut
Is the CPU switched out or active?
statistics::Scalar numLoadInsts
void repeatEvent(bool repeat)
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
statistics::Scalar numOps
std::vector< ThreadContext * > threadContexts
virtual void takeOverFrom(BaseCPU *cpu)
Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be sw...
statistics::Scalar numWorkItemsStarted
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
void traceFunctions(Addr pc)
Ports are used to interface objects to each other.
statistics::Scalar numMiscRegWrites
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port on this CPU.
int cpuId() const
Reads this CPU's ID.
statistics::Scalar numInsts
virtual void verifyMemoryMode() const
Verify that the system is in a memory mode supported by the CPU.
bool checkInterrupts(ThreadID tid) const
probing::PMUUPtr ppRetiredLoads
Retired load instructions.
int ContextID
Globally unique thread context ID.
double Counter
All counters are of 64-bit values.
void traceFunctionsInternal(Addr pc)
virtual void switchOut()
Prepare for another CPU to take over execution.
Cycles syscallRetryLatency
uint64_t getCurrentInstCount(ThreadID tid)
Get the number of instructions executed by the specified thread on this CPU.
statistics::Scalar numFpAluAccesses
std::ostream CheckpointOut
trace::InstTracer * tracer
trace::InstTracer * getTracer()
Provide access to the tracer pointer.
statistics::Scalar numVecAluAccesses
std::vector< std::unique_ptr< FetchCPUStats > > fetchStats
RequestorID dataRequestorId() const
Reads this CPU's unique data requestor ID.
statistics::Scalar numVecRegWrites
ClockedObjectParams Params
Parameters of ClockedObject.
bool mwait(ThreadID tid, PacketPtr pkt)
const unsigned int _cacheLineSize
Cache the cache line size that we get from the system.
probing::PMUUPtr ppActiveCycles
CPU cycle counter, only counts if any thread contexts is active.
static int numSimulatedCPUs()
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
const FlagsType total
Print the total.
statistics::Scalar icacheStallCycles
probing::PMUUPtr ppRetiredBranches
Retired branches (any type)
void clearInterrupts(ThreadID tid)
uint32_t _pid
The current OS process ID that is executing on this processor.
const bool powerGatingOnIdle
static std::unique_ptr< GlobalStats > globalStats
Pointer to the global stat structure.
void updateComCtrlStats(const StaticInstPtr staticInst)
int16_t ThreadID
Thread index/ID type.
std::vector< AddressMonitor > addressMonitor
#define panic(...)
This implements a cprintf based panic() function.
statistics::Scalar numLoadInsts
statistics::Scalar numOpsNotNOP
statistics::Formula branchRate
Generated on Sun Jul 30 2023 01:56:51 for gem5 by doxygen 1.8.17