gem5 v24.0.0.0
|
IEW handles both single threaded and SMT IEW (issue/execute/writeback). More...
#include <iew.hh>
Classes | |
struct | IEWStats |
Public Types | |
enum | Status { Active , Inactive } |
Overall IEW stage status. More... | |
enum | StageStatus { Running , Blocked , Idle , StartSquash , Squashing , Unblocking } |
Status for Issue, Execute, and Writeback stages. More... | |
Public Member Functions | |
IEW (CPU *_cpu, const BaseO3CPUParams ¶ms) | |
Constructs a IEW with the given parameters. | |
std::string | name () const |
Returns the name of the IEW stage. | |
void | regProbePoints () |
Registers probes. | |
void | startupStage () |
Initializes stage; sends back the number of free IQ and LSQ entries. | |
void | clearStates (ThreadID tid) |
Clear all thread-specific states. | |
void | setTimeBuffer (TimeBuffer< TimeStruct > *tb_ptr) |
Sets main time buffer used for backwards communication. | |
void | setRenameQueue (TimeBuffer< RenameStruct > *rq_ptr) |
Sets time buffer for getting instructions coming from rename. | |
void | setIEWQueue (TimeBuffer< IEWStruct > *iq_ptr) |
Sets time buffer to pass on instructions to commit. | |
void | setActiveThreads (std::list< ThreadID > *at_ptr) |
Sets pointer to list of active threads. | |
void | setScoreboard (Scoreboard *sb_ptr) |
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 (ThreadID tid) |
Squashes instructions in IEW for a specific thread. | |
void | wakeDependents (const DynInstPtr &inst) |
Wakes all dependents of a completed instruction. | |
void | rescheduleMemInst (const DynInstPtr &inst) |
Tells memory dependence unit that a memory instruction needs to be rescheduled. | |
void | replayMemInst (const DynInstPtr &inst) |
Re-executes all rescheduled memory instructions. | |
void | blockMemInst (const DynInstPtr &inst) |
Moves memory instruction onto the list of cache blocked instructions. | |
void | cacheUnblocked () |
Notifies that the cache has become unblocked. | |
void | instToCommit (const DynInstPtr &inst) |
Sends an instruction to commit through the time buffer. | |
void | skidInsert (ThreadID tid) |
Inserts unused instructions of a thread into the skid buffer. | |
int | skidCount () |
Returns the max of the number of entries in all of the skid buffers. | |
bool | skidsEmpty () |
Returns if all of the skid buffers are empty. | |
void | updateStatus () |
Updates overall IEW status based on all of the stages' statuses. | |
void | resetEntries () |
Resets entries of the IQ and the LSQ. | |
void | wakeCPU () |
Tells the CPU to wakeup if it has descheduled itself due to no activity. | |
void | activityThisCycle () |
Reports to the CPU that there is activity this cycle. | |
void | activateStage () |
Tells CPU that the IEW stage is active and running. | |
void | deactivateStage () |
Tells CPU that the IEW stage is inactive and idle. | |
bool | hasStoresToWB () |
Returns if the LSQ has any stores to writeback. | |
bool | hasStoresToWB (ThreadID tid) |
Returns if the LSQ has any stores to writeback. | |
void | checkMisprediction (const DynInstPtr &inst) |
Check misprediction | |
void | setLastRetiredHtmUid (ThreadID tid, uint64_t htmUid) |
void | tick () |
Ticks IEW stage, causing Dispatch, the IQ, the LSQ, Execute, and Writeback to run for one cycle. | |
Public Attributes | |
InstructionQueue | instQueue |
Instruction queue. | |
LSQ | ldstQueue |
Load / store queue. | |
FUPool * | fuPool |
Pointer to the functional unit pool. | |
bool | updateLSQNextCycle |
Records if the LSQ needs to be updated on the next cycle, so that IEW knows if there will be activity on the next cycle. | |
Private Member Functions | |
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. | |
void | block (ThreadID tid) |
Sets Dispatch to blocked, and signals back to other stages to block. | |
void | unblock (ThreadID tid) |
Unblocks Dispatch if the skid buffer is empty, and signals back to other stages to unblock. | |
void | dispatch (ThreadID tid) |
Determines proper actions to take given Dispatch's status. | |
void | dispatchInsts (ThreadID tid) |
Dispatches instructions to IQ and LSQ. | |
void | executeInsts () |
Executes instructions. | |
void | writebackInsts () |
Writebacks instructions. | |
bool | checkStall (ThreadID tid) |
Checks if any of the stall conditions are currently true. | |
void | checkSignalsAndUpdate (ThreadID tid) |
Processes inputs and changes state accordingly. | |
void | emptyRenameInsts (ThreadID tid) |
Removes instructions from rename from a thread's instruction list. | |
void | sortInsts () |
Sorts instructions coming from rename into lists separated by thread. | |
void | updateExeInstStats (const DynInstPtr &inst) |
Updates execution stats based on the instruction. | |
void | printAvailableInsts () |
Debug function to print instructions that are issued this cycle. | |
Private Attributes | |
Status | _status |
Overall stage status. | |
StageStatus | dispatchStatus [MaxThreads] |
Dispatch status. | |
StageStatus | exeStatus |
Execute status. | |
StageStatus | wbStatus |
Writeback status. | |
ProbePointArg< DynInstPtr > * | ppMispredict |
Probe points. | |
ProbePointArg< DynInstPtr > * | ppDispatch |
ProbePointArg< DynInstPtr > * | ppExecute |
To probe when instruction execution begins. | |
ProbePointArg< DynInstPtr > * | ppToCommit |
To probe when instruction execution is complete. | |
TimeBuffer< TimeStruct > * | timeBuffer |
Pointer to main time buffer used for backwards communication. | |
TimeBuffer< TimeStruct >::wire | toFetch |
Wire to write information heading to previous stages. | |
TimeBuffer< TimeStruct >::wire | fromCommit |
Wire to get commit's output from backwards time buffer. | |
TimeBuffer< TimeStruct >::wire | toRename |
Wire to write information heading to previous stages. | |
TimeBuffer< RenameStruct > * | renameQueue |
Rename instruction queue interface. | |
TimeBuffer< RenameStruct >::wire | fromRename |
Wire to get rename's output from rename queue. | |
TimeBuffer< IssueStruct > | issueToExecQueue |
Issue stage queue. | |
TimeBuffer< IssueStruct >::wire | fromIssue |
Wire to read information from the issue stage time queue. | |
TimeBuffer< IEWStruct > * | iewQueue |
IEW stage time buffer. | |
TimeBuffer< IEWStruct >::wire | toCommit |
Wire to write infromation heading to commit. | |
std::queue< DynInstPtr > | insts [MaxThreads] |
Queue of all instructions coming from rename this cycle. | |
std::queue< DynInstPtr > | skidBuffer [MaxThreads] |
Skid buffer between rename and IEW. | |
Scoreboard * | scoreboard |
Scoreboard pointer. | |
CPU * | cpu |
CPU pointer. | |
bool | wroteToTimeBuffer |
Records if IEW has written to the time buffer this cycle, so that the CPU can deschedule itself if there is no activity. | |
bool | fetchRedirect [MaxThreads] |
Records if there is a fetch redirect on this cycle for each thread. | |
bool | updatedQueues |
Records if the queues have been changed (inserted or issued insts), so that IEW knows to broadcast the updated amount of free entries. | |
Cycles | commitToIEWDelay |
Commit to IEW delay. | |
Cycles | renameToIEWDelay |
Rename to IEW delay. | |
Cycles | issueToExecuteDelay |
Issue to execute delay. | |
unsigned | dispatchWidth |
Width of dispatch, in instructions. | |
unsigned | issueWidth |
Width of issue, in instructions. | |
unsigned | wbNumInst |
Index into queue of instructions being written back. | |
unsigned | wbCycle |
Cycle number within the queue of instructions being written back. | |
unsigned | wbWidth |
Writeback width. | |
ThreadID | numThreads |
Number of active threads. | |
std::list< ThreadID > * | activeThreads |
Pointer to list of active threads. | |
unsigned | skidBufferMax |
Maximum size of the skid buffer. | |
gem5::o3::IEW::IEWStats | iewStats |
IEW handles both single threaded and SMT IEW (issue/execute/writeback).
It handles the dispatching of instructions to the LSQ/IQ as part of the issue stage, and has the IQ try to issue instructions each cycle. The execute latency is actually tied into the issue latency to allow the IQ to be able to do back-to-back scheduling without having to speculatively schedule instructions. This happens by having the IQ have access to the functional units, and the IQ gets the execution latencies from the FUs when it issues instructions. Instructions reach the execute stage on the last cycle of their execution, which is when the IQ knows to wake up any dependent instructions, allowing back to back scheduling. The execute portion of IEW separates memory instructions from non-memory instructions, either telling the LSQ to execute the instruction, or executing the instruction directly. The writeback portion of IEW completes the instructions by waking up any dependents, and marking the register ready on the scoreboard.
gem5::o3::IEW::IEW | ( | CPU * | _cpu, |
const BaseO3CPUParams & | params ) |
Constructs a IEW with the given parameters.
Definition at line 67 of file iew.cc.
References _status, Active, dispatchStatus, dispatchWidth, exeStatus, fatal, fetchRedirect, fromIssue, Idle, instQueue, issueToExecQueue, issueToExecuteDelay, issueWidth, gem5::o3::MaxThreads, gem5::o3::MaxWidth, renameToIEWDelay, Running, gem5::o3::InstructionQueue::setIssueToExecuteQueue(), skidBufferMax, updateLSQNextCycle, wbStatus, and wbWidth.
void gem5::o3::IEW::activateStage | ( | ) |
Tells CPU that the IEW stage is active and running.
Definition at line 778 of file iew.cc.
References gem5::o3::CPU::activateStage(), cpu, DPRINTF, and gem5::o3::CPU::IEWIdx.
Referenced by updateStatus().
void gem5::o3::IEW::activityThisCycle | ( | ) |
Reports to the CPU that there is activity this cycle.
Definition at line 771 of file iew.cc.
References gem5::o3::CPU::activityThisCycle(), cpu, and DPRINTF.
Referenced by executeInsts(), gem5::o3::LSQUnit::executeLoad(), gem5::o3::LSQUnit::executeStore(), and gem5::o3::LSQUnit::writeback().
|
private |
Sets Dispatch to blocked, and signals back to other stages to block.
Definition at line 465 of file iew.cc.
References Blocked, dispatchStatus, DPRINTF, skidInsert(), toRename, Unblocking, and wroteToTimeBuffer.
Referenced by checkSignalsAndUpdate(), and dispatchInsts().
void gem5::o3::IEW::blockMemInst | ( | const DynInstPtr & | inst | ) |
Moves memory instruction onto the list of cache blocked instructions.
Definition at line 517 of file iew.cc.
References gem5::o3::InstructionQueue::blockMemInst(), and instQueue.
Referenced by gem5::o3::LSQUnit::read().
void gem5::o3::IEW::cacheUnblocked | ( | ) |
Notifies that the cache has become unblocked.
Definition at line 523 of file iew.cc.
References gem5::o3::InstructionQueue::cacheUnblocked(), and instQueue.
Referenced by gem5::o3::LSQ::recvReqRetry(), and gem5::o3::LSQ::tick().
void gem5::o3::IEW::checkMisprediction | ( | const DynInstPtr & | inst | ) |
Check misprediction
Definition at line 1554 of file iew.cc.
References DPRINTF, fetchRedirect, iewStats, gem5::o3::IEW::IEWStats::predictedNotTakenIncorrect, gem5::o3::IEW::IEWStats::predictedTakenIncorrect, squashDueToBranch(), and toCommit.
Referenced by gem5::o3::LSQUnit::writeback().
|
private |
Processes inputs and changes state accordingly.
Definition at line 668 of file iew.cc.
References block(), Blocked, checkStall(), dispatchStatus, DPRINTF, emptyRenameInsts(), fetchRedirect, fromCommit, Running, squash(), Squashing, toRename, unblock(), Unblocking, and wroteToTimeBuffer.
Referenced by tick().
|
private |
Checks if any of the stall conditions are currently true.
Definition at line 652 of file iew.cc.
References DPRINTF, fromCommit, instQueue, and gem5::o3::InstructionQueue::isFull().
Referenced by checkSignalsAndUpdate().
void gem5::o3::IEW::clearStates | ( | ThreadID | tid | ) |
Clear all thread-specific states.
Definition at line 254 of file iew.cc.
References instQueue, ldstQueue, gem5::o3::InstructionQueue::numFreeEntries(), gem5::o3::LSQ::numFreeLoadEntries(), gem5::o3::LSQ::numFreeStoreEntries(), and toRename.
Referenced by gem5::o3::CPU::removeThread().
void gem5::o3::IEW::deactivateStage | ( | ) |
Tells CPU that the IEW stage is inactive and idle.
Definition at line 785 of file iew.cc.
References cpu, gem5::o3::CPU::deactivateStage(), DPRINTF, and gem5::o3::CPU::IEWIdx.
Referenced by updateStatus().
|
private |
Determines proper actions to take given Dispatch's status.
Definition at line 792 of file iew.cc.
References gem5::o3::IEW::IEWStats::blockCycles, Blocked, dispatchInsts(), dispatchStatus, DPRINTF, fromRename, Idle, iewStats, Running, skidInsert(), skidsEmpty(), gem5::o3::IEW::IEWStats::squashCycles, Squashing, unblock(), gem5::o3::IEW::IEWStats::unblockCycles, and Unblocking.
Referenced by tick().
|
private |
Dispatches instructions to IQ and LSQ.
Definition at line 839 of file iew.cc.
References block(), cpu, gem5::curTick(), gem5::o3::IEW::IEWStats::dispatchedInsts, dispatchStatus, dispatchWidth, gem5::o3::IEW::IEWStats::dispLoadInsts, gem5::o3::IEW::IEWStats::dispNonSpecInsts, gem5::o3::IEW::IEWStats::dispSquashedInsts, gem5::o3::IEW::IEWStats::dispStoreInsts, DPRINTF, gem5::BaseCPU::executeStats, gem5::o3::LSQ::getLatestHtmUid(), Idle, iewStats, gem5::o3::InstructionQueue::insert(), gem5::o3::InstructionQueue::insertBarrier(), gem5::o3::LSQ::insertLoad(), gem5::o3::InstructionQueue::insertNonSpec(), gem5::o3::LSQ::insertStore(), instQueue, insts, gem5::o3::IEW::IEWStats::iqFullEvents, gem5::o3::InstructionQueue::isFull(), ldstQueue, gem5::o3::LSQ::lqFull(), gem5::o3::IEW::IEWStats::lsqFullEvents, gem5::o3::LSQ::numHtmStarts(), gem5::o3::LSQ::numHtmStops(), ppDispatch, gem5::o3::InstructionQueue::recordProducer(), Running, skidBuffer, gem5::o3::LSQ::sqFull(), toRename, Unblocking, and updatedQueues.
Referenced by dispatch().
void gem5::o3::IEW::drainSanityCheck | ( | ) | const |
Perform sanity checks after a drain.
Definition at line 344 of file iew.cc.
References gem5::o3::InstructionQueue::drainSanityCheck(), gem5::o3::LSQ::drainSanityCheck(), instQueue, isDrained(), and ldstQueue.
Referenced by gem5::o3::CPU::drainSanityCheck().
|
private |
|
private |
Executes instructions.
In the case of memory operations, it informs the LSQ to execute the instructions. Also handles any redirects that occur due to the executed instructions.
Definition at line 1097 of file iew.cc.
References activeThreads, gem5::o3::CPU::activityThisCycle(), activityThisCycle(), cpu, gem5::o3::InstructionQueue::deferMemInst(), DPRINTF, gem5::o3::IEW::IEWStats::executedInstStats, gem5::o3::LSQ::executeLoad(), gem5::o3::LSQ::executeStore(), exeStatus, fetchRedirect, fromIssue, gem5::o3::InstructionQueue::getInstToExecute(), gem5::o3::LSQ::getMemDepViolator(), Idle, iewStats, instQueue, instToCommit(), ldstQueue, gem5::o3::IEW::IEWStats::memOrderViolationEvents, gem5::NoFault, gem5::o3::IEW::IEWStats::ExecutedInstStats::numSquashedInsts, panic, ppExecute, ppMispredict, gem5::o3::IEW::IEWStats::predictedNotTakenIncorrect, gem5::o3::IEW::IEWStats::predictedTakenIncorrect, Running, squashDueToBranch(), squashDueToMemOrder(), toCommit, updatedQueues, updateExeInstStats(), gem5::o3::InstructionQueue::violation(), gem5::o3::LSQ::violation(), wbCycle, and wbNumInst.
Referenced by tick().
|
inline |
Returns if the LSQ has any stores to writeback.
Definition at line 221 of file iew.hh.
References gem5::o3::LSQ::hasStoresToWB(), and ldstQueue.
Referenced by gem5::o3::Commit::commit(), and gem5::o3::Commit::commitHead().
|
inline |
Returns if the LSQ has any stores to writeback.
Definition at line 224 of file iew.hh.
References gem5::o3::LSQ::hasStoresToWB(), and ldstQueue.
void gem5::o3::IEW::instToCommit | ( | const DynInstPtr & | inst | ) |
Sends an instruction to commit through the time buffer.
Definition at line 529 of file iew.cc.
References DPRINTF, iewQueue, insts, wbCycle, wbNumInst, and wbWidth.
Referenced by executeInsts(), gem5::o3::LSQUnit::executeLoad(), gem5::o3::LSQUnit::executeStore(), and gem5::o3::LSQUnit::writeback().
bool gem5::o3::IEW::isDrained | ( | ) | const |
Has the stage drained?
Definition at line 316 of file iew.cc.
References dispatchStatus, DPRINTF, fuPool, instQueue, insts, gem5::o3::FUPool::isDrained(), gem5::o3::InstructionQueue::isDrained(), gem5::o3::LSQ::isDrained(), ldstQueue, numThreads, Running, and skidBuffer.
Referenced by drainSanityCheck(), and gem5::o3::CPU::isCpuDrained().
std::string gem5::o3::IEW::name | ( | ) | const |
Returns the name of the IEW stage.
Definition at line 118 of file iew.cc.
References cpu, and gem5::Named::name().
Referenced by gem5::o3::LSQ::name(), and gem5::o3::LSQUnit::name().
|
private |
void gem5::o3::IEW::regProbePoints | ( | ) |
Registers probes.
Probe point with dynamic instruction as the argument used to probe when an instruction starts to execute.
Probe point with dynamic instruction as the argument used to probe when an instruction execution completes and it is marked ready to commit.
Definition at line 124 of file iew.cc.
References cpu, gem5::SimObject::getProbeManager(), ppDispatch, ppExecute, ppMispredict, and ppToCommit.
Referenced by gem5::o3::CPU::regProbePoints().
void gem5::o3::IEW::replayMemInst | ( | const DynInstPtr & | inst | ) |
Re-executes all rescheduled memory instructions.
Definition at line 511 of file iew.cc.
References instQueue, and gem5::o3::InstructionQueue::replayMemInst().
Referenced by gem5::o3::LSQUnit::completeStore(), and gem5::o3::LSQUnit::storePostSend().
void gem5::o3::IEW::rescheduleMemInst | ( | const DynInstPtr & | inst | ) |
Tells memory dependence unit that a memory instruction needs to be rescheduled.
It will re-execute once replayMemInst() is called.
Definition at line 505 of file iew.cc.
References instQueue, and gem5::o3::InstructionQueue::rescheduleMemInst().
Referenced by gem5::o3::LSQUnit::read().
void gem5::o3::IEW::resetEntries | ( | ) |
Resets entries of the IQ and the LSQ.
Sets pointer to list of active threads.
Definition at line 301 of file iew.cc.
References activeThreads, instQueue, ldstQueue, gem5::o3::InstructionQueue::setActiveThreads(), and gem5::o3::LSQ::setActiveThreads().
void gem5::o3::IEW::setIEWQueue | ( | TimeBuffer< IEWStruct > * | iq_ptr | ) |
Sets time buffer to pass on instructions to commit.
Definition at line 292 of file iew.cc.
References gem5::TimeBuffer< T >::getWire(), iewQueue, and toCommit.
|
inline |
Definition at line 234 of file iew.hh.
References ldstQueue, and gem5::o3::LSQ::setLastRetiredHtmUid().
Referenced by gem5::o3::Commit::commitHead().
void gem5::o3::IEW::setRenameQueue | ( | TimeBuffer< RenameStruct > * | rq_ptr | ) |
Sets time buffer for getting instructions coming from rename.
Definition at line 283 of file iew.cc.
References fromRename, gem5::TimeBuffer< T >::getWire(), renameQueue, and renameToIEWDelay.
void gem5::o3::IEW::setScoreboard | ( | Scoreboard * | sb_ptr | ) |
void gem5::o3::IEW::setTimeBuffer | ( | TimeBuffer< TimeStruct > * | tb_ptr | ) |
Sets main time buffer used for backwards communication.
Definition at line 266 of file iew.cc.
References commitToIEWDelay, fromCommit, gem5::TimeBuffer< T >::getWire(), instQueue, gem5::o3::InstructionQueue::setTimeBuffer(), timeBuffer, toFetch, and toRename.
int gem5::o3::IEW::skidCount | ( | ) |
Returns the max of the number of entries in all of the skid buffers.
Definition at line 578 of file iew.cc.
References activeThreads, and skidBuffer.
void gem5::o3::IEW::skidInsert | ( | ThreadID | tid | ) |
Inserts unused instructions of a thread into the skid buffer.
Definition at line 557 of file iew.cc.
References DPRINTF, insts, skidBuffer, and skidBufferMax.
Referenced by block(), and dispatch().
bool gem5::o3::IEW::skidsEmpty | ( | ) |
Returns if all of the skid buffers are empty.
Definition at line 596 of file iew.cc.
References activeThreads, and skidBuffer.
Referenced by dispatch().
|
private |
Sorts instructions coming from rename into lists separated by thread.
Definition at line 731 of file iew.cc.
References fromRename, gem5::ArmISA::i, insts, and numThreads.
Referenced by tick().
void gem5::o3::IEW::squash | ( | ThreadID | tid | ) |
Squashes instructions in IEW for a specific thread.
Definition at line 380 of file iew.cc.
References DPRINTF, emptyRenameInsts(), fromCommit, instQueue, ldstQueue, skidBuffer, gem5::o3::InstructionQueue::squash(), gem5::o3::LSQ::squash(), toRename, and updatedQueues.
Referenced by checkSignalsAndUpdate().
|
private |
Sends commit proper information for a squash due to a branch mispredict.
Definition at line 415 of file iew.cc.
References DPRINTF, gem5::ArmISA::set, toCommit, and wroteToTimeBuffer.
Referenced by checkMisprediction(), and executeInsts().
|
private |
Sends commit proper information for a squash due to a memory order violation.
Definition at line 439 of file iew.cc.
References DPRINTF, gem5::ArmISA::set, toCommit, and wroteToTimeBuffer.
Referenced by executeInsts().
void gem5::o3::IEW::startupStage | ( | ) |
Initializes stage; sends back the number of free IQ and LSQ entries.
Definition at line 231 of file iew.cc.
References gem5::o3::CPU::activateStage(), gem5::o3::CPU::checker, cpu, gem5::o3::LSQ::getDataPort(), gem5::o3::CPU::IEWIdx, instQueue, ldstQueue, gem5::o3::InstructionQueue::numFreeEntries(), gem5::o3::LSQ::numFreeLoadEntries(), gem5::o3::LSQ::numFreeStoreEntries(), numThreads, gem5::CheckerCPU::setDcachePort(), and toRename.
Referenced by gem5::o3::CPU::startup(), and takeOverFrom().
void gem5::o3::IEW::takeOverFrom | ( | ) |
Takes over from another CPU's thread.
Definition at line 353 of file iew.cc.
References _status, Active, gem5::o3::CPU::activityThisCycle(), cpu, dispatchStatus, exeStatus, fetchRedirect, fuPool, gem5::ArmISA::i, Idle, instQueue, issueToExecQueue, ldstQueue, numThreads, Running, startupStage(), gem5::o3::FUPool::takeOverFrom(), gem5::o3::InstructionQueue::takeOverFrom(), gem5::o3::LSQ::takeOverFrom(), updateLSQNextCycle, and wbStatus.
Referenced by gem5::o3::CPU::takeOverFrom().
void gem5::o3::IEW::tick | ( | ) |
Ticks IEW stage, causing Dispatch, the IQ, the LSQ, Execute, and Writeback to run for one cycle.
Definition at line 1393 of file iew.cc.
References activeThreads, gem5::o3::CPU::activityThisCycle(), checkSignalsAndUpdate(), gem5::o3::InstructionQueue::commit(), gem5::o3::LSQ::commitLoads(), gem5::o3::LSQ::commitStores(), cpu, dispatch(), DPRINTF, executeInsts(), exeStatus, fromCommit, fuPool, gem5::o3::InstructionQueue::getCount(), gem5::o3::LSQ::getCount(), gem5::o3::InstructionQueue::hasReadyInsts(), Idle, instQueue, issueToExecQueue, ldstQueue, gem5::o3::InstructionQueue::numFreeEntries(), gem5::o3::LSQ::numFreeLoadEntries(), gem5::o3::LSQ::numFreeStoreEntries(), gem5::o3::FUPool::processFreeUnits(), gem5::o3::InstructionQueue::replayMemInst(), Running, gem5::o3::InstructionQueue::scheduleNonSpec(), gem5::o3::InstructionQueue::scheduleReadyInsts(), sortInsts(), Squashing, gem5::o3::LSQ::tick(), toFetch, toRename, updatedQueues, updateLSQNextCycle, updateStatus(), wbCycle, wbNumInst, writebackInsts(), gem5::o3::LSQ::writebackStores(), and wroteToTimeBuffer.
Referenced by gem5::o3::CPU::tick().
|
private |
Unblocks Dispatch if the skid buffer is empty, and signals back to other stages to unblock.
Definition at line 483 of file iew.cc.
References dispatchStatus, DPRINTF, Running, skidBuffer, toRename, and wroteToTimeBuffer.
Referenced by checkSignalsAndUpdate(), and dispatch().
|
private |
Updates execution stats based on the instruction.
Definition at line 1522 of file iew.cc.
References cpu, gem5::curTick(), and gem5::BaseCPU::executeStats.
Referenced by executeInsts().
void gem5::o3::IEW::updateStatus | ( | ) |
Updates overall IEW status based on all of the stages' statuses.
Definition at line 612 of file iew.cc.
References _status, activateStage(), Active, activeThreads, deactivateStage(), dispatchStatus, DPRINTF, gem5::o3::InstructionQueue::hasReadyInsts(), Inactive, instQueue, gem5::o3::InstructionQueue::IQIOStats::intInstQueueReads, gem5::o3::InstructionQueue::iqIOStats, ldstQueue, Unblocking, and gem5::o3::LSQ::willWB().
Referenced by tick().
void gem5::o3::IEW::wakeCPU | ( | ) |
Tells the CPU to wakeup if it has descheduled itself due to no activity.
Used mainly by the LdWritebackEvent.
Definition at line 765 of file iew.cc.
References cpu, and gem5::o3::CPU::wakeCPU().
Referenced by gem5::o3::InstructionQueue::processFUCompletion(), and gem5::o3::LSQUnit::writeback().
void gem5::o3::IEW::wakeDependents | ( | const DynInstPtr & | inst | ) |
Wakes all dependents of a completed instruction.
Definition at line 499 of file iew.cc.
References instQueue, and gem5::o3::InstructionQueue::wakeDependents().
|
private |
Writebacks instructions.
In our model, the instruction's execute() function atomically reads registers, executes, and writes registers. Thus this writeback only wakes up dependent instructions, and informs the scoreboard of registers becoming ready.
Definition at line 1343 of file iew.cc.
References gem5::o3::IEW::IEWStats::consumerInst, DPRINTF, gem5::ArmISA::i, iewStats, instQueue, gem5::o3::IEW::IEWStats::instsToCommit, gem5::NoFault, ppToCommit, gem5::o3::IEW::IEWStats::producerInst, scoreboard, gem5::o3::Scoreboard::setReg(), toCommit, gem5::o3::InstructionQueue::wakeDependents(), wbWidth, and gem5::o3::IEW::IEWStats::writebackCount.
Referenced by tick().
|
private |
Overall stage status.
Definition at line 112 of file iew.hh.
Referenced by IEW(), takeOverFrom(), and updateStatus().
Pointer to list of active threads.
Definition at line 412 of file iew.hh.
Referenced by executeInsts(), setActiveThreads(), skidCount(), skidsEmpty(), tick(), and updateStatus().
|
private |
|
private |
CPU pointer.
Definition at line 343 of file iew.hh.
Referenced by activateStage(), activityThisCycle(), deactivateStage(), dispatchInsts(), gem5::o3::IEW::IEWStats::ExecutedInstStats::ExecutedInstStats(), executeInsts(), gem5::o3::IEW::IEWStats::IEWStats(), name(), regProbePoints(), startupStage(), takeOverFrom(), tick(), updateExeInstStats(), and wakeCPU().
|
private |
Dispatch status.
Definition at line 114 of file iew.hh.
Referenced by block(), checkSignalsAndUpdate(), dispatch(), dispatchInsts(), IEW(), isDrained(), takeOverFrom(), unblock(), and updateStatus().
|
private |
Width of dispatch, in instructions.
Definition at line 390 of file iew.hh.
Referenced by dispatchInsts(), and IEW().
|
private |
Execute status.
Definition at line 116 of file iew.hh.
Referenced by executeInsts(), IEW(), takeOverFrom(), and tick().
|
private |
Records if there is a fetch redirect on this cycle for each thread.
Definition at line 369 of file iew.hh.
Referenced by checkMisprediction(), checkSignalsAndUpdate(), executeInsts(), IEW(), and takeOverFrom().
|
private |
Wire to get commit's output from backwards time buffer.
Definition at line 306 of file iew.hh.
Referenced by checkSignalsAndUpdate(), checkStall(), setTimeBuffer(), squash(), and tick().
|
private |
Wire to read information from the issue stage time queue.
Definition at line 321 of file iew.hh.
Referenced by executeInsts(), IEW(), and printAvailableInsts().
|
private |
Wire to get rename's output from rename queue.
Definition at line 315 of file iew.hh.
Referenced by dispatch(), setRenameQueue(), and sortInsts().
FUPool* gem5::o3::IEW::fuPool |
Pointer to the functional unit pool.
Definition at line 361 of file iew.hh.
Referenced by isDrained(), takeOverFrom(), and tick().
|
private |
IEW stage time buffer.
Holds ROB indices of instructions that can be marked as completed.
Definition at line 327 of file iew.hh.
Referenced by instToCommit(), and setIEWQueue().
|
private |
Referenced by checkMisprediction(), dispatch(), dispatchInsts(), executeInsts(), and writebackInsts().
InstructionQueue gem5::o3::IEW::instQueue |
Instruction queue.
Definition at line 355 of file iew.hh.
Referenced by blockMemInst(), cacheUnblocked(), checkStall(), clearStates(), gem5::o3::Rename::clearStates(), dispatchInsts(), drainSanityCheck(), executeInsts(), IEW(), isDrained(), gem5::o3::CPU::removeThread(), replayMemInst(), rescheduleMemInst(), gem5::o3::Rename::resetStage(), setActiveThreads(), setTimeBuffer(), squash(), startupStage(), takeOverFrom(), tick(), updateStatus(), wakeDependents(), and writebackInsts().
|
private |
Queue of all instructions coming from rename this cycle.
Definition at line 333 of file iew.hh.
Referenced by dispatchInsts(), emptyRenameInsts(), instToCommit(), isDrained(), skidInsert(), and sortInsts().
|
private |
Issue stage queue.
Definition at line 318 of file iew.hh.
Referenced by IEW(), takeOverFrom(), and tick().
|
private |
|
private |
LSQ gem5::o3::IEW::ldstQueue |
Load / store queue.
Definition at line 358 of file iew.hh.
Referenced by clearStates(), gem5::o3::Rename::clearStates(), dispatchInsts(), drainSanityCheck(), executeInsts(), gem5::o3::CPU::getDataPort(), hasStoresToWB(), hasStoresToWB(), gem5::o3::CPU::htmSendAbortSignal(), isDrained(), gem5::o3::CPU::pushRequest(), gem5::o3::CPU::removeThread(), gem5::o3::Rename::resetStage(), setActiveThreads(), setLastRetiredHtmUid(), squash(), startupStage(), takeOverFrom(), tick(), and updateStatus().
|
private |
Number of active threads.
Definition at line 409 of file iew.hh.
Referenced by isDrained(), sortInsts(), startupStage(), and takeOverFrom().
|
private |
Definition at line 122 of file iew.hh.
Referenced by dispatchInsts(), and regProbePoints().
|
private |
To probe when instruction execution begins.
Definition at line 124 of file iew.hh.
Referenced by executeInsts(), and regProbePoints().
|
private |
Probe points.
Definition at line 121 of file iew.hh.
Referenced by executeInsts(), and regProbePoints().
|
private |
To probe when instruction execution is complete.
Definition at line 126 of file iew.hh.
Referenced by regProbePoints(), and writebackInsts().
|
private |
Rename instruction queue interface.
Definition at line 312 of file iew.hh.
Referenced by setRenameQueue().
|
private |
|
private |
Scoreboard pointer.
Definition at line 339 of file iew.hh.
Referenced by setScoreboard(), and writebackInsts().
|
private |
Skid buffer between rename and IEW.
Definition at line 336 of file iew.hh.
Referenced by dispatchInsts(), isDrained(), skidCount(), skidInsert(), skidsEmpty(), squash(), and unblock().
|
private |
Maximum size of the skid buffer.
Definition at line 415 of file iew.hh.
Referenced by IEW(), and skidInsert().
|
private |
Pointer to main time buffer used for backwards communication.
Definition at line 300 of file iew.hh.
Referenced by setTimeBuffer().
|
private |
Wire to write infromation heading to commit.
Definition at line 330 of file iew.hh.
Referenced by checkMisprediction(), executeInsts(), setIEWQueue(), squashDueToBranch(), squashDueToMemOrder(), and writebackInsts().
|
private |
Wire to write information heading to previous stages.
Definition at line 303 of file iew.hh.
Referenced by setTimeBuffer(), and tick().
|
private |
Wire to write information heading to previous stages.
Definition at line 309 of file iew.hh.
Referenced by block(), checkSignalsAndUpdate(), clearStates(), dispatchInsts(), emptyRenameInsts(), setTimeBuffer(), squash(), startupStage(), tick(), and unblock().
|
private |
Records if the queues have been changed (inserted or issued insts), so that IEW knows to broadcast the updated amount of free entries.
Definition at line 374 of file iew.hh.
Referenced by dispatchInsts(), executeInsts(), squash(), and tick().
bool gem5::o3::IEW::updateLSQNextCycle |
Records if the LSQ needs to be updated on the next cycle, so that IEW knows if there will be activity on the next cycle.
Definition at line 365 of file iew.hh.
Referenced by gem5::o3::LSQUnit::completeStore(), IEW(), takeOverFrom(), and tick().
|
private |
Cycle number within the queue of instructions being written back.
Used in case there are too many instructions writing back at the current cycle and writesbacks need to be scheduled for the future. See comments in instToCommit().
Definition at line 403 of file iew.hh.
Referenced by executeInsts(), instToCommit(), and tick().
|
private |
Index into queue of instructions being written back.
Definition at line 396 of file iew.hh.
Referenced by executeInsts(), instToCommit(), and tick().
|
private |
|
private |
Writeback width.
Definition at line 406 of file iew.hh.
Referenced by IEW(), instToCommit(), and writebackInsts().
|
private |
Records if IEW has written to the time buffer this cycle, so that the CPU can deschedule itself if there is no activity.
Definition at line 348 of file iew.hh.
Referenced by block(), checkSignalsAndUpdate(), squashDueToBranch(), squashDueToMemOrder(), tick(), and unblock().