44 #ifndef __CPU_O3_COMMIT_IMPL_HH__ 45 #define __CPU_O3_COMMIT_IMPL_HH__ 51 #include "arch/utility.hh" 55 #include "config/the_isa.hh" 62 #include "debug/Activity.hh" 63 #include "debug/Commit.hh" 64 #include "debug/CommitRate.hh" 65 #include "debug/Drain.hh" 66 #include "debug/ExecFaulting.hh" 67 #include "debug/O3PipeView.hh" 68 #include "params/DerivO3CPU.hh" 80 trapSquash[tid] =
true;
85 : commitPolicy(params->smtCommitPolicy),
87 iewToCommitDelay(params->iewToCommitDelay),
88 commitToIEWDelay(params->commitToIEWDelay),
89 renameToROBDelay(params->renameToROBDelay),
90 fetchToCommitDelay(params->commitToFetchDelay),
91 renameWidth(params->renameWidth),
92 commitWidth(params->commitWidth),
93 numThreads(params->numThreads),
96 trapLatency(params->trapLatency),
97 canHandleInterrupts(true),
98 avoidQuiesceLiveLock(false)
101 fatal(
"commitWidth (%d) is larger than compiled limit (%d),\n" 102 "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
115 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>
152 using namespace Stats;
154 .
name(
name() +
".commitSquashedInsts")
155 .
desc(
"The number of squashed insts skipped by commit")
159 .
name(
name() +
".commitNonSpecStalls")
160 .
desc(
"The number of times commit has been forced to stall to " 161 "communicate backwards")
165 .
name(
name() +
".branchMispredicts")
166 .
desc(
"The number of times a branch was mispredicted")
171 .
name(
name() +
".committed_per_cycle")
172 .
desc(
"Number of insts commited each cycle")
179 .
desc(
"Number of instructions committed")
186 .
desc(
"Number of ops (including micro ops) committed")
193 .
desc(
"Number of s/w prefetches committed")
200 .
desc(
"Number of memory references committed")
207 .
desc(
"Number of loads committed")
214 .
desc(
"Number of atomic instructions committed")
221 .
desc(
"Number of memory barriers committed")
228 .
desc(
"Number of branches committed")
235 .
desc(
"Number of committed floating point instructions.")
242 .
desc(
"Number of committed Vector instructions.")
249 .
desc(
"Number of committed integer instructions.")
256 .
desc(
"Number of function calls committed.")
263 .
desc(
"Class of committed instruction")
270 .
desc(
"number cycles where commit BW limit reached")
274 template <
class Impl>
281 template <
class Impl>
294 template <
class Impl>
304 template <
class Impl>
314 template <
class Impl>
324 template <
class Impl>
338 template <
class Impl>
346 template <
class Impl>
353 template <
class Impl>
362 toIEW->commitInfo[tid].usedROB =
true;
364 toIEW->commitInfo[tid].emptyROB =
true;
369 cpu->activateStage(O3CPU::CommitIdx);
371 cpu->activityThisCycle();
374 template <
class Impl>
390 template <
class Impl>
397 template <
class Impl>
405 template <
class Impl>
413 template <
class Impl>
441 template <
class Impl>
457 template <
class Impl>
470 template <
class Impl>
478 while (threads != end) {
491 DPRINTF(Activity,
"Deactivating stage.\n");
492 cpu->deactivateStage(O3CPU::CommitIdx);
494 DPRINTF(Activity,
"Activating stage.\n");
495 cpu->activateStage(O3CPU::CommitIdx);
501 template <
class Impl>
508 while (threads != end) {
519 template <
class Impl>
526 template <
class Impl>
530 DPRINTF(Commit,
"Generating trap event for [tid:%i]\n", tid);
539 cpu->schedule(trap,
cpu->clockEdge(latency));
541 thread[tid]->trapPending =
true;
544 template <
class Impl>
549 DPRINTF(Commit,
"Generating TC squash event for [tid:%i]\n", tid);
554 template <
class Impl>
574 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
578 toIEW->commitInfo[tid].squash =
true;
582 toIEW->commitInfo[tid].robSquashing =
true;
584 toIEW->commitInfo[tid].mispredictInst = NULL;
585 toIEW->commitInfo[tid].squashInst = NULL;
587 toIEW->commitInfo[tid].pc =
pc[tid];
590 template <
class Impl>
596 DPRINTF(Commit,
"Squashing from trap, restarting at PC %s\n",
pc[tid]);
598 thread[tid]->trapPending =
false;
599 thread[tid]->noSquashFromTC =
false;
605 cpu->activityThisCycle();
608 template <
class Impl>
614 DPRINTF(Commit,
"Squashing from TC, restarting at PC %s\n",
pc[tid]);
616 thread[tid]->noSquashFromTC =
false;
617 assert(!
thread[tid]->trapPending);
620 cpu->activityThisCycle();
625 template <
class Impl>
629 DPRINTF(Commit,
"Squashing after squash after request, " 630 "restarting at PC %s\n",
pc[tid]);
640 cpu->activityThisCycle();
643 template <
class Impl>
647 DPRINTF(Commit,
"Executing squash after for [tid:%i] inst [sn:%llu]\n",
648 tid, head_inst->seqNum);
655 template <
class Impl>
670 while (threads != end) {
682 DPRINTF(Commit,
"[tid:%i] Still Squashing, cannot commit any" 683 " insts this cycle.\n", tid);
685 toIEW->commitInfo[tid].robSquashing =
true;
697 while (threads != end) {
707 DPRINTF(Commit,
"[tid:%i] Instruction [sn:%llu] PC %s is head of" 708 " ROB and ready to commit\n",
709 tid, inst->seqNum, inst->pcState());
716 DPRINTF(Commit,
"[tid:%i] Can't commit, Instruction [sn:%llu] PC " 717 "%s is head of ROB and not ready\n",
718 tid, inst->seqNum, inst->pcState());
721 DPRINTF(Commit,
"[tid:%i] ROB has %d insts & %d free entries.\n",
727 DPRINTF(Activity,
"Activity This Cycle.\n");
728 cpu->activityThisCycle();
734 template <
class Impl>
739 if (!
cpu->checkInterrupts(
cpu->tcBase(0))) {
740 DPRINTF(Commit,
"Pending interrupt is cleared by master before " 741 "it got handled. Restart fetching from the orig path.\n");
742 toIEW->commitInfo[0].clearInterrupt =
true;
753 DPRINTF(Commit,
"Interrupt detected.\n");
756 toIEW->commitInfo[0].clearInterrupt =
true;
758 assert(!
thread[0]->noSquashFromTC);
759 thread[0]->noSquashFromTC =
true;
762 cpu->checker->handlePendingInt();
768 cpu->processInterrupts(
cpu->getInterrupts());
770 thread[0]->noSquashFromTC =
false;
781 DPRINTF(Commit,
"Interrupt pending: instruction is %sin " 782 "flight, ROB is %sempty\n",
784 cpu->instList.empty() ?
"" :
"not " );
788 template <
class Impl>
810 toIEW->commitInfo[0].interruptPending =
true;
813 template <
class Impl>
819 if (
cpu->checkInterrupts(
cpu->tcBase(0)))
829 int num_squashing_threads = 0;
831 while (threads != end) {
844 if (
cpu->isThreadExiting(tid))
845 cpu->scheduleThreadExitEvent(tid);
863 if (
fromIEW->mispredictInst[tid]) {
865 "[tid:%i] Squashing due to branch mispred " 866 "PC:%#x [sn:%llu]\n",
868 fromIEW->mispredictInst[tid]->instAddr(),
872 "[tid:%i] Squashing due to order violation [sn:%llu]\n",
873 tid,
fromIEW->squashedSeqNum[tid]);
876 DPRINTF(Commit,
"[tid:%i] Redirecting to PC %#x\n",
878 fromIEW->pc[tid].nextInstAddr());
886 if (
fromIEW->includeSquashInst[tid]) {
897 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
899 toIEW->commitInfo[tid].squash =
true;
903 toIEW->commitInfo[tid].robSquashing =
true;
905 toIEW->commitInfo[tid].mispredictInst =
907 toIEW->commitInfo[tid].branchTaken =
909 toIEW->commitInfo[tid].squashInst =
911 if (
toIEW->commitInfo[tid].mispredictInst) {
912 if (
toIEW->commitInfo[tid].mispredictInst->isUncondCtrl()) {
913 toIEW->commitInfo[tid].branchTaken =
true;
922 num_squashing_threads++;
928 if (num_squashing_threads) {
943 while (threads != end) {
947 toIEW->commitInfo[tid].usedROB =
true;
967 toIEW->commitInfo[tid].usedROB =
true;
968 toIEW->commitInfo[tid].emptyROB =
true;
976 template <
class Impl>
989 DPRINTF(Commit,
"Trying to commit instructions in the ROB.\n");
991 unsigned num_committed = 0;
1010 ThreadID tid = head_inst->threadNumber;
1012 assert(tid == commit_thread);
1015 "Trying to commit head instruction, [tid:%i] [sn:%llu]\n",
1016 tid, head_inst->seqNum);
1020 if (head_inst->isSquashed()) {
1022 DPRINTF(Commit,
"Retiring squashed instruction from " 1034 pc[tid] = head_inst->pcState();
1041 thread[tid]->funcExeInst++;
1044 bool commit_success =
commitHead(head_inst, num_committed);
1046 if (commit_success) {
1054 toIEW->commitInfo[tid].doneSeqNum = head_inst->seqNum;
1058 ((THE_ISA != ALPHA_ISA) ||
1059 (!(
pc[0].instAddr() & 0x3)));
1064 assert(!head_inst->isStoreConditional() ||
1065 head_inst->isCompleted() ||
1066 !head_inst->readPredicate());
1069 head_inst->updateMiscRegs();
1074 cpu->checker->verify(head_inst);
1086 if (head_inst->isSquashAfter())
1091 !
thread[tid]->trapPending) {
1095 DPRINTF(Drain,
"Draining: %i:%s\n", tid,
pc[tid]);
1097 cpu->commitDrained(tid);
1102 bool onInstBoundary = !head_inst->isMicroop() ||
1103 head_inst->isLastMicroop() ||
1104 !head_inst->isDelayedCommit();
1106 if (onInstBoundary) {
1111 assert(!
thread[tid]->noSquashFromTC &&
1112 !
thread[tid]->trapPending);
1114 oldpc =
pc[tid].instAddr();
1115 thread[tid]->pcEventQueue.service(
1116 oldpc,
thread[tid]->getTC());
1121 "PC skip function event, stopping commit\n");
1134 onInstBoundary &&
cpu->checkInterrupts(
cpu->tcBase(0)))
1137 DPRINTF(Commit,
"Unable to commit head instruction PC:%s " 1138 "[tid:%i] [sn:%llu].\n",
1139 head_inst->pcState(), tid ,head_inst->seqNum);
1145 DPRINTF(CommitRate,
"%i\n", num_committed);
1153 template <
class Impl>
1159 ThreadID tid = head_inst->threadNumber;
1163 if (!head_inst->isExecuted()) {
1166 thread[tid]->funcExeInst--;
1170 assert(head_inst->isNonSpeculative() || head_inst->isStoreConditional()
1171 || head_inst->isMemBarrier() || head_inst->isWriteBarrier()
1172 || head_inst->isAtomic()
1173 || (head_inst->isLoad() && head_inst->strictlyOrdered()));
1176 "Encountered a barrier or non-speculative " 1177 "instruction [tid:%i] [sn:%llu] " 1178 "at the head of the ROB, PC %s.\n",
1179 tid, head_inst->seqNum, head_inst->pcState());
1181 if (inst_num > 0 ||
iewStage->hasStoresToWB(tid)) {
1183 "[tid:%i] [sn:%llu] " 1184 "Waiting for all stores to writeback.\n",
1185 tid, head_inst->seqNum);
1189 toIEW->commitInfo[tid].nonSpecSeqNum = head_inst->seqNum;
1193 head_inst->clearCanCommit();
1195 if (head_inst->isLoad() && head_inst->strictlyOrdered()) {
1196 DPRINTF(Commit,
"[tid:%i] [sn:%llu] " 1197 "Strictly ordered load, PC %s.\n",
1198 tid, head_inst->seqNum, head_inst->pcState());
1199 toIEW->commitInfo[tid].strictlyOrdered =
true;
1200 toIEW->commitInfo[tid].strictlyOrderedLoad = head_inst;
1208 if (head_inst->isThreadSync()) {
1210 panic(
"Thread sync instructions are not handled yet.\n");
1214 Fault inst_fault = head_inst->getFault();
1217 if (!head_inst->isStore() && inst_fault ==
NoFault) {
1218 head_inst->setCompleted();
1222 DPRINTF(Commit,
"Inst [tid:%i] [sn:%llu] PC %s has a fault\n",
1223 tid, head_inst->seqNum, head_inst->pcState());
1225 if (
iewStage->hasStoresToWB(tid) || inst_num > 0) {
1227 "[tid:%i] [sn:%llu] " 1228 "Stores outstanding, fault must wait.\n",
1229 tid, head_inst->seqNum);
1233 head_inst->setCompleted();
1239 cpu->checker->verify(head_inst);
1242 assert(!
thread[tid]->noSquashFromTC);
1246 thread[tid]->noSquashFromTC =
true;
1254 cpu->trap(inst_fault, tid,
1255 head_inst->notAnInst() ?
1257 head_inst->staticInst);
1260 thread[tid]->noSquashFromTC =
false;
1265 "[tid:%i] [sn:%llu] Committing instruction with fault\n",
1266 tid, head_inst->seqNum);
1267 if (head_inst->traceData) {
1268 if (
DTRACE(ExecFaulting)) {
1269 head_inst->traceData->setFetchSeq(head_inst->seqNum);
1270 head_inst->traceData->setCPSeq(
thread[tid]->numOp);
1271 head_inst->traceData->dump();
1273 delete head_inst->traceData;
1274 head_inst->traceData = NULL;
1285 if (
thread[tid]->profile) {
1286 thread[tid]->profilePC = head_inst->instAddr();
1288 thread[tid]->getTC(), head_inst->staticInst);
1291 thread[tid]->profileNode = node;
1294 if (head_inst->isControl()) {
1301 "[tid:%i] [sn:%llu] Committing instruction with PC %s\n",
1302 tid, head_inst->seqNum, head_inst->pcState());
1303 if (head_inst->traceData) {
1304 head_inst->traceData->setFetchSeq(head_inst->seqNum);
1305 head_inst->traceData->setCPSeq(
thread[tid]->numOp);
1306 head_inst->traceData->dump();
1307 delete head_inst->traceData;
1308 head_inst->traceData = NULL;
1310 if (head_inst->isReturn()) {
1312 "[tid:%i] [sn:%llu] Return Instruction Committed PC %s \n",
1313 tid, head_inst->seqNum, head_inst->pcState());
1317 for (
int i = 0;
i < head_inst->numDestRegs();
i++) {
1318 renameMap[tid]->setEntry(head_inst->flattenedDestRegIdx(
i),
1319 head_inst->renamedDestRegIdx(
i));
1326 if (
DTRACE(O3PipeView)) {
1327 head_inst->commitTick =
curTick() - head_inst->fetchTick;
1332 if (head_inst->isStore() || head_inst->isAtomic())
1339 template <
class Impl>
1343 DPRINTF(Commit,
"Getting instructions from Rename stage.\n");
1348 for (
int inst_num = 0; inst_num < insts_to_process; ++inst_num) {
1352 if (!inst->isSquashed() &&
1357 DPRINTF(Commit,
"[tid:%i] [sn:%llu] Inserting PC %s into ROB.\n",
1358 inst->seqNum, tid, inst->pcState());
1366 DPRINTF(Commit,
"[tid:%i] [sn:%llu] " 1367 "Instruction PC %s was squashed, skipping.\n",
1368 inst->seqNum, tid, inst->pcState());
1373 template <
class Impl>
1379 for (
int inst_num = 0; inst_num <
fromIEW->
size; ++inst_num) {
1380 assert(
fromIEW->insts[inst_num]);
1381 if (!
fromIEW->insts[inst_num]->isSquashed()) {
1382 DPRINTF(Commit,
"[tid:%i] Marking PC %s, [sn:%llu] ready " 1384 fromIEW->insts[inst_num]->threadNumber,
1385 fromIEW->insts[inst_num]->pcState(),
1386 fromIEW->insts[inst_num]->seqNum);
1389 fromIEW->insts[inst_num]->setCanCommit();
1394 template <
class Impl>
1400 if (!inst->isMicroop() || inst->isLastMicroop())
1406 if (!inst->isNop() && !inst->isInstPrefetch()) {
1407 cpu->instDone(tid, inst);
1413 if (inst->isControl())
1419 if (inst->isMemRef()) {
1422 if (inst->isLoad()) {
1426 if (inst->isAtomic()) {
1431 if (inst->isMemBarrier()) {
1436 if (inst->isInteger())
1440 if (inst->isFloating())
1443 if (inst->isVector())
1457 template <
class Impl>
1464 case CommitPolicy::Aggressive:
1470 case CommitPolicy::RoundRobin:
1473 case CommitPolicy::OldestReady:
1493 template<
class Impl>
1500 while (pri_iter != end) {
1521 template<
class Impl>
1525 unsigned oldest = 0;
1531 while (threads != end) {
1546 }
else if (head_inst->seqNum < oldest) {
1560 #endif//__CPU_O3_COMMIT_IMPL_HH__
void takeOverFrom()
Takes over another CPU's thread.
const unsigned commitWidth
Commit width, in instructions.
#define panic(...)
This implements a cprintf based panic() function.
void drainSanityCheck() const
Perform sanity checks after a drain.
const FlagsType pdf
Print the percent of the total that this entry represents.
void handleInterrupt()
Handles processing an interrupt.
void regProbePoints()
Registers probes.
const Cycles fetchToCommitDelay
void doSquash(ThreadID tid)
Executes the squash, marking squashed instructions.
void processTrapEvent(ThreadID tid)
Mark the thread as processing a trap.
Derived & init(size_type _x, size_type _y)
decltype(nullptr) constexpr NoFault
Cycles is a wrapper class for representing cycle counts, i.e.
void retireHead(ThreadID tid)
Retires the head instruction, removing it from the ROB.
void setRenameMap(RenameMap rm_ptr[Impl::MaxThreads])
Sets pointer to the commited state rename map.
#define fatal(...)
This implements a cprintf based fatal() function.
Stats::Scalar commitEligibleSamples
Number of cycles where the commit bandwidth limit is reached.
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.
TheISA::PCState pc[Impl::MaxThreads]
The commit PC state of each thread.
bool drainImminent
Is a drain imminent? Commit has found an instruction boundary while no interrupts were present or in ...
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
TimeBuffer< FetchStruct >::wire fromFetch
void squashFromTC(ThreadID tid)
Handles squashing due to an TC write.
Addr instAddr(ThreadID tid)
Returns the PC of a specific thread.
const Cycles renameToROBDelay
Rename to ROB delay.
void notify(const Arg &arg)
called at the ProbePoint call site, passes arg to each listener.
Stats::Vector statComBranches
Total number of committed branches.
Stats::Vector statComSwp
Total number of software prefetches committed.
bool commitHead(const DynInstPtr &head_inst, unsigned inst_num)
Tries to commit the head ROB instruction passed in.
CPUPol::RenameMap RenameMap
TimeBuffer< FetchStruct > * fetchQueue
Stats::Vector statComRefs
Stat for the total number of committed memory references.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
void squashFromSquashAfter(ThreadID tid)
Handles a squash from a squashAfter() request.
TimeBuffer< TimeStruct >::wire robInfoFromIEW
Wire to read information from IEW (for ROB).
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets the main time buffer pointer, used for backwards communication.
IEW * iewStage
The pointer to the IEW stage.
bool tcSquash[Impl::MaxThreads]
Records if a thread has to squash this cycle due to an XC write.
Overload hash function for BasicBlockRange type.
void updateStatus()
Updates the overall status of commit with the nextStatus, and tell the CPU if commit is active/inacti...
Stats::Vector2d statCommittedInstType
Committed instructions by instruction type (OpClass)
void getInsts()
Gets instructions from rename and inserts them into the ROB.
DynInstPtr findInst(ThreadID tid, InstSeqNum squash_inst)
Returns a pointer to the instruction with the given sequence if it is in the ROB. ...
void setRenameQueue(TimeBuffer< RenameStruct > *rq_ptr)
Sets the pointer to the queue coming from rename.
bool avoidQuiesceLiveLock
Have we had an interrupt pending and then seen it de-asserted because of a masking change...
DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params)
Construct a DefaultCommit with the given parameters.
Stats::Vector statComLoads
Stat for the total number of committed loads.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
void tick()
Ticks the commit stage, which tries to commit instructions.
std::list< ThreadID > * activeThreads
Pointer to the list of active threads.
RenameMap * renameMap[Impl::MaxThreads]
Rename map interface.
Derived & init(size_type size)
Set this vector to have the given size.
bool isEmpty() const
Returns if the ROB is empty.
const DynInstPtr & readHeadInst(ThreadID tid)
Returns pointer to the head instruction within the ROB.
ThreadID roundRobin()
Returns the thread ID to use based on a round robin policy.
void commitInsts()
Commits as many instructions as possible.
TimeBuffer< RenameStruct > * renameQueue
Rename instruction queue interface, for ROB.
bool isDrained() const
Has the stage drained?
void setIEWStage(IEW *iew_stage)
Sets the pointer to the IEW stage.
void drainResume()
Resumes execution after draining.
void propagateInterrupt()
Get fetch redirecting so we can handle an interrupt.
Stats::Vector opsCommitted
Total number of ops (including micro ops) committed.
void swAutoBegin(ThreadContext *tc, Addr next_pc)
void generateTrapEvent(ThreadID tid, Fault inst_fault)
Generates an event to schedule a squash due to a trap.
Stats::Vector statComFloating
Total number of floating point instructions.
const Cycles trapLatency
The latency to handle a trap.
Tick curTick()
The current simulated tick.
Addr microPC(ThreadID tid)
Reads the micro PC of a specific thread.
void setFetchQueue(TimeBuffer< FetchStruct > *fq_ptr)
void squashFromTrap(ThreadID tid)
Handles squashing due to a trap.
const unsigned renameWidth
Rename width, in instructions.
Stats::Vector statComAmos
Stat for the total number of committed atomics.
Stats::Scalar branchMispredicts
Stat for the total number of branch mispredicts that caused a squash.
ThreadID oldestReady()
Returns the thread ID to use based on an oldest instruction policy.
unsigned numFreeEntries()
Returns the number of total free entries in the ROB.
Stats::Vector statComMembars
Total number of committed memory barriers.
unsigned getThreadEntries(ThreadID tid)
Returns the number of entries being used by a specific thread.
TimeBuffer< IEWStruct >::wire fromIEW
Wire to read information from IEW queue.
ThreadStatus commitStatus[Impl::MaxThreads]
Per-thread status.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to the list of active threads.
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
Stats::Distribution numCommittedDist
Distribution of the number of committed instructions each cycle.
void squashAll(ThreadID tid)
Squashes all in flight instructions.
void generateTCEvent(ThreadID tid)
Records that commit needs to initiate a squash due to an external state update through the TC...
O3CPU * cpu
Pointer to O3CPU.
void regStats()
Registers statistics.
ProbePointArg< DynInstPtr > * ppCommit
Probe Points.
Distribution & init(Counter min, Counter max, Counter bkt)
Set the parameters of this distribution.
void deactivateThread(ThreadID tid)
Deschedules a thread from scheduling.
void setROB(ROB *rob_ptr)
Sets pointer to the ROB.
bool checkEmptyROB[Impl::MaxThreads]
Records if commit should check if the ROB is truly empty (see commit_impl.hh).
Fault interrupt
The interrupt fault.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void takeOverFrom()
Takes over from another CPU's thread.
void updateComInstStats(const DynInstPtr &inst)
Updates commit stats based on this instruction.
ProbePointArg< DynInstPtr > * ppSquash
To probe when an instruction is squashed.
bool isDoneSquashing(ThreadID tid) const
Reads the PC of the oldest head instruction.
void advancePC(PCState &pc, const StaticInstPtr &inst)
const Cycles iewToCommitDelay
IEW to Commit delay.
bool changedROBEntries()
Returns if any of the threads have the number of ROB entries changed on this cycle.
bool drainPending
Is a drain pending? Commit is looking for an instruction boundary while there are no pending interrup...
const FlagsType total
Print the total.
CommitPolicy commitPolicy
Commit policy used in SMT mode.
const ThreadID InvalidThreadID
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.
void drain()
Initializes the draining of commit.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
size_t numROBFreeEntries(ThreadID tid)
Returns the number of free ROB entries for a specific thread.
int16_t ThreadID
Thread index/ID type.
InstSeqNum lastCommitedSeqNum[Impl::MaxThreads]
The sequence number of the last commited instruction.
void drainSanityCheck() const
Perform sanity checks after a drain.
void resetEntries()
Re-adjust ROB partitioning.
std::list< ThreadID > priority_list
Priority List used for Commit Policy.
Stats::Vector statComVector
Total number of vector instructions.
bool isHeadReady(ThreadID tid)
Is the oldest instruction across all threads ready.
bool trapSquash[Impl::MaxThreads]
Records if a thread has to squash this cycle due to a trap.
int countInsts()
This is more of a debugging function than anything.
unsigned getMaxEntries(ThreadID tid)
Returns the maximum number of entries for a specific thread.
void commit()
Handles any squashes that are sent from IEW, and adds instructions to the ROB and tries to commit ins...
InstSeqNum youngestSeqNum[Impl::MaxThreads]
The sequence number of the youngest valid instruction in the ROB.
Stats::Scalar commitNonSpecStalls
Stat for the total number of times commit has had to stall due to a non- speculative instruction reac...
const ThreadID numThreads
Number of Active Threads.
ThreadID getCommittingThread()
Gets the thread to commit, based on the SMT policy.
virtual Addr nextInstAddr() const =0
void squashAfter(ThreadID tid, const DynInstPtr &head_inst)
Handle squashing from instruction with SquashAfter set.
void setIEWQueue(TimeBuffer< IEWStruct > *iq_ptr)
Sets the pointer to the queue coming from IEW.
Stats::Vector instsCommitted
Total number of instructions committed.
TimeBuffer< RenameStruct >::wire fromRename
Wire to read information from rename queue.
bool committedStores[Impl::MaxThreads]
Records if there were any stores committed this cycle.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Stats::Scalar commitSquashedInsts
Stat for the total number of squashed instructions discarded by commit.
TimeBuffer< IEWStruct > * iewQueue
IEW instruction queue interface.
DynInstPtr squashAfterInst[Impl::MaxThreads]
Instruction passed to squashAfter().
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
static const int NumArgumentRegs M5_VAR_USED
CommitStatus _nextStatus
Next commit status, to be set at the end of the cycle.
bool wroteToTimeBuffer
Records that commit has written to the time buffer this cycle.
Derived & ysubnames(const char **names)
void insertInst(const DynInstPtr &inst)
Function to insert an instruction into the ROB.
Impl::DynInstPtr DynInstPtr
Stats::Vector statComFunctionCalls
Total number of function calls.
const FlagsType dist
Print the distribution.
std::shared_ptr< FaultBase > Fault
std::string name() const
Returns the name of the DefaultCommit.
Stats::Vector statComInteger
Total number of integer instructions.
void clearStates(ThreadID tid)
Clear all thread-specific states.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
CommitStatus _status
Overall commit status.
bool canHandleInterrupts
True if last committed microop can be followed by an interrupt.
void startupStage()
Initializes stage by sending back the number of free entries.
void setThreads(std::vector< Thread *> &threads)
Sets the list of threads.
bool changedROBNumEntries[Impl::MaxThreads]
Records if the number of ROB entries has changed this cycle.
ProbePointArg< DynInstPtr > * ppCommitStall
std::vector< Thread * > thread
Vector of all of the threads.
void markCompletedInsts()
Marks completed instructions using information sent from IEW.