gem5 v24.0.0.0
|
Rename handles both single threaded and SMT rename. More...
#include <rename.hh>
Classes | |
struct | FreeEntries |
Structures whose free entries impact the amount of instructions that can be renamed. More... | |
struct | RenameHistory |
Holds the information for each destination register rename. More... | |
struct | RenameStats |
struct | Stalls |
Source of possible stalls. More... | |
Public Types | |
enum | RenameStatus { Active , Inactive } |
Overall rename status. More... | |
enum | ThreadStatus { Running , Idle , StartSquash , Squashing , Blocked , Unblocking , SerializeStall } |
Individual thread status. More... | |
typedef std::deque< DynInstPtr > | InstQueue |
Public Member Functions | |
Rename (CPU *_cpu, const BaseO3CPUParams ¶ms) | |
Rename constructor. | |
std::string | name () const |
Returns the name of rename. | |
void | regProbePoints () |
Registers probes. | |
void | setTimeBuffer (TimeBuffer< TimeStruct > *tb_ptr) |
Sets the main backwards communication time buffer pointer. | |
void | setRenameQueue (TimeBuffer< RenameStruct > *rq_ptr) |
Sets pointer to time buffer used to communicate to the next stage. | |
void | setDecodeQueue (TimeBuffer< DecodeStruct > *dq_ptr) |
Sets pointer to time buffer coming from decode. | |
void | setIEWStage (IEW *iew_stage) |
Sets pointer to IEW stage. | |
void | setCommitStage (Commit *commit_stage) |
Sets pointer to commit stage. | |
void | startupStage () |
Initializes variables for the stage. | |
void | clearStates (ThreadID tid) |
Clear all thread-specific states. | |
void | setActiveThreads (std::list< ThreadID > *at_ptr) |
Sets pointer to list of active threads. | |
void | setRenameMap (UnifiedRenameMap::PerThreadUnifiedRenameMap &rm_ptr) |
Sets pointer to rename maps (per-thread structures). | |
void | setFreeList (UnifiedFreeList *fl_ptr) |
Sets pointer to the free list. | |
void | setScoreboard (Scoreboard *_scoreboard) |
Sets pointer to the scoreboard. | |
void | drainSanityCheck () const |
Perform sanity checks after a drain. | |
bool | isDrained () const |
Has the stage drained? | |
void | takeOverFrom () |
Takes over from another CPU's thread. | |
void | squash (const InstSeqNum &squash_seq_num, ThreadID tid) |
Squashes all instructions in a thread. | |
void | tick () |
Ticks rename, which processes all input signals and attempts to rename as many instructions as possible. | |
void | dumpHistory () |
Debugging function used to dump history buffer of renamings. | |
Private Types | |
enum | FullSource { ROB , IQ , LQ , SQ , NONE } |
Enum to record the source of a structure full stall. More... | |
typedef std::pair< InstSeqNum, PhysRegIdPtr > | SeqNumRegPair |
Probe points. | |
Private Member Functions | |
void | resetStage () |
Reset this pipeline stage. | |
void | rename (bool &status_change, ThreadID tid) |
Determines what to do based on rename's current status. | |
void | renameInsts (ThreadID tid) |
Renames instructions for the given thread. | |
void | skidInsert (ThreadID tid) |
Inserts unused instructions from a given thread into the skid buffer, to be renamed once rename unblocks. | |
void | sortInsts () |
Separates instructions from decode into individual lists of instructions sorted by thread. | |
bool | skidsEmpty () |
Returns if all of the skid buffers are empty. | |
void | updateStatus () |
Updates overall rename status based on all of the threads' statuses. | |
bool | block (ThreadID tid) |
Switches rename to blocking, and signals back that rename has become blocked. | |
bool | unblock (ThreadID tid) |
Switches rename to unblocking if the skid buffer is empty, and signals back that rename has unblocked. | |
void | doSquash (const InstSeqNum &squash_seq_num, ThreadID tid) |
Executes actual squash, removing squashed instructions. | |
void | removeFromHistory (InstSeqNum inst_seq_num, ThreadID tid) |
Removes a committed instruction's rename history. | |
void | renameSrcRegs (const DynInstPtr &inst, ThreadID tid) |
Renames the source registers of an instruction. | |
void | renameDestRegs (const DynInstPtr &inst, ThreadID tid) |
Renames the destination registers of an instruction. | |
int | calcFreeROBEntries (ThreadID tid) |
Calculates the number of free ROB entries for a specific thread. | |
int | calcFreeIQEntries (ThreadID tid) |
Calculates the number of free IQ entries for a specific thread. | |
int | calcFreeLQEntries (ThreadID tid) |
Calculates the number of free LQ entries for a specific thread. | |
int | calcFreeSQEntries (ThreadID tid) |
Calculates the number of free SQ entries for a specific thread. | |
unsigned | validInsts () |
Returns the number of valid instructions coming from decode. | |
void | readStallSignals (ThreadID tid) |
Reads signals telling rename to block/unblock. | |
bool | checkStall (ThreadID tid) |
Checks if any stages are telling rename to block. | |
void | readFreeEntries (ThreadID tid) |
Gets the number of free entries for a specific thread. | |
bool | checkSignalsAndUpdate (ThreadID tid) |
Checks the signals and updates the status. | |
void | serializeAfter (InstQueue &inst_list, ThreadID tid) |
Either serializes on the next instruction available in the InstQueue, or records that it must serialize on the next instruction to enter rename. | |
void | incrFullStat (const FullSource &source) |
Function used to increment the stat that corresponds to the source of the stall. | |
Private Attributes | |
RenameStatus | _status |
Rename status. | |
ThreadStatus | renameStatus [MaxThreads] |
Per-thread status. | |
ProbePointArg< DynInstPtr > * | ppRename |
To probe when register renaming for an instruction is complete. | |
ProbePointArg< SeqNumRegPair > * | ppSquashInRename |
To probe when an instruction is squashed and the register mapping for it needs to be undone. | |
IEW * | iew_ptr |
Pointer to IEW stage. | |
Commit * | commit_ptr |
Pointer to commit stage. | |
std::list< RenameHistory > | historyBuffer [MaxThreads] |
A per-thread list of all destination register renames, used to either undo rename mappings or free old physical registers. | |
CPU * | cpu |
Pointer to CPU. | |
TimeBuffer< TimeStruct > * | timeBuffer |
Pointer to main time buffer used for backwards communication. | |
TimeBuffer< TimeStruct >::wire | fromIEW |
Wire to get IEW's output from backwards time buffer. | |
TimeBuffer< TimeStruct >::wire | fromCommit |
Wire to get commit's output from backwards time buffer. | |
TimeBuffer< TimeStruct >::wire | toDecode |
Wire to write infromation heading to previous stages. | |
TimeBuffer< RenameStruct > * | renameQueue |
Rename instruction queue. | |
TimeBuffer< RenameStruct >::wire | toIEW |
Wire to write any information heading to IEW. | |
TimeBuffer< DecodeStruct > * | decodeQueue |
Decode instruction queue interface. | |
TimeBuffer< DecodeStruct >::wire | fromDecode |
Wire to get decode's output from decode queue. | |
InstQueue | insts [MaxThreads] |
Queue of all instructions coming from decode this cycle. | |
InstQueue | skidBuffer [MaxThreads] |
Skid buffer between rename and decode. | |
UnifiedRenameMap * | renameMap [MaxThreads] |
Rename map interface. | |
UnifiedFreeList * | freeList |
Free list interface. | |
std::vector< PhysRegIdPtr > | freeingInProgress [MaxThreads] |
Hold phys regs to be released after squash finish. | |
std::list< ThreadID > * | activeThreads |
Pointer to the list of active threads. | |
Scoreboard * | scoreboard |
Pointer to the scoreboard. | |
int | instsInProgress [MaxThreads] |
Count of instructions in progress that have been sent off to the IQ and ROB, but are not yet included in their occupancy counts. | |
int | loadsInProgress [MaxThreads] |
Count of Load instructions in progress that have been sent off to the IQ and ROB, but are not yet included in their occupancy counts. | |
int | storesInProgress [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 | wroteToTimeBuffer |
Variable that tracks if decode has written to the time buffer this cycle. | |
FreeEntries | freeEntries [MaxThreads] |
Per-thread tracking of the number of free entries of back-end structures. | |
bool | emptyROB [MaxThreads] |
Records if the ROB is empty. | |
Stalls | stalls [MaxThreads] |
Tracks which stages are telling decode to stall. | |
DynInstPtr | serializeInst [MaxThreads] |
The serialize instruction that rename has stalled on. | |
bool | serializeOnNextInst [MaxThreads] |
Records if rename needs to serialize on the next instruction for any thread. | |
int | iewToRenameDelay |
Delay between iew and rename, in ticks. | |
int | decodeToRenameDelay |
Delay between decode and rename, in ticks. | |
unsigned | commitToRenameDelay |
Delay between commit and rename, in ticks. | |
unsigned | renameWidth |
Rename width, in instructions. | |
unsigned | toIEWIndex |
The index of the instruction in the time buffer to IEW that rename is currently using. | |
bool | blockThisCycle |
Whether or not rename needs to block this cycle. | |
bool | resumeSerialize |
Whether or not rename needs to resume a serialize instruction after squashing. | |
bool | resumeUnblocking |
Whether or not rename needs to resume clearing out the skidbuffer after squashing. | |
ThreadID | numThreads |
The number of threads active in rename. | |
unsigned | skidBufferMax |
The maximum skid buffer size. | |
gem5::o3::Rename::RenameStats | stats |
Rename handles both single threaded and SMT rename.
Its width is specified by the parameters; each cycle it tries to rename that many instructions. It holds onto the rename history of all instructions with destination registers, storing the arch. register, the new physical register, and the old physical register, to allow for undoing of mappings if squashing happens, or freeing up registers upon commit. Rename handles blocking if the ROB, IQ, or LSQ is going to be full. Rename also handles barriers, and does so by stalling on the instruction until the ROB is empty and there are no instructions in flight to the ROB.
|
private |
|
private |
gem5::o3::Rename::Rename | ( | CPU * | _cpu, |
const BaseO3CPUParams & | params ) |
Rename constructor.
Definition at line 61 of file rename.cc.
References decodeToRenameDelay, emptyROB, fatal, freeEntries, Idle, instsInProgress, loadsInProgress, gem5::o3::MaxThreads, gem5::o3::MaxWidth, renameMap, renameStatus, renameWidth, serializeInst, serializeOnNextInst, skidBufferMax, stalls, and storesInProgress.
|
private |
Switches rename to blocking, and signals back that rename has become blocked.
Definition at line 862 of file rename.cc.
References Blocked, DPRINTF, renameStatus, resumeUnblocking, SerializeStall, skidInsert(), toDecode, Unblocking, and wroteToTimeBuffer.
Referenced by checkSignalsAndUpdate(), rename(), and renameInsts().
|
private |
Calculates the number of free IQ entries for a specific thread.
Definition at line 1150 of file rename.cc.
References freeEntries, fromIEW, instsInProgress, and gem5::o3::Rename::FreeEntries::iqEntries.
Referenced by checkStall(), and renameInsts().
|
private |
Calculates the number of free LQ entries for a specific thread.
Definition at line 1161 of file rename.cc.
References DPRINTF, freeEntries, fromIEW, loadsInProgress, and gem5::o3::Rename::FreeEntries::lqEntries.
Referenced by checkStall(), and renameInsts().
|
private |
Calculates the number of free ROB entries for a specific thread.
Definition at line 1139 of file rename.cc.
References freeEntries, fromIEW, instsInProgress, and gem5::o3::Rename::FreeEntries::robEntries.
Referenced by checkStall(), and renameInsts().
|
private |
Calculates the number of free SQ entries for a specific thread.
Definition at line 1174 of file rename.cc.
References DPRINTF, freeEntries, fromIEW, gem5::o3::Rename::FreeEntries::sqEntries, and storesInProgress.
Referenced by checkStall(), and renameInsts().
|
private |
Checks the signals and updates the status.
Definition at line 1277 of file rename.cc.
References gem5::o3::UnifiedFreeList::addReg(), block(), Blocked, checkStall(), DPRINTF, freeingInProgress, freeList, fromCommit, insts, readFreeEntries(), readStallSignals(), renameStatus, resumeSerialize, resumeUnblocking, Running, serializeInst, SerializeStall, skidBuffer, squash(), Squashing, unblock(), and Unblocking.
Referenced by tick().
|
private |
Checks if any stages are telling rename to block.
Definition at line 1212 of file rename.cc.
References calcFreeIQEntries(), calcFreeLQEntries(), calcFreeROBEntries(), calcFreeSQEntries(), DPRINTF, emptyROB, instsInProgress, renameStatus, SerializeStall, and stalls.
Referenced by checkSignalsAndUpdate().
void gem5::o3::Rename::clearStates | ( | ThreadID | tid | ) |
Clear all thread-specific states.
Definition at line 230 of file rename.cc.
References commit_ptr, emptyROB, freeEntries, Idle, gem5::o3::Rename::Stalls::iew, iew_ptr, gem5::o3::IEW::instQueue, instsInProgress, gem5::o3::Rename::FreeEntries::iqEntries, gem5::o3::IEW::ldstQueue, loadsInProgress, gem5::o3::Rename::FreeEntries::lqEntries, gem5::o3::InstructionQueue::numFreeEntries(), gem5::o3::LSQ::numFreeLoadEntries(), gem5::o3::LSQ::numFreeStoreEntries(), gem5::o3::Commit::numROBFreeEntries(), renameStatus, gem5::o3::Rename::FreeEntries::robEntries, serializeInst, serializeOnNextInst, gem5::o3::Rename::FreeEntries::sqEntries, stalls, and storesInProgress.
Referenced by gem5::o3::CPU::removeThread().
|
private |
Executes actual squash, removing squashed instructions.
Definition at line 915 of file rename.cc.
References DPRINTF, freeingInProgress, historyBuffer, ppSquashInRename, renameMap, gem5::o3::UnifiedRenameMap::setEntry(), stats, and gem5::o3::Rename::RenameStats::undoneMaps.
Referenced by squash().
void gem5::o3::Rename::drainSanityCheck | ( | ) | const |
Perform sanity checks after a drain.
Definition at line 328 of file rename.cc.
References historyBuffer, insts, instsInProgress, numThreads, and skidBuffer.
Referenced by gem5::o3::CPU::drainSanityCheck().
void gem5::o3::Rename::dumpHistory | ( | ) |
Debugging function used to dump history buffer of renamings.
Definition at line 1423 of file rename.cc.
References gem5::cprintf(), historyBuffer, and numThreads.
|
private |
Function used to increment the stat that corresponds to the source of the stall.
Definition at line 1401 of file rename.cc.
References IQ, gem5::o3::Rename::RenameStats::IQFullEvents, LQ, gem5::o3::Rename::RenameStats::LQFullEvents, panic, ROB, gem5::o3::Rename::RenameStats::ROBFullEvents, SQ, gem5::o3::Rename::RenameStats::SQFullEvents, and stats.
Referenced by renameInsts().
bool gem5::o3::Rename::isDrained | ( | ) | const |
Has the stage drained?
Definition at line 308 of file rename.cc.
References historyBuffer, Idle, insts, instsInProgress, numThreads, renameStatus, Running, and skidBuffer.
Referenced by gem5::o3::CPU::isCpuDrained().
std::string gem5::o3::Rename::name | ( | ) | const |
Returns the name of rename.
Definition at line 92 of file rename.cc.
References cpu, and gem5::Named::name().
|
private |
Gets the number of free entries for a specific thread.
Definition at line 1240 of file rename.cc.
References gem5::CCRegClass, DPRINTF, emptyROB, gem5::FloatRegClass, freeEntries, fromCommit, fromIEW, instsInProgress, gem5::IntRegClass, gem5::o3::Rename::FreeEntries::iqEntries, gem5::o3::Rename::FreeEntries::lqEntries, gem5::MatRegClass, renameMap, gem5::o3::Rename::FreeEntries::robEntries, gem5::o3::Rename::FreeEntries::sqEntries, gem5::VecElemClass, gem5::VecPredRegClass, and gem5::VecRegClass.
Referenced by checkSignalsAndUpdate().
|
private |
Reads signals telling rename to block/unblock.
Definition at line 1199 of file rename.cc.
References fromIEW, gem5::o3::Rename::Stalls::iew, and stalls.
Referenced by checkSignalsAndUpdate().
void gem5::o3::Rename::regProbePoints | ( | ) |
Registers probes.
Definition at line 182 of file rename.cc.
References cpu, gem5::SimObject::getProbeManager(), ppRename, and ppSquashInRename.
Referenced by gem5::o3::CPU::regProbePoints().
|
private |
Removes a committed instruction's rename history.
Definition at line 963 of file rename.cc.
References gem5::o3::UnifiedFreeList::addReg(), gem5::o3::Rename::RenameStats::committedMaps, DPRINTF, freeList, historyBuffer, and stats.
Referenced by tick().
|
private |
Determines what to do based on rename's current status.
status_change | rename() sets this variable if there was a status change (ie switching from blocking to unblocking). |
tid | Thread id to rename instructions from. |
Definition at line 455 of file rename.cc.
References block(), gem5::o3::Rename::RenameStats::blockCycles, Blocked, blockThisCycle, DPRINTF, Idle, renameInsts(), renameStatus, resumeSerialize, resumeUnblocking, Running, SerializeStall, gem5::o3::Rename::RenameStats::serializeStallCycles, skidInsert(), gem5::o3::Rename::RenameStats::squashCycles, Squashing, stats, toDecode, unblock(), Unblocking, and validInsts().
Referenced by tick().
|
private |
Renames the destination registers of an instruction.
Definition at line 1085 of file rename.cc.
References gem5::RegId::className(), DPRINTF, gem5::RegId::flatten(), gem5::ThreadContext::getIsaPtr(), gem5::RegId::getNumPinnedWrites(), historyBuffer, gem5::RegId::index(), gem5::o3::Rename::RenameStats::renamedOperands, renameMap, scoreboard, gem5::RegId::setNumPinnedWrites(), stats, and gem5::o3::Scoreboard::unsetReg().
Referenced by renameInsts().
|
private |
Renames instructions for the given thread.
Also handles serializing instructions.
Definition at line 510 of file rename.cc.
References block(), blockThisCycle, calcFreeIQEntries(), calcFreeLQEntries(), calcFreeROBEntries(), calcFreeSQEntries(), DPRINTF, emptyROB, fromIEW, gem5::o3::Rename::RenameStats::fullRegistersEvents, gem5::o3::Rename::RenameStats::idleCycles, incrFullStat(), insts, instsInProgress, IQ, loadsInProgress, LQ, ppRename, renameDestRegs(), gem5::o3::Rename::RenameStats::renamedInsts, renameMap, renameSrcRegs(), renameStatus, renameWidth, ROB, gem5::o3::Rename::RenameStats::runCycles, Running, serializeAfter(), serializeInst, serializeOnNextInst, SerializeStall, gem5::o3::Rename::RenameStats::serializing, skidBuffer, SQ, gem5::o3::Rename::RenameStats::squashedInsts, stats, storesInProgress, gem5::o3::Rename::RenameStats::tempSerializing, toDecode, toIEW, toIEWIndex, gem5::o3::Rename::RenameStats::unblockCycles, Unblocking, and wroteToTimeBuffer.
Referenced by rename().
|
private |
Renames the source registers of an instruction.
Definition at line 1012 of file rename.cc.
References gem5::CCRegClass, gem5::PhysRegId::className(), gem5::RegId::className(), gem5::RegId::classValue(), DPRINTF, gem5::PhysRegId::flatIndex(), gem5::RegId::flatten(), gem5::FloatRegClass, gem5::o3::Rename::RenameStats::fpLookups, gem5::ThreadContext::getIsaPtr(), gem5::o3::Scoreboard::getReg(), gem5::PhysRegId::index(), gem5::RegId::index(), gem5::o3::Rename::RenameStats::intLookups, gem5::IntRegClass, gem5::InvalidRegClass, gem5::o3::Rename::RenameStats::lookups, gem5::o3::Rename::RenameStats::matLookups, gem5::MatRegClass, gem5::MiscRegClass, panic, renameMap, scoreboard, stats, gem5::VecElemClass, gem5::o3::Rename::RenameStats::vecLookups, gem5::o3::Rename::RenameStats::vecPredLookups, gem5::VecPredRegClass, and gem5::VecRegClass.
Referenced by renameInsts().
|
private |
Reset this pipeline stage.
Definition at line 251 of file rename.cc.
References _status, commit_ptr, emptyROB, freeEntries, Idle, gem5::o3::Rename::Stalls::iew, iew_ptr, Inactive, gem5::o3::IEW::instQueue, instsInProgress, gem5::o3::Rename::FreeEntries::iqEntries, gem5::o3::IEW::ldstQueue, loadsInProgress, gem5::o3::Rename::FreeEntries::lqEntries, gem5::o3::InstructionQueue::numFreeEntries(), gem5::o3::LSQ::numFreeLoadEntries(), gem5::o3::LSQ::numFreeStoreEntries(), gem5::o3::Commit::numROBFreeEntries(), numThreads, renameStatus, resumeSerialize, resumeUnblocking, gem5::o3::Rename::FreeEntries::robEntries, serializeInst, serializeOnNextInst, gem5::o3::Rename::FreeEntries::sqEntries, stalls, and storesInProgress.
Referenced by startupStage(), and takeOverFrom().
Either serializes on the next instruction available in the InstQueue, or records that it must serialize on the next instruction to enter rename.
inst_list | The list of younger, unprocessed instructions for the thread that has the serializeAfter instruction. |
tid | The thread id. |
Definition at line 1388 of file rename.cc.
References serializeOnNextInst.
Referenced by renameInsts().
Sets pointer to list of active threads.
Definition at line 282 of file rename.cc.
References activeThreads.
|
inline |
Sets pointer to commit stage.
Used only for initialization.
Definition at line 150 of file rename.hh.
References commit_ptr.
void gem5::o3::Rename::setDecodeQueue | ( | TimeBuffer< DecodeStruct > * | dq_ptr | ) |
Sets pointer to time buffer coming from decode.
Definition at line 215 of file rename.cc.
References decodeQueue, decodeToRenameDelay, fromDecode, and gem5::TimeBuffer< T >::getWire().
void gem5::o3::Rename::setFreeList | ( | UnifiedFreeList * | fl_ptr | ) |
|
inline |
void gem5::o3::Rename::setRenameMap | ( | UnifiedRenameMap::PerThreadUnifiedRenameMap & | rm_ptr | ) |
Sets pointer to rename maps (per-thread structures).
Definition at line 289 of file rename.cc.
References numThreads, and renameMap.
void gem5::o3::Rename::setRenameQueue | ( | TimeBuffer< RenameStruct > * | rq_ptr | ) |
Sets pointer to time buffer used to communicate to the next stage.
Definition at line 206 of file rename.cc.
References gem5::TimeBuffer< T >::getWire(), renameQueue, and toIEW.
void gem5::o3::Rename::setScoreboard | ( | Scoreboard * | _scoreboard | ) |
void gem5::o3::Rename::setTimeBuffer | ( | TimeBuffer< TimeStruct > * | tb_ptr | ) |
Sets the main backwards communication time buffer pointer.
Definition at line 191 of file rename.cc.
References commitToRenameDelay, fromCommit, fromIEW, gem5::TimeBuffer< T >::getWire(), iewToRenameDelay, timeBuffer, and toDecode.
|
private |
Inserts unused instructions from a given thread into the skid buffer, to be renamed once rename unblocks.
Definition at line 760 of file rename.cc.
References DPRINTF, insts, panic, skidBuffer, skidBufferMax, gem5::o3::Rename::RenameStats::skidInsts, stats, and warn.
|
private |
Returns if all of the skid buffers are empty.
Definition at line 808 of file rename.cc.
References activeThreads, and skidBuffer.
|
private |
Separates instructions from decode into individual lists of instructions sorted by thread.
Definition at line 793 of file rename.cc.
References gem5::curTick(), fromDecode, gem5::ArmISA::i, and insts.
Referenced by tick().
void gem5::o3::Rename::squash | ( | const InstSeqNum & | squash_seq_num, |
ThreadID | tid ) |
Squashes all instructions in a thread.
Definition at line 339 of file rename.cc.
References Blocked, doSquash(), DPRINTF, fromDecode, gem5::ArmISA::i, insts, renameStatus, resumeSerialize, serializeInst, SerializeStall, skidBuffer, Squashing, toDecode, Unblocking, and wroteToTimeBuffer.
Referenced by checkSignalsAndUpdate().
void gem5::o3::Rename::startupStage | ( | ) |
Initializes variables for the stage.
Definition at line 224 of file rename.cc.
References resetStage().
Referenced by gem5::o3::CPU::startup().
void gem5::o3::Rename::takeOverFrom | ( | ) |
Takes over from another CPU's thread.
Definition at line 322 of file rename.cc.
References resetStage().
Referenced by gem5::o3::CPU::takeOverFrom().
void gem5::o3::Rename::tick | ( | ) |
Ticks rename, which processes all input signals and attempts to rename as many instructions as possible.
Definition at line 392 of file rename.cc.
References activeThreads, gem5::o3::CPU::activityThisCycle(), blockThisCycle, checkSignalsAndUpdate(), cpu, DPRINTF, fromCommit, fromIEW, instsInProgress, loadsInProgress, numThreads, removeFromHistory(), rename(), renameStatus, sortInsts(), Squashing, storesInProgress, toIEWIndex, updateStatus(), and wroteToTimeBuffer.
Referenced by gem5::o3::CPU::tick().
|
private |
Switches rename to unblocking if the skid buffer is empty, and signals back that rename has unblocked.
Definition at line 895 of file rename.cc.
References DPRINTF, renameStatus, Running, SerializeStall, skidBuffer, toDecode, and wroteToTimeBuffer.
Referenced by checkSignalsAndUpdate(), and rename().
|
private |
Updates overall rename status based on all of the threads' statuses.
Definition at line 824 of file rename.cc.
References _status, gem5::o3::CPU::activateStage(), Active, activeThreads, cpu, gem5::o3::CPU::deactivateStage(), DPRINTF, Inactive, gem5::o3::CPU::RenameIdx, renameStatus, and Unblocking.
Referenced by tick().
|
private |
Returns the number of valid instructions coming from decode.
Definition at line 1186 of file rename.cc.
References fromDecode, and gem5::ArmISA::i.
Referenced by rename().
|
private |
Rename status.
Definition at line 111 of file rename.hh.
Referenced by resetStage(), and updateStatus().
Pointer to the list of active threads.
Definition at line 366 of file rename.hh.
Referenced by setActiveThreads(), skidsEmpty(), tick(), and updateStatus().
|
private |
Whether or not rename needs to block this cycle.
Definition at line 449 of file rename.hh.
Referenced by rename(), renameInsts(), and tick().
|
private |
Pointer to commit stage.
Used only for initialization.
Definition at line 160 of file rename.hh.
Referenced by clearStates(), resetStage(), and setCommitStage().
|
private |
Delay between commit and rename, in ticks.
Definition at line 438 of file rename.hh.
Referenced by setTimeBuffer().
|
private |
Pointer to CPU.
Definition at line 324 of file rename.hh.
Referenced by name(), regProbePoints(), tick(), and updateStatus().
|
private |
Decode instruction queue interface.
Definition at line 345 of file rename.hh.
Referenced by setDecodeQueue().
|
private |
Delay between decode and rename, in ticks.
Definition at line 435 of file rename.hh.
Referenced by Rename(), and setDecodeQueue().
|
private |
Records if the ROB is empty.
In SMT mode the ROB may be dynamically partitioned between threads, so the ROB must tell rename when it is empty.
Definition at line 411 of file rename.hh.
Referenced by checkStall(), clearStates(), readFreeEntries(), Rename(), renameInsts(), and resetStage().
|
private |
Per-thread tracking of the number of free entries of back-end structures.
Definition at line 405 of file rename.hh.
Referenced by calcFreeIQEntries(), calcFreeLQEntries(), calcFreeROBEntries(), calcFreeSQEntries(), clearStates(), readFreeEntries(), Rename(), and resetStage().
|
private |
Hold phys regs to be released after squash finish.
Definition at line 363 of file rename.hh.
Referenced by checkSignalsAndUpdate(), and doSquash().
|
private |
Free list interface.
Definition at line 360 of file rename.hh.
Referenced by checkSignalsAndUpdate(), removeFromHistory(), and setFreeList().
|
private |
Wire to get commit's output from backwards time buffer.
Definition at line 333 of file rename.hh.
Referenced by checkSignalsAndUpdate(), readFreeEntries(), setTimeBuffer(), and tick().
|
private |
Wire to get decode's output from decode queue.
Definition at line 348 of file rename.hh.
Referenced by setDecodeQueue(), sortInsts(), squash(), and validInsts().
|
private |
Wire to get IEW's output from backwards time buffer.
Definition at line 330 of file rename.hh.
Referenced by calcFreeIQEntries(), calcFreeLQEntries(), calcFreeROBEntries(), calcFreeSQEntries(), readFreeEntries(), readStallSignals(), renameInsts(), setTimeBuffer(), and tick().
|
private |
A per-thread list of all destination register renames, used to either undo rename mappings or free old physical registers.
Definition at line 321 of file rename.hh.
Referenced by doSquash(), drainSanityCheck(), dumpHistory(), isDrained(), removeFromHistory(), and renameDestRegs().
|
private |
Pointer to IEW stage.
Used only for initialization.
Definition at line 157 of file rename.hh.
Referenced by clearStates(), resetStage(), and setIEWStage().
|
private |
Delay between iew and rename, in ticks.
Definition at line 432 of file rename.hh.
Referenced by setTimeBuffer().
|
private |
Queue of all instructions coming from decode this cycle.
Definition at line 351 of file rename.hh.
Referenced by checkSignalsAndUpdate(), drainSanityCheck(), isDrained(), renameInsts(), skidInsert(), sortInsts(), and squash().
|
private |
Count of instructions in progress that have been sent off to the IQ and ROB, but are not yet included in their occupancy counts.
Definition at line 374 of file rename.hh.
Referenced by calcFreeIQEntries(), calcFreeROBEntries(), checkStall(), clearStates(), drainSanityCheck(), isDrained(), readFreeEntries(), Rename(), renameInsts(), resetStage(), and tick().
|
private |
Count of Load instructions in progress that have been sent off to the IQ and ROB, but are not yet included in their occupancy counts.
Definition at line 379 of file rename.hh.
Referenced by calcFreeLQEntries(), clearStates(), Rename(), renameInsts(), resetStage(), and tick().
|
private |
The number of threads active in rename.
Definition at line 460 of file rename.hh.
Referenced by drainSanityCheck(), dumpHistory(), isDrained(), resetStage(), setRenameMap(), and tick().
|
private |
To probe when register renaming for an instruction is complete.
Definition at line 119 of file rename.hh.
Referenced by regProbePoints(), and renameInsts().
|
private |
To probe when an instruction is squashed and the register mapping for it needs to be undone.
Definition at line 124 of file rename.hh.
Referenced by doSquash(), and regProbePoints().
|
private |
Rename map interface.
Definition at line 357 of file rename.hh.
Referenced by doSquash(), readFreeEntries(), Rename(), renameDestRegs(), renameInsts(), renameSrcRegs(), and setRenameMap().
|
private |
|
private |
Per-thread status.
Definition at line 114 of file rename.hh.
Referenced by block(), checkSignalsAndUpdate(), checkStall(), clearStates(), isDrained(), Rename(), rename(), renameInsts(), resetStage(), squash(), tick(), unblock(), and updateStatus().
|
private |
Rename width, in instructions.
Definition at line 441 of file rename.hh.
Referenced by Rename(), and renameInsts().
|
private |
Whether or not rename needs to resume a serialize instruction after squashing.
Definition at line 453 of file rename.hh.
Referenced by checkSignalsAndUpdate(), rename(), resetStage(), and squash().
|
private |
Whether or not rename needs to resume clearing out the skidbuffer after squashing.
Definition at line 457 of file rename.hh.
Referenced by block(), checkSignalsAndUpdate(), rename(), and resetStage().
|
private |
Pointer to the scoreboard.
Definition at line 369 of file rename.hh.
Referenced by renameDestRegs(), renameSrcRegs(), and setScoreboard().
|
private |
The serialize instruction that rename has stalled on.
Definition at line 424 of file rename.hh.
Referenced by checkSignalsAndUpdate(), clearStates(), Rename(), renameInsts(), resetStage(), and squash().
|
private |
Records if rename needs to serialize on the next instruction for any thread.
Definition at line 429 of file rename.hh.
Referenced by clearStates(), Rename(), renameInsts(), resetStage(), and serializeAfter().
|
private |
Skid buffer between rename and decode.
Definition at line 354 of file rename.hh.
Referenced by checkSignalsAndUpdate(), drainSanityCheck(), isDrained(), renameInsts(), skidInsert(), skidsEmpty(), squash(), and unblock().
|
private |
The maximum skid buffer size.
Definition at line 463 of file rename.hh.
Referenced by Rename(), and skidInsert().
|
private |
Tracks which stages are telling decode to stall.
Definition at line 421 of file rename.hh.
Referenced by checkStall(), clearStates(), readStallSignals(), Rename(), and resetStage().
|
private |
Referenced by doSquash(), incrFullStat(), removeFromHistory(), rename(), renameDestRegs(), renameInsts(), renameSrcRegs(), and skidInsert().
|
private |
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.
Definition at line 384 of file rename.hh.
Referenced by calcFreeSQEntries(), clearStates(), Rename(), renameInsts(), resetStage(), and tick().
|
private |
Pointer to main time buffer used for backwards communication.
Definition at line 327 of file rename.hh.
Referenced by setTimeBuffer().
|
private |
Wire to write infromation heading to previous stages.
Definition at line 336 of file rename.hh.
Referenced by block(), rename(), renameInsts(), setTimeBuffer(), squash(), and unblock().
|
private |
Wire to write any information heading to IEW.
Definition at line 342 of file rename.hh.
Referenced by renameInsts(), and setRenameQueue().
|
private |
The index of the instruction in the time buffer to IEW that rename is currently using.
Definition at line 446 of file rename.hh.
Referenced by renameInsts(), and tick().
|
private |