Go to the documentation of this file.
43 #ifndef __CPU_O3_CPU_HH__
44 #define __CPU_O3_CPU_HH__
70 #include "params/BaseO3CPU.hh"
191 void init()
override;
392 std::set<InstSeqNum> snList;
514 return thread[tid]->getTC();
556 flags, res, std::move(amo_op), byte_enable);
595 #endif // __CPU_O3_CPU_HH__
This is a simple scalar statistic, like a counter.
void addThreadToExitingList(ThreadID tid)
Insert tid to the list of threads trying to exit.
void dumpInsts()
Debug function to print all instructions on the list.
void * getWritableArchReg(const RegId ®, ThreadID tid)
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.
ProbePointArg< std::pair< DynInstPtr, PacketPtr > > * ppDataAccessComplete
bool isCpuDrained() const
Check if a system is in a drained state.
Memory operation metadata.
std::vector< ThreadID > tids
Available thread ids in the cpu.
std::map< ThreadID, unsigned > threadMap
Mapping for system thread id to cpu id.
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.
std::list< DynInstPtr >::iterator ListIt
gem5::o3::CPU::CPUStats cpuStats
InstSeqNum globalSeqNum
The global sequence number counter.
void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid)
Remove all instructions younger than the given sequence number.
RegVal getReg(PhysRegIdPtr phys_reg, ThreadID tid)
PhysRegFile regFile
The register file.
DrainState drainState() const
Return the current drain state of an object.
RequestPort & getInstPort()
Decode decode
The decode stage.
std::list< ThreadID > activeThreads
Active Threads List.
UnifiedFreeList freeList
The free list.
void processInterrupts(const Fault &interrupt)
Processes any an interrupt fault.
statistics::Scalar quiesceCycles
Stat for total number of cycles the CPU spends descheduled due to a quiesce operation or waiting for ...
Fault getInterrupts()
Returns the Fault for any valid interrupt.
void squashInstIt(const ListIt &instIt, ThreadID tid)
Removes the instruction pointed to by the iterator.
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 s...
Status _status
Overall CPU status.
TimeBuffer< TimeStruct > timeBuffer
The main time buffer to do backwards communication.
InstSeqNum getAndIncrementInstSeq()
Get the current instruction sequence number, and increment it.
std::list< int > cpuWaitList
Threads Scheduled to Enter CPU.
void removeThread(ThreadID tid)
Remove all of a thread's context from CPU.
FreeList class that simply holds the list of free integer and floating point registers.
Implements a simple scoreboard to track which registers are ready.
void schedule(Event &event, Tick when)
void setMiscReg(int misc_reg, RegVal val, ThreadID tid)
Sets a misc.
UnifiedRenameMap renameMap[MaxThreads]
The rename map.
Fetch class handles both single threaded and SMT fetch.
std::list< DynInstPtr > instList
List of all the instructions in flight.
Port & getDataPort() override
Get the dcache port (used to find block size for translations).
void verifyMemoryMode() const override
Verify that the system is in a memory mode supported by the CPU.
void deactivateThread(ThreadID tid)
Remove Thread from Active Threads List.
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
void drainSanityCheck() const
Perform sanity checks after a drain.
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
void cleanUpRemovedInsts()
Cleans up all instructions on the remove list.
void demapPage(Addr vaddr, uint64_t asn)
TimeBuffer< IEWStruct > iewQueue
The IEW stage's instruction queue.
ProbePointArg< PacketPtr > * ppInstAccessComplete
gem5::Checker< DynInstPtr > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
void unscheduleTickEvent()
Unschedule tick event, regardless of its current state.
Cycles is a wrapper class for representing cycle counts, i.e.
Counter totalInsts() const override
Count the Total Instructions Committed in the CPU.
void deactivateStage(const StageIdx idx)
Changes a stage's status to inactive within the activity recorder.
Derived ThreadContext class for use with the O3CPU.
statistics::Scalar idleCycles
Stat for total number of cycles the CPU spends descheduled.
int numActiveThreads()
Returns the Number of Active Threads in the CPU.
TimeBuffer< DecodeStruct > decodeQueue
The decode stage's instruction queue.
DrainState
Object drain/handover states.
bool tryDrain()
Check if the pipeline has drained and signal drain done.
virtual void wakeup(ThreadID tid) override
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
void insertThread(ThreadID tid)
Setup CPU to insert a thread's context.
Port & getInstPort() override
Used by the fetch unit to get a hold of the instruction port.
Commit handles single threaded and SMT commit.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
std::shared_ptr< FaultBase > Fault
void scheduleTickEvent(Cycles delay)
Schedule tick event, regardless of its current state.
Counter totalOps() const override
Count the Total Ops (including micro ops) committed in the CPU.
const Params & params() const
void suspendContext(ThreadID tid) override
Remove Thread from Active Threads List.
StageIdx
Enum to give each stage a specific index, so when calling activateStage() or deactivateStage(),...
Fetch fetch
The fetch stage.
void halt()
Halts the CPU.
void scheduleThreadExitEvent(ThreadID tid)
If a thread is trying to exit and its corresponding trap event has been completed,...
Simple physical register file class.
uint64_t Tick
Tick count type.
void pcState(const PCStateBase &new_pc_state, ThreadID tid)
Sets the commit PC state of a specific thread.
IEW handles both single threaded and SMT IEW (issue/execute/writeback).
void squashFromTC(ThreadID tid)
Initiates a squash of all in-flight instructions for a given thread.
void activateStage(const StageIdx idx)
Changes a stage's status to active within the activity recorder.
RegVal readMiscRegNoEffect(int misc_reg, ThreadID tid) const
Register accessors.
gem5::ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
void activateThread(ThreadID tid)
Add Thread to Active Threads List.
std::vector< ThreadState * > thread
Pointers to all of the threads in the CPU.
void demapPage(Addr vaddr, uint64_t asn)
statistics::Scalar timesIdled
Stat for total number of times the CPU is descheduled.
DrainState drain() override
Starts draining the CPU's pipeline of all instructions in order to stop all memory accesses.
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
void reschedule(Event &event, Tick when, bool always=false)
EventFunctionWrapper tickEvent
The tick event used for scheduling CPU ticks.
void switchOut() override
Switches out this CPU.
CPU(const BaseO3CPUParams ¶ms)
Constructs a CPU with the given parameters.
void setMiscRegNoEffect(int misc_reg, RegVal val, ThreadID tid)
Sets a miscellaneous register.
TimeBuffer< RenameStruct > renameQueue
The rename stage's instruction queue.
ROB rob
The re-order buffer.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
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...
void activity()
Records that there is activity this cycle.
ProbePointArg generates a point for the class of Arg.
void regProbePoints() override
Register probe points.
System * system
Pointer to the system.
int instcount
Count of total number of dynamic instructions in flight.
Cycles lastRunningCycle
The cycle that the CPU was last running, used for statistics.
void updateThreadPriority()
Update The Order In Which We Process Threads.
static constexpr int MaxThreads
Rename handles both single threaded and SMT rename.
void * getWritableReg(PhysRegIdPtr phys_reg, ThreadID tid)
void activityThisCycle()
Records that there was time buffer activity this cycle.
Rename rename
The dispatch stage.
TimeBuffer< FetchStruct > fetchQueue
The fetch stage's instruction queue.
void activateStage(const int idx)
Marks a stage as active.
void takeOverFrom(BaseCPU *oldCPU) override
Takes over from another CPU.
IEW iew
The issue/execute/writeback stages.
void removeInstsNotInROB(ThreadID tid)
Remove all instructions that are not currently in the ROB.
void exitThreads()
Terminate all threads that are ready to exit.
Tick lastActivatedCycle
The cycle that the CPU was last activated by a new thread.
Ports are used to interface objects to each other.
void commitDrained(ThreadID tid)
Commit has reached a safe point to drain a thread.
Decode class handles both single threaded and SMT decode.
UnifiedRenameMap commitRenameMap[MaxThreads]
The commit rename map.
void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst)
Traps to handle given fault.
bool squashed() const
Check whether the event is squashed.
void drainResume() override
Resumes execution after a drain.
ThreadID getFreeTid()
Gets a free thread id.
ListIt addInst(const DynInstPtr &inst)
Function to add instruction onto the head of the list of the instructions.
void setArchReg(const RegId ®, RegVal val, ThreadID tid)
bool isThreadExiting(ThreadID tid) const
Is the thread trying to exit?
EventFunctionWrapper threadExitEvent
The exit event used for terminating all ready-to-exit threads.
double Counter
All counters are of 64-bit values.
ActivityRecorder helper class that informs the CPU if it can switch over to being idle or not.
bool isDraining() const
Is the CPU draining?
RegVal readMiscReg(int misc_reg, ThreadID tid)
Reads a misc.
std::ostream CheckpointOut
std::unordered_map< ThreadID, bool > exitingThreads
This is a list of threads that are trying to exit.
Fault pushRequest(const DynInstPtr &inst, bool isLoad, uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res, AtomicOpFunctorPtr amo_op, const std::vector< bool > &byte_enable)
void squash()
Squash the current event.
RequestPort & getDataPort()
Scoreboard scoreboard
Integer Register Scoreboard.
LSQ ldstQueue
Load / store queue.
Commit commit
The commit stage.
void haltContext(ThreadID tid) override
Remove Thread from Active Threads List && Remove Thread Context from CPU.
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
ActivityRecorder activityRec
The activity recorder; used to tell if the CPU has any activity remaining or if it can go to idle and...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void deactivateStage(const int idx)
Deactivates a stage.
std::vector< BaseISA * > isa
void activateContext(ThreadID tid) override
Add Thread to Active Threads List.
void tick()
Ticks CPU, calling tick() on each stage, and checking the overall activity to see if the CPU should d...
RegVal getArchReg(const RegId ®, ThreadID tid)
Architectural register accessors.
void startup() override
startup() is the final initialization call before simulation.
void setReg(PhysRegIdPtr phys_reg, RegVal val, ThreadID tid)
@ Draining
Draining buffers pending serialization/handover.
void instDone(ThreadID tid, const DynInstPtr &inst)
Function to tell the CPU that an instruction has completed.
bool scheduled() const
Determine if the current event is scheduled.
int16_t ThreadID
Thread index/ID type.
void init() override
Initialize the CPU.
Register ID: describe an architectural register with its class and index.
#define panic(...)
This implements a cprintf based panic() function.
Unified register rename map for all classes of registers.
void removeFrontInst(const DynInstPtr &inst)
Remove an instruction from the front end of the list.
Generated on Sun Jul 30 2023 01:56:47 for gem5 by doxygen 1.8.17