41#ifndef __CPU_O3_IEW_HH__
42#define __CPU_O3_IEW_HH__
55#include "debug/IEW.hh"
61struct BaseO3CPUParams;
130 IEW(
CPU *_cpu,
const BaseO3CPUParams ¶ms);
133 std::string
name()
const;
Cycles is a wrapper class for representing cycle counts, i.e.
ProbePointArg generates a point for the class of Arg.
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
Pool of FU's, specific to the new CPU model.
IEW handles both single threaded and SMT IEW (issue/execute/writeback).
void printAvailableInsts()
Debug function to print instructions that are issued this cycle.
Status
Overall IEW stage status.
void updateStatus()
Updates overall IEW status based on all of the stages' statuses.
void deactivateStage()
Tells CPU that the IEW stage is inactive and idle.
TimeBuffer< IEWStruct > * iewQueue
IEW stage time buffer.
void resetEntries()
Resets entries of the IQ and the LSQ.
TimeBuffer< TimeStruct >::wire fromCommit
Wire to get commit's output from backwards time buffer.
StageStatus dispatchStatus[MaxThreads]
Dispatch status.
std::list< ThreadID > * activeThreads
Pointer to list of active threads.
void takeOverFrom()
Takes over from another CPU's thread.
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets main time buffer used for backwards communication.
int skidCount()
Returns the max of the number of entries in all of the skid buffers.
void instToCommit(const DynInstPtr &inst)
Sends an instruction to commit through the time buffer.
FUPool * fuPool
Pointer to the functional unit pool.
void squashDueToBranch(const DynInstPtr &inst, ThreadID tid)
Sends commit proper information for a squash due to a branch mispredict.
void squashDueToMemOrder(const DynInstPtr &inst, ThreadID tid)
Sends commit proper information for a squash due to a memory order violation.
unsigned wbWidth
Writeback width.
std::queue< DynInstPtr > insts[MaxThreads]
Queue of all instructions coming from rename this cycle.
void block(ThreadID tid)
Sets Dispatch to blocked, and signals back to other stages to block.
StageStatus exeStatus
Execute status.
void clearStates(ThreadID tid)
Clear all thread-specific states.
void dispatch(ThreadID tid)
Determines proper actions to take given Dispatch's status.
void startupStage()
Initializes stage; sends back the number of free IQ and LSQ entries.
void blockMemInst(const DynInstPtr &inst)
Moves memory instruction onto the list of cache blocked instructions.
void unblock(ThreadID tid)
Unblocks Dispatch if the skid buffer is empty, and signals back to other stages to unblock.
void sortInsts()
Sorts instructions coming from rename into lists separated by thread.
void wakeDependents(const DynInstPtr &inst)
Wakes all dependents of a completed instruction.
unsigned issueWidth
Width of issue, in instructions.
void updateExeInstStats(const DynInstPtr &inst)
Updates execution stats based on the instruction.
void dispatchInsts(ThreadID tid)
Dispatches instructions to IQ and LSQ.
void drainSanityCheck() const
Perform sanity checks after a drain.
TimeBuffer< IssueStruct > issueToExecQueue
Issue stage queue.
void checkSignalsAndUpdate(ThreadID tid)
Processes inputs and changes state accordingly.
void activateStage()
Tells CPU that the IEW stage is active and running.
TimeBuffer< TimeStruct >::wire toRename
Wire to write information heading to previous stages.
bool wroteToTimeBuffer
Records if IEW has written to the time buffer this cycle, so that the CPU can deschedule itself if th...
void activityThisCycle()
Reports to the CPU that there is activity this cycle.
void setScoreboard(Scoreboard *sb_ptr)
Sets pointer to the scoreboard.
Scoreboard * scoreboard
Scoreboard pointer.
std::queue< DynInstPtr > skidBuffer[MaxThreads]
Skid buffer between rename and IEW.
TimeBuffer< IssueStruct >::wire fromIssue
Wire to read information from the issue stage time queue.
Cycles renameToIEWDelay
Rename to IEW delay.
TimeBuffer< TimeStruct > * timeBuffer
Pointer to main time buffer used for backwards communication.
void writebackInsts()
Writebacks instructions.
void wakeCPU()
Tells the CPU to wakeup if it has descheduled itself due to no activity.
void squash(ThreadID tid)
Squashes instructions in IEW for a specific thread.
void setIEWQueue(TimeBuffer< IEWStruct > *iq_ptr)
Sets time buffer to pass on instructions to commit.
ProbePointArg< DynInstPtr > * ppExecute
To probe when instruction execution begins.
void rescheduleMemInst(const DynInstPtr &inst)
Tells memory dependence unit that a memory instruction needs to be rescheduled.
ThreadID numThreads
Number of active threads.
unsigned skidBufferMax
Maximum size of the skid buffer.
Status _status
Overall stage status.
TimeBuffer< RenameStruct >::wire fromRename
Wire to get rename's output from rename queue.
ProbePointArg< DynInstPtr > * ppMispredict
Probe points.
TimeBuffer< TimeStruct >::wire toFetch
Wire to write information heading to previous stages.
gem5::o3::IEW::IEWStats iewStats
void setLastRetiredHtmUid(ThreadID tid, uint64_t htmUid)
bool isDrained() const
Has the stage drained?
InstructionQueue instQueue
Instruction queue.
bool fetchRedirect[MaxThreads]
Records if there is a fetch redirect on this cycle for each thread.
TimeBuffer< RenameStruct > * renameQueue
Rename instruction queue interface.
IEW(CPU *_cpu, const BaseO3CPUParams ¶ms)
Constructs a IEW with the given parameters.
unsigned dispatchWidth
Width of dispatch, in instructions.
ProbePointArg< DynInstPtr > * ppDispatch
std::string name() const
Returns the name of the IEW stage.
void tick()
Ticks IEW stage, causing Dispatch, the IQ, the LSQ, Execute, and Writeback to run for one cycle.
bool hasStoresToWB(ThreadID tid)
Returns if the LSQ has any stores to writeback.
ProbePointArg< DynInstPtr > * ppToCommit
To probe when instruction execution is complete.
bool updatedQueues
Records if the queues have been changed (inserted or issued insts), so that IEW knows to broadcast th...
bool hasStoresToWB()
Returns if the LSQ has any stores to writeback.
void checkMisprediction(const DynInstPtr &inst)
Check misprediction
LSQ ldstQueue
Load / store queue.
Cycles issueToExecuteDelay
Issue to execute delay.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
bool skidsEmpty()
Returns if all of the skid buffers are empty.
bool updateLSQNextCycle
Records if the LSQ needs to be updated on the next cycle, so that IEW knows if there will be activity...
void emptyRenameInsts(ThreadID tid)
Removes instructions from rename from a thread's instruction list.
void replayMemInst(const DynInstPtr &inst)
Re-executes all rescheduled memory instructions.
Cycles commitToIEWDelay
Commit to IEW delay.
unsigned wbCycle
Cycle number within the queue of instructions being written back.
void skidInsert(ThreadID tid)
Inserts unused instructions of a thread into the skid buffer.
void cacheUnblocked()
Notifies that the cache has become unblocked.
TimeBuffer< IEWStruct >::wire toCommit
Wire to write infromation heading to commit.
void regProbePoints()
Registers probes.
bool checkStall(ThreadID tid)
Checks if any of the stall conditions are currently true.
void executeInsts()
Executes instructions.
unsigned wbNumInst
Index into queue of instructions being written back.
void setRenameQueue(TimeBuffer< RenameStruct > *rq_ptr)
Sets time buffer for getting instructions coming from rename.
StageStatus wbStatus
Writeback status.
StageStatus
Status for Issue, Execute, and Writeback stages.
A standard instruction queue class.
void setLastRetiredHtmUid(ThreadID tid, uint64_t htmUid)
bool hasStoresToWB()
Returns whether or not there are any stores to write back to memory.
Implements a simple scoreboard to track which registers are ready.
This is a simple scalar statistic, like a counter.
A vector of scalar stats.
static constexpr int MaxThreads
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
int16_t ThreadID
Thread index/ID type.
Declaration of Statistics objects.
statistics::Vector numSwp
Number of executed software prefetches.
statistics::Scalar numSquashedInsts
Stat for total number of squashed instructions skipped at execute.
ExecutedInstStats(CPU *cpu)
statistics::Scalar dispatchedInsts
Stat for total number of instructions dispatched.
statistics::Formula wbFanout
Average number of woken instructions per writeback.
statistics::Scalar squashCycles
Stat for total number of squashing cycles.
statistics::Vector consumerInst
Number of instructions that wake up from producers.
statistics::Scalar predictedNotTakenIncorrect
Stat for total number of incorrect predicted not taken branches.
statistics::Scalar dispLoadInsts
Stat for total number of dispatched load instructions.
statistics::Scalar dispNonSpecInsts
Stat for total number of dispatched non speculative insts.
statistics::Scalar idleCycles
Stat for total number of idle cycles.
statistics::Vector instsToCommit
Number of instructions sent to commit.
gem5::o3::IEW::IEWStats::ExecutedInstStats executedInstStats
statistics::Formula wbRate
Number of instructions per cycle written back.
statistics::Scalar dispSquashedInsts
Stat for total number of squashed instructions dispatch skips.
statistics::Scalar predictedTakenIncorrect
Stat for total number of incorrect predicted taken branches.
statistics::Scalar blockCycles
Stat for total number of blocking cycles.
statistics::Vector writebackCount
Number of instructions that writeback.
statistics::Scalar memOrderViolationEvents
Stat for total number of memory ordering violation events.
statistics::Vector producerInst
Number of instructions that wake consumers.
statistics::Scalar iqFullEvents
Stat for number of times the IQ becomes full.
statistics::Scalar unblockCycles
Stat for total number of unblocking cycles.
statistics::Scalar lsqFullEvents
Stat for number of times the LSQ becomes full.
statistics::Formula branchMispredicts
Stat for total number of mispredicted branches detected at execute.
statistics::Scalar dispStoreInsts
Stat for total number of dispatched store instructions.