44 #ifndef __CPU_O3_RENAME_HH__
45 #define __CPU_O3_RENAME_HH__
51 #include "config/the_isa.hh"
55 struct DerivO3CPUParams;
74 typedef typename Impl::CPUPol
CPUPol;
76 typedef typename Impl::O3CPU
O3CPU;
85 typedef typename CPUPol::IEW
IEW;
86 typedef typename CPUPol::Commit
Commit;
139 std::string
name()
const;
531 #endif // __CPU_O3_RENAME_HH__
Structures whose free entries impact the amount of instructions that can be renamed.
void setScoreboard(Scoreboard *_scoreboard)
Sets pointer to the scoreboard.
ThreadStatus
Individual thread status.
Stats::Scalar renameFullRegistersEvents
Stat for total number of times that rename runs out of free registers to use to rename.
int decodeToRenameDelay
Delay between decode and rename, in ticks.
void readStallSignals(ThreadID tid)
Reads signals telling rename to block/unblock.
bool unblock(ThreadID tid)
Switches rename to unblocking if the skid buffer is empty, and signals back that rename has unblocked...
Impl::DynInstPtr DynInstPtr
Stats::Scalar renameRunCycles
Stat for total number of cycles spent running normally.
int iewToRenameDelay
Delay between iew and rename, in ticks.
RenameStatus _status
Rename status.
DefaultRename handles both single threaded and SMT rename.
PhysRegIndex newPhysReg
The new physical register that the arch.
RenameMap * renameMap[Impl::MaxThreads]
Rename map interface.
TimeBuffer< RenameStruct >::wire toIEW
Wire to write any information heading to IEW.
ProbePointArg< DynInstPtr > * ppRename
To probe when register renaming for an instruction is complete.
void setFreeList(FreeList *fl_ptr)
Sets pointer to the free list.
std::list< ThreadID > * activeThreads
Pointer to the list of active threads.
FreeEntries freeEntries[Impl::MaxThreads]
Per-thread tracking of the number of free entries of back-end structures.
void setRenameQueue(TimeBuffer< RenameStruct > *rq_ptr)
Sets pointer to time buffer used to communicate to the next stage.
TimeBuffer< TimeStruct > * timeBuffer
Pointer to main time buffer used for backwards communication.
PhysRegIndex prevPhysReg
The old physical register that the arch.
bool block(ThreadID tid)
Switches rename to blocking, and signals back that rename has become blocked.
bool isDrained() const
Has the stage drained?
void renameDestRegs(DynInstPtr &inst, ThreadID tid)
Renames the destination registers of an instruction.
PhysRegIndex maxPhysicalRegs
Stats::Scalar renameRenamedOperands
Stat for total number of renamed destination registers.
IEW * iew_ptr
Pointer to IEW stage.
Stats::Scalar renameROBFullEvents
Stat for total number of times that the ROB starts a stall in rename.
CPUPol::TimeStruct TimeStruct
bool serializeOnNextInst[Impl::MaxThreads]
Records if rename needs to serialize on the next instruction for any thread.
void regProbePoints()
Registers probes.
Stalls stalls[Impl::MaxThreads]
Tracks which stages are telling decode to stall.
bool wroteToTimeBuffer
Variable that tracks if decode has written to the time buffer this cycle.
void renameSrcRegs(DynInstPtr &inst, ThreadID tid)
Renames the source registers of an instruction.
Stats::Scalar renamedSerializing
Number of serialize instructions handled.
int calcFreeSQEntries(ThreadID tid)
Calculates the number of free SQ entries for a specific thread.
TimeBuffer< DecodeStruct > * decodeQueue
Decode instruction queue interface.
bool resumeSerialize
Whether or not rename needs to resume a serialize instruction after squashing.
unsigned commitWidth
Commit width, in instructions.
void doSquash(const InstSeqNum &squash_seq_num, ThreadID tid)
Executes actual squash, removing squashed instructions.
Stats::Scalar renameSquashedInsts
Stat for total number of squashed instructions that rename discards.
CPUPol::FreeList FreeList
unsigned validInsts()
Returns the number of valid instructions coming from decode.
void dumpHistory()
Debugging function used to dump history buffer of renamings.
Declaration of Statistics objects.
Stats::Scalar renamedTempSerializing
Number of instructions marked as temporarily serializing.
Scoreboard * scoreboard
Pointer to the scoreboard.
This is a simple scalar statistic, like a counter.
bool checkSignalsAndUpdate(ThreadID tid)
Checks the signals and updates the status.
void setCommitStage(Commit *commit_stage)
Sets pointer to commit stage.
unsigned toIEWIndex
The index of the instruction in the time buffer to IEW that rename is currently using.
TimeBuffer< TimeStruct >::wire fromCommit
Wire to get commit's output from backwards time buffer.
Stats::Scalar renameUnblockCycles
Stat for total number of cycles spent unblocking.
void regStats()
Registers statistics.
std::pair< InstSeqNum, short int > SeqNumRegPair
Probe points.
TimeBuffer< RenameStruct > * renameQueue
Rename instruction queue.
void renameInsts(ThreadID tid)
Renames instructions for the given thread.
int loadsInProgress[Impl::MaxThreads]
Count of Load instructions in progress that have been sent off to the IQ and ROB, but are not yet inc...
Implements a simple scoreboard to track which registers are ready.
std::list< RenameHistory > historyBuffer[Impl::MaxThreads]
A per-thread list of all destination register renames, used to either undo rename mappings or free ol...
bool skidsEmpty()
Returns if all of the skid buffers are empty.
Stats::Scalar renameIQFullEvents
Stat for total number of times that the IQ starts a stall in rename.
void removeFromHistory(InstSeqNum inst_seq_num, ThreadID tid)
Removes a committed instruction's rename history.
Stats::Scalar renameCommittedMaps
Stat for total number of committed renaming mappings.
void drainSanityCheck() const
Perform sanity checks after a drain.
Stats::Scalar renameRenamedInsts
Stat for total number of renamed instructions.
CPUPol::RenameMap RenameMap
Holds the information for each destination register rename.
Commit * commit_ptr
Pointer to commit stage.
void readFreeEntries(ThreadID tid)
Gets the number of free entries for a specific thread.
O3CPU * cpu
Pointer to CPU.
void takeOverFrom()
Takes over from another CPU's thread.
void skidInsert(ThreadID tid)
Inserts unused instructions from a given thread into the skid buffer, to be renamed once rename unblo...
TimeBuffer< DecodeStruct >::wire fromDecode
Wire to get decode's output from decode queue.
RenameStatus
Overall rename status.
FullSource
Enum to record the source of a structure full stall.
int calcFreeROBEntries(ThreadID tid)
Calculates the number of free ROB entries for a specific thread.
Stats::Scalar renameSquashCycles
Stat for total number of cycles spent squashing.
ProbePointArg< SeqNumRegPair > * ppSquashInRename
To probe when an instruction is squashed and the register mapping for it needs to be undone...
Stats::Scalar renameSerializeStallCycles
Stat for total number of cycles spent stalling for a serializing inst.
void squash(const InstSeqNum &squash_seq_num, ThreadID tid)
Squashes all instructions in a thread.
ThreadID numThreads
The number of threads active in rename.
InstQueue skidBuffer[Impl::MaxThreads]
Skid buffer between rename and decode.
int instsInProgress[Impl::MaxThreads]
Count of instructions in progress that have been sent off to the IQ and ROB, but are not yet included...
Stats::Scalar renameBlockCycles
Stat for total number of cycles spent blocking.
TimeBuffer< TimeStruct >::wire fromIEW
Wire to get IEW's output from backwards time buffer.
Stats::Scalar renameRenameLookups
Stat for total number of source register rename lookups.
Stats::Scalar renameLQFullEvents
Stat for total number of times that the LQ starts a stall in rename.
CPUPol::DecodeStruct DecodeStruct
void resetStage()
Reset this pipeline stage.
Stats::Scalar renameSQFullEvents
Stat for total number of times that the SQ starts a stall in rename.
int16_t ThreadID
Thread index/ID type.
Stats::Scalar fpRenameLookups
void rename(bool &status_change, ThreadID tid)
Determines what to do based on rename's current status.
int calcFreeLQEntries(ThreadID tid)
Calculates the number of free LQ entries for a specific thread.
int storesInProgress[Impl::MaxThreads]
Count of Store instructions in progress that have been sent off to the IQ and ROB, but are not yet included in their occupancy counts.
bool blockThisCycle
Whether or not rename needs to block this cycle.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
void tick()
Ticks rename, which processes all input signals and attempts to rename as many instructions as possib...
TheISA::RegIndex RegIndex
std::string name() const
Returns the name of rename.
TimeBuffer< TimeStruct >::wire toDecode
Wire to write infromation heading to previous stages.
RegIndex archReg
The architectural register index that was renamed.
bool emptyROB[Impl::MaxThreads]
Records if the ROB is empty.
unsigned commitToRenameDelay
Delay between commit and rename, in ticks.
InstQueue insts[Impl::MaxThreads]
Queue of all instructions coming from decode this cycle.
void startupStage()
Initializes variables for the stage.
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets the main backwards communication time buffer pointer.
int calcFreeIQEntries(ThreadID tid)
Calculates the number of free IQ entries for a specific thread.
Stats::Scalar renameUndoneMaps
Stat for total number of mappings that were undone due to a squash.
void sortInsts()
Separates instructions from decode into individual lists of instructions sorted by thread...
void setRenameMap(RenameMap rm_ptr[Impl::MaxThreads])
Sets pointer to rename maps (per-thread structures).
void incrFullStat(const FullSource &source)
Function used to increment the stat that corresponds to the source of the stall.
unsigned skidBufferMax
The maximum skid buffer size.
FreeList * freeList
Free list interface.
DefaultRename(O3CPU *_cpu, DerivO3CPUParams *params)
DefaultRename constructor.
void updateStatus()
Updates overall rename status based on all of the threads' statuses.
void serializeAfter(InstQueue &inst_list, ThreadID tid)
Either serializes on the next instruction available in the InstQueue, or records that it must seriali...
CPUPol::RenameStruct RenameStruct
Source of possible stalls.
Stats::Scalar renameSkidInsts
Number of instructions inserted into skid buffers.
unsigned renameWidth
Rename width, in instructions.
DynInstPtr serializeInst[Impl::MaxThreads]
The serialize instruction that rename has stalled on.
bool resumeUnblocking
Whether or not rename needs to resume clearing out the skidbuffer after squashing.
bool checkStall(ThreadID tid)
Checks if any stages are telling rename to block.
Stats::Scalar intRenameLookups
std::deque< DynInstPtr > InstQueue
void setDecodeQueue(TimeBuffer< DecodeStruct > *dq_ptr)
Sets pointer to time buffer coming from decode.
InstSeqNum instSeqNum
The sequence number of the instruction that renamed.
void setIEWStage(IEW *iew_stage)
Sets pointer to IEW stage.
ThreadStatus renameStatus[Impl::MaxThreads]
Per-thread status.
RenameHistory(InstSeqNum _instSeqNum, RegIndex _archReg, PhysRegIndex _newPhysReg, PhysRegIndex _prevPhysReg)
Stats::Scalar renameIdleCycles
Stat for total number of cycles spent idle.