59#include "debug/Activity.hh"
60#include "debug/Commit.hh"
61#include "debug/CommitRate.hh"
62#include "debug/Drain.hh"
63#include "debug/ExecFaulting.hh"
64#include "debug/HtmCpu.hh"
65#include "debug/O3PipeView.hh"
66#include "params/BaseO3CPU.hh"
102 fatal(
"commitWidth (%d) is larger than compiled limit (%d),\n"
103 "\tincrease MaxWidth in src/cpu/o3/limits.hh\n",
122 pc[tid].reset(params.isa[0]->newPCState());
141 cpu->getProbeManager(),
"Commit");
143 cpu->getProbeManager(),
"CommitStall");
145 cpu->getProbeManager(),
"Squash");
151 "The number of squashed insts skipped by commit"),
153 "The number of times commit has been forced to stall to "
154 "communicate backwards"),
156 "The number of times a branch was mispredicted"),
158 "Number of insts commited each cycle"),
160 "Number of atomic instructions committed"),
162 "Number of memory barriers committed"),
164 "Number of function calls committed."),
166 "Class of committed instruction"),
168 "number cycles where commit BW limit reached")
177 .init(0,
commit->commitWidth,1)
181 .init(
cpu->numThreads)
185 .init(
cpu->numThreads)
193 .init(
commit->numThreads,enums::Num_OpClass)
273 toIEW->commitInfo[tid].usedROB =
true;
274 toIEW->commitInfo[tid].freeROBEntries =
rob->numFreeEntries(tid);
275 toIEW->commitInfo[tid].emptyROB =
true;
282 cpu->activityThisCycle();
295 pc[tid].reset(
cpu->tcBase(tid)->getIsaPtr()->newPCState());
300 for (
int i = -
cpu->timeBuffer.getPast();
302 cpu->timeBuffer[
i].commitInfo[
i] = {};
318 rob->drainSanityCheck();
324 panic(
"cannot drain partially through a HTM transaction");
342 if (
pc[tid]->microPC() != 0)
352 return rob->isEmpty() &&
374 auto thread_it = std::find(
417 DPRINTF(Activity,
"Deactivating stage.\n");
420 DPRINTF(Activity,
"Activating stage.\n");
442 return rob->numFreeEntries(tid);
448 DPRINTF(
Commit,
"Generating trap event for [tid:%i]\n", tid);
454 Cycles latency = std::dynamic_pointer_cast<SyscallRetryFault>(inst_fault) ?
458 if (inst_fault !=
nullptr &&
459 std::dynamic_pointer_cast<GenericHtmFailureFault>(inst_fault)) {
465 cpu->schedule(trap,
cpu->clockEdge(latency));
467 thread[tid]->trapPending =
true;
474 DPRINTF(
Commit,
"Generating TC squash event for [tid:%i]\n", tid);
494 rob->squash(squashed_inst, tid);
498 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
502 toIEW->commitInfo[tid].squash =
true;
506 toIEW->commitInfo[tid].robSquashing =
true;
508 toIEW->commitInfo[tid].mispredictInst = NULL;
509 toIEW->commitInfo[tid].squashInst = NULL;
519 DPRINTF(
Commit,
"Squashing from trap, restarting at PC %s\n", *
pc[tid]);
521 thread[tid]->trapPending =
false;
522 thread[tid]->noSquashFromTC =
false;
528 cpu->activityThisCycle();
538 thread[tid]->noSquashFromTC =
false;
539 assert(!
thread[tid]->trapPending);
542 cpu->activityThisCycle();
551 "restarting at PC %s\n", *
pc[tid]);
561 cpu->activityThisCycle();
567 DPRINTF(
Commit,
"Executing squash after for [tid:%i] inst [sn:%llu]\n",
568 tid, head_inst->seqNum);
593 if (
rob->isDoneSquashing(tid)) {
597 " insts this cycle.\n", tid);
599 toIEW->commitInfo[tid].robSquashing =
true;
610 if (!
rob->isEmpty(tid) &&
rob->readHeadInst(tid)->readyToCommit()) {
615 [[maybe_unused]]
const DynInstPtr &inst =
rob->readHeadInst(tid);
617 DPRINTF(
Commit,
"[tid:%i] Instruction [sn:%llu] PC %s is head of"
618 " ROB and ready to commit\n",
619 tid, inst->seqNum, inst->pcState());
621 }
else if (!
rob->isEmpty(tid)) {
626 DPRINTF(
Commit,
"[tid:%i] Can't commit, Instruction [sn:%llu] PC "
627 "%s is head of ROB and not ready\n",
628 tid, inst->seqNum, inst->pcState());
631 DPRINTF(
Commit,
"[tid:%i] ROB has %d insts & %d free entries.\n",
632 tid,
rob->countInsts(tid),
rob->numFreeEntries(tid));
637 DPRINTF(Activity,
"Activity This Cycle.\n");
638 cpu->activityThisCycle();
648 if (!
cpu->checkInterrupts(0)) {
649 DPRINTF(
Commit,
"Pending interrupt is cleared by requestor before "
650 "it got handled. Restart fetching from the orig path.\n");
651 toIEW->commitInfo[0].clearInterrupt =
true;
665 toIEW->commitInfo[0].clearInterrupt =
true;
667 assert(!
thread[0]->noSquashFromTC);
668 thread[0]->noSquashFromTC =
true;
671 cpu->checker->handlePendingInt();
677 cpu->processInterrupts(
cpu->getInterrupts());
679 thread[0]->noSquashFromTC =
false;
691 "flight, ROB is %sempty\n",
693 cpu->instList.empty() ?
"" :
"not " );
718 toIEW->commitInfo[0].interruptPending =
true;
726 if (
cpu->checkInterrupts(0))
734 int num_squashing_threads = 0;
746 if (
cpu->isThreadExiting(tid))
747 cpu->scheduleThreadExitEvent(tid);
765 if (
fromIEW->mispredictInst[tid]) {
767 "[tid:%i] Squashing due to branch mispred "
768 "PC:%#x [sn:%llu]\n",
770 fromIEW->mispredictInst[tid]->pcState().instAddr(),
774 "[tid:%i] Squashing due to order violation [sn:%llu]\n",
775 tid,
fromIEW->squashedSeqNum[tid]);
787 if (
fromIEW->includeSquashInst[tid]) {
795 rob->squash(squashed_inst, tid);
798 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
800 toIEW->commitInfo[tid].squash =
true;
804 toIEW->commitInfo[tid].robSquashing =
true;
806 toIEW->commitInfo[tid].mispredictInst =
808 toIEW->commitInfo[tid].branchTaken =
810 toIEW->commitInfo[tid].squashInst =
811 rob->findInst(tid, squashed_inst);
812 if (
toIEW->commitInfo[tid].mispredictInst) {
813 if (
toIEW->commitInfo[tid].mispredictInst->isUncondCtrl()) {
814 toIEW->commitInfo[tid].branchTaken =
true;
816 ++
stats.branchMispredicts;
823 num_squashing_threads++;
829 if (num_squashing_threads) {
844 toIEW->commitInfo[tid].usedROB =
true;
845 toIEW->commitInfo[tid].freeROBEntries =
rob->numFreeEntries(tid);
849 if (
rob->isEmpty(tid))
864 toIEW->commitInfo[tid].usedROB =
true;
865 toIEW->commitInfo[tid].emptyROB =
true;
866 toIEW->commitInfo[tid].freeROBEntries =
rob->numFreeEntries(tid);
885 DPRINTF(
Commit,
"Trying to commit instructions in the ROB.\n");
887 unsigned num_committed = 0;
905 cpu->clearInterrupts(0);
906 toIEW->commitInfo[0].clearInterrupt =
true;
916 if (commit_thread == -1 || !
rob->isHeadReady(commit_thread))
919 head_inst =
rob->readHeadInst(commit_thread);
921 ThreadID tid = head_inst->threadNumber;
923 assert(tid == commit_thread);
926 "Trying to commit head instruction, [tid:%i] [sn:%llu]\n",
927 tid, head_inst->seqNum);
931 if (head_inst->isSquashed()) {
936 rob->retireHead(commit_thread);
938 ++
stats.commitSquashedInsts;
947 }
else if (head_inst->noCapableFU() &&
948 head_inst->getFault() ==
NoFault) {
949 panic(
"CPU cannot execute [sn:%llu] op_class: %u but"
950 " did not trigger a fault. Do you need to update"
951 " the configuration and add a functional unit for"
954 head_inst->opClass());
956 set(
pc[tid], head_inst->pcState());
959 bool commit_success =
commitHead(head_inst, num_committed);
961 if (commit_success) {
963 cpu->commitStats[tid]
964 ->committedInstType[head_inst->opClass()]++;
965 stats.committedInstType[tid][head_inst->opClass()]++;
971 if (head_inst->isHtmStart())
975 if (head_inst->inHtmTransactionalState()) {
982 if (head_inst->isHtmStop())
988 toIEW->commitInfo[tid].doneSeqNum = head_inst->seqNum;
995 assert(!head_inst->isStoreConditional() ||
996 head_inst->isCompleted() ||
997 !head_inst->readPredicate());
1000 head_inst->updateMiscRegs();
1005 cpu->checker->verify(head_inst);
1008 cpu->traceFunctions(
pc[tid]->instAddr());
1010 head_inst->staticInst->advancePC(*
pc[tid]);
1017 if (head_inst->isSquashAfter())
1022 !
thread[tid]->trapPending) {
1026 DPRINTF(Drain,
"Draining: %i:%s\n", tid, *
pc[tid]);
1028 cpu->commitDrained(tid);
1033 bool onInstBoundary = !head_inst->isMicroop() ||
1034 head_inst->isLastMicroop() ||
1035 !head_inst->isDelayedCommit();
1037 if (onInstBoundary) {
1042 assert(!
thread[tid]->noSquashFromTC &&
1043 !
thread[tid]->trapPending);
1045 oldpc =
pc[tid]->instAddr();
1046 thread[tid]->pcEventQueue.service(
1047 oldpc,
thread[tid]->getTC());
1049 }
while (oldpc !=
pc[tid]->instAddr());
1052 "PC skip function event, stopping commit\n");
1066 onInstBoundary &&
cpu->checkInterrupts(0))
1070 "[tid:%i] [sn:%llu].\n",
1071 head_inst->pcState(), tid ,head_inst->seqNum);
1077 DPRINTF(CommitRate,
"%i\n", num_committed);
1078 stats.numCommittedDist.sample(num_committed);
1081 stats.commitEligibleSamples++;
1090 ThreadID tid = head_inst->threadNumber;
1094 if (!head_inst->isExecuted()) {
1097 assert(head_inst->isNonSpeculative() || head_inst->isStoreConditional()
1098 || head_inst->isReadBarrier() || head_inst->isWriteBarrier()
1099 || head_inst->isAtomic()
1100 || (head_inst->isLoad() && head_inst->strictlyOrdered()));
1103 "Encountered a barrier or non-speculative "
1104 "instruction [tid:%i] [sn:%llu] "
1105 "at the head of the ROB, PC %s.\n",
1106 tid, head_inst->seqNum, head_inst->pcState());
1108 if (inst_num > 0 ||
iewStage->hasStoresToWB(tid)) {
1110 "[tid:%i] [sn:%llu] "
1111 "Waiting for all stores to writeback.\n",
1112 tid, head_inst->seqNum);
1116 toIEW->commitInfo[tid].nonSpecSeqNum = head_inst->seqNum;
1120 head_inst->clearCanCommit();
1122 if (head_inst->isLoad() && head_inst->strictlyOrdered()) {
1124 "Strictly ordered load, PC %s.\n",
1125 tid, head_inst->seqNum, head_inst->pcState());
1126 toIEW->commitInfo[tid].strictlyOrdered =
true;
1127 toIEW->commitInfo[tid].strictlyOrderedLoad = head_inst;
1129 ++
stats.commitNonSpecStalls;
1136 Fault inst_fault = head_inst->getFault();
1141 if (inst_fault !=
NoFault && head_inst->inHtmTransactionalState()) {
1143 if (!std::dynamic_pointer_cast<GenericHtmFailureFault>(inst_fault)) {
1144 DPRINTF(HtmCpu,
"%s - fault (%s) encountered within transaction"
1145 " - converting to GenericHtmFailureFault\n",
1146 head_inst->staticInst->getName(), inst_fault->name());
1147 inst_fault = std::make_shared<GenericHtmFailureFault>(
1148 head_inst->getHtmTransactionUid(),
1156 if (!head_inst->isStore() && inst_fault ==
NoFault) {
1157 head_inst->setCompleted();
1161 DPRINTF(
Commit,
"Inst [tid:%i] [sn:%llu] PC %s has a fault\n",
1162 tid, head_inst->seqNum, head_inst->pcState());
1164 if (
iewStage->hasStoresToWB(tid) || inst_num > 0) {
1166 "[tid:%i] [sn:%llu] "
1167 "Stores outstanding, fault must wait.\n",
1168 tid, head_inst->seqNum);
1172 head_inst->setCompleted();
1178 cpu->checker->verify(head_inst);
1181 assert(!
thread[tid]->noSquashFromTC);
1185 thread[tid]->noSquashFromTC =
true;
1193 cpu->trap(inst_fault, tid,
1195 head_inst->staticInst);
1198 thread[tid]->noSquashFromTC =
false;
1203 "[tid:%i] [sn:%llu] Committing instruction with fault\n",
1204 tid, head_inst->seqNum);
1205 if (head_inst->traceData) {
1208 if (debug::ExecFaulting
1209 &&
dynamic_cast<ReExec*
>(inst_fault.get()) ==
nullptr) {
1211 head_inst->traceData->setFaulting(
true);
1212 head_inst->traceData->setFetchSeq(head_inst->seqNum);
1213 head_inst->traceData->setCPSeq(
thread[tid]->numOp);
1214 head_inst->traceData->dump();
1216 delete head_inst->traceData;
1217 head_inst->traceData = NULL;
1228 "[tid:%i] [sn:%llu] Committing instruction with PC %s\n",
1229 tid, head_inst->seqNum, head_inst->pcState());
1230 if (head_inst->traceData) {
1231 head_inst->traceData->setFetchSeq(head_inst->seqNum);
1232 head_inst->traceData->setCPSeq(
thread[tid]->numOp);
1233 head_inst->traceData->dump();
1234 delete head_inst->traceData;
1235 head_inst->traceData = NULL;
1237 if (head_inst->isReturn()) {
1239 "[tid:%i] [sn:%llu] Return Instruction Committed PC %s \n",
1240 tid, head_inst->seqNum, head_inst->pcState());
1244 for (
int i = 0;
i < head_inst->numDestRegs();
i++) {
1245 renameMap[tid]->setEntry(head_inst->flattenedDestIdx(
i),
1246 head_inst->renamedDestIdx(
i));
1251 if (head_inst->isHtmStart())
1252 iewStage->setLastRetiredHtmUid(tid, head_inst->getHtmTransactionUid());
1255 rob->retireHead(tid);
1258 if (debug::O3PipeView) {
1259 head_inst->commitTick =
curTick() - head_inst->fetchTick;
1264 if (head_inst->isStore() || head_inst->isAtomic())
1274 DPRINTF(
Commit,
"Getting instructions from Rename stage.\n");
1279 for (
int inst_num = 0; inst_num < insts_to_process; ++inst_num) {
1283 if (!inst->isSquashed() &&
1288 DPRINTF(
Commit,
"[tid:%i] [sn:%llu] Inserting PC %s into ROB.\n",
1289 tid, inst->seqNum, inst->pcState());
1291 rob->insertInst(inst);
1293 assert(
rob->getThreadEntries(tid) <=
rob->getMaxEntries(tid));
1298 "Instruction PC %s was squashed, skipping.\n",
1299 tid, inst->seqNum, inst->pcState());
1309 for (
int inst_num = 0; inst_num <
fromIEW->size; ++inst_num) {
1310 assert(
fromIEW->insts[inst_num]);
1311 if (!
fromIEW->insts[inst_num]->isSquashed()) {
1314 fromIEW->insts[inst_num]->threadNumber,
1315 fromIEW->insts[inst_num]->pcState(),
1316 fromIEW->insts[inst_num]->seqNum);
1319 fromIEW->insts[inst_num]->setCanCommit();
1329 if (!inst->isMicroop() || inst->isLastMicroop()) {
1330 cpu->commitStats[tid]->numInsts++;
1331 cpu->baseStats.numInsts++;
1333 cpu->commitStats[tid]->numOps++;
1337 if (!inst->isNop() && !inst->isInstPrefetch()) {
1338 cpu->instDone(tid, inst);
1344 cpu->commitStats[tid]->updateComCtrlStats(inst->staticInst);
1349 if (inst->isMemRef()) {
1350 cpu->commitStats[tid]->numMemRefs++;
1352 if (inst->isLoad()) {
1353 cpu->commitStats[tid]->numLoadInsts++;
1356 if (inst->isStore()) {
1357 cpu->commitStats[tid]->numStoreInsts++;
1361 if (inst->isFullMemBarrier()) {
1362 stats.membars[tid]++;
1366 if (inst->isInteger()) {
1367 cpu->commitStats[tid]->numIntInsts++;
1371 if (inst->isFloating()) {
1372 cpu->commitStats[tid]->numFpInsts++;
1375 if (inst->isVector()) {
1376 cpu->commitStats[tid]->numVecInsts++;
1381 stats.functionCalls[tid]++;
1401 if (
cpu->isThreadExiting(tid) &&
1402 !
rob->isEmpty(tid) &&
1406 assert(
rob->isHeadReady(tid) &&
1407 rob->readHeadInst(tid)->isSquashed());
1413 case CommitPolicy::RoundRobin:
1416 case CommitPolicy::OldestReady:
1442 while (pri_iter != end) {
1449 if (
rob->isHeadReady(tid)) {
1466 unsigned oldest = 0;
1467 unsigned oldest_seq_num = 0;
1471 if (!
rob->isEmpty(tid) &&
1476 if (
rob->isHeadReady(tid)) {
1482 oldest_seq_num = head_inst->seqNum;
1484 }
else if (head_inst->seqNum < oldest_seq_num) {
1486 oldest_seq_num = head_inst->seqNum;
Cycles is a wrapper class for representing cycle counts, i.e.
ProbePointArg generates a point for the class of Arg.
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
ThreadStatus commitStatus[MaxThreads]
Per-thread status.
TimeBuffer< IEWStruct >::wire fromIEW
Wire to read information from IEW queue.
std::vector< ThreadState * > thread
Vector of all of the threads.
ThreadID oldestReady()
Returns the thread ID to use based on an oldest instruction policy.
ProbePointArg< DynInstPtr > * ppCommitStall
void squashFromSquashAfter(ThreadID tid)
Handles a squash from a squashAfter() request.
void squashAll(ThreadID tid)
Squashes all in flight instructions.
void startupStage()
Initializes stage by sending back the number of free entries.
bool changedROBNumEntries[MaxThreads]
Records if the number of ROB entries has changed this cycle.
bool changedROBEntries()
Returns if any of the threads have the number of ROB entries changed on this cycle.
DynInstPtr squashAfterInst[MaxThreads]
Instruction passed to squashAfter().
bool executingHtmTransaction(ThreadID) const
Is the CPU currently processing a HTM transaction?
CommitStatus _status
Overall commit status.
gem5::o3::Commit::CommitStats stats
void setIEWQueue(TimeBuffer< IEWStruct > *iq_ptr)
Sets the pointer to the queue coming from IEW.
size_t numROBFreeEntries(ThreadID tid)
Returns the number of free ROB entries for a specific thread.
void setFetchQueue(TimeBuffer< FetchStruct > *fq_ptr)
void processTrapEvent(ThreadID tid)
Mark the thread as processing a trap.
void setRenameQueue(TimeBuffer< RenameStruct > *rq_ptr)
Sets the pointer to the queue coming from rename.
bool checkEmptyROB[MaxThreads]
Records if commit should check if the ROB is truly empty (see commit_impl.hh).
void generateTrapEvent(ThreadID tid, Fault inst_fault)
Generates an event to schedule a squash due to a trap.
void deactivateThread(ThreadID tid)
Deschedules a thread from scheduling.
TimeBuffer< TimeStruct >::wire toIEW
Wire to write information heading to previous stages.
CPU * cpu
Pointer to O3CPU.
void squashFromTC(ThreadID tid)
Handles squashing due to an TC write.
const ThreadID numThreads
Number of Active Threads.
ProbePointArg< DynInstPtr > * ppSquash
To probe when an instruction is squashed.
Commit(CPU *_cpu, const BaseO3CPUParams ¶ms)
Construct a Commit with the given parameters.
bool trapInFlight[MaxThreads]
Records if there is a trap currently in flight.
void handleInterrupt()
Handles processing an interrupt.
const Cycles fetchToCommitDelay
void propagateInterrupt()
Get fetch redirecting so we can handle an interrupt.
std::string name() const
Returns the name of the Commit.
TimeBuffer< FetchStruct > * fetchQueue
void setROB(ROB *rob_ptr)
Sets pointer to the ROB.
int htmStarts[MaxThreads]
CommitPolicy commitPolicy
Commit policy used in SMT mode.
TimeBuffer< TimeStruct >::wire robInfoFromIEW
Wire to read information from IEW (for ROB).
void tick()
Ticks the commit stage, which tries to commit instructions.
void setIEWStage(IEW *iew_stage)
Sets the pointer to the IEW stage.
const unsigned renameWidth
Rename width, in instructions.
bool drainPending
Is a drain pending?
const Cycles trapLatency
The latency to handle a trap.
ProbePointArg< DynInstPtr > * ppCommit
Probe Points.
bool wroteToTimeBuffer
Records that commit has written to the time buffer this cycle.
TimeBuffer< IEWStruct > * iewQueue
IEW instruction queue interface.
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets the main time buffer pointer, used for backwards communication.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
const Cycles renameToROBDelay
Rename to ROB delay.
std::list< ThreadID > * activeThreads
Pointer to the list of active threads.
void updateStatus()
Updates the overall status of commit with the nextStatus, and tell the CPU if commit is active/inacti...
void squashAfter(ThreadID tid, const DynInstPtr &head_inst)
Handle squashing from instruction with SquashAfter set.
bool commitHead(const DynInstPtr &head_inst, unsigned inst_num)
Tries to commit the head ROB instruction passed in.
void resetHtmStartsStops(ThreadID)
void getInsts()
Gets instructions from rename and inserts them into the ROB.
bool tcSquash[MaxThreads]
Records if a thread has to squash this cycle due to an XC write.
const Cycles commitToIEWDelay
Commit to IEW delay.
void drainSanityCheck() const
Perform sanity checks after a drain.
void takeOverFrom()
Takes over from another CPU's thread.
void clearStates(ThreadID tid)
Clear all thread-specific states.
void drainResume()
Resumes execution after draining.
TimeBuffer< RenameStruct > * renameQueue
Rename instruction queue interface, for ROB.
void drain()
Initializes the draining of commit.
bool trapSquash[MaxThreads]
Records if a thread has to squash this cycle due to a trap.
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.
CommitStatus _nextStatus
Next commit status, to be set at the end of the cycle.
bool drainImminent
Is a drain imminent?
void commitInsts()
Commits as many instructions as possible.
void markCompletedInsts()
Marks completed instructions using information sent from IEW.
bool canHandleInterrupts
True if last committed microop can be followed by an interrupt.
TimeBuffer< TimeStruct > * timeBuffer
Time buffer interface.
TimeBuffer< RenameStruct >::wire fromRename
Wire to read information from rename queue.
ThreadID roundRobin()
Returns the thread ID to use based on a round robin policy.
void generateTCEvent(ThreadID tid)
Records that commit needs to initiate a squash due to an external state update through the TC.
std::unique_ptr< PCStateBase > pc[MaxThreads]
The commit PC state of each thread.
void regProbePoints()
Registers probes.
IEW * iewStage
The pointer to the IEW stage.
void setThreads(std::vector< ThreadState * > &threads)
Sets the list of threads.
void updateComInstStats(const DynInstPtr &inst)
Updates commit stats based on this instruction.
ThreadID getCommittingThread()
Gets the thread to commit, based on the SMT policy.
const Cycles iewToCommitDelay
IEW to Commit delay.
bool avoidQuiesceLiveLock
Have we had an interrupt pending and then seen it de-asserted because of a masking change?
std::list< ThreadID > priority_list
Priority List used for Commit Policy.
void commit()
Handles any squashes that are sent from IEW, and adds instructions to the ROB and tries to commit ins...
UnifiedRenameMap * renameMap[MaxThreads]
Rename map interface.
void setRenameMap(UnifiedRenameMap::PerThreadUnifiedRenameMap &rm_ptr)
Sets pointer to the commited state rename map.
void squashFromTrap(ThreadID tid)
Handles squashing due to a trap.
bool committedStores[MaxThreads]
Records if there were any stores committed this cycle.
const unsigned commitWidth
Commit width, in instructions.
bool isDrained() const
Has the stage drained?
Fault interrupt
The interrupt fault.
TimeBuffer< FetchStruct >::wire fromFetch
IEW handles both single threaded and SMT IEW (issue/execute/writeback).
std::array< UnifiedRenameMap, MaxThreads > PerThreadUnifiedRenameMap
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
#define panic(...)
This implements a cprintf based panic() function.
#define fatal(...)
This implements a cprintf based fatal() function.
static constexpr int MaxThreads
RefCountingPtr< DynInst > DynInstPtr
static constexpr int MaxWidth
const FlagsType pdf
Print the percent of the total that this entry represents.
const FlagsType total
Print the total.
const FlagsType dist
Print the distribution.
Copyright (c) 2024 Arm Limited All rights reserved.
std::shared_ptr< FaultBase > Fault
int16_t ThreadID
Thread index/ID type.
const ThreadID InvalidThreadID
Tick curTick()
The universal simulation clock.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
const StaticInstPtr nullStaticInstPtr
Statically allocated null StaticInstPtr.
constexpr decltype(nullptr) NoFault
statistics::Vector amos
Stat for the total number of committed atomics.
CommitStats(CPU *cpu, Commit *commit)
statistics::Distribution numCommittedDist
Distribution of the number of committed instructions each cycle.
statistics::Scalar commitNonSpecStalls
Stat for the total number of times commit has had to stall due to a non-speculative instruction reach...
statistics::Scalar commitEligibleSamples
Number of cycles where the commit bandwidth limit is reached.
statistics::Scalar commitSquashedInsts
Stat for the total number of squashed instructions discarded by commit.
statistics::Scalar branchMispredicts
Stat for the total number of branch mispredicts that caused a squash.
statistics::Vector2d committedInstType
Committed instructions by instruction type (OpClass)
statistics::Vector functionCalls
Total number of function calls.
statistics::Vector membars
Total number of committed memory barriers.