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"
75 trapSquash[tid] =
true;
80 : commitPolicy(params.smtCommitPolicy),
82 iewToCommitDelay(params.iewToCommitDelay),
83 commitToIEWDelay(params.commitToIEWDelay),
84 renameToROBDelay(params.renameToROBDelay),
85 fetchToCommitDelay(params.commitToFetchDelay),
86 renameWidth(params.renameWidth),
87 commitWidth(params.commitWidth),
88 numThreads(params.numThreads),
91 trapLatency(params.trapLatency),
92 canHandleInterrupts(true),
93 avoidQuiesceLiveLock(false),
97 fatal(
"commitWidth (%d) is larger than compiled limit (%d),\n"
98 "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
111 for (
ThreadID tid = 0; tid < Impl::MaxThreads; tid++) {
130 template <
class Impl>
134 return cpu->name() +
".commit";
137 template <
class Impl>
146 template <
class Impl>
149 :
Stats::Group(cpu,
"commit"),
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"),
161 "Number of ops (including micro ops) committed"),
168 "Number of committed Vector instructions."),
170 "Number of committed floating point instructions."),
172 "Number of committed integer instructions."),
174 "Number of function calls committed."),
176 "Class of committed instruction"),
178 "number cycles where commit BW limit reached")
180 using namespace Stats;
241 template <
class Impl>
248 template <
class Impl>
261 template <
class Impl>
271 template <
class Impl>
281 template <
class Impl>
291 template <
class Impl>
305 template <
class Impl>
313 template <
class Impl>
320 template <
class Impl>
329 toIEW->commitInfo[tid].usedROB =
true;
331 toIEW->commitInfo[tid].emptyROB =
true;
336 cpu->activateStage(O3CPU::CommitIdx);
338 cpu->activityThisCycle();
341 template <
class Impl>
357 template <
class Impl>
364 template <
class Impl>
372 template <
class Impl>
383 panic(
"cannot drain partially through a HTM transaction");
388 template <
class Impl>
416 template <
class Impl>
432 template <
class Impl>
444 template <
class Impl>
454 template <
class Impl>
466 template <
class Impl>
474 while (threads != end) {
487 DPRINTF(Activity,
"Deactivating stage.\n");
488 cpu->deactivateStage(O3CPU::CommitIdx);
490 DPRINTF(Activity,
"Activating stage.\n");
491 cpu->activateStage(O3CPU::CommitIdx);
497 template <
class Impl>
504 while (threads != end) {
515 template <
class Impl>
522 template <
class Impl>
526 DPRINTF(Commit,
"Generating trap event for [tid:%i]\n", tid);
532 Cycles latency = std::dynamic_pointer_cast<SyscallRetryFault>(inst_fault) ?
536 if (inst_fault !=
nullptr &&
537 std::dynamic_pointer_cast<GenericHtmFailureFault>(inst_fault)) {
543 cpu->schedule(trap,
cpu->clockEdge(latency));
545 thread[tid]->trapPending =
true;
548 template <
class Impl>
553 DPRINTF(Commit,
"Generating TC squash event for [tid:%i]\n", tid);
558 template <
class Impl>
578 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
582 toIEW->commitInfo[tid].squash =
true;
586 toIEW->commitInfo[tid].robSquashing =
true;
588 toIEW->commitInfo[tid].mispredictInst = NULL;
589 toIEW->commitInfo[tid].squashInst = NULL;
591 toIEW->commitInfo[tid].pc =
pc[tid];
594 template <
class Impl>
600 DPRINTF(Commit,
"Squashing from trap, restarting at PC %s\n",
pc[tid]);
602 thread[tid]->trapPending =
false;
603 thread[tid]->noSquashFromTC =
false;
609 cpu->activityThisCycle();
612 template <
class Impl>
618 DPRINTF(Commit,
"Squashing from TC, restarting at PC %s\n",
pc[tid]);
620 thread[tid]->noSquashFromTC =
false;
621 assert(!
thread[tid]->trapPending);
624 cpu->activityThisCycle();
629 template <
class Impl>
633 DPRINTF(Commit,
"Squashing after squash after request, "
634 "restarting at PC %s\n",
pc[tid]);
644 cpu->activityThisCycle();
647 template <
class Impl>
651 DPRINTF(Commit,
"Executing squash after for [tid:%i] inst [sn:%llu]\n",
652 tid, head_inst->seqNum);
659 template <
class Impl>
674 while (threads != end) {
686 DPRINTF(Commit,
"[tid:%i] Still Squashing, cannot commit any"
687 " insts this cycle.\n", tid);
689 toIEW->commitInfo[tid].robSquashing =
true;
701 while (threads != end) {
711 DPRINTF(Commit,
"[tid:%i] Instruction [sn:%llu] PC %s is head of"
712 " ROB and ready to commit\n",
713 tid, inst->seqNum, inst->pcState());
720 DPRINTF(Commit,
"[tid:%i] Can't commit, Instruction [sn:%llu] PC "
721 "%s is head of ROB and not ready\n",
722 tid, inst->seqNum, inst->pcState());
725 DPRINTF(Commit,
"[tid:%i] ROB has %d insts & %d free entries.\n",
731 DPRINTF(Activity,
"Activity This Cycle.\n");
732 cpu->activityThisCycle();
738 template <
class Impl>
743 if (!
cpu->checkInterrupts(0)) {
744 DPRINTF(Commit,
"Pending interrupt is cleared by requestor before "
745 "it got handled. Restart fetching from the orig path.\n");
746 toIEW->commitInfo[0].clearInterrupt =
true;
757 DPRINTF(Commit,
"Interrupt detected.\n");
760 toIEW->commitInfo[0].clearInterrupt =
true;
762 assert(!
thread[0]->noSquashFromTC);
763 thread[0]->noSquashFromTC =
true;
766 cpu->checker->handlePendingInt();
772 cpu->processInterrupts(
cpu->getInterrupts());
774 thread[0]->noSquashFromTC =
false;
785 DPRINTF(Commit,
"Interrupt pending: instruction is %sin "
786 "flight, ROB is %sempty\n",
788 cpu->instList.empty() ?
"" :
"not " );
792 template <
class Impl>
814 toIEW->commitInfo[0].interruptPending =
true;
817 template <
class Impl>
823 if (
cpu->checkInterrupts(0))
833 int num_squashing_threads = 0;
835 while (threads != end) {
848 if (
cpu->isThreadExiting(tid))
849 cpu->scheduleThreadExitEvent(tid);
867 if (
fromIEW->mispredictInst[tid]) {
869 "[tid:%i] Squashing due to branch mispred "
870 "PC:%#x [sn:%llu]\n",
872 fromIEW->mispredictInst[tid]->instAddr(),
876 "[tid:%i] Squashing due to order violation [sn:%llu]\n",
877 tid,
fromIEW->squashedSeqNum[tid]);
880 DPRINTF(Commit,
"[tid:%i] Redirecting to PC %#x\n",
882 fromIEW->pc[tid].nextInstAddr());
890 if (
fromIEW->includeSquashInst[tid]) {
901 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
903 toIEW->commitInfo[tid].squash =
true;
907 toIEW->commitInfo[tid].robSquashing =
true;
909 toIEW->commitInfo[tid].mispredictInst =
911 toIEW->commitInfo[tid].branchTaken =
913 toIEW->commitInfo[tid].squashInst =
915 if (
toIEW->commitInfo[tid].mispredictInst) {
916 if (
toIEW->commitInfo[tid].mispredictInst->isUncondCtrl()) {
917 toIEW->commitInfo[tid].branchTaken =
true;
919 ++
stats.branchMispredicts;
926 num_squashing_threads++;
932 if (num_squashing_threads) {
947 while (threads != end) {
951 toIEW->commitInfo[tid].usedROB =
true;
971 toIEW->commitInfo[tid].usedROB =
true;
972 toIEW->commitInfo[tid].emptyROB =
true;
980 template <
class Impl>
993 DPRINTF(Commit,
"Trying to commit instructions in the ROB.\n");
995 unsigned num_committed = 0;
1013 cpu->clearInterrupts(0);
1014 toIEW->commitInfo[0].clearInterrupt =
true;
1029 ThreadID tid = head_inst->threadNumber;
1031 assert(tid == commit_thread);
1034 "Trying to commit head instruction, [tid:%i] [sn:%llu]\n",
1035 tid, head_inst->seqNum);
1039 if (head_inst->isSquashed()) {
1041 DPRINTF(Commit,
"Retiring squashed instruction from "
1046 ++
stats.commitSquashedInsts;
1053 pc[tid] = head_inst->pcState();
1060 thread[tid]->funcExeInst++;
1063 bool commit_success =
commitHead(head_inst, num_committed);
1065 if (commit_success) {
1067 stats.committedInstType[tid][head_inst->opClass()]++;
1073 if (head_inst->isHtmStart())
1077 if (head_inst->inHtmTransactionalState()) {
1084 if (head_inst->isHtmStop())
1090 toIEW->commitInfo[tid].doneSeqNum = head_inst->seqNum;
1097 assert(!head_inst->isStoreConditional() ||
1098 head_inst->isCompleted() ||
1099 !head_inst->readPredicate());
1102 head_inst->updateMiscRegs();
1107 cpu->checker->verify(head_inst);
1119 if (head_inst->isSquashAfter())
1124 !
thread[tid]->trapPending) {
1128 DPRINTF(Drain,
"Draining: %i:%s\n", tid,
pc[tid]);
1130 cpu->commitDrained(tid);
1135 bool onInstBoundary = !head_inst->isMicroop() ||
1136 head_inst->isLastMicroop() ||
1137 !head_inst->isDelayedCommit();
1139 if (onInstBoundary) {
1144 assert(!
thread[tid]->noSquashFromTC &&
1145 !
thread[tid]->trapPending);
1147 oldpc =
pc[tid].instAddr();
1148 thread[tid]->pcEventQueue.service(
1149 oldpc,
thread[tid]->getTC());
1154 "PC skip function event, stopping commit\n");
1167 onInstBoundary &&
cpu->checkInterrupts(0))
1170 DPRINTF(Commit,
"Unable to commit head instruction PC:%s "
1171 "[tid:%i] [sn:%llu].\n",
1172 head_inst->pcState(), tid ,head_inst->seqNum);
1178 DPRINTF(CommitRate,
"%i\n", num_committed);
1179 stats.numCommittedDist.sample(num_committed);
1182 stats.commitEligibleSamples++;
1186 template <
class Impl>
1192 ThreadID tid = head_inst->threadNumber;
1196 if (!head_inst->isExecuted()) {
1199 thread[tid]->funcExeInst--;
1203 assert(head_inst->isNonSpeculative() || head_inst->isStoreConditional()
1204 || head_inst->isReadBarrier() || head_inst->isWriteBarrier()
1205 || head_inst->isAtomic()
1206 || (head_inst->isLoad() && head_inst->strictlyOrdered()));
1209 "Encountered a barrier or non-speculative "
1210 "instruction [tid:%i] [sn:%llu] "
1211 "at the head of the ROB, PC %s.\n",
1212 tid, head_inst->seqNum, head_inst->pcState());
1214 if (inst_num > 0 ||
iewStage->hasStoresToWB(tid)) {
1216 "[tid:%i] [sn:%llu] "
1217 "Waiting for all stores to writeback.\n",
1218 tid, head_inst->seqNum);
1222 toIEW->commitInfo[tid].nonSpecSeqNum = head_inst->seqNum;
1226 head_inst->clearCanCommit();
1228 if (head_inst->isLoad() && head_inst->strictlyOrdered()) {
1229 DPRINTF(Commit,
"[tid:%i] [sn:%llu] "
1230 "Strictly ordered load, PC %s.\n",
1231 tid, head_inst->seqNum, head_inst->pcState());
1232 toIEW->commitInfo[tid].strictlyOrdered =
true;
1233 toIEW->commitInfo[tid].strictlyOrderedLoad = head_inst;
1235 ++
stats.commitNonSpecStalls;
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->regs.flattenedDestIdx(
i),
1353 head_inst->regs.renamedDestIdx(
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->isFullMemBarrier()) {
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.vectorInstructions[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)
DefaultCommit(O3CPU *_cpu, const DerivO3CPUParams ¶ms)
Construct a DefaultCommit with the given parameters.
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.
Stats::Vector vectorInstructions
Total number of vector instructions.
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.
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.
#define UNIT_CYCLE
Convenience macros to declare the unit of a stat.
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.
Tick curTick()
The universal simulation clock.
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.
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.
size_t numROBFreeEntries(ThreadID tid)
Returns the number of free ROB entries for a specific thread.
Generated on Tue Mar 23 2021 19:41:24 for gem5 by doxygen 1.8.17