Go to the documentation of this file.
42 #ifndef __CPU_BASE_HH__
43 #define __CPU_BASE_HH__
49 #include "config/the_isa.hh"
50 #if THE_ISA == NULL_ISA
63 #include "debug/Mwait.hh"
166 return [port](
PacketPtr pkt)->
void { port->sendFunctional(pkt); };
261 static const uint32_t
invldPid = std::numeric_limits<uint32_t>::max();
297 {
return reinterpret_cast<const Params *
>(_params); }
301 void init()
override;
569 for (
int i = 0;
i < size; ++
i)
580 for (
int i = 0;
i < size; ++
i)
618 #endif // THE_ISA == NULL_ISA
620 #endif // __CPU_BASE_HH__
bool mwait(ThreadID tid, PacketPtr pkt)
ProbePoints::PMUUPtr ppRetiredInstsPC
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port on this CPU.
CPUProgressEvent(BaseCPU *_cpu, Tick ival=0)
void flushTLBs()
Flush all TLBs in the CPU.
virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const
Serialize a single thread.
bool functionTracingEnabled
void taskId(uint32_t id)
Set cpu task id.
uint64_t getCurrentInstCount(ThreadID tid)
Get the number of instructions executed by the specified thread on this CPU.
ProbePoints::PMUUPtr ppRetiredBranches
Retired branches (any type)
virtual void verifyMemoryMode() const
Verify that the system is in a memory mode supported by the CPU.
uint32_t _pid
The current OS process ID that is executing on this processor.
const PortID InvalidPortID
virtual Port & getDataPort()=0
Purely virtual method that returns a reference to the data port.
int16_t ThreadID
Thread index/ID type.
ProbePoints::PMUUPtr ppAllCycles
CPU cycle counter even if any thread Context is suspended.
Trace::InstTracer * tracer
static int numSimulatedCPUs()
int ContextID
Globally unique thread context ID.
bool doMonitor(PacketPtr pkt)
virtual const char * description() const
Return a C string describing the event.
unsigned int cacheLineSize() const
Get the cache line size of the system.
void armMonitor(ThreadID tid, Addr address)
uint64_t Tick
Tick count type.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Cycles syscallRetryLatency
static void wakeup(ThreadID tid)
void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseTLB *dtb)
void enableFunctionTrace()
void postInterrupt(ThreadID tid, int int_num, int index)
void registerThreadContexts()
void deschedulePowerGatingEvent()
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
uint32_t socketId() const
Reads this CPU's Socket ID.
virtual Counter totalOps() const =0
virtual ThreadContext * getContext(int tn)
Given a thread num get tho thread context for it.
ProbePoints::PMUUPtr ppRetiredLoads
Retired load instructions.
void notify(const Arg &arg)
called at the ProbePoint call site, passes arg to each listener.
static const uint32_t invldPid
Invalid or unknown Pid.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
virtual PortProxy::SendFunctionalFunc getSendFunctional()
Returns a sendFunctional delegate for use with port proxies.
This is a simple scalar statistic, like a counter.
int64_t Counter
Statistics counter type.
int findContext(ThreadContext *tc)
Given a Thread Context pointer return the thread num.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
void traceFunctionsInternal(Addr pc)
RequestorID _instRequestorId
instruction side request id that must be placed in all requests
const unsigned int _cacheLineSize
Cache the cache line size that we get from the system.
static Counter numSimulatedInsts()
Tick instCnt
Instruction count used for SPARC misc register.
std::vector< BaseInterrupts * > interrupts
Stats::Scalar numWorkItemsStarted
void repeatEvent(bool repeat)
BaseCPU(Params *params, bool is_checker=false)
Ports are used to interface objects to each other.
uint32_t _taskId
An intrenal representation of a task identifier within gem5.
ProbePoints::PMUUPtr ppActiveCycles
CPU cycle counter, only counts if any thread contexts is active.
std::vector< ThreadContext * > threadContexts
void clearInterrupt(ThreadID tid, int int_num, int index)
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
std::function< void(PacketPtr pkt)> SendFunctionalFunc
ProbePoints::PMUUPtr pmuProbePoint(const char *name)
Helper method to instantiate probe points belonging to this object.
void setPid(uint32_t pid)
ProbePoints::PMUUPtr ppRetiredStores
Retired store instructions.
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
unsigned numContexts()
Get the number of thread contexts available.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const Params * params() const
ProbePoints::PMUUPtr ppRetiredInsts
Instruction commit probe point.
const std::string & name()
ThreadID contextToThread(ContextID cid)
Convert ContextID to threadID.
std::unique_ptr< PMU > PMUUPtr
RequestorID instRequestorId() const
Reads this CPU's unique instruction requestor ID.
uint32_t taskId() const
Get cpu task id.
const Cycles pwrGatingLatency
virtual void haltContext(ThreadID thread_num)
Notify the CPU that the indicated context is now halted.
void schedulePowerGatingEvent()
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...
void clearInterrupts(ThreadID tid)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
virtual void switchOut()
Prepare for another CPU to take over execution.
RequestorID _dataRequestorId
data side request id that must be placed in all requests
Trace::InstTracer * getTracer()
Provide access to the tracer pointer.
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
void traceFunctions(Addr pc)
RequestorID dataRequestorId() const
Reads this CPU's unique data requestor ID.
Cycles is a wrapper class for representing cycle counts, i.e.
std::ostream * functionTraceStream
void scheduleInstStop(ThreadID tid, Counter insts, const char *cause)
Schedule an event that exits the simulation loops after a predefined number of instructions.
std::ostream CheckpointOut
static Counter numSimulatedOps()
static std::vector< BaseCPU * > cpuList
Static global cpu list.
void regProbePoints() override
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
EventFunctionWrapper enterPwrGatingEvent
const uint32_t _socketId
Each cpu will have a socket ID that corresponds to its physical location in the system.
Stats::Scalar numWorkItemsCompleted
Addr currentFunctionStart
virtual Counter totalInsts() const =0
std::vector< AddressMonitor > addressMonitor
virtual void unserializeThread(CheckpointIn &cp, ThreadID tid)
Unserialize one thread.
bool switchedOut() const
Determine if the CPU is switched out.
bool _switchedOut
Is the CPU switched out or active?
const FlagsType total
Print the total.
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
bool checkInterrupts(ThreadID tid) const
virtual Port & getInstPort()=0
Purely virtual method that returns a reference to the instruction port.
bool waitForRemoteGDB() const
BaseInterrupts * getInterruptController(ThreadID tid)
int cpuId() const
Reads this CPU's ID.
ProbePointArg< bool > * ppSleeping
ProbePoint that signals transitions of threadContexts sets.
const bool powerGatingOnIdle
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17