Go to the documentation of this file.
41 #ifndef __CPU_O3_COMMIT_IMPL_HH__
42 #define __CPU_O3_COMMIT_IMPL_HH__
48 #include "arch/utility.hh"
51 #include "config/the_isa.hh"
58 #include "debug/Activity.hh"
59 #include "debug/Commit.hh"
60 #include "debug/CommitRate.hh"
61 #include "debug/Drain.hh"
62 #include "debug/ExecFaulting.hh"
63 #include "debug/HtmCpu.hh"
64 #include "debug/O3PipeView.hh"
65 #include "params/DerivO3CPU.hh"
77 trapSquash[tid] =
true;
82 : commitPolicy(params->smtCommitPolicy),
84 iewToCommitDelay(params->iewToCommitDelay),
85 commitToIEWDelay(params->commitToIEWDelay),
86 renameToROBDelay(params->renameToROBDelay),
87 fetchToCommitDelay(params->commitToFetchDelay),
88 renameWidth(params->renameWidth),
89 commitWidth(params->commitWidth),
90 numThreads(params->numThreads),
93 trapLatency(params->trapLatency),
94 canHandleInterrupts(true),
95 avoidQuiesceLiveLock(false),
99 fatal(
"commitWidth (%d) is larger than compiled limit (%d),\n"
100 "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
113 for (
ThreadID tid = 0; tid < Impl::MaxThreads; tid++) {
132 template <
class Impl>
136 return cpu->name() +
".commit";
139 template <
class Impl>
148 template <
class Impl>
151 :
Stats::Group(cpu,
"commit"),
152 ADD_STAT(commitSquashedInsts,
"The number of squashed insts skipped by"
154 ADD_STAT(commitNonSpecStalls,
"The number of times commit has been"
155 " forced to stall to communicate backwards"),
156 ADD_STAT(branchMispredicts,
"The number of times a branch was"
158 ADD_STAT(numCommittedDist,
"Number of insts commited each cycle"),
159 ADD_STAT(instsCommitted,
"Number of instructions committed"),
160 ADD_STAT(opsCommitted,
"Number of ops (including micro ops) committed"),
161 ADD_STAT(memRefs,
"Number of memory references committed"),
162 ADD_STAT(loads,
"Number of loads committed"),
163 ADD_STAT(amos,
"Number of atomic instructions committed"),
164 ADD_STAT(membars,
"Number of memory barriers committed"),
165 ADD_STAT(branches,
"Number of branches committed"),
167 ADD_STAT(floating,
"Number of committed floating point"
169 ADD_STAT(integer,
"Number of committed integer instructions."),
170 ADD_STAT(functionCalls,
"Number of function calls committed."),
171 ADD_STAT(committedInstType,
"Class of committed instruction"),
172 ADD_STAT(commitEligibleSamples,
"number cycles where commit BW limit"
175 using namespace Stats;
214 .init(
cpu->numThreads)
236 template <
class Impl>
243 template <
class Impl>
256 template <
class Impl>
266 template <
class Impl>
276 template <
class Impl>
286 template <
class Impl>
300 template <
class Impl>
308 template <
class Impl>
315 template <
class Impl>
324 toIEW->commitInfo[tid].usedROB =
true;
326 toIEW->commitInfo[tid].emptyROB =
true;
331 cpu->activateStage(O3CPU::CommitIdx);
333 cpu->activityThisCycle();
336 template <
class Impl>
352 template <
class Impl>
359 template <
class Impl>
367 template <
class Impl>
378 panic(
"cannot drain partially through a HTM transaction");
383 template <
class Impl>
411 template <
class Impl>
427 template <
class Impl>
439 template <
class Impl>
449 template <
class Impl>
461 template <
class Impl>
469 while (threads != end) {
482 DPRINTF(Activity,
"Deactivating stage.\n");
483 cpu->deactivateStage(O3CPU::CommitIdx);
485 DPRINTF(Activity,
"Activating stage.\n");
486 cpu->activateStage(O3CPU::CommitIdx);
492 template <
class Impl>
499 while (threads != end) {
510 template <
class Impl>
517 template <
class Impl>
521 DPRINTF(Commit,
"Generating trap event for [tid:%i]\n", tid);
527 Cycles latency = dynamic_pointer_cast<SyscallRetryFault>(inst_fault) ?
531 if (inst_fault !=
nullptr &&
532 std::dynamic_pointer_cast<GenericHtmFailureFault>(inst_fault)) {
538 cpu->schedule(trap,
cpu->clockEdge(latency));
540 thread[tid]->trapPending =
true;
543 template <
class Impl>
548 DPRINTF(Commit,
"Generating TC squash event for [tid:%i]\n", tid);
553 template <
class Impl>
573 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
577 toIEW->commitInfo[tid].squash =
true;
581 toIEW->commitInfo[tid].robSquashing =
true;
583 toIEW->commitInfo[tid].mispredictInst = NULL;
584 toIEW->commitInfo[tid].squashInst = NULL;
586 toIEW->commitInfo[tid].pc =
pc[tid];
589 template <
class Impl>
595 DPRINTF(Commit,
"Squashing from trap, restarting at PC %s\n",
pc[tid]);
597 thread[tid]->trapPending =
false;
598 thread[tid]->noSquashFromTC =
false;
604 cpu->activityThisCycle();
607 template <
class Impl>
613 DPRINTF(Commit,
"Squashing from TC, restarting at PC %s\n",
pc[tid]);
615 thread[tid]->noSquashFromTC =
false;
616 assert(!
thread[tid]->trapPending);
619 cpu->activityThisCycle();
624 template <
class Impl>
628 DPRINTF(Commit,
"Squashing after squash after request, "
629 "restarting at PC %s\n",
pc[tid]);
639 cpu->activityThisCycle();
642 template <
class Impl>
646 DPRINTF(Commit,
"Executing squash after for [tid:%i] inst [sn:%llu]\n",
647 tid, head_inst->seqNum);
654 template <
class Impl>
669 while (threads != end) {
681 DPRINTF(Commit,
"[tid:%i] Still Squashing, cannot commit any"
682 " insts this cycle.\n", tid);
684 toIEW->commitInfo[tid].robSquashing =
true;
696 while (threads != end) {
706 DPRINTF(Commit,
"[tid:%i] Instruction [sn:%llu] PC %s is head of"
707 " ROB and ready to commit\n",
708 tid, inst->seqNum, inst->pcState());
715 DPRINTF(Commit,
"[tid:%i] Can't commit, Instruction [sn:%llu] PC "
716 "%s is head of ROB and not ready\n",
717 tid, inst->seqNum, inst->pcState());
720 DPRINTF(Commit,
"[tid:%i] ROB has %d insts & %d free entries.\n",
726 DPRINTF(Activity,
"Activity This Cycle.\n");
727 cpu->activityThisCycle();
733 template <
class Impl>
738 if (!
cpu->checkInterrupts(0)) {
739 DPRINTF(Commit,
"Pending interrupt is cleared by requestor before "
740 "it got handled. Restart fetching from the orig path.\n");
741 toIEW->commitInfo[0].clearInterrupt =
true;
752 DPRINTF(Commit,
"Interrupt detected.\n");
755 toIEW->commitInfo[0].clearInterrupt =
true;
757 assert(!
thread[0]->noSquashFromTC);
758 thread[0]->noSquashFromTC =
true;
761 cpu->checker->handlePendingInt();
767 cpu->processInterrupts(
cpu->getInterrupts());
769 thread[0]->noSquashFromTC =
false;
780 DPRINTF(Commit,
"Interrupt pending: instruction is %sin "
781 "flight, ROB is %sempty\n",
783 cpu->instList.empty() ?
"" :
"not " );
787 template <
class Impl>
809 toIEW->commitInfo[0].interruptPending =
true;
812 template <
class Impl>
818 if (
cpu->checkInterrupts(0))
828 int num_squashing_threads = 0;
830 while (threads != end) {
843 if (
cpu->isThreadExiting(tid))
844 cpu->scheduleThreadExitEvent(tid);
862 if (
fromIEW->mispredictInst[tid]) {
864 "[tid:%i] Squashing due to branch mispred "
865 "PC:%#x [sn:%llu]\n",
867 fromIEW->mispredictInst[tid]->instAddr(),
871 "[tid:%i] Squashing due to order violation [sn:%llu]\n",
872 tid,
fromIEW->squashedSeqNum[tid]);
875 DPRINTF(Commit,
"[tid:%i] Redirecting to PC %#x\n",
877 fromIEW->pc[tid].nextInstAddr());
885 if (
fromIEW->includeSquashInst[tid]) {
896 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
898 toIEW->commitInfo[tid].squash =
true;
902 toIEW->commitInfo[tid].robSquashing =
true;
904 toIEW->commitInfo[tid].mispredictInst =
906 toIEW->commitInfo[tid].branchTaken =
908 toIEW->commitInfo[tid].squashInst =
910 if (
toIEW->commitInfo[tid].mispredictInst) {
911 if (
toIEW->commitInfo[tid].mispredictInst->isUncondCtrl()) {
912 toIEW->commitInfo[tid].branchTaken =
true;
914 ++
stats.branchMispredicts;
921 num_squashing_threads++;
927 if (num_squashing_threads) {
942 while (threads != end) {
946 toIEW->commitInfo[tid].usedROB =
true;
966 toIEW->commitInfo[tid].usedROB =
true;
967 toIEW->commitInfo[tid].emptyROB =
true;
975 template <
class Impl>
988 DPRINTF(Commit,
"Trying to commit instructions in the ROB.\n");
990 unsigned num_committed = 0;
1008 cpu->clearInterrupts(0);
1009 toIEW->commitInfo[0].clearInterrupt =
true;
1024 ThreadID tid = head_inst->threadNumber;
1026 assert(tid == commit_thread);
1029 "Trying to commit head instruction, [tid:%i] [sn:%llu]\n",
1030 tid, head_inst->seqNum);
1034 if (head_inst->isSquashed()) {
1036 DPRINTF(Commit,
"Retiring squashed instruction from "
1041 ++
stats.commitSquashedInsts;
1048 pc[tid] = head_inst->pcState();
1055 thread[tid]->funcExeInst++;
1058 bool commit_success =
commitHead(head_inst, num_committed);
1060 if (commit_success) {
1062 stats.committedInstType[tid][head_inst->opClass()]++;
1068 if (head_inst->isHtmStart())
1072 if (head_inst->inHtmTransactionalState()) {
1079 if (head_inst->isHtmStop())
1085 toIEW->commitInfo[tid].doneSeqNum = head_inst->seqNum;
1092 assert(!head_inst->isStoreConditional() ||
1093 head_inst->isCompleted() ||
1094 !head_inst->readPredicate());
1097 head_inst->updateMiscRegs();
1102 cpu->checker->verify(head_inst);
1114 if (head_inst->isSquashAfter())
1119 !
thread[tid]->trapPending) {
1123 DPRINTF(Drain,
"Draining: %i:%s\n", tid,
pc[tid]);
1125 cpu->commitDrained(tid);
1130 bool onInstBoundary = !head_inst->isMicroop() ||
1131 head_inst->isLastMicroop() ||
1132 !head_inst->isDelayedCommit();
1134 if (onInstBoundary) {
1139 assert(!
thread[tid]->noSquashFromTC &&
1140 !
thread[tid]->trapPending);
1142 oldpc =
pc[tid].instAddr();
1143 thread[tid]->pcEventQueue.service(
1144 oldpc,
thread[tid]->getTC());
1149 "PC skip function event, stopping commit\n");
1162 onInstBoundary &&
cpu->checkInterrupts(0))
1165 DPRINTF(Commit,
"Unable to commit head instruction PC:%s "
1166 "[tid:%i] [sn:%llu].\n",
1167 head_inst->pcState(), tid ,head_inst->seqNum);
1173 DPRINTF(CommitRate,
"%i\n", num_committed);
1174 stats.numCommittedDist.sample(num_committed);
1177 stats.commitEligibleSamples++;
1181 template <
class Impl>
1187 ThreadID tid = head_inst->threadNumber;
1191 if (!head_inst->isExecuted()) {
1194 thread[tid]->funcExeInst--;
1198 assert(head_inst->isNonSpeculative() || head_inst->isStoreConditional()
1199 || head_inst->isMemBarrier() || head_inst->isWriteBarrier()
1200 || head_inst->isAtomic()
1201 || (head_inst->isLoad() && head_inst->strictlyOrdered()));
1204 "Encountered a barrier or non-speculative "
1205 "instruction [tid:%i] [sn:%llu] "
1206 "at the head of the ROB, PC %s.\n",
1207 tid, head_inst->seqNum, head_inst->pcState());
1209 if (inst_num > 0 ||
iewStage->hasStoresToWB(tid)) {
1211 "[tid:%i] [sn:%llu] "
1212 "Waiting for all stores to writeback.\n",
1213 tid, head_inst->seqNum);
1217 toIEW->commitInfo[tid].nonSpecSeqNum = head_inst->seqNum;
1221 head_inst->clearCanCommit();
1223 if (head_inst->isLoad() && head_inst->strictlyOrdered()) {
1224 DPRINTF(Commit,
"[tid:%i] [sn:%llu] "
1225 "Strictly ordered load, PC %s.\n",
1226 tid, head_inst->seqNum, head_inst->pcState());
1227 toIEW->commitInfo[tid].strictlyOrdered =
true;
1228 toIEW->commitInfo[tid].strictlyOrderedLoad = head_inst;
1230 ++
stats.commitNonSpecStalls;
1236 if (head_inst->isThreadSync()) {
1238 panic(
"Thread sync instructions are not handled yet.\n");
1242 Fault inst_fault = head_inst->getFault();
1247 if (inst_fault !=
NoFault && head_inst->inHtmTransactionalState()) {
1249 if (!std::dynamic_pointer_cast<GenericHtmFailureFault>(inst_fault)) {
1250 DPRINTF(HtmCpu,
"%s - fault (%s) encountered within transaction"
1251 " - converting to GenericHtmFailureFault\n",
1252 head_inst->staticInst->getName(), inst_fault->name());
1253 inst_fault = std::make_shared<GenericHtmFailureFault>(
1254 head_inst->getHtmTransactionUid(),
1262 if (!head_inst->isStore() && inst_fault ==
NoFault) {
1263 head_inst->setCompleted();
1267 DPRINTF(Commit,
"Inst [tid:%i] [sn:%llu] PC %s has a fault\n",
1268 tid, head_inst->seqNum, head_inst->pcState());
1270 if (
iewStage->hasStoresToWB(tid) || inst_num > 0) {
1272 "[tid:%i] [sn:%llu] "
1273 "Stores outstanding, fault must wait.\n",
1274 tid, head_inst->seqNum);
1278 head_inst->setCompleted();
1284 cpu->checker->verify(head_inst);
1287 assert(!
thread[tid]->noSquashFromTC);
1291 thread[tid]->noSquashFromTC =
true;
1299 cpu->trap(inst_fault, tid,
1300 head_inst->notAnInst() ?
1302 head_inst->staticInst);
1305 thread[tid]->noSquashFromTC =
false;
1310 "[tid:%i] [sn:%llu] Committing instruction with fault\n",
1311 tid, head_inst->seqNum);
1312 if (head_inst->traceData) {
1316 &&
dynamic_cast<ReExec*
>(inst_fault.get()) ==
nullptr) {
1318 head_inst->traceData->setFaulting(
true);
1319 head_inst->traceData->setFetchSeq(head_inst->seqNum);
1320 head_inst->traceData->setCPSeq(
thread[tid]->numOp);
1321 head_inst->traceData->dump();
1323 delete head_inst->traceData;
1324 head_inst->traceData = NULL;
1335 "[tid:%i] [sn:%llu] Committing instruction with PC %s\n",
1336 tid, head_inst->seqNum, head_inst->pcState());
1337 if (head_inst->traceData) {
1338 head_inst->traceData->setFetchSeq(head_inst->seqNum);
1339 head_inst->traceData->setCPSeq(
thread[tid]->numOp);
1340 head_inst->traceData->dump();
1341 delete head_inst->traceData;
1342 head_inst->traceData = NULL;
1344 if (head_inst->isReturn()) {
1346 "[tid:%i] [sn:%llu] Return Instruction Committed PC %s \n",
1347 tid, head_inst->seqNum, head_inst->pcState());
1351 for (
int i = 0;
i < head_inst->numDestRegs();
i++) {
1352 renameMap[tid]->setEntry(head_inst->flattenedDestRegIdx(
i),
1353 head_inst->renamedDestRegIdx(
i));
1358 if (head_inst->isHtmStart())
1359 iewStage->setLastRetiredHtmUid(tid, head_inst->getHtmTransactionUid());
1365 if (
DTRACE(O3PipeView)) {
1366 head_inst->commitTick =
curTick() - head_inst->fetchTick;
1371 if (head_inst->isStore() || head_inst->isAtomic())
1378 template <
class Impl>
1382 DPRINTF(Commit,
"Getting instructions from Rename stage.\n");
1387 for (
int inst_num = 0; inst_num < insts_to_process; ++inst_num) {
1391 if (!inst->isSquashed() &&
1396 DPRINTF(Commit,
"[tid:%i] [sn:%llu] Inserting PC %s into ROB.\n",
1397 inst->seqNum, tid, inst->pcState());
1405 DPRINTF(Commit,
"[tid:%i] [sn:%llu] "
1406 "Instruction PC %s was squashed, skipping.\n",
1407 inst->seqNum, tid, inst->pcState());
1412 template <
class Impl>
1418 for (
int inst_num = 0; inst_num <
fromIEW->
size; ++inst_num) {
1419 assert(
fromIEW->insts[inst_num]);
1420 if (!
fromIEW->insts[inst_num]->isSquashed()) {
1421 DPRINTF(Commit,
"[tid:%i] Marking PC %s, [sn:%llu] ready "
1423 fromIEW->insts[inst_num]->threadNumber,
1424 fromIEW->insts[inst_num]->pcState(),
1425 fromIEW->insts[inst_num]->seqNum);
1428 fromIEW->insts[inst_num]->setCanCommit();
1433 template <
class Impl>
1439 if (!inst->isMicroop() || inst->isLastMicroop())
1440 stats.instsCommitted[tid]++;
1441 stats.opsCommitted[tid]++;
1445 if (!inst->isNop() && !inst->isInstPrefetch()) {
1446 cpu->instDone(tid, inst);
1452 if (inst->isControl())
1453 stats.branches[tid]++;
1458 if (inst->isMemRef()) {
1459 stats.memRefs[tid]++;
1461 if (inst->isLoad()) {
1465 if (inst->isAtomic()) {
1470 if (inst->isMemBarrier()) {
1471 stats.membars[tid]++;
1475 if (inst->isInteger())
1476 stats.integer[tid]++;
1479 if (inst->isFloating())
1480 stats.floating[tid]++;
1482 if (inst->isVector())
1483 stats.vector[tid]++;
1487 stats.functionCalls[tid]++;
1496 template <
class Impl>
1503 case CommitPolicy::Aggressive:
1509 case CommitPolicy::RoundRobin:
1512 case CommitPolicy::OldestReady:
1532 template<
class Impl>
1539 while (pri_iter != end) {
1560 template<
class Impl>
1564 unsigned oldest = 0;
1570 while (threads != end) {
1585 }
else if (head_inst->seqNum < oldest) {
1599 #endif//__CPU_O3_COMMIT_IMPL_HH__
void tick()
Ticks the commit stage, which tries to commit instructions.
const ThreadID InvalidThreadID
#define fatal(...)
This implements a cprintf based fatal() function.
void squashFromTC(ThreadID tid)
Handles squashing due to an TC write.
CommitStatus _nextStatus
Next commit status, to be set at the end of the cycle.
void resetEntries()
Re-adjust ROB partitioning.
Stats::Scalar branchMispredicts
Stat for the total number of branch mispredicts that caused a squash.
void generateTrapEvent(ThreadID tid, Fault inst_fault)
Generates an event to schedule a squash due to a trap.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
void squashFromSquashAfter(ThreadID tid)
Handles a squash from a squashAfter() request.
ThreadID getCommittingThread()
Gets the thread to commit, based on the SMT policy.
Stats::Vector functionCalls
Total number of function calls.
bool changedROBNumEntries[Impl::MaxThreads]
Records if the number of ROB entries has changed this cycle.
void takeOverFrom()
Takes over from another CPU's thread.
bool isDoneSquashing(ThreadID tid) const
Reads the PC of the oldest head instruction.
ThreadID oldestReady()
Returns the thread ID to use based on an oldest instruction policy.
Stats::Vector membars
Total number of committed memory barriers.
Stats::Vector instsCommitted
Total number of instructions committed.
void resetHtmStartsStops(ThreadID)
Stats::Vector2d committedInstType
Committed instructions by instruction type (OpClass)
int16_t ThreadID
Thread index/ID type.
void squashAfter(ThreadID tid, const DynInstPtr &head_inst)
Handle squashing from instruction with SquashAfter set.
DynInstPtr findInst(ThreadID tid, InstSeqNum squash_inst)
Returns a pointer to the instruction with the given sequence if it is in the ROB.
void squash(InstSeqNum squash_num, ThreadID tid)
Squashes all instructions younger than the given sequence number for the specific thread.
TimeBuffer< TimeStruct > * timeBuffer
Time buffer interface.
TimeBuffer< IEWStruct >::wire fromIEW
Wire to read information from IEW queue.
bool committedStores[Impl::MaxThreads]
Records if there were any stores committed this cycle.
ThreadStatus commitStatus[Impl::MaxThreads]
Per-thread status.
void drain()
Initializes the draining of commit.
TimeBuffer< IEWStruct > * iewQueue
IEW instruction queue interface.
InstSeqNum lastCommitedSeqNum[Impl::MaxThreads]
The sequence number of the last commited instruction.
std::list< ThreadID > priority_list
Priority List used for Commit Policy.
void squashAll(ThreadID tid)
Squashes all in flight instructions.
O3CPU * cpu
Pointer to O3CPU.
Impl::DynInstPtr DynInstPtr
bool trapSquash[Impl::MaxThreads]
Records if a thread has to squash this cycle due to a trap.
unsigned getMaxEntries(ThreadID tid)
Returns the maximum number of entries for a specific thread.
const DynInstPtr & readHeadInst(ThreadID tid)
Returns pointer to the head instruction within the ROB.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
void clearStates(ThreadID tid)
Clear all thread-specific states.
Addr microPC(ThreadID tid)
Reads the micro PC of a specific thread.
void notify(const Arg &arg)
called at the ProbePoint call site, passes arg to each listener.
Stats::Vector amos
Stat for the total number of committed atomics.
const unsigned renameWidth
Rename width, in instructions.
bool changedROBEntries()
Returns if any of the threads have the number of ROB entries changed on this cycle.
std::vector< Thread * > thread
Vector of all of the threads.
void advancePC(PCState &pc, const StaticInstPtr &inst)
TimeBuffer< FetchStruct > * fetchQueue
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
TimeBuffer< RenameStruct >::wire fromRename
Wire to read information from rename queue.
IEW * iewStage
The pointer to the IEW stage.
Derived & ysubnames(const char **names)
DynInstPtr squashAfterInst[Impl::MaxThreads]
Instruction passed to squashAfter().
int htmStops[Impl::MaxThreads]
void drainSanityCheck() const
Perform sanity checks after a drain.
bool trapInFlight[Impl::MaxThreads]
Records if there is a trap currently in flight.
TimeBuffer< TimeStruct >::wire toIEW
Wire to write information heading to previous stages.
bool wroteToTimeBuffer
Records that commit has written to the time buffer this cycle.
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
void setROB(ROB *rob_ptr)
Sets pointer to the ROB.
const ThreadID numThreads
Number of Active Threads.
Stats::Vector branches
Total number of committed branches.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
TimeBuffer< RenameStruct > * renameQueue
Rename instruction queue interface, for ROB.
std::shared_ptr< FaultBase > Fault
bool canHandleInterrupts
True if last committed microop can be followed by an interrupt.
Stats::Vector opsCommitted
Total number of ops (including micro ops) committed.
const Cycles renameToROBDelay
Rename to ROB delay.
void markCompletedInsts()
Marks completed instructions using information sent from IEW.
DefaultCommit handles single threaded and SMT commit.
const unsigned commitWidth
Commit width, in instructions.
void takeOverFrom()
Takes over another CPU's thread.
void drainSanityCheck() const
Perform sanity checks after a drain.
const Cycles iewToCommitDelay
IEW to Commit delay.
bool drainPending
Is a drain pending? Commit is looking for an instruction boundary while there are no pending interrup...
CommitPolicy commitPolicy
Commit policy used in SMT mode.
std::vector< Info * > stats
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
void handleInterrupt()
Handles processing an interrupt.
void processTrapEvent(ThreadID tid)
Mark the thread as processing a trap.
void regProbePoints()
Registers probes.
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets the main time buffer pointer, used for backwards communication.
void doSquash(ThreadID tid)
Executes the squash, marking squashed instructions.
void updateStatus()
Updates the overall status of commit with the nextStatus, and tell the CPU if commit is active/inacti...
bool tcSquash[Impl::MaxThreads]
Records if a thread has to squash this cycle due to an XC write.
Stats::Scalar commitSquashedInsts
Stat for the total number of squashed instructions discarded by commit.
TheISA::PCState pc[Impl::MaxThreads]
The commit PC state of each thread.
int htmStarts[Impl::MaxThreads]
unsigned getThreadEntries(ThreadID tid)
Returns the number of entries being used by a specific thread.
void setRenameQueue(TimeBuffer< RenameStruct > *rq_ptr)
Sets the pointer to the queue coming from rename.
constexpr decltype(nullptr) NoFault
std::string name() const
Returns the name of the DefaultCommit.
bool isHeadReady(ThreadID tid)
Is the oldest instruction across all threads ready.
bool drainImminent
Is a drain imminent? Commit has found an instruction boundary while no interrupts were present or in ...
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
const FlagsType dist
Print the distribution.
CommitStatus _status
Overall commit status.
Derived & init(size_type size)
Set this vector to have the given size.
TimeBuffer< FetchStruct >::wire fromFetch
void generateTCEvent(ThreadID tid)
Records that commit needs to initiate a squash due to an external state update through the TC.
void startupStage()
Initializes stage by sending back the number of free entries.
ThreadID roundRobin()
Returns the thread ID to use based on a round robin policy.
bool commitHead(const DynInstPtr &head_inst, unsigned inst_num)
Tries to commit the head ROB instruction passed in.
CommitStats(O3CPU *cpu, DefaultCommit *commit)
ProbePointArg< DynInstPtr > * ppCommitStall
ProbePointArg< DynInstPtr > * ppCommit
Probe Points.
bool isDrained() const
Has the stage drained?
CPUPol::RenameMap RenameMap
void drainResume()
Resumes execution after draining.
Stats::Scalar commitNonSpecStalls
Stat for the total number of times commit has had to stall due to a non-speculative instruction reach...
void setIEWQueue(TimeBuffer< IEWStruct > *iq_ptr)
Sets the pointer to the queue coming from IEW.
void propagateInterrupt()
Get fetch redirecting so we can handle an interrupt.
const Cycles trapLatency
The latency to handle a trap.
const Cycles fetchToCommitDelay
TimeBuffer< TimeStruct >::wire robInfoFromIEW
Wire to read information from IEW (for ROB).
void setFetchQueue(TimeBuffer< FetchStruct > *fq_ptr)
void setRenameMap(RenameMap rm_ptr[Impl::MaxThreads])
Sets pointer to the commited state rename map.
void squashFromTrap(ThreadID tid)
Handles squashing due to a trap.
Overload hash function for BasicBlockRange type.
void retireHead(ThreadID tid)
Retires the head instruction, removing it from the ROB.
Distribution & init(Counter min, Counter max, Counter bkt)
Set the parameters of this distribution.
const FlagsType pdf
Print the percent of the total that this entry represents.
Derived & init(size_type _x, size_type _y)
Cycles is a wrapper class for representing cycle counts, i.e.
RenameMap * renameMap[Impl::MaxThreads]
Rename map interface.
int countInsts()
This is more of a debugging function than anything.
Stats::Vector loads
Stat for the total number of committed loads.
bool isEmpty() const
Returns if the ROB is empty.
Addr instAddr(ThreadID tid)
Returns the PC of a specific thread.
std::list< ThreadID > * activeThreads
Pointer to the list of active threads.
void commitInsts()
Commits as many instructions as possible.
Stats::Vector memRefs
Stat for the total number of committed memory references.
Stats::Vector floating
Total number of floating point instructions.
void deactivateThread(ThreadID tid)
Deschedules a thread from scheduling.
void commit()
Handles any squashes that are sent from IEW, and adds instructions to the ROB and tries to commit ins...
void setIEWStage(IEW *iew_stage)
Sets the pointer to the IEW stage.
InstSeqNum youngestSeqNum[Impl::MaxThreads]
The sequence number of the youngest valid instruction in the ROB.
bool checkEmptyROB[Impl::MaxThreads]
Records if commit should check if the ROB is truly empty (see commit_impl.hh).
const FlagsType total
Print the total.
Fault interrupt
The interrupt fault.
void updateComInstStats(const DynInstPtr &inst)
Updates commit stats based on this instruction.
ProbePointArg< DynInstPtr > * ppSquash
To probe when an instruction is squashed.
Stats::Vector integer
Total number of integer instructions.
unsigned numFreeEntries()
Returns the number of total free entries in the ROB.
void setThreads(std::vector< Thread * > &threads)
Sets the list of threads.
bool executingHtmTransaction(ThreadID) const
Is the CPU currently processing a HTM transaction?
void getInsts()
Gets instructions from rename and inserts them into the ROB.
bool avoidQuiesceLiveLock
Have we had an interrupt pending and then seen it de-asserted because of a masking change?...
Stats::Distribution numCommittedDist
Distribution of the number of committed instructions each cycle.
DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params)
Construct a DefaultCommit with the given parameters.
void insertInst(const DynInstPtr &inst)
Function to insert an instruction into the ROB.
#define panic(...)
This implements a cprintf based panic() function.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to the list of active threads.
Tick curTick()
The current simulated tick.
size_t numROBFreeEntries(ThreadID tid)
Returns the number of free ROB entries for a specific thread.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17