41 #ifndef __CPU_O3_COMMIT_IMPL_HH__ 42 #define __CPU_O3_COMMIT_IMPL_HH__ 48 #include "arch/utility.hh" 52 #include "config/the_isa.hh" 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/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)
98 fatal(
"commitWidth (%d) is larger than compiled limit (%d),\n" 99 "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
112 for (
ThreadID tid = 0; tid < Impl::MaxThreads; tid++) {
129 template <
class Impl>
133 return cpu->name() +
".commit";
136 template <
class Impl>
145 template <
class Impl>
149 using namespace Stats;
151 .
name(
name() +
".commitSquashedInsts")
152 .
desc(
"The number of squashed insts skipped by commit")
156 .
name(
name() +
".commitNonSpecStalls")
157 .
desc(
"The number of times commit has been forced to stall to " 158 "communicate backwards")
162 .
name(
name() +
".branchMispredicts")
163 .
desc(
"The number of times a branch was mispredicted")
168 .
name(
name() +
".committed_per_cycle")
169 .
desc(
"Number of insts commited each cycle")
176 .
desc(
"Number of instructions committed")
183 .
desc(
"Number of ops (including micro ops) committed")
190 .
desc(
"Number of s/w prefetches committed")
197 .
desc(
"Number of memory references committed")
204 .
desc(
"Number of loads committed")
211 .
desc(
"Number of atomic instructions committed")
218 .
desc(
"Number of memory barriers committed")
225 .
desc(
"Number of branches committed")
232 .
desc(
"Number of committed floating point instructions.")
239 .
desc(
"Number of committed Vector instructions.")
246 .
desc(
"Number of committed integer instructions.")
253 .
desc(
"Number of function calls committed.")
260 .
desc(
"Class of committed instruction")
267 .
desc(
"number cycles where commit BW limit reached")
271 template <
class Impl>
278 template <
class Impl>
291 template <
class Impl>
301 template <
class Impl>
311 template <
class Impl>
321 template <
class Impl>
335 template <
class Impl>
343 template <
class Impl>
350 template <
class Impl>
359 toIEW->commitInfo[tid].usedROB =
true;
361 toIEW->commitInfo[tid].emptyROB =
true;
366 cpu->activateStage(O3CPU::CommitIdx);
368 cpu->activityThisCycle();
371 template <
class Impl>
387 template <
class Impl>
394 template <
class Impl>
402 template <
class Impl>
410 template <
class Impl>
438 template <
class Impl>
454 template <
class Impl>
467 template <
class Impl>
475 while (threads != end) {
488 DPRINTF(Activity,
"Deactivating stage.\n");
489 cpu->deactivateStage(O3CPU::CommitIdx);
491 DPRINTF(Activity,
"Activating stage.\n");
492 cpu->activateStage(O3CPU::CommitIdx);
498 template <
class Impl>
505 while (threads != end) {
516 template <
class Impl>
523 template <
class Impl>
527 DPRINTF(Commit,
"Generating trap event for [tid:%i]\n", tid);
536 cpu->schedule(trap,
cpu->clockEdge(latency));
538 thread[tid]->trapPending =
true;
541 template <
class Impl>
546 DPRINTF(Commit,
"Generating TC squash event for [tid:%i]\n", tid);
551 template <
class Impl>
571 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
575 toIEW->commitInfo[tid].squash =
true;
579 toIEW->commitInfo[tid].robSquashing =
true;
581 toIEW->commitInfo[tid].mispredictInst = NULL;
582 toIEW->commitInfo[tid].squashInst = NULL;
584 toIEW->commitInfo[tid].pc =
pc[tid];
587 template <
class Impl>
593 DPRINTF(Commit,
"Squashing from trap, restarting at PC %s\n",
pc[tid]);
595 thread[tid]->trapPending =
false;
596 thread[tid]->noSquashFromTC =
false;
602 cpu->activityThisCycle();
605 template <
class Impl>
611 DPRINTF(Commit,
"Squashing from TC, restarting at PC %s\n",
pc[tid]);
613 thread[tid]->noSquashFromTC =
false;
614 assert(!
thread[tid]->trapPending);
617 cpu->activityThisCycle();
622 template <
class Impl>
626 DPRINTF(Commit,
"Squashing after squash after request, " 627 "restarting at PC %s\n",
pc[tid]);
637 cpu->activityThisCycle();
640 template <
class Impl>
644 DPRINTF(Commit,
"Executing squash after for [tid:%i] inst [sn:%llu]\n",
645 tid, head_inst->seqNum);
652 template <
class Impl>
667 while (threads != end) {
679 DPRINTF(Commit,
"[tid:%i] Still Squashing, cannot commit any" 680 " insts this cycle.\n", tid);
682 toIEW->commitInfo[tid].robSquashing =
true;
694 while (threads != end) {
704 DPRINTF(Commit,
"[tid:%i] Instruction [sn:%llu] PC %s is head of" 705 " ROB and ready to commit\n",
706 tid, inst->seqNum, inst->pcState());
713 DPRINTF(Commit,
"[tid:%i] Can't commit, Instruction [sn:%llu] PC " 714 "%s is head of ROB and not ready\n",
715 tid, inst->seqNum, inst->pcState());
718 DPRINTF(Commit,
"[tid:%i] ROB has %d insts & %d free entries.\n",
724 DPRINTF(Activity,
"Activity This Cycle.\n");
725 cpu->activityThisCycle();
731 template <
class Impl>
736 if (!
cpu->checkInterrupts(
cpu->tcBase(0))) {
737 DPRINTF(Commit,
"Pending interrupt is cleared by master before " 738 "it got handled. Restart fetching from the orig path.\n");
739 toIEW->commitInfo[0].clearInterrupt =
true;
750 DPRINTF(Commit,
"Interrupt detected.\n");
753 toIEW->commitInfo[0].clearInterrupt =
true;
755 assert(!
thread[0]->noSquashFromTC);
756 thread[0]->noSquashFromTC =
true;
759 cpu->checker->handlePendingInt();
765 cpu->processInterrupts(
cpu->getInterrupts());
767 thread[0]->noSquashFromTC =
false;
778 DPRINTF(Commit,
"Interrupt pending: instruction is %sin " 779 "flight, ROB is %sempty\n",
781 cpu->instList.empty() ?
"" :
"not " );
785 template <
class Impl>
807 toIEW->commitInfo[0].interruptPending =
true;
810 template <
class Impl>
816 if (
cpu->checkInterrupts(
cpu->tcBase(0)))
826 int num_squashing_threads = 0;
828 while (threads != end) {
841 if (
cpu->isThreadExiting(tid))
842 cpu->scheduleThreadExitEvent(tid);
860 if (
fromIEW->mispredictInst[tid]) {
862 "[tid:%i] Squashing due to branch mispred " 863 "PC:%#x [sn:%llu]\n",
865 fromIEW->mispredictInst[tid]->instAddr(),
869 "[tid:%i] Squashing due to order violation [sn:%llu]\n",
870 tid,
fromIEW->squashedSeqNum[tid]);
873 DPRINTF(Commit,
"[tid:%i] Redirecting to PC %#x\n",
875 fromIEW->pc[tid].nextInstAddr());
883 if (
fromIEW->includeSquashInst[tid]) {
894 toIEW->commitInfo[tid].doneSeqNum = squashed_inst;
896 toIEW->commitInfo[tid].squash =
true;
900 toIEW->commitInfo[tid].robSquashing =
true;
902 toIEW->commitInfo[tid].mispredictInst =
904 toIEW->commitInfo[tid].branchTaken =
906 toIEW->commitInfo[tid].squashInst =
908 if (
toIEW->commitInfo[tid].mispredictInst) {
909 if (
toIEW->commitInfo[tid].mispredictInst->isUncondCtrl()) {
910 toIEW->commitInfo[tid].branchTaken =
true;
919 num_squashing_threads++;
925 if (num_squashing_threads) {
940 while (threads != end) {
944 toIEW->commitInfo[tid].usedROB =
true;
964 toIEW->commitInfo[tid].usedROB =
true;
965 toIEW->commitInfo[tid].emptyROB =
true;
973 template <
class Impl>
986 DPRINTF(Commit,
"Trying to commit instructions in the ROB.\n");
988 unsigned num_committed = 0;
1007 ThreadID tid = head_inst->threadNumber;
1009 assert(tid == commit_thread);
1012 "Trying to commit head instruction, [tid:%i] [sn:%llu]\n",
1013 tid, head_inst->seqNum);
1017 if (head_inst->isSquashed()) {
1019 DPRINTF(Commit,
"Retiring squashed instruction from " 1031 pc[tid] = head_inst->pcState();
1038 thread[tid]->funcExeInst++;
1041 bool commit_success =
commitHead(head_inst, num_committed);
1043 if (commit_success) {
1051 toIEW->commitInfo[tid].doneSeqNum = head_inst->seqNum;
1058 assert(!head_inst->isStoreConditional() ||
1059 head_inst->isCompleted() ||
1060 !head_inst->readPredicate());
1063 head_inst->updateMiscRegs();
1068 cpu->checker->verify(head_inst);
1080 if (head_inst->isSquashAfter())
1085 !
thread[tid]->trapPending) {
1089 DPRINTF(Drain,
"Draining: %i:%s\n", tid,
pc[tid]);
1091 cpu->commitDrained(tid);
1096 bool onInstBoundary = !head_inst->isMicroop() ||
1097 head_inst->isLastMicroop() ||
1098 !head_inst->isDelayedCommit();
1100 if (onInstBoundary) {
1105 assert(!
thread[tid]->noSquashFromTC &&
1106 !
thread[tid]->trapPending);
1108 oldpc =
pc[tid].instAddr();
1109 thread[tid]->pcEventQueue.service(
1110 oldpc,
thread[tid]->getTC());
1115 "PC skip function event, stopping commit\n");
1128 onInstBoundary &&
cpu->checkInterrupts(
cpu->tcBase(0)))
1131 DPRINTF(Commit,
"Unable to commit head instruction PC:%s " 1132 "[tid:%i] [sn:%llu].\n",
1133 head_inst->pcState(), tid ,head_inst->seqNum);
1139 DPRINTF(CommitRate,
"%i\n", num_committed);
1147 template <
class Impl>
1153 ThreadID tid = head_inst->threadNumber;
1157 if (!head_inst->isExecuted()) {
1160 thread[tid]->funcExeInst--;
1164 assert(head_inst->isNonSpeculative() || head_inst->isStoreConditional()
1165 || head_inst->isMemBarrier() || head_inst->isWriteBarrier()
1166 || head_inst->isAtomic()
1167 || (head_inst->isLoad() && head_inst->strictlyOrdered()));
1170 "Encountered a barrier or non-speculative " 1171 "instruction [tid:%i] [sn:%llu] " 1172 "at the head of the ROB, PC %s.\n",
1173 tid, head_inst->seqNum, head_inst->pcState());
1175 if (inst_num > 0 ||
iewStage->hasStoresToWB(tid)) {
1177 "[tid:%i] [sn:%llu] " 1178 "Waiting for all stores to writeback.\n",
1179 tid, head_inst->seqNum);
1183 toIEW->commitInfo[tid].nonSpecSeqNum = head_inst->seqNum;
1187 head_inst->clearCanCommit();
1189 if (head_inst->isLoad() && head_inst->strictlyOrdered()) {
1190 DPRINTF(Commit,
"[tid:%i] [sn:%llu] " 1191 "Strictly ordered load, PC %s.\n",
1192 tid, head_inst->seqNum, head_inst->pcState());
1193 toIEW->commitInfo[tid].strictlyOrdered =
true;
1194 toIEW->commitInfo[tid].strictlyOrderedLoad = head_inst;
1202 if (head_inst->isThreadSync()) {
1204 panic(
"Thread sync instructions are not handled yet.\n");
1208 Fault inst_fault = head_inst->getFault();
1211 if (!head_inst->isStore() && inst_fault ==
NoFault) {
1212 head_inst->setCompleted();
1216 DPRINTF(Commit,
"Inst [tid:%i] [sn:%llu] PC %s has a fault\n",
1217 tid, head_inst->seqNum, head_inst->pcState());
1219 if (
iewStage->hasStoresToWB(tid) || inst_num > 0) {
1221 "[tid:%i] [sn:%llu] " 1222 "Stores outstanding, fault must wait.\n",
1223 tid, head_inst->seqNum);
1227 head_inst->setCompleted();
1233 cpu->checker->verify(head_inst);
1236 assert(!
thread[tid]->noSquashFromTC);
1240 thread[tid]->noSquashFromTC =
true;
1248 cpu->trap(inst_fault, tid,
1249 head_inst->notAnInst() ?
1251 head_inst->staticInst);
1254 thread[tid]->noSquashFromTC =
false;
1259 "[tid:%i] [sn:%llu] Committing instruction with fault\n",
1260 tid, head_inst->seqNum);
1261 if (head_inst->traceData) {
1262 if (
DTRACE(ExecFaulting)) {
1263 head_inst->traceData->setFetchSeq(head_inst->seqNum);
1264 head_inst->traceData->setCPSeq(
thread[tid]->numOp);
1265 head_inst->traceData->dump();
1267 delete head_inst->traceData;
1268 head_inst->traceData = NULL;
1279 if (
thread[tid]->profile) {
1280 thread[tid]->profilePC = head_inst->instAddr();
1282 thread[tid]->getTC(), head_inst->staticInst);
1285 thread[tid]->profileNode = node;
1288 if (head_inst->isControl()) {
1295 "[tid:%i] [sn:%llu] Committing instruction with PC %s\n",
1296 tid, head_inst->seqNum, head_inst->pcState());
1297 if (head_inst->traceData) {
1298 head_inst->traceData->setFetchSeq(head_inst->seqNum);
1299 head_inst->traceData->setCPSeq(
thread[tid]->numOp);
1300 head_inst->traceData->dump();
1301 delete head_inst->traceData;
1302 head_inst->traceData = NULL;
1304 if (head_inst->isReturn()) {
1306 "[tid:%i] [sn:%llu] Return Instruction Committed PC %s \n",
1307 tid, head_inst->seqNum, head_inst->pcState());
1311 for (
int i = 0;
i < head_inst->numDestRegs();
i++) {
1312 renameMap[tid]->setEntry(head_inst->flattenedDestRegIdx(
i),
1313 head_inst->renamedDestRegIdx(
i));
1320 if (
DTRACE(O3PipeView)) {
1321 head_inst->commitTick =
curTick() - head_inst->fetchTick;
1326 if (head_inst->isStore() || head_inst->isAtomic())
1333 template <
class Impl>
1337 DPRINTF(Commit,
"Getting instructions from Rename stage.\n");
1342 for (
int inst_num = 0; inst_num < insts_to_process; ++inst_num) {
1346 if (!inst->isSquashed() &&
1351 DPRINTF(Commit,
"[tid:%i] [sn:%llu] Inserting PC %s into ROB.\n",
1352 inst->seqNum, tid, inst->pcState());
1360 DPRINTF(Commit,
"[tid:%i] [sn:%llu] " 1361 "Instruction PC %s was squashed, skipping.\n",
1362 inst->seqNum, tid, inst->pcState());
1367 template <
class Impl>
1373 for (
int inst_num = 0; inst_num <
fromIEW->
size; ++inst_num) {
1374 assert(
fromIEW->insts[inst_num]);
1375 if (!
fromIEW->insts[inst_num]->isSquashed()) {
1376 DPRINTF(Commit,
"[tid:%i] Marking PC %s, [sn:%llu] ready " 1378 fromIEW->insts[inst_num]->threadNumber,
1379 fromIEW->insts[inst_num]->pcState(),
1380 fromIEW->insts[inst_num]->seqNum);
1383 fromIEW->insts[inst_num]->setCanCommit();
1388 template <
class Impl>
1394 if (!inst->isMicroop() || inst->isLastMicroop())
1400 if (!inst->isNop() && !inst->isInstPrefetch()) {
1401 cpu->instDone(tid, inst);
1407 if (inst->isControl())
1413 if (inst->isMemRef()) {
1416 if (inst->isLoad()) {
1420 if (inst->isAtomic()) {
1425 if (inst->isMemBarrier()) {
1430 if (inst->isInteger())
1434 if (inst->isFloating())
1437 if (inst->isVector())
1451 template <
class Impl>
1458 case CommitPolicy::Aggressive:
1464 case CommitPolicy::RoundRobin:
1467 case CommitPolicy::OldestReady:
1487 template<
class Impl>
1494 while (pri_iter != end) {
1515 template<
class Impl>
1519 unsigned oldest = 0;
1525 while (threads != end) {
1540 }
else if (head_inst->seqNum < oldest) {
1554 #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 ...
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...
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
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 advancePC(PCState &pc, const StaticInstPtr &inst)
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.
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.
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.