gem5  v20.1.0.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
BaseCPU Class Referenceabstract

#include <cpu_dummy.hh>

Inheritance diagram for BaseCPU:
BaseKvmCPU BaseO3CPU BaseSimpleCPU CheckerCPU Iris::BaseCPU MinorCPU TraceCPU ArmKvmCPU BaseArmKvmCPU X86KvmCPU FullO3CPU< Impl > FullO3CPU< O3CPUImpl > AtomicSimpleCPU TimingSimpleCPU Checker< Impl > Checker< O3CPUImpl > DummyChecker Iris::CPU< CortexA76TC > Iris::CPU< TC >

Public Types

typedef BaseCPUParams Params
 

Public Member Functions

virtual PortgetDataPort ()=0
 Purely virtual method that returns a reference to the data port. More...
 
virtual PortProxy::SendFunctionalFunc getSendFunctional ()
 Returns a sendFunctional delegate for use with port proxies. More...
 
virtual PortgetInstPort ()=0
 Purely virtual method that returns a reference to the instruction port. More...
 
int cpuId () const
 Reads this CPU's ID. More...
 
uint32_t socketId () const
 Reads this CPU's Socket ID. More...
 
RequestorID dataRequestorId () const
 Reads this CPU's unique data requestor ID. More...
 
RequestorID instRequestorId () const
 Reads this CPU's unique instruction requestor ID. More...
 
PortgetPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a port on this CPU. More...
 
uint32_t taskId () const
 Get cpu task id. More...
 
void taskId (uint32_t id)
 Set cpu task id. More...
 
uint32_t getPid () const
 
void setPid (uint32_t pid)
 
void workItemBegin ()
 
void workItemEnd ()
 
Tick instCount ()
 
BaseInterruptsgetInterruptController (ThreadID tid)
 
virtual void wakeup (ThreadID tid)=0
 
void postInterrupt (ThreadID tid, int int_num, int index)
 
void clearInterrupt (ThreadID tid, int int_num, int index)
 
void clearInterrupts (ThreadID tid)
 
bool checkInterrupts (ThreadID tid) const
 
Trace::InstTracergetTracer ()
 Provide access to the tracer pointer. More...
 
virtual void activateContext (ThreadID thread_num)
 Notify the CPU that the indicated context is now active. More...
 
virtual void suspendContext (ThreadID thread_num)
 Notify the CPU that the indicated context is now suspended. More...
 
virtual void haltContext (ThreadID thread_num)
 Notify the CPU that the indicated context is now halted. More...
 
int findContext (ThreadContext *tc)
 Given a Thread Context pointer return the thread num. More...
 
virtual ThreadContextgetContext (int tn)
 Given a thread num get tho thread context for it. More...
 
unsigned numContexts ()
 Get the number of thread contexts available. More...
 
ThreadID contextToThread (ContextID cid)
 Convert ContextID to threadID. More...
 
const Paramsparams () const
 
 BaseCPU (Params *params, bool is_checker=false)
 
virtual ~BaseCPU ()
 
void init () override
 
void startup () override
 
void regStats () override
 
void regProbePoints () override
 
void registerThreadContexts ()
 
void deschedulePowerGatingEvent ()
 
void schedulePowerGatingEvent ()
 
virtual void switchOut ()
 Prepare for another CPU to take over execution. More...
 
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 switched in. More...
 
void flushTLBs ()
 Flush all TLBs in the CPU. More...
 
bool switchedOut () const
 Determine if the CPU is switched out. More...
 
virtual void verifyMemoryMode () const
 Verify that the system is in a memory mode supported by the CPU. More...
 
unsigned int cacheLineSize () const
 Get the cache line size of the system. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize this object to the given output stream. More...
 
void unserialize (CheckpointIn &cp) override
 Reconstruct the state of this object from a checkpoint. More...
 
virtual void serializeThread (CheckpointOut &cp, ThreadID tid) const
 Serialize a single thread. More...
 
virtual void unserializeThread (CheckpointIn &cp, ThreadID tid)
 Unserialize one thread. More...
 
virtual Counter totalInsts () const =0
 
virtual Counter totalOps () const =0
 
void scheduleInstStop (ThreadID tid, Counter insts, const char *cause)
 Schedule an event that exits the simulation loops after a predefined number of instructions. More...
 
uint64_t getCurrentInstCount (ThreadID tid)
 Get the number of instructions executed by the specified thread on this CPU. More...
 
void traceFunctions (Addr pc)
 
void armMonitor (ThreadID tid, Addr address)
 
bool mwait (ThreadID tid, PacketPtr pkt)
 
void mwaitAtomic (ThreadID tid, ThreadContext *tc, BaseTLB *dtb)
 
AddressMonitorgetCpuAddrMonitor (ThreadID tid)
 
bool waitForRemoteGDB () const
 

Static Public Member Functions

static int numSimulatedInsts ()
 
static int numSimulatedOps ()
 
static void wakeup (ThreadID tid)
 
static int numSimulatedCPUs ()
 
static Counter numSimulatedInsts ()
 
static Counter numSimulatedOps ()
 

Public Attributes

ThreadID numThreads
 Number of threads we're actually simulating (<= SMT_MAX_THREADS). More...
 
Systemsystem
 
Stats::Scalar numCycles
 
Stats::Scalar numWorkItemsStarted
 
Stats::Scalar numWorkItemsCompleted
 
Cycles syscallRetryLatency
 

Static Public Attributes

static const uint32_t invldPid = std::numeric_limits<uint32_t>::max()
 Invalid or unknown Pid. More...
 
static const Addr PCMask = ~((Addr)sizeof(TheISA::MachInst) - 1)
 

Protected Types

enum  CPUState { CPU_STATE_ON, CPU_STATE_SLEEP, CPU_STATE_WAKEUP }
 

Protected Member Functions

void updateCycleCounters (CPUState state)
 base method keeping track of cycle progression More...
 
void enterPwrGating ()
 

Protected Attributes

Tick instCnt
 Instruction count used for SPARC misc register. More...
 
int _cpuId
 
const uint32_t _socketId
 Each cpu will have a socket ID that corresponds to its physical location in the system. More...
 
RequestorID _instRequestorId
 instruction side request id that must be placed in all requests More...
 
RequestorID _dataRequestorId
 data side request id that must be placed in all requests More...
 
uint32_t _taskId
 An intrenal representation of a task identifier within gem5. More...
 
uint32_t _pid
 The current OS process ID that is executing on this processor. More...
 
bool _switchedOut
 Is the CPU switched out or active? More...
 
const unsigned int _cacheLineSize
 Cache the cache line size that we get from the system. More...
 
std::vector< BaseInterrupts * > interrupts
 
std::vector< ThreadContext * > threadContexts
 
Trace::InstTracertracer
 
Cycles previousCycle
 
CPUState previousState
 
const Cycles pwrGatingLatency
 
const bool powerGatingOnIdle
 
EventFunctionWrapper enterPwrGatingEvent
 

Private Member Functions

void enableFunctionTrace ()
 
void traceFunctionsInternal (Addr pc)
 

Private Attributes

bool functionTracingEnabled
 
std::ostream * functionTraceStream
 
Addr currentFunctionStart
 
Addr currentFunctionEnd
 
Tick functionEntryTick
 
std::vector< AddressMonitoraddressMonitor
 

Static Private Attributes

static std::vector< BaseCPU * > cpuList
 Static global cpu list. More...
 

PMU Probe points.

ProbePoints::PMUUPtr ppRetiredInsts
 Instruction commit probe point. More...
 
ProbePoints::PMUUPtr ppRetiredInstsPC
 
ProbePoints::PMUUPtr ppRetiredLoads
 Retired load instructions. More...
 
ProbePoints::PMUUPtr ppRetiredStores
 Retired store instructions. More...
 
ProbePoints::PMUUPtr ppRetiredBranches
 Retired branches (any type) More...
 
ProbePoints::PMUUPtr ppAllCycles
 CPU cycle counter even if any thread Context is suspended. More...
 
ProbePoints::PMUUPtr ppActiveCycles
 CPU cycle counter, only counts if any thread contexts is active. More...
 
ProbePointArg< bool > * ppSleeping
 ProbePoint that signals transitions of threadContexts sets. More...
 
virtual void probeInstCommit (const StaticInstPtr &inst, Addr pc)
 Helper method to trigger PMU probes for a committed instruction. More...
 
ProbePoints::PMUUPtr pmuProbePoint (const char *name)
 Helper method to instantiate probe points belonging to this object. More...
 

Detailed Description

Definition at line 43 of file cpu_dummy.hh.

Member Typedef Documentation

◆ Params

typedef BaseCPUParams BaseCPU::Params

Definition at line 295 of file base.hh.

Member Enumeration Documentation

◆ CPUState

enum BaseCPU::CPUState
protected
Enumerator
CPU_STATE_ON 
CPU_STATE_SLEEP 
CPU_STATE_WAKEUP 

Definition at line 507 of file base.hh.

Constructor & Destructor Documentation

◆ BaseCPU()

BaseCPU::BaseCPU ( Params params,
bool  is_checker = false 
)

Definition at line 123 of file base.cc.

References enterPwrGating().

◆ ~BaseCPU()

BaseCPU::~BaseCPU ( )
virtual

Reimplemented in Iris::BaseCPU.

Definition at line 184 of file base.cc.

Member Function Documentation

◆ activateContext()

void BaseCPU::activateContext ( ThreadID  thread_num)
virtual

◆ armMonitor()

void BaseCPU::armMonitor ( ThreadID  tid,
Addr  address 
)

◆ cacheLineSize()

unsigned int BaseCPU::cacheLineSize ( ) const
inline

◆ checkInterrupts()

bool BaseCPU::checkInterrupts ( ThreadID  tid) const
inline

Definition at line 246 of file base.hh.

References FullSystem, and interrupts.

Referenced by BaseSimpleCPU::checkForInterrupts(), and Minor::Execute::isInterrupted().

◆ clearInterrupt()

void BaseCPU::clearInterrupt ( ThreadID  tid,
int  int_num,
int  index 
)
inline

◆ clearInterrupts()

void BaseCPU::clearInterrupts ( ThreadID  tid)
inline

Definition at line 240 of file base.hh.

References interrupts.

Referenced by ArmISA::Reset::invoke().

◆ contextToThread()

ThreadID BaseCPU::contextToThread ( ContextID  cid)
inline

Convert ContextID to threadID.

Definition at line 291 of file base.hh.

References threadContexts.

Referenced by Minor::LSQ::tryToSend().

◆ cpuId()

int BaseCPU::cpuId ( ) const
inline

◆ dataRequestorId()

RequestorID BaseCPU::dataRequestorId ( ) const
inline

◆ deschedulePowerGatingEvent()

void BaseCPU::deschedulePowerGatingEvent ( )

◆ enableFunctionTrace()

void BaseCPU::enableFunctionTrace ( )
private

Definition at line 179 of file base.cc.

References functionTracingEnabled.

◆ enterPwrGating()

void BaseCPU::enterPwrGating ( )
protected

Definition at line 526 of file base.cc.

References RiscvISA::OFF.

Referenced by BaseCPU().

◆ findContext()

int BaseCPU::findContext ( ThreadContext tc)

Given a Thread Context pointer return the thread num.

Definition at line 469 of file base.cc.

References threadContexts.

◆ flushTLBs()

void BaseCPU::flushTLBs ( )

Flush all TLBs in the CPU.

This method is mainly used to flush stale translations when switching CPUs. It is also exported to the Python world to allow it to request a TLB flush after draining the CPU to make it easier to compare traces when debugging handover/checkpointing.

Definition at line 635 of file base.cc.

References BaseTLB::flushAll(), ThreadContext::getCheckerCpuPtr(), ThreadContext::getDTBPtr(), CheckerCPU::getDTBPtr(), ThreadContext::getITBPtr(), CheckerCPU::getITBPtr(), ArmISA::i, and threadContexts.

Referenced by switchOut().

◆ getContext()

virtual ThreadContext* BaseCPU::getContext ( int  tn)
inlinevirtual

◆ getCpuAddrMonitor()

AddressMonitor* BaseCPU::getCpuAddrMonitor ( ThreadID  tid)
inline

◆ getCurrentInstCount()

Tick BaseCPU::getCurrentInstCount ( ThreadID  tid)

Get the number of instructions executed by the specified thread on this CPU.

Used by Python to control simulation.

Parameters
tidThread monitor
Returns
Number of instructions executed

Definition at line 698 of file base.cc.

References threadContexts.

Referenced by scheduleInstStop().

◆ getDataPort()

virtual Port& BaseCPU::getDataPort ( )
pure virtual

Purely virtual method that returns a reference to the data port.

All subclasses must implement this method.

Returns
a reference to the data port

Implemented in FullO3CPU< Impl >, FullO3CPU< O3CPUImpl >, TimingSimpleCPU, AtomicSimpleCPU, MinorCPU, CheckerCPU, BaseKvmCPU, Iris::BaseCPU, and TraceCPU.

Referenced by getPort(), getSendFunctional(), TraceCPU::takeOverFrom(), and takeOverFrom().

◆ getInstPort()

virtual Port& BaseCPU::getInstPort ( )
pure virtual

Purely virtual method that returns a reference to the instruction port.

All subclasses must implement this method.

Returns
a reference to the instruction port

Implemented in FullO3CPU< Impl >, FullO3CPU< O3CPUImpl >, TimingSimpleCPU, AtomicSimpleCPU, MinorCPU, CheckerCPU, BaseKvmCPU, Iris::BaseCPU, and TraceCPU.

Referenced by getPort(), TraceCPU::takeOverFrom(), and takeOverFrom().

◆ getInterruptController()

BaseInterrupts* BaseCPU::getInterruptController ( ThreadID  tid)
inline

◆ getPid()

uint32_t BaseCPU::getPid ( ) const
inline

Definition at line 206 of file base.hh.

References _pid.

Referenced by takeOverFrom().

◆ getPort()

Port & BaseCPU::getPort ( const std::string &  if_name,
PortID  idx = InvalidPortID 
)
override

Get a port on this CPU.

All CPUs have a data and instruction port, and this method uses getDataPort and getInstPort of the subclasses to resolve the two ports.

Parameters
if_namethe port name
idxignored index
Returns
a reference to the port with the given name

Definition at line 402 of file base.cc.

References getDataPort(), getInstPort(), and SimObject::getPort().

Referenced by FastModel::CortexA76::getPort().

◆ getSendFunctional()

virtual PortProxy::SendFunctionalFunc BaseCPU::getSendFunctional ( )
inlinevirtual

Returns a sendFunctional delegate for use with port proxies.

Reimplemented in Iris::BaseCPU.

Definition at line 162 of file base.hh.

References getDataPort().

Referenced by ThreadState::initMemProxies().

◆ getTracer()

Trace::InstTracer* BaseCPU::getTracer ( )
inline

Provide access to the tracer pointer.

Definition at line 267 of file base.hh.

References tracer.

◆ haltContext()

void BaseCPU::haltContext ( ThreadID  thread_num)
virtual

Notify the CPU that the indicated context is now halted.

Reimplemented in FullO3CPU< Impl >, FullO3CPU< O3CPUImpl >, BaseSimpleCPU, and BaseKvmCPU.

Definition at line 520 of file base.cc.

References CPU_STATE_SLEEP, and updateCycleCounters().

Referenced by SimpleThread::halt().

◆ init()

void BaseCPU::init ( )
override

◆ instCount()

Tick BaseCPU::instCount ( )
inline

◆ instRequestorId()

RequestorID BaseCPU::instRequestorId ( ) const
inline

Reads this CPU's unique instruction requestor ID.

Definition at line 186 of file base.hh.

References _instRequestorId.

Referenced by Minor::Fetch1::fetchLine(), and BaseSimpleCPU::setupFetchRequest().

◆ mwait()

bool BaseCPU::mwait ( ThreadID  tid,
PacketPtr  pkt 
)

◆ mwaitAtomic()

void BaseCPU::mwaitAtomic ( ThreadID  tid,
ThreadContext tc,
BaseTLB dtb 
)

◆ numContexts()

unsigned BaseCPU::numContexts ( )
inline

Get the number of thread contexts available.

Definition at line 286 of file base.hh.

References threadContexts.

◆ numSimulatedCPUs()

static int BaseCPU::numSimulatedCPUs ( )
inlinestatic

Definition at line 563 of file base.hh.

References cpuList.

◆ numSimulatedInsts() [1/2]

static int BaseCPU::numSimulatedInsts ( )
inlinestatic

Definition at line 46 of file cpu_dummy.hh.

Referenced by Stats::Global::Global(), and ElasticTrace::regEtraceListeners().

◆ numSimulatedInsts() [2/2]

static Counter BaseCPU::numSimulatedInsts ( )
inlinestatic

Definition at line 564 of file base.hh.

References cpuList, ArmISA::i, Stats::total, and totalInsts().

◆ numSimulatedOps() [1/2]

static int BaseCPU::numSimulatedOps ( )
inlinestatic

Definition at line 47 of file cpu_dummy.hh.

Referenced by Stats::Global::Global().

◆ numSimulatedOps() [2/2]

static Counter BaseCPU::numSimulatedOps ( )
inlinestatic

Definition at line 575 of file base.hh.

References cpuList, ArmISA::i, Stats::total, and totalOps().

◆ params()

const Params* BaseCPU::params ( ) const
inline

◆ pmuProbePoint()

ProbePoints::PMUUPtr BaseCPU::pmuProbePoint ( const char *  name)
protected

Helper method to instantiate probe points belonging to this object.

Parameters
nameName of the probe point.
Returns
A unique_ptr to the new probe point.

Definition at line 326 of file base.cc.

References name().

Referenced by regProbePoints().

◆ postInterrupt()

void BaseCPU::postInterrupt ( ThreadID  tid,
int  int_num,
int  index 
)

◆ probeInstCommit()

void BaseCPU::probeInstCommit ( const StaticInstPtr inst,
Addr  pc 
)
virtual

Helper method to trigger PMU probes for a committed instruction.

Parameters
instInstruction that just committed
pcPC of the instruction that just committed

Definition at line 351 of file base.cc.

References StaticInst::isAtomic(), StaticInst::isControl(), StaticInst::isLastMicroop(), StaticInst::isLoad(), StaticInst::isMicroop(), StaticInst::isStore(), MipsISA::pc, ppRetiredBranches, ppRetiredInsts, ppRetiredInstsPC, ppRetiredLoads, and ppRetiredStores.

Referenced by Minor::Execute::doInstCommitAccounting(), and BaseSimpleCPU::postExecute().

◆ registerThreadContexts()

void BaseCPU::registerThreadContexts ( )

◆ regProbePoints()

void BaseCPU::regProbePoints ( )
override

◆ regStats()

void BaseCPU::regStats ( )
override

◆ scheduleInstStop()

void BaseCPU::scheduleInstStop ( ThreadID  tid,
Counter  insts,
const char *  cause 
)

Schedule an event that exits the simulation loops after a predefined number of instructions.

This method is usually called from the configuration script to get an exit event some time in the future. It is typically used when the script wants to simulate for a specific number of instructions rather than ticks.

Parameters
tidThread monitor.
instsNumber of instructions into the future.
causeCause to signal in the exit event.

Definition at line 689 of file base.cc.

References MipsISA::event, getCurrentInstCount(), and threadContexts.

Referenced by init().

◆ schedulePowerGatingEvent()

void BaseCPU::schedulePowerGatingEvent ( )

◆ serialize()

void BaseCPU::serialize ( CheckpointOut cp) const
override

Serialize this object to the given output stream.

Note
CPU models should normally overload the serializeThread() method instead of the serialize() method as this provides a uniform data format for all CPU models and promotes better code reuse.
Parameters
cpThe stream to serialize to.

Definition at line 651 of file base.cc.

References _pid, _switchedOut, csprintf(), ArmISA::i, instCnt, interrupts, numThreads, SERIALIZE_SCALAR, and serializeThread().

Referenced by MinorCPU::serialize(), and Iris::BaseCPU::serializeThread().

◆ serializeThread()

virtual void BaseCPU::serializeThread ( CheckpointOut cp,
ThreadID  tid 
) const
inlinevirtual

Serialize a single thread.

Parameters
cpThe stream to serialize to.
tidID of the current thread.

Reimplemented in FullO3CPU< Impl >, FullO3CPU< O3CPUImpl >, BaseSimpleCPU, MinorCPU, Iris::BaseCPU, and BaseKvmCPU.

Definition at line 408 of file base.hh.

Referenced by serialize().

◆ setPid()

void BaseCPU::setPid ( uint32_t  pid)
inline

Definition at line 207 of file base.hh.

References _pid.

Referenced by ArmISA::DumpStats::process().

◆ socketId()

uint32_t BaseCPU::socketId ( ) const
inline

Reads this CPU's Socket ID.

Definition at line 181 of file base.hh.

References _socketId.

Referenced by ThreadState::socketId(), and Iris::ThreadContext::socketId().

◆ startup()

void BaseCPU::startup ( )
override

◆ suspendContext()

void BaseCPU::suspendContext ( ThreadID  thread_num)
virtual

◆ switchedOut()

bool BaseCPU::switchedOut ( ) const
inline

Determine if the CPU is switched out.

Returns
True if the CPU is switched out, false otherwise.

Definition at line 352 of file base.hh.

References _switchedOut.

Referenced by BaseKvmCPU::drain(), MinorCPU::drain(), AtomicSimpleCPU::drain(), TimingSimpleCPU::drain(), BaseKvmCPU::drainResume(), MinorCPU::drainResume(), AtomicSimpleCPU::drainResume(), TimingSimpleCPU::drainResume(), CPUProgressEvent::process(), and MinorCPU::switchOut().

◆ switchOut()

void BaseCPU::switchOut ( )
virtual

Prepare for another CPU to take over execution.

When this method exits, all internal state should have been flushed. After the method returns, the simulator calls takeOverFrom() on the new CPU with this CPU as its parameter.

Reimplemented in FullO3CPU< Impl >, FullO3CPU< O3CPUImpl >, TimingSimpleCPU, AtomicSimpleCPU, MinorCPU, BaseKvmCPU, Checker< Impl >, and Checker< O3CPUImpl >.

Definition at line 532 of file base.cc.

References _switchedOut, flushTLBs(), and RiscvISA::OFF.

Referenced by BaseKvmCPU::switchOut(), MinorCPU::switchOut(), AtomicSimpleCPU::switchOut(), TimingSimpleCPU::switchOut(), and FullO3CPU< O3CPUImpl >::switchOut().

◆ takeOverFrom()

void BaseCPU::takeOverFrom ( BaseCPU cpu)
virtual

◆ taskId() [1/2]

uint32_t BaseCPU::taskId ( ) const
inline

◆ taskId() [2/2]

void BaseCPU::taskId ( uint32_t  id)
inline

Set cpu task id.

Definition at line 204 of file base.hh.

References _taskId, and ArmISA::id.

◆ totalInsts()

virtual Counter BaseCPU::totalInsts ( ) const
pure virtual

◆ totalOps()

virtual Counter BaseCPU::totalOps ( ) const
pure virtual

◆ traceFunctions()

void BaseCPU::traceFunctions ( Addr  pc)
inline

Definition at line 557 of file base.hh.

References functionTracingEnabled, MipsISA::pc, and traceFunctionsInternal().

Referenced by BaseSimpleCPU::postExecute().

◆ traceFunctionsInternal()

void BaseCPU::traceFunctionsInternal ( Addr  pc)
private

◆ unserialize()

void BaseCPU::unserialize ( CheckpointIn cp)
override

Reconstruct the state of this object from a checkpoint.

Note
CPU models should normally overload the unserializeThread() method instead of the unserialize() method as this provides a uniform data format for all CPU models and promotes better code reuse.
Parameters
cpThe checkpoint use.

Definition at line 672 of file base.cc.

References _pid, _switchedOut, csprintf(), ArmISA::i, instCnt, interrupts, numThreads, UNSERIALIZE_SCALAR, and unserializeThread().

Referenced by MinorCPU::unserialize().

◆ unserializeThread()

virtual void BaseCPU::unserializeThread ( CheckpointIn cp,
ThreadID  tid 
)
inlinevirtual

Unserialize one thread.

Parameters
cpThe checkpoint use.
tidID of the current thread.

Reimplemented in FullO3CPU< Impl >, FullO3CPU< O3CPUImpl >, BaseSimpleCPU, MinorCPU, and BaseKvmCPU.

Definition at line 416 of file base.hh.

Referenced by unserialize().

◆ updateCycleCounters()

void BaseCPU::updateCycleCounters ( CPUState  state)
inlineprotected

◆ verifyMemoryMode()

virtual void BaseCPU::verifyMemoryMode ( ) const
inlinevirtual

Verify that the system is in a memory mode supported by the CPU.

Implementations are expected to query the system for the current memory mode and ensure that it is what the CPU model expects. If the check fails, the implementation should terminate the simulation using fatal().

Reimplemented in FullO3CPU< Impl >, TimingSimpleCPU, AtomicSimpleCPU, BaseKvmCPU, and NonCachingSimpleCPU.

Definition at line 363 of file base.hh.

Referenced by init().

◆ waitForRemoteGDB()

bool BaseCPU::waitForRemoteGDB ( ) const

Definition at line 753 of file base.cc.

References params().

◆ wakeup() [1/2]

static void BaseCPU::wakeup ( ThreadID  tid)
inlinestatic

Definition at line 48 of file cpu_dummy.hh.

Referenced by postInterrupt().

◆ wakeup() [2/2]

virtual void BaseCPU::wakeup ( ThreadID  tid)
pure virtual

◆ workItemBegin()

void BaseCPU::workItemBegin ( )
inline

Definition at line 209 of file base.hh.

References numWorkItemsStarted.

Referenced by PseudoInst::workbegin().

◆ workItemEnd()

void BaseCPU::workItemEnd ( )
inline

Definition at line 210 of file base.hh.

References numWorkItemsCompleted.

Referenced by PseudoInst::workend().

Member Data Documentation

◆ _cacheLineSize

const unsigned int BaseCPU::_cacheLineSize
protected

Cache the cache line size that we get from the system.

Definition at line 146 of file base.hh.

Referenced by cacheLineSize().

◆ _cpuId

int BaseCPU::_cpuId
protected

Definition at line 116 of file base.hh.

Referenced by cpuId(), registerThreadContexts(), and takeOverFrom().

◆ _dataRequestorId

RequestorID BaseCPU::_dataRequestorId
protected

data side request id that must be placed in all requests

Definition at line 129 of file base.hh.

Referenced by dataRequestorId().

◆ _instRequestorId

RequestorID BaseCPU::_instRequestorId
protected

instruction side request id that must be placed in all requests

Definition at line 126 of file base.hh.

Referenced by instRequestorId().

◆ _pid

uint32_t BaseCPU::_pid
protected

The current OS process ID that is executing on this processor.

This is used to generate a taskId

Definition at line 140 of file base.hh.

Referenced by getPid(), serialize(), setPid(), takeOverFrom(), and unserialize().

◆ _socketId

const uint32_t BaseCPU::_socketId
protected

Each cpu will have a socket ID that corresponds to its physical location in the system.

This is usually used to bucket cpu cores under single DVFS domain. This information may also be required by the OS to identify the cpu core grouping (as in the case of ARM via MPIDR register)

Definition at line 123 of file base.hh.

Referenced by socketId().

◆ _switchedOut

bool BaseCPU::_switchedOut
protected

Is the CPU switched out or active?

Definition at line 143 of file base.hh.

Referenced by serialize(), startup(), switchedOut(), switchOut(), takeOverFrom(), and unserialize().

◆ _taskId

uint32_t BaseCPU::_taskId
protected

An intrenal representation of a task identifier within gem5.

This is used so the CPU can add which taskId (which is an internal representation of the OS process ID) to each request so components in the memory system can track which process IDs are ultimately interacting with them

Definition at line 136 of file base.hh.

Referenced by takeOverFrom(), and taskId().

◆ addressMonitor

std::vector<AddressMonitor> BaseCPU::addressMonitor
private

Definition at line 593 of file base.hh.

Referenced by armMonitor(), getCpuAddrMonitor(), mwait(), and mwaitAtomic().

◆ cpuList

vector< BaseCPU * > BaseCPU::cpuList
staticprivate

Static global cpu list.

Definition at line 554 of file base.hh.

Referenced by numSimulatedCPUs(), numSimulatedInsts(), and numSimulatedOps().

◆ currentFunctionEnd

Addr BaseCPU::currentFunctionEnd
private

Definition at line 548 of file base.hh.

Referenced by traceFunctionsInternal().

◆ currentFunctionStart

Addr BaseCPU::currentFunctionStart
private

Definition at line 547 of file base.hh.

Referenced by traceFunctionsInternal().

◆ enterPwrGatingEvent

EventFunctionWrapper BaseCPU::enterPwrGatingEvent
protected

◆ functionEntryTick

Tick BaseCPU::functionEntryTick
private

Definition at line 549 of file base.hh.

Referenced by traceFunctionsInternal().

◆ functionTraceStream

std::ostream* BaseCPU::functionTraceStream
private

Definition at line 546 of file base.hh.

Referenced by traceFunctionsInternal().

◆ functionTracingEnabled

bool BaseCPU::functionTracingEnabled
private

Definition at line 545 of file base.hh.

Referenced by enableFunctionTrace(), and traceFunctions().

◆ instCnt

Tick BaseCPU::instCnt
protected

Instruction count used for SPARC misc register.

Todo:
unify this with the counters that cpus individually keep

Definition at line 110 of file base.hh.

Referenced by TimingSimpleCPU::completeIfetch(), instCount(), serialize(), AtomicSimpleCPU::tick(), and unserialize().

◆ interrupts

std::vector<BaseInterrupts*> BaseCPU::interrupts
protected

◆ invldPid

const uint32_t BaseCPU::invldPid = std::numeric_limits<uint32_t>::max()
static

Invalid or unknown Pid.

Possible when operating system is not present or has not assigned a pid yet

Definition at line 261 of file base.hh.

Referenced by ArmISA::FsLinux::startup().

◆ numCycles

Stats::Scalar BaseCPU::numCycles

◆ numThreads

ThreadID BaseCPU::numThreads

◆ numWorkItemsCompleted

Stats::Scalar BaseCPU::numWorkItemsCompleted

Definition at line 590 of file base.hh.

Referenced by regStats(), and workItemEnd().

◆ numWorkItemsStarted

Stats::Scalar BaseCPU::numWorkItemsStarted

Definition at line 589 of file base.hh.

Referenced by regStats(), and workItemBegin().

◆ PCMask

const Addr BaseCPU::PCMask = ~((Addr)sizeof(TheISA::MachInst) - 1)
static

◆ powerGatingOnIdle

const bool BaseCPU::powerGatingOnIdle
protected

Definition at line 614 of file base.hh.

Referenced by schedulePowerGatingEvent(), and suspendContext().

◆ ppActiveCycles

ProbePoints::PMUUPtr BaseCPU::ppActiveCycles
protected

CPU cycle counter, only counts if any thread contexts is active.

Definition at line 494 of file base.hh.

Referenced by regProbePoints(), and updateCycleCounters().

◆ ppAllCycles

ProbePoints::PMUUPtr BaseCPU::ppAllCycles
protected

CPU cycle counter even if any thread Context is suspended.

Definition at line 491 of file base.hh.

Referenced by regProbePoints(), and updateCycleCounters().

◆ ppRetiredBranches

ProbePoints::PMUUPtr BaseCPU::ppRetiredBranches
protected

Retired branches (any type)

Definition at line 488 of file base.hh.

Referenced by probeInstCommit(), and regProbePoints().

◆ ppRetiredInsts

ProbePoints::PMUUPtr BaseCPU::ppRetiredInsts
protected

Instruction commit probe point.

This probe point is triggered whenever one or more instructions are committed. It is normally triggered once for every instruction. However, CPU models committing bundles of instructions may call notify once for the entire bundle.

Definition at line 479 of file base.hh.

Referenced by probeInstCommit(), and regProbePoints().

◆ ppRetiredInstsPC

ProbePoints::PMUUPtr BaseCPU::ppRetiredInstsPC
protected

Definition at line 480 of file base.hh.

Referenced by probeInstCommit(), and regProbePoints().

◆ ppRetiredLoads

ProbePoints::PMUUPtr BaseCPU::ppRetiredLoads
protected

Retired load instructions.

Definition at line 483 of file base.hh.

Referenced by probeInstCommit(), and regProbePoints().

◆ ppRetiredStores

ProbePoints::PMUUPtr BaseCPU::ppRetiredStores
protected

Retired store instructions.

Definition at line 485 of file base.hh.

Referenced by probeInstCommit(), and regProbePoints().

◆ ppSleeping

ProbePointArg<bool>* BaseCPU::ppSleeping
protected

ProbePoint that signals transitions of threadContexts sets.

The ProbePoint reports information through it bool parameter.

  • If the parameter is true then the last enabled threadContext of the CPU object was disabled.
  • If the parameter is false then a threadContext was enabled, all the remaining threadContexts are disabled.

Definition at line 504 of file base.hh.

Referenced by regProbePoints(), and updateCycleCounters().

◆ previousCycle

Cycles BaseCPU::previousCycle
protected

Definition at line 513 of file base.hh.

Referenced by takeOverFrom(), and updateCycleCounters().

◆ previousState

CPUState BaseCPU::previousState
protected

Definition at line 514 of file base.hh.

Referenced by takeOverFrom(), and updateCycleCounters().

◆ pwrGatingLatency

const Cycles BaseCPU::pwrGatingLatency
protected

Definition at line 613 of file base.hh.

Referenced by schedulePowerGatingEvent(), and suspendContext().

◆ syscallRetryLatency

Cycles BaseCPU::syscallRetryLatency

Definition at line 607 of file base.hh.

Referenced by TimingSimpleCPU::advanceInst(), and AtomicSimpleCPU::tick().

◆ system

System* BaseCPU::system

◆ threadContexts

std::vector<ThreadContext *> BaseCPU::threadContexts
protected

◆ tracer

Trace::InstTracer* BaseCPU::tracer
protected

Definition at line 254 of file base.hh.

Referenced by getTracer(), and BaseSimpleCPU::preExecute().


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:21 for gem5 by doxygen 1.8.17