gem5 v24.0.0.0
|
Commit handles single threaded and SMT commit. More...
#include <commit.hh>
Classes | |
struct | CommitStats |
Public Types | |
enum | CommitStatus { Active , Inactive } |
Overall commit status. More... | |
enum | ThreadStatus { Running , Idle , ROBSquashing , TrapPending , FetchTrapPending , SquashAfterPending } |
Individual thread status. More... | |
Public Member Functions | |
Commit (CPU *_cpu, const BaseO3CPUParams ¶ms) | |
Construct a Commit with the given parameters. | |
std::string | name () const |
Returns the name of the Commit. | |
void | regProbePoints () |
Registers probes. | |
void | setThreads (std::vector< ThreadState * > &threads) |
Sets the list of threads. | |
void | setTimeBuffer (TimeBuffer< TimeStruct > *tb_ptr) |
Sets the main time buffer pointer, used for backwards communication. | |
void | setFetchQueue (TimeBuffer< FetchStruct > *fq_ptr) |
void | setRenameQueue (TimeBuffer< RenameStruct > *rq_ptr) |
Sets the pointer to the queue coming from rename. | |
void | setIEWQueue (TimeBuffer< IEWStruct > *iq_ptr) |
Sets the pointer to the queue coming from IEW. | |
void | setIEWStage (IEW *iew_stage) |
Sets the pointer to the IEW stage. | |
void | setActiveThreads (std::list< ThreadID > *at_ptr) |
Sets pointer to list of active threads. | |
void | setRenameMap (UnifiedRenameMap::PerThreadUnifiedRenameMap &rm_ptr) |
Sets pointer to the commited state rename map. | |
void | setROB (ROB *rob_ptr) |
Sets pointer to the ROB. | |
void | startupStage () |
Initializes stage by sending back the number of free entries. | |
void | clearStates (ThreadID tid) |
Clear all thread-specific states. | |
void | drain () |
Initializes the draining of commit. | |
void | drainResume () |
Resumes execution after draining. | |
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 | deactivateThread (ThreadID tid) |
Deschedules a thread from scheduling. | |
bool | executingHtmTransaction (ThreadID) const |
Is the CPU currently processing a HTM transaction? | |
void | resetHtmStartsStops (ThreadID) |
void | tick () |
Ticks the commit stage, which tries to commit instructions. | |
void | commit () |
Handles any squashes that are sent from IEW, and adds instructions to the ROB and tries to commit instructions. | |
size_t | numROBFreeEntries (ThreadID tid) |
Returns the number of free ROB entries for a specific thread. | |
void | generateTrapEvent (ThreadID tid, Fault inst_fault) |
Generates an event to schedule a squash due to a trap. | |
void | generateTCEvent (ThreadID tid) |
Records that commit needs to initiate a squash due to an external state update through the TC. | |
const PCStateBase & | pcState (ThreadID tid) |
Reads the PC of a specific thread. | |
void | pcState (const PCStateBase &val, ThreadID tid) |
Sets the PC of a specific thread. | |
Public Attributes | |
IEW * | iewStage |
The pointer to the IEW stage. | |
ROB * | rob |
ROB interface. | |
Private Member Functions | |
void | processTrapEvent (ThreadID tid) |
Mark the thread as processing a trap. | |
void | updateStatus () |
Updates the overall status of commit with the nextStatus, and tell the CPU if commit is active/inactive. | |
bool | changedROBEntries () |
Returns if any of the threads have the number of ROB entries changed on this cycle. | |
void | squashAll (ThreadID tid) |
Squashes all in flight instructions. | |
void | squashFromTrap (ThreadID tid) |
Handles squashing due to a trap. | |
void | squashFromTC (ThreadID tid) |
Handles squashing due to an TC write. | |
void | squashFromSquashAfter (ThreadID tid) |
Handles a squash from a squashAfter() request. | |
void | squashAfter (ThreadID tid, const DynInstPtr &head_inst) |
Handle squashing from instruction with SquashAfter set. | |
void | handleInterrupt () |
Handles processing an interrupt. | |
void | propagateInterrupt () |
Get fetch redirecting so we can handle an interrupt. | |
void | commitInsts () |
Commits as many instructions as possible. | |
bool | commitHead (const DynInstPtr &head_inst, unsigned inst_num) |
Tries to commit the head ROB instruction passed in. | |
void | getInsts () |
Gets instructions from rename and inserts them into the ROB. | |
void | markCompletedInsts () |
Marks completed instructions using information sent from IEW. | |
ThreadID | getCommittingThread () |
Gets the thread to commit, based on the SMT policy. | |
ThreadID | roundRobin () |
Returns the thread ID to use based on a round robin policy. | |
ThreadID | oldestReady () |
Returns the thread ID to use based on an oldest instruction policy. | |
void | updateComInstStats (const DynInstPtr &inst) |
Updates commit stats based on this instruction. | |
Private Attributes | |
CommitStatus | _status |
Overall commit status. | |
CommitStatus | _nextStatus |
Next commit status, to be set at the end of the cycle. | |
ThreadStatus | commitStatus [MaxThreads] |
Per-thread status. | |
CommitPolicy | commitPolicy |
Commit policy used in SMT mode. | |
ProbePointArg< DynInstPtr > * | ppCommit |
Probe Points. | |
ProbePointArg< DynInstPtr > * | ppCommitStall |
ProbePointArg< DynInstPtr > * | ppSquash |
To probe when an instruction is squashed. | |
TimeBuffer< TimeStruct > * | timeBuffer |
Time buffer interface. | |
TimeBuffer< TimeStruct >::wire | toIEW |
Wire to write information heading to previous stages. | |
TimeBuffer< TimeStruct >::wire | robInfoFromIEW |
Wire to read information from IEW (for ROB). | |
TimeBuffer< FetchStruct > * | fetchQueue |
TimeBuffer< FetchStruct >::wire | fromFetch |
TimeBuffer< IEWStruct > * | iewQueue |
IEW instruction queue interface. | |
TimeBuffer< IEWStruct >::wire | fromIEW |
Wire to read information from IEW queue. | |
TimeBuffer< RenameStruct > * | renameQueue |
Rename instruction queue interface, for ROB. | |
TimeBuffer< RenameStruct >::wire | fromRename |
Wire to read information from rename queue. | |
CPU * | cpu |
Pointer to O3CPU. | |
std::vector< ThreadState * > | thread |
Vector of all of the threads. | |
bool | wroteToTimeBuffer |
Records that commit has written to the time buffer this cycle. | |
bool | changedROBNumEntries [MaxThreads] |
Records if the number of ROB entries has changed this cycle. | |
bool | trapSquash [MaxThreads] |
Records if a thread has to squash this cycle due to a trap. | |
bool | tcSquash [MaxThreads] |
Records if a thread has to squash this cycle due to an XC write. | |
DynInstPtr | squashAfterInst [MaxThreads] |
Instruction passed to squashAfter(). | |
std::list< ThreadID > | priority_list |
Priority List used for Commit Policy. | |
const Cycles | iewToCommitDelay |
IEW to Commit delay. | |
const Cycles | commitToIEWDelay |
Commit to IEW delay. | |
const Cycles | renameToROBDelay |
Rename to ROB delay. | |
const Cycles | fetchToCommitDelay |
const unsigned | renameWidth |
Rename width, in instructions. | |
const unsigned | commitWidth |
Commit width, in instructions. | |
const ThreadID | numThreads |
Number of Active Threads. | |
bool | drainPending |
Is a drain pending? Commit is looking for an instruction boundary while there are no pending interrupts. | |
bool | drainImminent |
Is a drain imminent? Commit has found an instruction boundary while no interrupts were present or in flight. | |
const Cycles | trapLatency |
The latency to handle a trap. | |
Fault | interrupt |
The interrupt fault. | |
std::unique_ptr< PCStateBase > | pc [MaxThreads] |
The commit PC state of each thread. | |
InstSeqNum | youngestSeqNum [MaxThreads] |
The sequence number of the youngest valid instruction in the ROB. | |
InstSeqNum | lastCommitedSeqNum [MaxThreads] |
The sequence number of the last commited instruction. | |
bool | trapInFlight [MaxThreads] |
Records if there is a trap currently in flight. | |
bool | committedStores [MaxThreads] |
Records if there were any stores committed this cycle. | |
bool | checkEmptyROB [MaxThreads] |
Records if commit should check if the ROB is truly empty (see commit_impl.hh). | |
std::list< ThreadID > * | activeThreads |
Pointer to the list of active threads. | |
UnifiedRenameMap * | renameMap [MaxThreads] |
Rename map interface. | |
bool | canHandleInterrupts |
True if last committed microop can be followed by an interrupt. | |
bool | avoidQuiesceLiveLock |
Have we had an interrupt pending and then seen it de-asserted because of a masking change? In this case the variable is set and the next time interrupts are enabled and pending the pipeline will squash to avoid a possible livelock senario. | |
int | htmStarts [MaxThreads] |
int | htmStops [MaxThreads] |
gem5::o3::Commit::CommitStats | stats |
Commit handles single threaded and SMT commit.
Its width is specified by the parameters; each cycle it tries to commit that many instructions. The SMT policy decides which thread it tries to commit instructions from. Non- speculative instructions must reach the head of the ROB before they are ready to execute; once they reach the head, commit will broadcast the instruction's sequence number to the previous stages so that they can issue/ execute the instruction. Only one non-speculative instruction is handled per cycle. Commit is responsible for handling all back-end initiated redirects. It receives the redirect, and then broadcasts it to all stages, indicating the sequence number they should squash until, and any necessary branch misprediction information as well. It priortizes redirects by instruction's age, only broadcasting a redirect if it corresponds to an instruction that should currently be in the ROB. This is done by tracking the sequence number of the youngest instruction in the ROB, which gets updated to any squashing instruction's sequence number, and only broadcasting a redirect if it corresponds to an older instruction. Commit also supports multiple cycle squashing, to model a ROB that can only remove a certain number of instructions per cycle.
gem5::o3::Commit::Commit | ( | CPU * | _cpu, |
const BaseO3CPUParams & | params ) |
Construct a Commit with the given parameters.
Definition at line 84 of file commit.cc.
References _nextStatus, _status, Active, changedROBNumEntries, checkEmptyROB, commitPolicy, commitStatus, committedStores, commitWidth, fatal, htmStarts, htmStops, Idle, Inactive, interrupt, lastCommitedSeqNum, gem5::o3::MaxThreads, gem5::o3::MaxWidth, gem5::NoFault, numThreads, pc, priority_list, renameMap, squashAfterInst, tcSquash, trapInFlight, trapSquash, and youngestSeqNum.
|
private |
Returns if any of the threads have the number of ROB entries changed on this cycle.
Used to determine if the number of free ROB entries needs to be sent back to previous stages.
Definition at line 428 of file commit.cc.
References activeThreads, and changedROBNumEntries.
void gem5::o3::Commit::clearStates | ( | ThreadID | tid | ) |
Clear all thread-specific states.
Definition at line 286 of file commit.cc.
References changedROBNumEntries, checkEmptyROB, commitStatus, committedStores, cpu, gem5::ThreadContext::getIsaPtr(), Idle, lastCommitedSeqNum, gem5::BaseISA::newPCState(), pc, squashAfterInst, gem5::o3::CPU::tcBase(), tcSquash, trapInFlight, and trapSquash.
Referenced by gem5::o3::CPU::removeThread().
void gem5::o3::Commit::commit | ( | ) |
Handles any squashes that are sent from IEW, and adds instructions to the ROB and tries to commit instructions.
Definition at line 736 of file commit.cc.
References _nextStatus, Active, activeThreads, gem5::o3::Commit::CommitStats::branchMispredicts, changedROBNumEntries, checkEmptyROB, gem5::BaseCPU::checkInterrupts(), commitInsts(), commitStatus, committedStores, cpu, DPRINTF, gem5::o3::ROB::findInst(), fromIEW, gem5::FullSystem, getInsts(), gem5::o3::IEW::hasStoresToWB(), iewStage, gem5::PCStateBase::instAddr(), gem5::o3::ROB::isEmpty(), gem5::o3::CPU::isThreadExiting(), gem5::o3::ROB::numFreeEntries(), numThreads, pc, pcState(), propagateInterrupt(), rob, ROBSquashing, gem5::o3::CPU::scheduleThreadExitEvent(), gem5::ArmISA::set, gem5::o3::ROB::squash(), SquashAfterPending, squashFromSquashAfter(), squashFromTC(), squashFromTrap(), stats, tcSquash, toIEW, TrapPending, trapSquash, wroteToTimeBuffer, and youngestSeqNum.
Referenced by gem5::o3::Commit::CommitStats::CommitStats(), and tick().
|
private |
Tries to commit the head ROB instruction passed in.
head_inst | The instruction to be committed. |
Definition at line 1098 of file commit.cc.
References gem5::o3::CPU::checker, gem5::o3::Commit::CommitStats::commitNonSpecStalls, commitStatus, committedStores, cpu, gem5::curTick(), DPRINTF, gem5::EXCEPTION, generateTrapEvent(), gem5::o3::IEW::hasStoresToWB(), gem5::ArmISA::i, iewStage, gem5::NoFault, gem5::nullStaticInstPtr, renameMap, gem5::o3::ROB::retireHead(), rob, gem5::o3::UnifiedRenameMap::setEntry(), gem5::o3::IEW::setLastRetiredHtmUid(), stats, thread, toIEW, gem5::o3::CPU::trap(), TrapPending, updateComInstStats(), and gem5::Checker< class >::verify().
Referenced by commitInsts().
|
private |
Commits as many instructions as possible.
Definition at line 897 of file commit.cc.
References avoidQuiesceLiveLock, canHandleInterrupts, changedROBNumEntries, gem5::o3::CPU::checker, gem5::BaseCPU::checkInterrupts(), gem5::BaseCPU::clearInterrupts(), gem5::o3::CPU::commitDrained(), gem5::o3::Commit::CommitStats::commitEligibleSamples, commitHead(), gem5::o3::Commit::CommitStats::commitSquashedInsts, gem5::BaseCPU::commitStats, gem5::o3::Commit::CommitStats::committedInstType, commitWidth, gem5::X86ISA::count, cpu, DPRINTF, drainImminent, drainPending, executingHtmTransaction(), getCommittingThread(), handleInterrupt(), htmStarts, htmStops, interrupt, gem5::o3::ROB::isHeadReady(), lastCommitedSeqNum, gem5::NoFault, gem5::o3::Commit::CommitStats::numCommittedDist, pc, ppCommit, ppSquash, gem5::o3::ROB::readHeadInst(), gem5::o3::ROB::retireHead(), rob, gem5::statistics::DistBase< Derived, Stor >::sample(), gem5::ArmISA::set, squashAfter(), stats, thread, toIEW, gem5::BaseCPU::traceFunctions(), and gem5::Checker< class >::verify().
Referenced by commit().
void gem5::o3::Commit::deactivateThread | ( | ThreadID | tid | ) |
Deschedules a thread from scheduling.
Definition at line 367 of file commit.cc.
References priority_list.
Referenced by gem5::o3::CPU::deactivateThread().
void gem5::o3::Commit::drain | ( | ) |
Initializes the draining of commit.
Definition at line 300 of file commit.cc.
References drainPending.
Referenced by gem5::o3::CPU::drain().
void gem5::o3::Commit::drainResume | ( | ) |
Resumes execution after draining.
Definition at line 303 of file commit.cc.
References drainImminent, and drainPending.
Referenced by gem5::o3::CPU::drainResume().
void gem5::o3::Commit::drainSanityCheck | ( | ) | const |
Perform sanity checks after a drain.
Definition at line 310 of file commit.cc.
References gem5::o3::ROB::drainSanityCheck(), executingHtmTransaction(), isDrained(), numThreads, panic, and rob.
Referenced by gem5::o3::CPU::drainSanityCheck().
bool gem5::o3::Commit::executingHtmTransaction | ( | ThreadID | tid | ) | const |
Is the CPU currently processing a HTM transaction?
Definition at line 378 of file commit.cc.
References htmStarts, htmStops, and gem5::InvalidThreadID.
Referenced by commitInsts(), gem5::o3::CPU::deactivateThread(), and drainSanityCheck().
void gem5::o3::Commit::generateTCEvent | ( | ThreadID | tid | ) |
Records that commit needs to initiate a squash due to an external state update through the TC.
Definition at line 476 of file commit.cc.
References DPRINTF, tcSquash, and trapInFlight.
Referenced by gem5::o3::CPU::squashFromTC().
Generates an event to schedule a squash due to a trap.
Definition at line 451 of file commit.cc.
References gem5::Clocked::clockEdge(), cpu, gem5::EventBase::CPU_Tick_Pri, DPRINTF, processTrapEvent(), gem5::EventManager::schedule(), gem5::BaseCPU::syscallRetryLatency, thread, trapInFlight, and trapLatency.
Referenced by commitHead(), and handleInterrupt().
|
private |
Gets the thread to commit, based on the SMT policy.
Definition at line 1403 of file commit.cc.
References activeThreads, commitPolicy, commitStatus, cpu, FetchTrapPending, Idle, gem5::InvalidThreadID, gem5::o3::ROB::isEmpty(), gem5::o3::ROB::isHeadReady(), gem5::o3::CPU::isThreadExiting(), numThreads, oldestReady(), gem5::o3::ROB::readHeadInst(), rob, roundRobin(), and Running.
Referenced by commitInsts().
|
private |
Gets instructions from rename and inserts them into the ROB.
Definition at line 1284 of file commit.cc.
References changedROBNumEntries, commitStatus, DPRINTF, fromRename, gem5::o3::ROB::getMaxEntries(), gem5::o3::ROB::getThreadEntries(), gem5::o3::ROB::insertInst(), renameWidth, rob, ROBSquashing, TrapPending, and youngestSeqNum.
Referenced by commit().
|
private |
Handles processing an interrupt.
Definition at line 659 of file commit.cc.
References avoidQuiesceLiveLock, canHandleInterrupts, gem5::o3::CPU::checker, gem5::BaseCPU::checkInterrupts(), commitStatus, cpu, DPRINTF, generateTrapEvent(), gem5::o3::CPU::getInterrupts(), gem5::Checker< class >::handlePendingInt(), gem5::o3::CPU::instList, interrupt, gem5::NoFault, gem5::o3::CPU::processInterrupts(), thread, toIEW, and TrapPending.
Referenced by commitInsts().
bool gem5::o3::Commit::isDrained | ( | ) | const |
Has the stage drained?
Definition at line 325 of file commit.cc.
References interrupt, gem5::o3::ROB::isEmpty(), gem5::NoFault, numThreads, pc, and rob.
Referenced by drainSanityCheck(), and gem5::o3::CPU::isCpuDrained().
|
private |
std::string gem5::o3::Commit::name | ( | ) | const |
Returns the name of the Commit.
Definition at line 135 of file commit.cc.
References cpu, and gem5::Named::name().
size_t gem5::o3::Commit::numROBFreeEntries | ( | ThreadID | tid | ) |
Returns the number of free ROB entries for a specific thread.
Definition at line 445 of file commit.cc.
References gem5::o3::ROB::numFreeEntries(), and rob.
Referenced by gem5::o3::Rename::clearStates(), and gem5::o3::Rename::resetStage().
|
private |
Returns the thread ID to use based on an oldest instruction policy.
Definition at line 1476 of file commit.cc.
References activeThreads, commitStatus, FetchTrapPending, Idle, gem5::InvalidThreadID, gem5::o3::ROB::isEmpty(), gem5::o3::ROB::isHeadReady(), gem5::o3::ROB::readHeadInst(), rob, and Running.
Referenced by getCommittingThread().
|
inline |
Sets the PC of a specific thread.
Definition at line 312 of file commit.hh.
References pc, gem5::ArmISA::set, and gem5::X86ISA::val.
|
inline |
Reads the PC of a specific thread.
Definition at line 309 of file commit.hh.
References pc.
Referenced by commit(), markCompletedInsts(), gem5::o3::CPU::pcState(), and gem5::o3::CPU::pcState().
|
private |
Mark the thread as processing a trap.
Definition at line 77 of file commit.cc.
References trapSquash.
Referenced by generateTrapEvent().
|
private |
Get fetch redirecting so we can handle an interrupt.
Definition at line 712 of file commit.cc.
References commitStatus, cpu, drainImminent, gem5::o3::CPU::getInterrupts(), interrupt, gem5::NoFault, tcSquash, toIEW, TrapPending, and trapSquash.
Referenced by commit().
void gem5::o3::Commit::regProbePoints | ( | ) |
Registers probes.
Definition at line 138 of file commit.cc.
References cpu, gem5::SimObject::getProbeManager(), ppCommit, ppCommitStall, and ppSquash.
Referenced by gem5::o3::CPU::regProbePoints().
void gem5::o3::Commit::resetHtmStartsStops | ( | ThreadID | tid | ) |
Definition at line 387 of file commit.cc.
References htmStarts, htmStops, and gem5::InvalidThreadID.
Referenced by gem5::o3::CPU::htmSendAbortSignal().
|
private |
Returns the thread ID to use based on a round robin policy.
Definition at line 1449 of file commit.cc.
References commitStatus, FetchTrapPending, Idle, gem5::InvalidThreadID, gem5::o3::ROB::isHeadReady(), priority_list, rob, and Running.
Referenced by getCommittingThread().
Sets pointer to list of active threads.
Definition at line 251 of file commit.cc.
References activeThreads.
void gem5::o3::Commit::setFetchQueue | ( | TimeBuffer< FetchStruct > * | fq_ptr | ) |
Definition at line 218 of file commit.cc.
References fetchQueue, fetchToCommitDelay, fromFetch, and gem5::TimeBuffer< T >::getWire().
void gem5::o3::Commit::setIEWQueue | ( | TimeBuffer< IEWStruct > * | iq_ptr | ) |
Sets the pointer to the queue coming from IEW.
Definition at line 236 of file commit.cc.
References fromIEW, gem5::TimeBuffer< T >::getWire(), iewQueue, and iewToCommitDelay.
void gem5::o3::Commit::setIEWStage | ( | IEW * | iew_stage | ) |
void gem5::o3::Commit::setRenameMap | ( | UnifiedRenameMap::PerThreadUnifiedRenameMap & | rm_ptr | ) |
Sets pointer to the commited state rename map.
Definition at line 257 of file commit.cc.
References numThreads, and renameMap.
void gem5::o3::Commit::setRenameQueue | ( | TimeBuffer< RenameStruct > * | rq_ptr | ) |
Sets the pointer to the queue coming from rename.
Definition at line 227 of file commit.cc.
References fromRename, gem5::TimeBuffer< T >::getWire(), renameQueue, and renameToROBDelay.
void gem5::o3::Commit::setROB | ( | ROB * | rob_ptr | ) |
void gem5::o3::Commit::setThreads | ( | std::vector< ThreadState * > & | threads | ) |
Sets the list of threads.
Definition at line 200 of file commit.cc.
References thread.
Referenced by gem5::o3::CPU::init().
void gem5::o3::Commit::setTimeBuffer | ( | TimeBuffer< TimeStruct > * | tb_ptr | ) |
Sets the main time buffer pointer, used for backwards communication.
Definition at line 206 of file commit.cc.
References gem5::TimeBuffer< T >::getWire(), iewToCommitDelay, robInfoFromIEW, timeBuffer, and toIEW.
|
private |
Handle squashing from instruction with SquashAfter set.
This differs from the other squashes as it squashes following instructions instead of the current instruction and doesn't clean up various status bits about traps/tc writes pending. Since there might have been instructions committed by the commit stage before the squashing instruction was reached and we can't commit and squash in the same cycle, we have to squash in two steps:
tid | ID of the thread to squash. |
head_inst | Instruction that requested the squash. |
Definition at line 570 of file commit.cc.
References commitStatus, DPRINTF, squashAfterInst, and SquashAfterPending.
Referenced by commitInsts().
|
private |
Squashes all in flight instructions.
Definition at line 485 of file commit.cc.
References changedROBNumEntries, gem5::o3::ROB::isEmpty(), lastCommitedSeqNum, pc, gem5::o3::ROB::readHeadInst(), rob, gem5::ArmISA::set, gem5::o3::ROB::squash(), toIEW, and youngestSeqNum.
Referenced by squashFromSquashAfter(), squashFromTC(), and squashFromTrap().
|
private |
Handles a squash from a squashAfter() request.
Definition at line 553 of file commit.cc.
References gem5::o3::CPU::activityThisCycle(), commitStatus, cpu, DPRINTF, pc, ROBSquashing, squashAfterInst, squashAll(), and toIEW.
Referenced by commit().
|
private |
Handles squashing due to an TC write.
Definition at line 537 of file commit.cc.
References gem5::o3::CPU::activityThisCycle(), commitStatus, cpu, DPRINTF, pc, ROBSquashing, squashAll(), tcSquash, and thread.
Referenced by commit().
|
private |
Handles squashing due to a trap.
Definition at line 520 of file commit.cc.
References gem5::o3::CPU::activityThisCycle(), commitStatus, cpu, DPRINTF, pc, ROBSquashing, squashAll(), thread, trapInFlight, and trapSquash.
Referenced by commit().
void gem5::o3::Commit::startupStage | ( | ) |
Initializes stage by sending back the number of free entries.
Definition at line 266 of file commit.cc.
References gem5::o3::CPU::activateStage(), activeThreads, gem5::o3::CPU::activityThisCycle(), gem5::o3::CPU::CommitIdx, cpu, gem5::o3::ROB::numFreeEntries(), numThreads, gem5::o3::ROB::resetEntries(), rob, gem5::o3::ROB::setActiveThreads(), and toIEW.
Referenced by gem5::o3::CPU::startup().
void gem5::o3::Commit::takeOverFrom | ( | ) |
Takes over from another CPU's thread.
Definition at line 352 of file commit.cc.
References _nextStatus, _status, Active, changedROBNumEntries, commitStatus, Idle, Inactive, numThreads, rob, squashAfterInst, gem5::o3::ROB::takeOverFrom(), tcSquash, and trapSquash.
Referenced by gem5::o3::CPU::takeOverFrom().
void gem5::o3::Commit::tick | ( | ) |
Ticks the commit stage, which tries to commit instructions.
Definition at line 581 of file commit.cc.
References _nextStatus, Active, activeThreads, gem5::o3::CPU::activityThisCycle(), commit(), commitStatus, committedStores, gem5::o3::ROB::countInsts(), cpu, gem5::o3::ROB::doSquash(), DPRINTF, Inactive, gem5::o3::ROB::isDoneSquashing(), gem5::o3::ROB::isEmpty(), markCompletedInsts(), gem5::o3::ROB::numFreeEntries(), ppCommitStall, gem5::o3::ROB::readHeadInst(), rob, ROBSquashing, Running, toIEW, updateStatus(), and wroteToTimeBuffer.
Referenced by gem5::o3::CPU::tick().
|
private |
Updates commit stats based on this instruction.
Definition at line 1337 of file commit.cc.
References gem5::BaseCPU::baseStats, gem5::BaseCPU::commitStats, cpu, gem5::o3::Commit::CommitStats::functionCalls, gem5::o3::CPU::instDone(), gem5::o3::Commit::CommitStats::membars, gem5::BaseCPU::BaseCPUStats::numInsts, and stats.
Referenced by commitHead().
|
private |
Updates the overall status of commit with the nextStatus, and tell the CPU if commit is active/inactive.
Definition at line 398 of file commit.cc.
References _nextStatus, _status, gem5::o3::CPU::activateStage(), Active, activeThreads, changedROBNumEntries, gem5::o3::CPU::CommitIdx, commitStatus, cpu, gem5::o3::CPU::deactivateStage(), DPRINTF, FetchTrapPending, Inactive, and TrapPending.
Referenced by tick().
|
private |
Next commit status, to be set at the end of the cycle.
Definition at line 118 of file commit.hh.
Referenced by Commit(), commit(), takeOverFrom(), tick(), and updateStatus().
|
private |
Overall commit status.
Definition at line 116 of file commit.hh.
Referenced by Commit(), takeOverFrom(), and updateStatus().
Pointer to the list of active threads.
Definition at line 443 of file commit.hh.
Referenced by changedROBEntries(), commit(), getCommittingThread(), oldestReady(), setActiveThreads(), startupStage(), tick(), and updateStatus().
|
private |
Have we had an interrupt pending and then seen it de-asserted because of a masking change? In this case the variable is set and the next time interrupts are enabled and pending the pipeline will squash to avoid a possible livelock senario.
Definition at line 455 of file commit.hh.
Referenced by commitInsts(), and handleInterrupt().
|
private |
True if last committed microop can be followed by an interrupt.
Definition at line 449 of file commit.hh.
Referenced by commitInsts(), and handleInterrupt().
|
private |
Records if the number of ROB entries has changed this cycle.
If it has, then the number of free entries must be re-broadcast.
Definition at line 359 of file commit.hh.
Referenced by changedROBEntries(), clearStates(), Commit(), commit(), commitInsts(), getInsts(), squashAll(), takeOverFrom(), and updateStatus().
|
private |
|
private |
Commit policy used in SMT mode.
Definition at line 122 of file commit.hh.
Referenced by Commit(), and getCommittingThread().
|
private |
Per-thread status.
Definition at line 120 of file commit.hh.
Referenced by clearStates(), Commit(), commit(), commitHead(), getCommittingThread(), getInsts(), handleInterrupt(), oldestReady(), propagateInterrupt(), roundRobin(), squashAfter(), squashFromSquashAfter(), squashFromTC(), squashFromTrap(), takeOverFrom(), tick(), and updateStatus().
|
private |
Records if there were any stores committed this cycle.
Definition at line 436 of file commit.hh.
Referenced by clearStates(), Commit(), commit(), commitHead(), and tick().
|
private |
|
private |
Commit width, in instructions.
Definition at line 396 of file commit.hh.
Referenced by Commit(), and commitInsts().
|
private |
Pointer to O3CPU.
Definition at line 346 of file commit.hh.
Referenced by clearStates(), commit(), commitHead(), commitInsts(), gem5::o3::Commit::CommitStats::CommitStats(), generateTrapEvent(), getCommittingThread(), handleInterrupt(), name(), propagateInterrupt(), regProbePoints(), squashFromSquashAfter(), squashFromTC(), squashFromTrap(), startupStage(), tick(), updateComInstStats(), and updateStatus().
|
private |
Is a drain imminent? Commit has found an instruction boundary while no interrupts were present or in flight.
This was the last architecturally committed instruction. Interrupts disabled and pipeline flushed. Waiting for structures to finish draining.
Definition at line 411 of file commit.hh.
Referenced by commitInsts(), drainResume(), and propagateInterrupt().
|
private |
Is a drain pending? Commit is looking for an instruction boundary while there are no pending interrupts.
Definition at line 404 of file commit.hh.
Referenced by commitInsts(), drain(), and drainResume().
|
private |
Definition at line 324 of file commit.hh.
Referenced by setFetchQueue().
|
private |
Definition at line 388 of file commit.hh.
Referenced by setFetchQueue().
|
private |
Definition at line 326 of file commit.hh.
Referenced by setFetchQueue().
|
private |
Wire to read information from IEW queue.
Definition at line 332 of file commit.hh.
Referenced by commit(), markCompletedInsts(), and setIEWQueue().
|
private |
Wire to read information from rename queue.
Definition at line 338 of file commit.hh.
Referenced by getInsts(), and setRenameQueue().
|
private |
Definition at line 461 of file commit.hh.
Referenced by Commit(), commitInsts(), executingHtmTransaction(), and resetHtmStartsStops().
|
private |
Definition at line 462 of file commit.hh.
Referenced by Commit(), commitInsts(), executingHtmTransaction(), and resetHtmStartsStops().
|
private |
IEW instruction queue interface.
Definition at line 329 of file commit.hh.
Referenced by setIEWQueue().
IEW* gem5::o3::Commit::iewStage |
The pointer to the IEW stage.
Used solely to ensure that various events (traps, interrupts, syscalls) do not occur until all stores have written back.
Definition at line 164 of file commit.hh.
Referenced by commit(), commitHead(), and setIEWStage().
|
private |
Definition at line 380 of file commit.hh.
Referenced by setIEWQueue(), and setTimeBuffer().
|
private |
The interrupt fault.
Definition at line 419 of file commit.hh.
Referenced by Commit(), commitInsts(), handleInterrupt(), isDrained(), and propagateInterrupt().
|
private |
The sequence number of the last commited instruction.
Definition at line 430 of file commit.hh.
Referenced by clearStates(), Commit(), commitInsts(), and squashAll().
|
private |
Number of Active Threads.
Definition at line 399 of file commit.hh.
Referenced by Commit(), commit(), drainSanityCheck(), getCommittingThread(), isDrained(), setRenameMap(), startupStage(), and takeOverFrom().
|
private |
The commit PC state of each thread.
Refers to the instruction that is currently being processed/committed.
Definition at line 424 of file commit.hh.
Referenced by clearStates(), Commit(), commit(), commitInsts(), isDrained(), pcState(), pcState(), squashAll(), squashFromSquashAfter(), squashFromTC(), and squashFromTrap().
|
private |
Probe Points.
Definition at line 125 of file commit.hh.
Referenced by commitInsts(), and regProbePoints().
|
private |
Definition at line 126 of file commit.hh.
Referenced by regProbePoints(), and tick().
|
private |
To probe when an instruction is squashed.
Definition at line 128 of file commit.hh.
Referenced by commitInsts(), and regProbePoints().
Priority List used for Commit Policy.
Definition at line 377 of file commit.hh.
Referenced by Commit(), deactivateThread(), and roundRobin().
|
private |
Rename map interface.
Definition at line 446 of file commit.hh.
Referenced by Commit(), commitHead(), and setRenameMap().
|
private |
Rename instruction queue interface, for ROB.
Definition at line 335 of file commit.hh.
Referenced by setRenameQueue().
|
private |
|
private |
Rename width, in instructions.
Used so ROB knows how many instructions to get from the rename instruction queue.
Definition at line 393 of file commit.hh.
Referenced by getInsts().
ROB* gem5::o3::Commit::rob |
ROB interface.
Definition at line 342 of file commit.hh.
Referenced by commit(), commitHead(), commitInsts(), drainSanityCheck(), getCommittingThread(), getInsts(), gem5::o3::CPU::insertThread(), isDrained(), numROBFreeEntries(), oldestReady(), gem5::o3::CPU::removeThread(), roundRobin(), setROB(), squashAll(), startupStage(), takeOverFrom(), and tick().
|
private |
Wire to read information from IEW (for ROB).
Definition at line 322 of file commit.hh.
Referenced by setTimeBuffer().
|
private |
Instruction passed to squashAfter().
The squash after implementation needs to buffer the instruction that caused a squash since this needs to be passed to the fetch stage once squashing starts.
Definition at line 374 of file commit.hh.
Referenced by clearStates(), Commit(), squashAfter(), squashFromSquashAfter(), and takeOverFrom().
|
private |
Referenced by commit(), commitHead(), commitInsts(), and updateComInstStats().
|
private |
Records if a thread has to squash this cycle due to an XC write.
Definition at line 365 of file commit.hh.
Referenced by clearStates(), Commit(), commit(), generateTCEvent(), propagateInterrupt(), squashFromTC(), and takeOverFrom().
|
private |
Vector of all of the threads.
Definition at line 349 of file commit.hh.
Referenced by commitHead(), commitInsts(), generateTrapEvent(), handleInterrupt(), setThreads(), squashFromTC(), and squashFromTrap().
|
private |
|
private |
Wire to write information heading to previous stages.
Definition at line 319 of file commit.hh.
Referenced by commit(), commitHead(), commitInsts(), handleInterrupt(), propagateInterrupt(), setTimeBuffer(), squashAll(), squashFromSquashAfter(), startupStage(), and tick().
|
private |
Records if there is a trap currently in flight.
Definition at line 433 of file commit.hh.
Referenced by clearStates(), Commit(), generateTCEvent(), generateTrapEvent(), and squashFromTrap().
|
private |
The latency to handle a trap.
Used when scheduling trap squash event.
Definition at line 416 of file commit.hh.
Referenced by generateTrapEvent().
|
private |
Records if a thread has to squash this cycle due to a trap.
Definition at line 362 of file commit.hh.
Referenced by clearStates(), Commit(), commit(), processTrapEvent(), propagateInterrupt(), squashFromTrap(), and takeOverFrom().
|
private |
|
private |
The sequence number of the youngest valid instruction in the ROB.
Definition at line 427 of file commit.hh.
Referenced by Commit(), commit(), getInsts(), and squashAll().