gem5 v24.0.0.0
|
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buffers between stages. More...
#include <cpu.hh>
Classes | |
struct | CPUStats |
Public Types | |
enum | Status { Running , Idle , Halted , Blocked , SwitchedOut } |
enum | StageIdx { FetchIdx , DecodeIdx , RenameIdx , IEWIdx , CommitIdx , NumStages } |
Enum to give each stage a specific index, so when calling activateStage() or deactivateStage(), they can specify which stage is being activated/deactivated. More... | |
typedef std::list< DynInstPtr >::iterator | ListIt |
using | LSQRequest = LSQ::LSQRequest |
using | PerThreadUnifiedRenameMap |
Public Types inherited from gem5::ClockedObject | |
using | Params = ClockedObjectParams |
Parameters of ClockedObject. | |
Public Types inherited from gem5::SimObject | |
typedef SimObjectParams | Params |
Public Member Functions | |
CPU (const BaseO3CPUParams ¶ms) | |
Constructs a CPU with the given parameters. | |
void | regProbePoints () override |
Register probe points. | |
void | demapPage (Addr vaddr, uint64_t asn) |
void | tick () |
Ticks CPU, calling tick() on each stage, and checking the overall activity to see if the CPU should deschedule itself. | |
void | init () override |
Initialize the CPU. | |
void | startup () override |
startup() is the final initialization call before simulation. | |
int | numActiveThreads () |
Returns the Number of Active Threads in the CPU. | |
void | activateThread (ThreadID tid) |
Add Thread to Active Threads List. | |
void | deactivateThread (ThreadID tid) |
Remove Thread from Active Threads List. | |
void | insertThread (ThreadID tid) |
Setup CPU to insert a thread's context. | |
void | removeThread (ThreadID tid) |
Remove all of a thread's context from CPU. | |
Counter | totalInsts () const override |
Count the Total Instructions Committed in the CPU. | |
Counter | totalOps () const override |
Count the Total Ops (including micro ops) committed in the CPU. | |
void | activateContext (ThreadID tid) override |
Add Thread to Active Threads List. | |
void | suspendContext (ThreadID tid) override |
Remove Thread from Active Threads List. | |
void | haltContext (ThreadID tid) override |
Remove Thread from Active Threads List && Remove Thread Context from CPU. | |
void | updateThreadPriority () |
Update The Order In Which We Process Threads. | |
bool | isDraining () const |
Is the CPU draining? | |
void | serializeThread (CheckpointOut &cp, ThreadID tid) const override |
Serialize a single thread. | |
void | unserializeThread (CheckpointIn &cp, ThreadID tid) override |
Unserialize one thread. | |
void | addThreadToExitingList (ThreadID tid) |
Insert tid to the list of threads trying to exit. | |
bool | isThreadExiting (ThreadID tid) const |
Is the thread trying to exit? | |
void | scheduleThreadExitEvent (ThreadID tid) |
If a thread is trying to exit and its corresponding trap event has been completed, schedule an event to terminate the thread. | |
void | exitThreads () |
Terminate all threads that are ready to exit. | |
DrainState | drain () override |
Starts draining the CPU's pipeline of all instructions in order to stop all memory accesses. | |
void | drainResume () override |
Resumes execution after a drain. | |
void | commitDrained (ThreadID tid) |
Commit has reached a safe point to drain a thread. | |
void | switchOut () override |
Switches out this CPU. | |
void | takeOverFrom (BaseCPU *oldCPU) override |
Takes over from another CPU. | |
void | verifyMemoryMode () const override |
Verify that the system is in a memory mode supported by the CPU. | |
InstSeqNum | getAndIncrementInstSeq () |
Get the current instruction sequence number, and increment it. | |
void | trap (const Fault &fault, ThreadID tid, const StaticInstPtr &inst) |
Traps to handle given fault. | |
Fault | getInterrupts () |
Returns the Fault for any valid interrupt. | |
void | processInterrupts (const Fault &interrupt) |
Processes any an interrupt fault. | |
void | halt () |
Halts the CPU. | |
RegVal | readMiscRegNoEffect (int misc_reg, ThreadID tid) const |
Register accessors. | |
RegVal | readMiscReg (int misc_reg, ThreadID tid) |
Reads a misc. | |
void | setMiscRegNoEffect (int misc_reg, RegVal val, ThreadID tid) |
Sets a miscellaneous register. | |
void | setMiscReg (int misc_reg, RegVal val, ThreadID tid) |
Sets a misc. | |
RegVal | getReg (PhysRegIdPtr phys_reg, ThreadID tid) |
void | getReg (PhysRegIdPtr phys_reg, void *val, ThreadID tid) |
void * | getWritableReg (PhysRegIdPtr phys_reg, ThreadID tid) |
void | setReg (PhysRegIdPtr phys_reg, RegVal val, ThreadID tid) |
void | setReg (PhysRegIdPtr phys_reg, const void *val, ThreadID tid) |
RegVal | getArchReg (const RegId ®, ThreadID tid) |
Architectural register accessors. | |
void | getArchReg (const RegId ®, void *val, ThreadID tid) |
void * | getWritableArchReg (const RegId ®, ThreadID tid) |
void | setArchReg (const RegId ®, RegVal val, ThreadID tid) |
void | setArchReg (const RegId ®, const void *val, ThreadID tid) |
void | pcState (const PCStateBase &new_pc_state, ThreadID tid) |
Sets the commit PC state of a specific thread. | |
const PCStateBase & | pcState (ThreadID tid) |
Reads the commit PC state of a specific thread. | |
void | squashFromTC (ThreadID tid) |
Initiates a squash of all in-flight instructions for a given thread. | |
ListIt | addInst (const DynInstPtr &inst) |
Function to add instruction onto the head of the list of the instructions. | |
void | instDone (ThreadID tid, const DynInstPtr &inst) |
Function to tell the CPU that an instruction has completed. | |
void | removeFrontInst (const DynInstPtr &inst) |
Remove an instruction from the front end of the list. | |
void | removeInstsNotInROB (ThreadID tid) |
Remove all instructions that are not currently in the ROB. | |
void | removeInstsUntil (const InstSeqNum &seq_num, ThreadID tid) |
Remove all instructions younger than the given sequence number. | |
void | squashInstIt (const ListIt &instIt, ThreadID tid) |
Removes the instruction pointed to by the iterator. | |
void | cleanUpRemovedInsts () |
Cleans up all instructions on the remove list. | |
void | dumpInsts () |
Debug function to print all instructions on the list. | |
void | activityThisCycle () |
Records that there was time buffer activity this cycle. | |
void | activateStage (const StageIdx idx) |
Changes a stage's status to active within the activity recorder. | |
void | deactivateStage (const StageIdx idx) |
Changes a stage's status to inactive within the activity recorder. | |
void | wakeCPU () |
Wakes the CPU, rescheduling the CPU if it's not already active. | |
virtual void | wakeup (ThreadID tid) override |
ThreadID | getFreeTid () |
Gets a free thread id. | |
gem5::ThreadContext * | tcBase (ThreadID tid) |
Returns a pointer to a thread context. | |
Fault | pushRequest (const DynInstPtr &inst, bool isLoad, uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res, AtomicOpFunctorPtr amo_op=nullptr, const std::vector< bool > &byte_enable=std::vector< bool >()) |
CPU pushRequest function, forwards request to LSQ. | |
Port & | getInstPort () override |
Used by the fetch unit to get a hold of the instruction port. | |
Port & | getDataPort () override |
Get the dcache port (used to find block size for translations). | |
void | htmSendAbortSignal (ThreadID tid, uint64_t htm_uid, HtmFailureFaultCause cause) override |
This function is used to instruct the memory subsystem that a transaction should be aborted and the speculative state should be thrown away. | |
Public Member Functions inherited from gem5::BaseCPU | |
int | cpuId () const |
Reads this CPU's ID. | |
uint32_t | socketId () const |
Reads this CPU's Socket ID. | |
RequestorID | dataRequestorId () const |
Reads this CPU's unique data requestor ID. | |
RequestorID | instRequestorId () const |
Reads this CPU's unique instruction requestor ID. | |
Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a port on this CPU. | |
uint32_t | taskId () const |
Get cpu task id. | |
void | taskId (uint32_t id) |
Set cpu task id. | |
uint32_t | getPid () const |
void | setPid (uint32_t pid) |
void | workItemBegin () |
void | workItemEnd () |
Tick | instCount () |
BaseInterrupts * | getInterruptController (ThreadID tid) |
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::InstTracer * | getTracer () |
Provide access to the tracer pointer. | |
int | findContext (ThreadContext *tc) |
Given a Thread Context pointer return the thread num. | |
virtual ThreadContext * | getContext (int tn) |
Given a thread num get tho thread context for it. | |
unsigned | numContexts () |
Get the number of thread contexts available. | |
ThreadID | contextToThread (ContextID cid) |
Convert ContextID to threadID. | |
PARAMS (BaseCPU) | |
BaseCPU (const Params ¶ms, bool is_checker=false) | |
virtual | ~BaseCPU () |
void | regStats () override |
Callback to set stat parameters. | |
void | registerThreadContexts () |
void | deschedulePowerGatingEvent () |
void | schedulePowerGatingEvent () |
virtual void | setReset (bool state) |
Set the reset of the CPU to be either asserted or deasserted. | |
void | flushTLBs () |
Flush all TLBs in the CPU. | |
bool | switchedOut () const |
Determine if the CPU is switched out. | |
Addr | cacheLineSize () const |
Get the cache line size of the system. | |
void | serialize (CheckpointOut &cp) const override |
Serialize this object to the given output stream. | |
void | unserialize (CheckpointIn &cp) override |
Reconstruct the state of this object from a checkpoint. | |
void | scheduleInstStop (ThreadID tid, Counter insts, std::string cause) |
Schedule an event that exits the simulation loops after a predefined number of instructions. | |
void | scheduleSimpointsInstStop (std::vector< Counter > inst_starts) |
Schedule simpoint events using the scheduleInstStop function. | |
void | scheduleInstStopAnyThread (Counter max_insts) |
Schedule an exit event when any threads in the core reach the max_insts instructions using the scheduleInstStop function. | |
uint64_t | getCurrentInstCount (ThreadID tid) |
Get the number of instructions executed by the specified thread on this CPU. | |
void | traceFunctions (Addr pc) |
void | armMonitor (ThreadID tid, Addr address) |
bool | mwait (ThreadID tid, PacketPtr pkt) |
void | mwaitAtomic (ThreadID tid, ThreadContext *tc, BaseMMU *mmu) |
AddressMonitor * | getCpuAddrMonitor (ThreadID tid) |
virtual void | probeInstCommit (const StaticInstPtr &inst, Addr pc) |
Helper method to trigger PMU probes for a committed instruction. | |
Public Member Functions inherited from gem5::ClockedObject | |
ClockedObject (const ClockedObjectParams &p) | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
Public Member Functions inherited from gem5::SimObject | |
const Params & | params () const |
SimObject (const Params &p) | |
virtual | ~SimObject () |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. | |
virtual void | regProbeListeners () |
Register probe listeners for this object. | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
Public Member Functions inherited from gem5::EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from gem5::Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. | |
virtual void | notifyFork () |
Notify a child process of a fork. | |
Public Member Functions inherited from gem5::statistics::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Public Member Functions inherited from gem5::Clocked | |
void | updateClockPeriod () |
Update the tick to the current tick. | |
Tick | clockEdge (Cycles cycles=Cycles(0)) const |
Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. | |
Tick | nextCycle () const |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. | |
uint64_t | frequency () const |
Tick | clockPeriod () const |
double | voltage () const |
Cycles | ticksToCycles (Tick t) const |
Tick | cyclesToTicks (Cycles c) const |
Public Attributes | |
BaseMMU * | mmu |
Status | _status |
Overall CPU status. | |
ProbePointArg< PacketPtr > * | ppInstAccessComplete |
ProbePointArg< std::pair< DynInstPtr, PacketPtr > > * | ppDataAccessComplete |
int | instcount |
Count of total number of dynamic instructions in flight. | |
std::list< DynInstPtr > | instList |
List of all the instructions in flight. | |
std::queue< ListIt > | removeList |
List of all the instructions that will be removed at the end of this cycle. | |
bool | removeInstsThisCycle |
Records if instructions need to be removed this cycle due to being retired or squashed. | |
TimeBuffer< TimeStruct > | timeBuffer |
The main time buffer to do backwards communication. | |
TimeBuffer< FetchStruct > | fetchQueue |
The fetch stage's instruction queue. | |
TimeBuffer< DecodeStruct > | decodeQueue |
The decode stage's instruction queue. | |
TimeBuffer< RenameStruct > | renameQueue |
The rename stage's instruction queue. | |
TimeBuffer< IEWStruct > | iewQueue |
The IEW stage's instruction queue. | |
InstSeqNum | globalSeqNum |
The global sequence number counter. | |
gem5::Checker< DynInstPtr > * | checker |
Pointer to the checker, which can dynamically verify instruction results at run time. | |
System * | system |
Pointer to the system. | |
std::vector< ThreadState * > | thread |
Pointers to all of the threads in the CPU. | |
std::list< int > | cpuWaitList |
Threads Scheduled to Enter CPU. | |
Cycles | lastRunningCycle |
The cycle that the CPU was last running, used for statistics. | |
Tick | lastActivatedCycle |
The cycle that the CPU was last activated by a new thread. | |
std::map< ThreadID, unsigned > | threadMap |
Mapping for system thread id to cpu id. | |
std::vector< ThreadID > | tids |
Available thread ids in the cpu. | |
gem5::o3::CPU::CPUStats | cpuStats |
Public Attributes inherited from gem5::BaseCPU | |
ThreadID | numThreads |
Number of threads we're actually simulating (<= SMT_MAX_THREADS). | |
System * | system |
gem5::BaseCPU::BaseCPUStats | baseStats |
Cycles | syscallRetryLatency |
std::vector< std::unique_ptr< FetchCPUStats > > | fetchStats |
std::vector< std::unique_ptr< ExecuteCPUStats > > | executeStats |
std::vector< std::unique_ptr< CommitCPUStats > > | commitStats |
Public Attributes inherited from gem5::ClockedObject | |
PowerState * | powerState |
Protected Attributes | |
Fetch | fetch |
The fetch stage. | |
Decode | decode |
The decode stage. | |
Rename | rename |
The dispatch stage. | |
IEW | iew |
The issue/execute/writeback stages. | |
Commit | commit |
The commit stage. | |
PhysRegFile | regFile |
The register file. | |
UnifiedFreeList | freeList |
The free list. | |
PerThreadUnifiedRenameMap | renameMap |
The rename map. | |
PerThreadUnifiedRenameMap | commitRenameMap |
The commit rename map. | |
ROB | rob |
The re-order buffer. | |
std::list< ThreadID > | activeThreads |
Active Threads List. | |
std::unordered_map< ThreadID, bool > | exitingThreads |
This is a list of threads that are trying to exit. | |
Scoreboard | scoreboard |
Integer Register Scoreboard. | |
std::vector< BaseISA * > | isa |
Protected Attributes inherited from gem5::BaseCPU | |
Tick | instCnt |
Instruction count used for SPARC misc register. | |
int | _cpuId |
const uint32_t | _socketId |
Each cpu will have a socket ID that corresponds to its physical location in the system. | |
RequestorID | _instRequestorId |
instruction side request id that must be placed in all requests | |
RequestorID | _dataRequestorId |
data side request id that must be placed in all requests | |
uint32_t | _taskId |
An intrenal representation of a task identifier within gem5. | |
uint32_t | _pid |
The current OS process ID that is executing on this processor. | |
bool | _switchedOut |
Is the CPU switched out or active? | |
const Addr | _cacheLineSize |
Cache the cache line size that we get from the system. | |
SignalSinkPort< bool > | modelResetPort |
std::vector< BaseInterrupts * > | interrupts |
std::vector< ThreadContext * > | threadContexts |
trace::InstTracer * | tracer |
Cycles | previousCycle |
CPUState | previousState |
const Cycles | pwrGatingLatency |
const bool | powerGatingOnIdle |
EventFunctionWrapper | enterPwrGatingEvent |
probing::PMUUPtr | ppRetiredInsts |
Instruction commit probe point. | |
probing::PMUUPtr | ppRetiredInstsPC |
probing::PMUUPtr | ppRetiredLoads |
Retired load instructions. | |
probing::PMUUPtr | ppRetiredStores |
Retired store instructions. | |
probing::PMUUPtr | ppRetiredBranches |
Retired branches (any type) | |
probing::PMUUPtr | ppAllCycles |
CPU cycle counter even if any thread Context is suspended. | |
probing::PMUUPtr | ppActiveCycles |
CPU cycle counter, only counts if any thread contexts is active. | |
ProbePointArg< bool > * | ppSleeping |
ProbePoint that signals transitions of threadContexts sets. | |
Protected Attributes inherited from gem5::SimObject | |
const SimObjectParams & | _params |
Cached copy of the object parameters. | |
Protected Attributes inherited from gem5::EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. | |
Private Member Functions | |
void | scheduleTickEvent (Cycles delay) |
Schedule tick event, regardless of its current state. | |
void | unscheduleTickEvent () |
Unschedule tick event, regardless of its current state. | |
bool | tryDrain () |
Check if the pipeline has drained and signal drain done. | |
void | drainSanityCheck () const |
Perform sanity checks after a drain. | |
bool | isCpuDrained () const |
Check if a system is in a drained state. | |
Private Attributes | |
EventFunctionWrapper | tickEvent |
The tick event used for scheduling CPU ticks. | |
EventFunctionWrapper | threadExitEvent |
The exit event used for terminating all ready-to-exit threads. | |
ActivityRecorder | activityRec |
The activity recorder; used to tell if the CPU has any activity remaining or if it can go to idle and deschedule itself. | |
Friends | |
class | ThreadContext |
Additional Inherited Members | |
Static Public Member Functions inherited from gem5::BaseCPU | |
static int | numSimulatedCPUs () |
static Counter | numSimulatedInsts () |
static Counter | numSimulatedOps () |
Static Public Member Functions inherited from gem5::SimObject | |
static void | serializeAll (const std::string &cpt_dir) |
Create a checkpoint by serializing all SimObjects in the system. | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. | |
static void | setSimObjectResolver (SimObjectResolver *resolver) |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
static SimObjectResolver * | getSimObjectResolver () |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
Static Public Member Functions inherited from gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Static Public Attributes inherited from gem5::BaseCPU | |
static const uint32_t | invldPid = std::numeric_limits<uint32_t>::max() |
Invalid or unknown Pid. | |
Protected Types inherited from gem5::BaseCPU | |
enum | CPUState { CPU_STATE_ON , CPU_STATE_SLEEP , CPU_STATE_WAKEUP } |
Protected Member Functions inherited from gem5::BaseCPU | |
void | updateCycleCounters (CPUState state) |
base method keeping track of cycle progression | |
void | enterPwrGating () |
probing::PMUUPtr | pmuProbePoint (const char *name) |
Helper method to instantiate probe points belonging to this object. | |
Protected Member Functions inherited from gem5::Drainable | |
Drainable () | |
virtual | ~Drainable () |
void | signalDrainDone () const |
Signal that an object is drained. | |
Protected Member Functions inherited from gem5::Clocked | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. | |
void | resetClock () const |
Reset the object's clock using the current global tick value. | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. | |
Static Protected Attributes inherited from gem5::BaseCPU | |
static std::unique_ptr< GlobalStats > | globalStats |
Pointer to the global stat structure. | |
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buffers between stages.
typedef std::list<DynInstPtr>::iterator gem5::o3::CPU::ListIt |
Enum to give each stage a specific index, so when calling activateStage() or deactivateStage(), they can specify which stage is being activated/deactivated.
Enumerator | |
---|---|
FetchIdx | |
DecodeIdx | |
RenameIdx | |
IEWIdx | |
CommitIdx | |
NumStages |
gem5::o3::CPU::CPU | ( | const BaseO3CPUParams & | params | ) |
|
overridevirtual |
Add Thread to Active Threads List.
Reimplemented from gem5::BaseCPU.
Definition at line 515 of file cpu.cc.
References _status, gem5::BaseCPU::activateContext(), activateThread(), gem5::ActivityRecorder::activity(), activityRec, cpuStats, gem5::Clocked::curCycle(), gem5::curTick(), gem5::Drained, gem5::Drainable::drainState(), fetch, lastActivatedCycle, lastRunningCycle, gem5::o3::CPU::CPUStats::quiesceCycles, Running, scheduleTickEvent(), gem5::BaseCPU::switchedOut(), and gem5::o3::Fetch::wakeFromQuiesce().
Referenced by gem5::o3::ThreadContext::activate(), drain(), and insertThread().
|
inline |
Changes a stage's status to active within the activity recorder.
Definition at line 492 of file cpu.hh.
References gem5::ActivityRecorder::activateStage(), and activityRec.
Referenced by gem5::o3::IEW::activateStage(), gem5::o3::Commit::startupStage(), gem5::o3::IEW::startupStage(), gem5::o3::Fetch::switchToActive(), gem5::o3::Fetch::updateFetchStatus(), gem5::o3::Commit::updateStatus(), gem5::o3::Decode::updateStatus(), and gem5::o3::Rename::updateStatus().
void gem5::o3::CPU::activateThread | ( | ThreadID | tid | ) |
Add Thread to Active Threads List.
Definition at line 451 of file cpu.cc.
References activeThreads, DPRINTF, and gem5::BaseCPU::switchedOut().
Referenced by activateContext(), and drainResume().
|
inline |
Records that there was time buffer activity this cycle.
Definition at line 488 of file cpu.hh.
References gem5::ActivityRecorder::activity(), and activityRec.
Referenced by gem5::o3::IEW::activityThisCycle(), gem5::o3::LSQUnit::completeStore(), gem5::o3::IEW::executeInsts(), gem5::o3::Fetch::finishTranslation(), gem5::o3::InstructionQueue::scheduleReadyInsts(), gem5::o3::Commit::squashFromSquashAfter(), gem5::o3::Commit::squashFromTC(), gem5::o3::Commit::squashFromTrap(), gem5::o3::Commit::startupStage(), gem5::o3::IEW::takeOverFrom(), gem5::o3::Commit::tick(), gem5::o3::Decode::tick(), gem5::o3::Fetch::tick(), gem5::o3::IEW::tick(), and gem5::o3::Rename::tick().
CPU::ListIt gem5::o3::CPU::addInst | ( | const DynInstPtr & | inst | ) |
Function to add instruction onto the head of the list of the instructions.
Used when new instructions are fetched.
Definition at line 1133 of file cpu.cc.
References instList.
Referenced by gem5::o3::Fetch::buildInst().
void gem5::o3::CPU::addThreadToExitingList | ( | ThreadID | tid | ) |
Insert tid to the list of threads trying to exit.
Definition at line 1378 of file cpu.cc.
References DPRINTF, exitingThreads, gem5::ThreadContext::Halted, gem5::ArmISA::status, and tcBase().
Referenced by gem5::o3::ThreadContext::halt().
void gem5::o3::CPU::cleanUpRemovedInsts | ( | ) |
Cleans up all instructions on the remove list.
Definition at line 1265 of file cpu.cc.
References DPRINTF, instList, removeInstsThisCycle, and removeList.
Referenced by tick().
void gem5::o3::CPU::commitDrained | ( | ThreadID | tid | ) |
Commit has reached a safe point to drain a thread.
Commit calls this method to inform the pipeline that it has reached a point where it is not executed microcode and is about to squash uncommitted instructions to fully drain the pipeline.
Definition at line 852 of file cpu.cc.
References gem5::o3::Fetch::drainStall(), and fetch.
Referenced by gem5::o3::Commit::commitInsts().
|
inline |
Changes a stage's status to inactive within the activity recorder.
Definition at line 499 of file cpu.hh.
References activityRec, and gem5::ActivityRecorder::deactivateStage().
Referenced by gem5::o3::IEW::deactivateStage(), gem5::o3::Fetch::switchToInactive(), gem5::o3::Fetch::updateFetchStatus(), gem5::o3::Commit::updateStatus(), gem5::o3::Decode::updateStatus(), and gem5::o3::Rename::updateStatus().
void gem5::o3::CPU::deactivateThread | ( | ThreadID | tid | ) |
Remove Thread from Active Threads List.
Definition at line 467 of file cpu.cc.
References activeThreads, commit, gem5::o3::Commit::deactivateThread(), gem5::o3::Fetch::deactivateThread(), DPRINTF, gem5::o3::Commit::executingHtmTransaction(), fetch, and gem5::BaseCPU::switchedOut().
Referenced by haltContext(), and suspendContext().
|
inline |
Definition at line 183 of file cpu.hh.
References gem5::BaseMMU::demapPage(), mmu, and gem5::MipsISA::vaddr.
Referenced by gem5::o3::DynInst::demapPage().
|
overridevirtual |
Starts draining the CPU's pipeline of all instructions in order to stop all memory accesses.
Implements gem5::Drainable.
Definition at line 727 of file cpu.cc.
References activateContext(), gem5::ActivityRecorder::activity(), activityRec, commit, decodeQueue, gem5::EventManager::deschedule(), gem5::BaseCPU::deschedulePowerGatingEvent(), DPRINTF, gem5::o3::Commit::drain(), gem5::Drained, gem5::Draining, drainSanityCheck(), fetchQueue, gem5::ArmISA::i, iewQueue, isCpuDrained(), renameQueue, gem5::Event::scheduled(), gem5::ThreadContext::Suspended, gem5::BaseCPU::switchedOut(), gem5::ArmISA::t, gem5::BaseCPU::threadContexts, tickEvent, timeBuffer, and wakeCPU().
|
overridevirtual |
Resumes execution after a drain.
Reimplemented from gem5::Drainable.
Definition at line 855 of file cpu.cc.
References _status, activateThread(), gem5::ThreadContext::Active, commit, DPRINTF, gem5::o3::Commit::drainResume(), gem5::o3::Fetch::drainResume(), fetch, gem5::ArmISA::i, Idle, gem5::Clocked::nextCycle(), Running, gem5::EventManager::schedule(), gem5::Event::scheduled(), gem5::BaseCPU::schedulePowerGatingEvent(), gem5::ArmISA::status, gem5::BaseCPU::switchedOut(), thread, tickEvent, and verifyMemoryMode().
|
private |
Perform sanity checks after a drain.
This method is called from drain() when it has determined that the CPU is fully drained when gem5 is compiled with the NDEBUG macro undefined. The intention of this method is to do more extensive tests than the isDrained() method to weed out any draining bugs.
Definition at line 804 of file cpu.cc.
References commit, decode, gem5::o3::Commit::drainSanityCheck(), gem5::o3::Decode::drainSanityCheck(), gem5::o3::Fetch::drainSanityCheck(), gem5::o3::IEW::drainSanityCheck(), gem5::o3::Rename::drainSanityCheck(), fetch, iew, isCpuDrained(), and rename.
Referenced by drain().
void gem5::o3::CPU::dumpInsts | ( | ) |
Debug function to print all instructions on the list.
Definition at line 1289 of file cpu.cc.
References gem5::cprintf(), and instList.
Referenced by gem5::o3::DynInst::DynInst().
void gem5::o3::CPU::exitThreads | ( | ) |
Terminate all threads that are ready to exit.
Definition at line 1423 of file cpu.cc.
References DPRINTF, exitingThreads, haltContext(), gem5::ThreadContext::Halted, gem5::ThreadContext::setStatus(), and tcBase().
|
inline |
Get the current instruction sequence number, and increment it.
Definition at line 284 of file cpu.hh.
References globalSeqNum.
Referenced by gem5::o3::Fetch::buildInst().
Architectural register accessors.
Looks up in the commit rename table to obtain the true physical index of the architected register first, then accesses that physical register.
Definition at line 1074 of file cpu.cc.
References commitRenameMap, gem5::RegId::flatten(), gem5::o3::PhysRegFile::getReg(), isa, gem5::X86ISA::reg, and regFile.
Referenced by gem5::o3::ThreadContext::getReg(), and gem5::o3::ThreadContext::getReg().
Definition at line 1082 of file cpu.cc.
References commitRenameMap, gem5::RegId::flatten(), gem5::o3::PhysRegFile::getReg(), isa, gem5::X86ISA::reg, regFile, and gem5::X86ISA::val.
|
inlineoverridevirtual |
Get the dcache port (used to find block size for translations).
Implements gem5::BaseCPU.
Definition at line 571 of file cpu.hh.
References gem5::o3::LSQ::getDataPort(), iew, and gem5::o3::IEW::ldstQueue.
ThreadID gem5::o3::CPU::getFreeTid | ( | ) |
Gets a free thread id.
Use if thread ids change across system.
Definition at line 1349 of file cpu.cc.
References gem5::InvalidThreadID, gem5::BaseCPU::numThreads, and tids.
|
inlineoverridevirtual |
Used by the fetch unit to get a hold of the instruction port.
Implements gem5::BaseCPU.
Definition at line 564 of file cpu.hh.
References fetch, and gem5::o3::Fetch::getInstPort().
Referenced by gem5::o3::Fetch::takeOverFrom().
Fault gem5::o3::CPU::getInterrupts | ( | ) |
Returns the Fault for any valid interrupt.
Definition at line 685 of file cpu.cc.
References gem5::BaseCPU::interrupts.
Referenced by gem5::o3::Commit::handleInterrupt(), and gem5::o3::Commit::propagateInterrupt().
RegVal gem5::o3::CPU::getReg | ( | PhysRegIdPtr | phys_reg, |
ThreadID | tid ) |
Definition at line 954 of file cpu.cc.
References gem5::CCRegClass, gem5::PhysRegId::classValue(), gem5::BaseCPU::executeStats, gem5::FloatRegClass, gem5::o3::PhysRegFile::getReg(), gem5::IntRegClass, regFile, gem5::VecElemClass, gem5::VecPredRegClass, and gem5::VecRegClass.
Referenced by gem5::o3::DynInst::forwardOldRegs(), gem5::o3::DynInst::getRegOperand(), and gem5::o3::DynInst::getRegOperand().
void gem5::o3::CPU::getReg | ( | PhysRegIdPtr | phys_reg, |
void * | val, | ||
ThreadID | tid ) |
Definition at line 980 of file cpu.cc.
References gem5::CCRegClass, gem5::PhysRegId::classValue(), gem5::BaseCPU::executeStats, gem5::FloatRegClass, gem5::o3::PhysRegFile::getReg(), gem5::IntRegClass, regFile, gem5::X86ISA::val, gem5::VecElemClass, gem5::VecPredRegClass, and gem5::VecRegClass.
Definition at line 1090 of file cpu.cc.
References commitRenameMap, gem5::RegId::flatten(), gem5::o3::PhysRegFile::getWritableReg(), isa, gem5::X86ISA::reg, and regFile.
Referenced by gem5::o3::ThreadContext::getWritableReg().
void * gem5::o3::CPU::getWritableReg | ( | PhysRegIdPtr | phys_reg, |
ThreadID | tid ) |
Definition at line 1006 of file cpu.cc.
References gem5::PhysRegId::classValue(), gem5::BaseCPU::executeStats, gem5::o3::PhysRegFile::getWritableReg(), regFile, gem5::VecPredRegClass, and gem5::VecRegClass.
Referenced by gem5::o3::DynInst::getWritableRegOperand().
|
inline |
|
overridevirtual |
Remove Thread from Active Threads List && Remove Thread Context from CPU.
Reimplemented from gem5::BaseCPU.
Definition at line 573 of file cpu.cc.
References _status, activeThreads, gem5::BaseCPU::CPU_STATE_SLEEP, gem5::Clocked::curCycle(), deactivateThread(), DPRINTF, Idle, lastRunningCycle, removeThread(), gem5::Event::scheduled(), gem5::BaseCPU::switchedOut(), tickEvent, unscheduleTickEvent(), and gem5::BaseCPU::updateCycleCounters().
Referenced by exitThreads().
|
overridevirtual |
This function is used to instruct the memory subsystem that a transaction should be aborted and the speculative state should be thrown away.
This is called in the transaction's very last breath in the core. Afterwards, the core throws away its speculative state and resumes execution at the point the transaction started, i.e. reverses time. When instruction execution resumes, the core expects the memory subsystem to be in a stable, i.e. pre-speculative, state as well.
Reimplemented from gem5::BaseCPU.
Definition at line 1446 of file cpu.cc.
References gem5::BaseCPU::_dataRequestorId, gem5::X86ISA::addr, commit, gem5::Packet::createRead(), gem5::Packet::dataStatic(), flags, gem5::o3::LSQ::getDataPort(), gem5::Request::HTM_ABORT, iew, gem5::o3::IEW::ldstQueue, panic, gem5::Request::PHYSICAL, gem5::o3::Commit::resetHtmStartsStops(), gem5::o3::LSQ::resetHtmStartsStops(), gem5::RequestPort::sendTimingReq(), gem5::Packet::setHtmTransactional(), gem5::Request::STRICT_ORDER, gem5::BaseCPU::taskId(), and thread.
Referenced by gem5::o3::ThreadContext::htmAbortTransaction().
|
overridevirtual |
Initialize the CPU.
Reimplemented from gem5::BaseCPU.
Definition at line 421 of file cpu.cc.
References commit, gem5::BaseCPU::init(), gem5::BaseCPU::numThreads, gem5::o3::Commit::setThreads(), and thread.
void gem5::o3::CPU::insertThread | ( | ThreadID | tid | ) |
Setup CPU to insert a thread's context.
Definition at line 595 of file cpu.cc.
References activateContext(), gem5::ThreadContext::Active, gem5::CCRegClass, commit, DPRINTF, freeList, gem5::FullSystem, gem5::o3::UnifiedFreeList::getReg(), isa, pcState(), gem5::ThreadContext::pcState(), renameMap, gem5::o3::ROB::resetEntries(), gem5::o3::Commit::rob, scoreboard, gem5::o3::Scoreboard::setReg(), gem5::ThreadContext::setStatus(), system, tcBase(), gem5::System::threads, and gem5::X86ISA::type.
void gem5::o3::CPU::instDone | ( | ThreadID | tid, |
const DynInstPtr & | inst ) |
Function to tell the CPU that an instruction has completed.
Definition at line 1141 of file cpu.cc.
References gem5::BaseCPU::commitStats, gem5::BaseCPU::probeInstCommit(), and thread.
Referenced by gem5::o3::Commit::updateComInstStats().
|
private |
Check if a system is in a drained state.
Definition at line 815 of file cpu.cc.
References commit, decode, DPRINTF, fetch, iew, instList, gem5::o3::Commit::isDrained(), gem5::o3::Decode::isDrained(), gem5::o3::Fetch::isDrained(), gem5::o3::IEW::isDrained(), gem5::o3::Rename::isDrained(), removeList, and rename.
Referenced by drain(), drainSanityCheck(), and tryDrain().
|
inline |
Is the CPU draining?
Definition at line 238 of file cpu.hh.
References gem5::Draining, and gem5::Drainable::drainState().
Referenced by gem5::o3::Fetch::checkStall(), gem5::o3::Fetch::drainStall(), and gem5::o3::ThreadContext::suspend().
bool gem5::o3::CPU::isThreadExiting | ( | ThreadID | tid | ) | const |
Is the thread trying to exit?
Definition at line 1397 of file cpu.cc.
References exitingThreads.
Referenced by gem5::o3::Commit::commit(), gem5::o3::ROB::doSquash(), and gem5::o3::Commit::getCommittingThread().
|
inline |
Returns the Number of Active Threads in the CPU.
Definition at line 200 of file cpu.hh.
References activeThreads.
void gem5::o3::CPU::pcState | ( | const PCStateBase & | new_pc_state, |
ThreadID | tid ) |
Sets the commit PC state of a specific thread.
Definition at line 1120 of file cpu.cc.
References commit, gem5::o3::Commit::pcState(), and gem5::X86ISA::val.
Referenced by gem5::o3::Fetch::clearStates(), insertThread(), gem5::o3::ThreadContext::pcState(), gem5::o3::ThreadContext::pcState(), gem5::o3::ThreadContext::pcStateNoRecord(), and gem5::o3::Fetch::resetStage().
const PCStateBase & gem5::o3::CPU::pcState | ( | ThreadID | tid | ) |
Reads the commit PC state of a specific thread.
Definition at line 1114 of file cpu.cc.
References commit, and gem5::o3::Commit::pcState().
void gem5::o3::CPU::processInterrupts | ( | const Fault & | interrupt | ) |
Processes any an interrupt fault.
Definition at line 692 of file cpu.cc.
References DPRINTF, gem5::BaseCPU::interrupts, gem5::NoFault, and trap().
Referenced by gem5::o3::Commit::handleInterrupt().
|
inline |
CPU pushRequest function, forwards request to LSQ.
Definition at line 552 of file cpu.hh.
References gem5::X86ISA::addr, data, flags, iew, gem5::o3::IEW::ldstQueue, and gem5::o3::LSQ::pushRequest().
Referenced by gem5::o3::DynInst::initiateMemAMO(), gem5::o3::DynInst::initiateMemMgmtCmd(), gem5::o3::DynInst::initiateMemRead(), and gem5::o3::DynInst::writeMem().
Reads a misc.
register, including any side effects the read might have as defined by the architecture.
Definition at line 934 of file cpu.cc.
References gem5::BaseCPU::executeStats, and isa.
Referenced by gem5::o3::DynInst::readMiscReg(), gem5::o3::ThreadContext::readMiscReg(), and gem5::o3::DynInst::readMiscRegOperand().
Register accessors.
Index refers to the physical register index. Reads a miscellaneous register.
Definition at line 928 of file cpu.cc.
References isa.
Referenced by gem5::o3::ThreadContext::readMiscRegNoEffect().
|
overridevirtual |
Register probe points.
Reimplemented from gem5::BaseCPU.
Definition at line 323 of file cpu.cc.
References commit, fetch, gem5::SimObject::getProbeManager(), iew, ppDataAccessComplete, ppInstAccessComplete, gem5::BaseCPU::regProbePoints(), gem5::o3::Commit::regProbePoints(), gem5::o3::Fetch::regProbePoints(), gem5::o3::IEW::regProbePoints(), gem5::o3::Rename::regProbePoints(), and rename.
void gem5::o3::CPU::removeFrontInst | ( | const DynInstPtr & | inst | ) |
Remove an instruction from the front end of the list.
There's no restriction on location of the instruction.
Definition at line 1160 of file cpu.cc.
References DPRINTF, removeInstsThisCycle, and removeList.
Referenced by gem5::o3::ROB::retireHead().
void gem5::o3::CPU::removeInstsNotInROB | ( | ThreadID | tid | ) |
Remove all instructions that are not currently in the ROB.
There's also an option to not squash delay slot instructions.
Definition at line 1173 of file cpu.cc.
References DPRINTF, instList, gem5::o3::ROB::isEmpty(), gem5::o3::ROB::readTailInst(), removeInstsThisCycle, rob, and squashInstIt().
Referenced by gem5::o3::Fetch::squash().
void gem5::o3::CPU::removeInstsUntil | ( | const InstSeqNum & | seq_num, |
ThreadID | tid ) |
Remove all instructions younger than the given sequence number.
Definition at line 1217 of file cpu.cc.
References DPRINTF, instList, removeInstsThisCycle, and squashInstIt().
Referenced by gem5::o3::Decode::squash(), and gem5::o3::Fetch::squashFromDecode().
void gem5::o3::CPU::removeThread | ( | ThreadID | tid | ) |
Remove all of a thread's context from CPU.
Definition at line 633 of file cpu.cc.
References gem5::o3::Commit::clearStates(), gem5::o3::Decode::clearStates(), gem5::o3::Fetch::clearStates(), gem5::o3::IEW::clearStates(), gem5::o3::Rename::clearStates(), commit, decode, decodeQueue, DPRINTF, fetch, fetchQueue, gem5::o3::InstructionQueue::getCount(), gem5::o3::LSQ::getCount(), gem5::ArmISA::i, iew, iewQueue, gem5::o3::IEW::instQueue, gem5::o3::ROB::isEmpty(), gem5::o3::IEW::ldstQueue, rename, renameQueue, gem5::o3::Commit::rob, and timeBuffer.
Referenced by haltContext().
void gem5::o3::CPU::scheduleThreadExitEvent | ( | ThreadID | tid | ) |
If a thread is trying to exit and its corresponding trap event has been completed, schedule an event to terminate the thread.
Definition at line 1403 of file cpu.cc.
References exitingThreads, gem5::Clocked::nextCycle(), gem5::EventManager::schedule(), gem5::Event::scheduled(), and threadExitEvent.
Referenced by gem5::o3::Commit::commit().
|
inlineprivate |
Schedule tick event, regardless of its current state.
Definition at line 129 of file cpu.hh.
References gem5::Clocked::clockEdge(), gem5::EventManager::reschedule(), gem5::EventManager::schedule(), gem5::Event::scheduled(), gem5::Event::squashed(), and tickEvent.
Referenced by activateContext().
|
overridevirtual |
Serialize a single thread.
cp | The stream to serialize to. |
tid | ID of the current thread. |
Reimplemented from gem5::BaseCPU.
Definition at line 715 of file cpu.cc.
References thread.
Definition at line 1106 of file cpu.cc.
References commitRenameMap, gem5::RegId::flatten(), isa, gem5::X86ISA::reg, regFile, gem5::o3::PhysRegFile::setReg(), and gem5::X86ISA::val.
Definition at line 1098 of file cpu.cc.
References commitRenameMap, gem5::RegId::flatten(), isa, gem5::X86ISA::reg, regFile, gem5::o3::PhysRegFile::setReg(), and gem5::X86ISA::val.
Referenced by gem5::o3::ThreadContext::setReg(), and gem5::o3::ThreadContext::setReg().
Sets a misc.
register, including any side effects the write might have as defined by the architecture.
Definition at line 947 of file cpu.cc.
References gem5::BaseCPU::executeStats, isa, and gem5::X86ISA::val.
Referenced by gem5::o3::ThreadContext::setMiscReg(), and gem5::o3::DynInst::updateMiscRegs().
Sets a miscellaneous register.
Definition at line 941 of file cpu.cc.
References isa, and gem5::X86ISA::val.
Referenced by gem5::o3::ThreadContext::setMiscRegNoEffect().
void gem5::o3::CPU::setReg | ( | PhysRegIdPtr | phys_reg, |
const void * | val, | ||
ThreadID | tid ) |
Definition at line 1048 of file cpu.cc.
References gem5::CCRegClass, gem5::PhysRegId::classValue(), gem5::BaseCPU::executeStats, gem5::FloatRegClass, gem5::IntRegClass, regFile, gem5::o3::PhysRegFile::setReg(), gem5::X86ISA::val, gem5::VecElemClass, gem5::VecPredRegClass, and gem5::VecRegClass.
void gem5::o3::CPU::setReg | ( | PhysRegIdPtr | phys_reg, |
RegVal | val, | ||
ThreadID | tid ) |
Definition at line 1022 of file cpu.cc.
References gem5::CCRegClass, gem5::PhysRegId::classValue(), gem5::BaseCPU::executeStats, gem5::FloatRegClass, gem5::IntRegClass, regFile, gem5::o3::PhysRegFile::setReg(), gem5::X86ISA::val, gem5::VecElemClass, gem5::VecPredRegClass, and gem5::VecRegClass.
Referenced by gem5::o3::DynInst::setRegOperand(), and gem5::o3::DynInst::setRegOperand().
void gem5::o3::CPU::squashFromTC | ( | ThreadID | tid | ) |
Initiates a squash of all in-flight instructions for a given thread.
The source of the squash is an external update of state through the TC.
Definition at line 1126 of file cpu.cc.
References commit, gem5::o3::Commit::generateTCEvent(), and thread.
Referenced by gem5::o3::ThreadContext::conditionalSquash().
Removes the instruction pointed to by the iterator.
Definition at line 1245 of file cpu.cc.
References DPRINTF, and removeList.
Referenced by removeInstsNotInROB(), and removeInstsUntil().
|
overridevirtual |
startup() is the final initialization call before simulation.
All state is initialized (including unserialized state, if any, such as the curTick() value), so this is the appropriate place to schedule initial event(s) for objects that need them.
Reimplemented from gem5::BaseCPU.
Definition at line 439 of file cpu.cc.
References commit, decode, fetch, iew, rename, gem5::BaseCPU::startup(), gem5::o3::Commit::startupStage(), gem5::o3::Decode::startupStage(), gem5::o3::Fetch::startupStage(), gem5::o3::IEW::startupStage(), and gem5::o3::Rename::startupStage().
|
overridevirtual |
Remove Thread from Active Threads List.
Reimplemented from gem5::BaseCPU.
Definition at line 553 of file cpu.cc.
References _status, activeThreads, gem5::Clocked::curCycle(), deactivateThread(), DPRINTF, Idle, lastRunningCycle, gem5::BaseCPU::suspendContext(), gem5::BaseCPU::switchedOut(), and unscheduleTickEvent().
Referenced by gem5::o3::ThreadContext::suspend().
|
overridevirtual |
Switches out this CPU.
Reimplemented from gem5::BaseCPU.
Definition at line 884 of file cpu.cc.
References _status, activityRec, checker, DPRINTF, gem5::ActivityRecorder::reset(), SwitchedOut, gem5::BaseCPU::switchOut(), and gem5::Checker< class >::switchOut().
|
overridevirtual |
Takes over from another CPU.
Reimplemented from gem5::BaseCPU.
Definition at line 898 of file cpu.cc.
References _status, commit, gem5::Clocked::curCycle(), decode, fetch, globalSeqNum, Idle, iew, lastRunningCycle, rename, gem5::Event::scheduled(), gem5::BaseCPU::takeOverFrom(), gem5::o3::Commit::takeOverFrom(), gem5::o3::Decode::takeOverFrom(), gem5::o3::Fetch::takeOverFrom(), gem5::o3::IEW::takeOverFrom(), gem5::o3::Rename::takeOverFrom(), and tickEvent.
|
inline |
Returns a pointer to a thread context.
Definition at line 515 of file cpu.hh.
References thread.
Referenced by addThreadToExitingList(), gem5::o3::Fetch::buildInst(), gem5::o3::Commit::clearStates(), exitThreads(), gem5::o3::LSQUnit::getLatestHtmUid(), gem5::o3::LSQUnit::insertLoad(), insertThread(), gem5::o3::LSQUnit::read(), gem5::o3::LSQUnit::squash(), and gem5::o3::LSQUnit::writebackStores().
void gem5::o3::CPU::tick | ( | ) |
Ticks CPU, calling tick() on each stage, and checking the overall activity to see if the CPU should deschedule itself.
Definition at line 363 of file cpu.cc.
References _status, gem5::ActivityRecorder::active(), activityRec, gem5::ActivityRecorder::advance(), gem5::BaseCPU::baseStats, cleanUpRemovedInsts(), gem5::Clocked::clockEdge(), commit, gem5::BaseCPU::CPU_STATE_ON, cpuStats, gem5::Clocked::curCycle(), decode, decodeQueue, DPRINTF, gem5::Drained, gem5::Drainable::drainState(), fetch, fetchQueue, gem5::FullSystem, Idle, iew, iewQueue, lastRunningCycle, gem5::BaseCPU::BaseCPUStats::numCycles, removeInstsThisCycle, rename, renameQueue, gem5::EventManager::schedule(), gem5::Event::scheduled(), SwitchedOut, gem5::BaseCPU::switchedOut(), gem5::o3::Commit::tick(), gem5::o3::Decode::tick(), gem5::o3::Fetch::tick(), gem5::o3::IEW::tick(), gem5::o3::Rename::tick(), tickEvent, timeBuffer, gem5::o3::CPU::CPUStats::timesIdled, tryDrain(), gem5::BaseCPU::updateCycleCounters(), and updateThreadPriority().
Referenced by CPU().
|
overridevirtual |
Count the Total Instructions Committed in the CPU.
Implements gem5::BaseCPU.
Definition at line 491 of file cpu.cc.
References gem5::ArmISA::i, thread, and gem5::statistics::total.
|
overridevirtual |
Count the Total Ops (including micro ops) committed in the CPU.
Implements gem5::BaseCPU.
Definition at line 503 of file cpu.cc.
References gem5::ArmISA::i, thread, and gem5::statistics::total.
void gem5::o3::CPU::trap | ( | const Fault & | fault, |
ThreadID | tid, | ||
const StaticInstPtr & | inst ) |
Traps to handle given fault.
Definition at line 708 of file cpu.cc.
References gem5::BaseCPU::threadContexts.
Referenced by gem5::o3::Commit::commitHead(), processInterrupts(), and gem5::o3::DynInst::trap().
|
private |
Check if the pipeline has drained and signal drain done.
This method checks if a drain has been requested and if the CPU has drained successfully (i.e., there are no instructions in the pipeline). If the CPU has drained, it deschedules the tick event and signals the drain manager.
Definition at line 789 of file cpu.cc.
References gem5::EventManager::deschedule(), DPRINTF, gem5::Draining, gem5::Drainable::drainState(), isCpuDrained(), gem5::Event::scheduled(), gem5::Drainable::signalDrainDone(), and tickEvent.
Referenced by tick().
|
inlineprivate |
Unschedule tick event, regardless of its current state.
Definition at line 139 of file cpu.hh.
References gem5::Event::scheduled(), gem5::Event::squash(), and tickEvent.
Referenced by haltContext(), and suspendContext().
|
overridevirtual |
Unserialize one thread.
cp | The checkpoint use. |
tid | ID of the current thread. |
Reimplemented from gem5::BaseCPU.
Definition at line 721 of file cpu.cc.
References thread.
void gem5::o3::CPU::updateThreadPriority | ( | ) |
Update The Order In Which We Process Threads.
Definition at line 1362 of file cpu.cc.
References activeThreads.
Referenced by tick().
|
overridevirtual |
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 from gem5::BaseCPU.
Definition at line 919 of file cpu.cc.
References fatal, gem5::System::isTimingMode(), and system.
Referenced by drainResume().
void gem5::o3::CPU::wakeCPU | ( | ) |
Wakes the CPU, rescheduling the CPU if it's not already active.
Definition at line 1316 of file cpu.cc.
References gem5::ActivityRecorder::active(), activityRec, gem5::BaseCPU::baseStats, gem5::Clocked::clockEdge(), cpuStats, gem5::Clocked::curCycle(), DPRINTF, gem5::o3::CPU::CPUStats::idleCycles, lastRunningCycle, gem5::BaseCPU::BaseCPUStats::numCycles, gem5::EventManager::schedule(), gem5::Event::scheduled(), and tickEvent.
Referenced by gem5::o3::InstructionQueue::cacheUnblocked(), gem5::o3::LSQUnit::completeStore(), drain(), gem5::o3::Fetch::finishTranslation(), gem5::o3::Fetch::processCacheCompletion(), gem5::o3::IEW::wakeCPU(), and wakeup().
|
overridevirtual |
Implements gem5::BaseCPU.
Definition at line 1337 of file cpu.cc.
References DPRINTF, gem5::ArmISA::status, gem5::ThreadContext::Suspended, thread, gem5::BaseCPU::threadContexts, and wakeCPU().
Referenced by gem5::o3::LSQ::DcachePort::recvTimingSnoopReq().
|
friend |
Status gem5::o3::CPU::_status |
Overall CPU status.
Definition at line 117 of file cpu.hh.
Referenced by activateContext(), drainResume(), haltContext(), suspendContext(), switchOut(), takeOverFrom(), and tick().
Active Threads List.
Definition at line 435 of file cpu.hh.
Referenced by activateThread(), deactivateThread(), haltContext(), numActiveThreads(), suspendContext(), and updateThreadPriority().
|
private |
The activity recorder; used to tell if the CPU has any activity remaining or if it can go to idle and deschedule itself.
Definition at line 484 of file cpu.hh.
Referenced by activateContext(), activateStage(), activityThisCycle(), deactivateStage(), drain(), switchOut(), tick(), and wakeCPU().
gem5::Checker<DynInstPtr>* gem5::o3::CPU::checker |
Pointer to the checker, which can dynamically verify instruction results at run time.
This can be set to NULL if it is not being used.
Definition at line 527 of file cpu.hh.
Referenced by gem5::o3::Commit::commitHead(), gem5::o3::Commit::commitInsts(), gem5::o3::DynInst::completeAcc(), gem5::o3::LSQUnit::completeStore(), gem5::o3::Commit::handleInterrupt(), gem5::o3::LSQ::pushRequest(), gem5::o3::IEW::startupStage(), gem5::o3::LSQUnit::storePostSend(), and switchOut().
|
protected |
The commit stage.
Definition at line 417 of file cpu.hh.
Referenced by deactivateThread(), drain(), drainResume(), drainSanityCheck(), htmSendAbortSignal(), init(), insertThread(), isCpuDrained(), pcState(), pcState(), regProbePoints(), removeThread(), squashFromTC(), startup(), takeOverFrom(), and tick().
|
protected |
The commit rename map.
Definition at line 429 of file cpu.hh.
Referenced by getArchReg(), getArchReg(), getWritableArchReg(), setArchReg(), and setArchReg().
gem5::o3::CPU::CPUStats gem5::o3::CPU::cpuStats |
Referenced by activateContext(), tick(), and wakeCPU().
std::list<int> gem5::o3::CPU::cpuWaitList |
|
protected |
The decode stage.
Definition at line 408 of file cpu.hh.
Referenced by drainSanityCheck(), isCpuDrained(), removeThread(), startup(), takeOverFrom(), and tick().
TimeBuffer<DecodeStruct> gem5::o3::CPU::decodeQueue |
The decode stage's instruction queue.
Definition at line 471 of file cpu.hh.
Referenced by drain(), removeThread(), and tick().
|
protected |
This is a list of threads that are trying to exit.
Each thread id is mapped to a boolean value denoting whether the thread is ready to exit.
Definition at line 442 of file cpu.hh.
Referenced by addThreadToExitingList(), exitThreads(), isThreadExiting(), and scheduleThreadExitEvent().
|
protected |
The fetch stage.
Definition at line 405 of file cpu.hh.
Referenced by activateContext(), commitDrained(), deactivateThread(), drainResume(), drainSanityCheck(), gem5::o3::ThreadContext::getDecoderPtr(), getInstPort(), isCpuDrained(), regProbePoints(), removeThread(), startup(), takeOverFrom(), and tick().
TimeBuffer<FetchStruct> gem5::o3::CPU::fetchQueue |
The fetch stage's instruction queue.
Definition at line 468 of file cpu.hh.
Referenced by drain(), removeThread(), and tick().
|
protected |
InstSeqNum gem5::o3::CPU::globalSeqNum |
The global sequence number counter.
Definition at line 521 of file cpu.hh.
Referenced by getAndIncrementInstSeq(), and takeOverFrom().
|
protected |
The issue/execute/writeback stages.
Definition at line 414 of file cpu.hh.
Referenced by drainSanityCheck(), getDataPort(), htmSendAbortSignal(), isCpuDrained(), pushRequest(), regProbePoints(), removeThread(), startup(), takeOverFrom(), and tick().
TimeBuffer<IEWStruct> gem5::o3::CPU::iewQueue |
int gem5::o3::CPU::instcount |
Count of total number of dynamic instructions in flight.
Definition at line 380 of file cpu.hh.
Referenced by gem5::o3::DynInst::DynInst(), and gem5::o3::DynInst::~DynInst().
std::list<DynInstPtr> gem5::o3::CPU::instList |
List of all the instructions in flight.
Definition at line 384 of file cpu.hh.
Referenced by addInst(), cleanUpRemovedInsts(), dumpInsts(), gem5::o3::Commit::handleInterrupt(), isCpuDrained(), removeInstsNotInROB(), and removeInstsUntil().
|
protected |
Definition at line 447 of file cpu.hh.
Referenced by gem5::o3::ThreadContext::clearArchRegs(), getArchReg(), getArchReg(), gem5::o3::ThreadContext::getIsaPtr(), getWritableArchReg(), insertThread(), readMiscReg(), readMiscRegNoEffect(), setArchReg(), setArchReg(), setMiscReg(), and setMiscRegNoEffect().
Tick gem5::o3::CPU::lastActivatedCycle |
The cycle that the CPU was last activated by a new thread.
Definition at line 542 of file cpu.hh.
Referenced by activateContext().
Cycles gem5::o3::CPU::lastRunningCycle |
The cycle that the CPU was last running, used for statistics.
Definition at line 539 of file cpu.hh.
Referenced by activateContext(), haltContext(), suspendContext(), takeOverFrom(), tick(), and wakeCPU().
BaseMMU* gem5::o3::CPU::mmu |
Definition at line 110 of file cpu.hh.
Referenced by demapPage(), gem5::o3::Fetch::fetchCacheLine(), gem5::o3::LSQUnit::getMMUPtr(), gem5::o3::ThreadContext::getMMUPtr(), and gem5::o3::DynInst::mwaitAtomic().
ProbePointArg<std::pair<DynInstPtr, PacketPtr> >* gem5::o3::CPU::ppDataAccessComplete |
Definition at line 177 of file cpu.hh.
Referenced by gem5::o3::LSQUnit::completeDataAccess(), and regProbePoints().
ProbePointArg<PacketPtr>* gem5::o3::CPU::ppInstAccessComplete |
Definition at line 176 of file cpu.hh.
Referenced by gem5::o3::Fetch::processCacheCompletion(), and regProbePoints().
|
protected |
The register file.
Definition at line 420 of file cpu.hh.
Referenced by getArchReg(), getArchReg(), getReg(), getReg(), getWritableArchReg(), getWritableReg(), setArchReg(), setArchReg(), setReg(), and setReg().
bool gem5::o3::CPU::removeInstsThisCycle |
Records if instructions need to be removed this cycle due to being retired or squashed.
Definition at line 401 of file cpu.hh.
Referenced by cleanUpRemovedInsts(), removeFrontInst(), removeInstsNotInROB(), removeInstsUntil(), and tick().
std::queue<ListIt> gem5::o3::CPU::removeList |
List of all the instructions that will be removed at the end of this cycle.
Definition at line 389 of file cpu.hh.
Referenced by cleanUpRemovedInsts(), isCpuDrained(), removeFrontInst(), and squashInstIt().
|
protected |
The dispatch stage.
Definition at line 411 of file cpu.hh.
Referenced by drainSanityCheck(), isCpuDrained(), regProbePoints(), removeThread(), startup(), takeOverFrom(), and tick().
|
protected |
TimeBuffer<RenameStruct> gem5::o3::CPU::renameQueue |
The rename stage's instruction queue.
Definition at line 474 of file cpu.hh.
Referenced by drain(), removeThread(), and tick().
|
protected |
|
protected |
System* gem5::o3::CPU::system |
Pointer to the system.
Definition at line 530 of file cpu.hh.
Referenced by gem5::o3::Fetch::finishTranslation(), gem5::o3::ThreadContext::getSystemPtr(), insertThread(), and verifyMemoryMode().
std::vector<ThreadState *> gem5::o3::CPU::thread |
Pointers to all of the threads in the CPU.
Definition at line 533 of file cpu.hh.
Referenced by gem5::o3::Fetch::buildInst(), gem5::o3::LSQUnit::checkSnoop(), drainResume(), gem5::o3::Fetch::fetchCacheLine(), htmSendAbortSignal(), init(), instDone(), serializeThread(), squashFromTC(), tcBase(), totalInsts(), totalOps(), unserializeThread(), and wakeup().
|
private |
The exit event used for terminating all ready-to-exit threads.
Definition at line 125 of file cpu.hh.
Referenced by scheduleThreadExitEvent().
std::map<ThreadID, unsigned> gem5::o3::CPU::threadMap |
|
private |
The tick event used for scheduling CPU ticks.
Definition at line 122 of file cpu.hh.
Referenced by drain(), drainResume(), haltContext(), scheduleTickEvent(), takeOverFrom(), tick(), tryDrain(), unscheduleTickEvent(), and wakeCPU().
std::vector<ThreadID> gem5::o3::CPU::tids |
TimeBuffer<TimeStruct> gem5::o3::CPU::timeBuffer |
The main time buffer to do backwards communication.
Definition at line 465 of file cpu.hh.
Referenced by drain(), removeThread(), and tick().