Go to the documentation of this file.
55 #include "debug/Activity.hh"
56 #include "debug/Drain.hh"
57 #include "debug/IEW.hh"
58 #include "debug/O3PipeView.hh"
59 #include "params/BaseO3CPU.hh"
68 : issueToExecQueue(params.backComSize, params.forwardComSize),
70 instQueue(_cpu, this, params),
71 ldstQueue(_cpu, this, params),
72 fuPool(params.fuPool),
73 commitToIEWDelay(params.commitToIEWDelay),
74 renameToIEWDelay(params.renameToIEWDelay),
75 issueToExecuteDelay(params.issueToExecuteDelay),
76 dispatchWidth(params.dispatchWidth),
77 issueWidth(params.issueWidth),
80 wbWidth(params.wbWidth),
81 numThreads(params.numThreads),
85 fatal(
"dispatchWidth (%d) is larger than compiled limit (%d),\n"
86 "\tincrease MaxWidth in src/cpu/o3/limits.hh\n",
89 fatal(
"issueWidth (%d) is larger than compiled limit (%d),\n"
90 "\tincrease MaxWidth in src/cpu/o3/limits.hh\n",
93 fatal(
"wbWidth (%d) is larger than compiled limit (%d),\n"
94 "\tincrease MaxWidth in src/cpu/o3/limits.hh\n",
145 : statistics::
Group(cpu,
"iew"),
146 ADD_STAT(idleCycles, statistics::units::Cycle::get(),
147 "Number of cycles IEW is idle"),
148 ADD_STAT(squashCycles, statistics::units::Cycle::get(),
149 "Number of cycles IEW is squashing"),
150 ADD_STAT(blockCycles, statistics::units::Cycle::get(),
151 "Number of cycles IEW is blocking"),
152 ADD_STAT(unblockCycles, statistics::units::Cycle::get(),
153 "Number of cycles IEW is unblocking"),
155 "Number of instructions dispatched to IQ"),
157 "Number of squashed instructions skipped by dispatch"),
159 "Number of dispatched load instructions"),
161 "Number of dispatched store instructions"),
163 "Number of dispatched non-speculative instructions"),
165 "Number of times the IQ has become full, causing a stall"),
167 "Number of times the LSQ has become full, causing a stall"),
168 ADD_STAT(memOrderViolationEvents, statistics::units::
Count::get(),
169 "Number of memory order violations"),
170 ADD_STAT(predictedTakenIncorrect, statistics::units::
Count::get(),
171 "Number of branches that were predicted taken incorrectly"),
172 ADD_STAT(predictedNotTakenIncorrect, statistics::units::
Count::get(),
173 "Number of branches that were predicted not taken incorrectly"),
175 "Number of branch mispredicts detected at execute",
176 predictedTakenIncorrect + predictedNotTakenIncorrect),
177 executedInstStats(cpu),
179 "Cumulative count of insts sent to commit"),
181 "Cumulative count of insts written-back"),
183 "Number of instructions producing a value"),
185 "Number of instructions consuming a value"),
186 ADD_STAT(wbRate, statistics::units::Rate<
187 statistics::units::
Count, statistics::units::Cycle>::get(),
188 "Insts written-back per cycle"),
189 ADD_STAT(wbFanout, statistics::units::Rate<
190 statistics::units::
Count, statistics::units::
Count>::get(),
191 "Average fanout of values written-back")
221 "Number of squashed instructions skipped in execute"),
223 "Number of swp insts executed")
234 toRename->iewInfo[tid].usedIQ =
true;
235 toRename->iewInfo[tid].freeIQEntries =
238 toRename->iewInfo[tid].usedLSQ =
true;
239 toRename->iewInfo[tid].freeLQEntries =
241 toRename->iewInfo[tid].freeSQEntries =
256 toRename->iewInfo[tid].usedIQ =
true;
257 toRename->iewInfo[tid].freeIQEntries =
260 toRename->iewInfo[tid].usedLSQ =
true;
321 if (!
insts[tid].empty()) {
322 DPRINTF(Drain,
"%i: Insts not empty.\n", tid);
326 DPRINTF(Drain,
"%i: Skid buffer not empty.\n", tid);
336 DPRINTF(Drain,
"FU pool still busy.\n");
382 DPRINTF(
IEW,
"[tid:%i] Squashing all instructions.\n", tid);
393 "Removing skidbuffer instructions until "
394 "[sn:%llu] [tid:%i]\n",
399 toRename->iewInfo[tid].dispatchedToLQ++;
403 toRename->iewInfo[tid].dispatchedToSQ++;
406 toRename->iewInfo[tid].dispatched++;
417 DPRINTF(
IEW,
"[tid:%i] [sn:%llu] Squashing from a specific instruction,"
419 "\n", tid, inst->seqNum, inst->pcState() );
422 inst->seqNum <
toCommit->squashedSeqNum[tid]) {
424 toCommit->squashedSeqNum[tid] = inst->seqNum;
425 toCommit->branchTaken[tid] = inst->pcState().branching();
428 inst->staticInst->advancePC(*
toCommit->pc[tid]);
430 toCommit->mispredictInst[tid] = inst;
431 toCommit->includeSquashInst[tid] =
false;
441 DPRINTF(
IEW,
"[tid:%i] Memory violation, squashing violator and younger "
442 "insts, PC: %s [sn:%llu].\n", tid, inst->pcState(), inst->seqNum);
450 inst->seqNum <=
toCommit->squashedSeqNum[tid]) {
453 toCommit->squashedSeqNum[tid] = inst->seqNum;
455 toCommit->mispredictInst[tid] = NULL;
458 toCommit->includeSquashInst[tid] =
true;
485 DPRINTF(
IEW,
"[tid:%i] Reading instructions out of the skid "
486 "buffer %u.\n",tid, tid);
493 DPRINTF(
IEW,
"[tid:%i] Done unblocking.\n",tid);
549 DPRINTF(
IEW,
"Current wb cycle: %i, width: %i, numInst: %i\nwbActual:%i\n",
561 while (!
insts[tid].empty()) {
562 inst =
insts[tid].front();
566 DPRINTF(
IEW,
"[tid:%i] Inserting [sn:%lli] PC:%s into "
567 "dispatch skidBuffer %i\n",tid, inst->seqNum,
568 inst->pcState(),tid);
574 "Skidbuffer Exceeded Max Size");
585 while (threads != end) {
587 unsigned thread_count =
skidBuffer[tid].size();
588 if (max < thread_count)
601 while (threads != end) {
614 bool any_unblocking =
false;
619 while (threads != end) {
623 any_unblocking =
true;
656 if (
fromCommit->commitInfo[tid].robSquashing) {
657 DPRINTF(
IEW,
"[tid:%i] Stall from Commit stage detected.\n",tid);
660 DPRINTF(
IEW,
"[tid:%i] Stall: IQ is full.\n",tid);
691 if (
fromCommit->commitInfo[tid].robSquashing) {
692 DPRINTF(
IEW,
"[tid:%i] ROB is still squashing.\n", tid);
708 DPRINTF(
IEW,
"[tid:%i] Done blocking, switching to unblocking.\n",
721 DPRINTF(
IEW,
"[tid:%i] Done squashing, switching to running.\n",
736 assert(
insts[tid].empty());
738 for (
int i = 0;
i < insts_from_rename; ++
i) {
746 DPRINTF(
IEW,
"[tid:%i] Removing incoming rename instructions\n", tid);
748 while (!
insts[tid].empty()) {
750 if (
insts[tid].front()->isLoad()) {
751 toRename->iewInfo[tid].dispatchedToLQ++;
753 if (
insts[tid].front()->isStore() ||
754 insts[tid].front()->isAtomic()) {
755 toRename->iewInfo[tid].dispatchedToSQ++;
758 toRename->iewInfo[tid].dispatched++;
773 DPRINTF(Activity,
"Activity this cycle.\n");
780 DPRINTF(Activity,
"Activating stage.\n");
787 DPRINTF(Activity,
"Deactivating stage.\n");
812 DPRINTF(
IEW,
"[tid:%i] Not blocked, so attempting to run "
843 std::queue<DynInstPtr> &insts_to_dispatch =
847 int insts_to_add = insts_to_dispatch.size();
850 bool add_to_iq =
false;
851 int dis_num_inst = 0;
855 for ( ; dis_num_inst < insts_to_add &&
859 inst = insts_to_dispatch.front();
862 DPRINTF(
IEW,
"[tid:%i] Issue: Examining instruction from skid "
869 DPRINTF(
IEW,
"[tid:%i] Issue: Adding PC %s [sn:%lli] [tid:%i] to "
871 tid, inst->pcState(), inst->seqNum, inst->threadNumber);
878 if (inst->isSquashed()) {
879 DPRINTF(
IEW,
"[tid:%i] Issue: Squashed instruction encountered, "
880 "not adding to IQ.\n", tid);
884 insts_to_dispatch.pop();
887 if (inst->isLoad()) {
888 toRename->iewInfo[tid].dispatchedToLQ++;
890 if (inst->isStore() || inst->isAtomic()) {
891 toRename->iewInfo[tid].dispatchedToSQ++;
894 toRename->iewInfo[tid].dispatched++;
901 DPRINTF(
IEW,
"[tid:%i] Issue: IQ has become full.\n", tid);
919 DPRINTF(
IEW,
"[tid:%i] Issue: %s has become full.\n",tid,
920 inst->isLoad() ?
"LQ" :
"SQ");
938 const int htmDepth = numHtmStarts - numHtmStops;
944 inst->clearHtmTransactionalState();
949 if (inst->isAtomic()) {
950 DPRINTF(
IEW,
"[tid:%i] Issue: Memory instruction "
951 "encountered, adding to LSQ.\n", tid);
960 inst->setCanCommit();
966 toRename->iewInfo[tid].dispatchedToSQ++;
967 }
else if (inst->isLoad()) {
968 DPRINTF(
IEW,
"[tid:%i] Issue: Memory instruction "
969 "encountered, adding to LSQ.\n", tid);
979 toRename->iewInfo[tid].dispatchedToLQ++;
980 }
else if (inst->isStore()) {
981 DPRINTF(
IEW,
"[tid:%i] Issue: Memory instruction "
982 "encountered, adding to LSQ.\n", tid);
988 if (inst->isStoreConditional()) {
993 inst->setCanCommit();
1002 toRename->iewInfo[tid].dispatchedToSQ++;
1003 }
else if (inst->isReadBarrier() || inst->isWriteBarrier()) {
1005 inst->setCanCommit();
1008 }
else if (inst->isNop()) {
1009 DPRINTF(
IEW,
"[tid:%i] Issue: Nop instruction encountered, "
1010 "skipping.\n", tid);
1013 inst->setExecuted();
1014 inst->setCanCommit();
1022 assert(!inst->isExecuted());
1026 if (add_to_iq && inst->isNonSpeculative()) {
1027 DPRINTF(
IEW,
"[tid:%i] Issue: Nonspeculative instruction "
1028 "encountered, skipping.\n", tid);
1031 inst->setCanCommit();
1047 insts_to_dispatch.pop();
1049 toRename->iewInfo[tid].dispatched++;
1054 inst->dispatchTick =
curTick() - inst->fetchTick;
1059 if (!insts_to_dispatch.empty()) {
1060 DPRINTF(
IEW,
"[tid:%i] Issue: Bandwidth Full. Blocking.\n", tid);
1079 std::cout <<
"Available Instructions: ";
1083 if (inst%3==0) std::cout <<
"\n\t";
1085 std::cout <<
"PC: " <<
fromIssue->insts[inst]->pcState()
1086 <<
" TN: " <<
fromIssue->insts[inst]->threadNumber
1087 <<
" SN: " <<
fromIssue->insts[inst]->seqNum <<
" | ";
1105 while (threads != end) {
1117 for (; inst_num < insts_to_execute;
1120 DPRINTF(
IEW,
"Execute: Executing instructions from IQ.\n");
1124 DPRINTF(
IEW,
"Execute: Processing PC %s, [tid:%i] [sn:%llu].\n",
1125 inst->pcState(), inst->threadNumber,inst->seqNum);
1132 if (inst->isSquashed()) {
1133 DPRINTF(
IEW,
"Execute: Instruction was squashed. PC: %s, [tid:%i]"
1134 " [sn:%llu]\n", inst->pcState(), inst->threadNumber,
1139 inst->setExecuted();
1143 inst->setCanCommit();
1155 if (inst->isMemRef()) {
1156 DPRINTF(
IEW,
"Execute: Calculating address for memory "
1160 if (inst->isAtomic()) {
1164 if (inst->isTranslationDelayed() &&
1168 DPRINTF(
IEW,
"Execute: Delayed translation, deferring "
1173 }
else if (inst->isLoad()) {
1178 if (inst->isTranslationDelayed() &&
1182 DPRINTF(
IEW,
"Execute: Delayed translation, deferring "
1188 if (inst->isDataPrefetch() || inst->isInstPrefetch()) {
1191 }
else if (inst->isStore()) {
1194 if (inst->isTranslationDelayed() &&
1198 DPRINTF(
IEW,
"Execute: Delayed translation, deferring "
1205 if (fault !=
NoFault || !inst->readPredicate() ||
1206 !inst->isStoreConditional()) {
1211 inst->setExecuted();
1220 panic(
"Unexpected memory type!\n");
1228 if (inst->getFault() ==
NoFault) {
1230 if (!inst->readPredicate())
1231 inst->forwardOldRegs();
1234 inst->setExecuted();
1253 toCommit->squashedSeqNum[tid] > inst->seqNum) {
1257 bool loadNotExecuted = !inst->isExecuted() && inst->isLoad();
1259 if (inst->mispredicted() && !loadNotExecuted) {
1263 "Branch mispredict detected.\n",
1266 "Predicted target was PC: %s\n",
1267 tid, inst->seqNum, inst->readPredTarg());
1269 "Redirecting fetch to PC: %s\n",
1270 tid, inst->seqNum, inst->pcState());
1276 if (inst->readPredTaken()) {
1282 assert(inst->isMemRef());
1289 DPRINTF(
IEW,
"LDSTQ detected a violation. Violator PC: %s "
1290 "[sn:%lli], inst PC: %s [sn:%lli]. Addr is: %#x.\n",
1291 violator->pcState(), violator->seqNum,
1292 inst->pcState(), inst->seqNum, inst->physEffAddr);
1308 assert(inst->isMemRef());
1312 DPRINTF(
IEW,
"LDSTQ detected a violation. Violator PC: "
1313 "%s, inst PC: %s. Addr is: %#x.\n",
1314 violator->pcState(), inst->pcState(),
1316 DPRINTF(
IEW,
"Violation will not be handled because "
1317 "already squashing\n");
1350 for (
int inst_num = 0; inst_num <
wbWidth &&
1351 toCommit->insts[inst_num]; inst_num++) {
1355 DPRINTF(
IEW,
"Sending instructions to commit, [sn:%lli] PC %s.\n",
1356 inst->seqNum, inst->pcState());
1368 if (!inst->isSquashed() && inst->isExecuted() &&
1369 inst->getFault() ==
NoFault) {
1372 for (
int i = 0;
i < inst->numDestRegs();
i++) {
1374 if (inst->renamedDestIdx(
i)->
1375 getNumPinnedWritesToComplete() == 0) {
1376 DPRINTF(
IEW,
"Setting Destination Register %i (%s)\n",
1377 inst->renamedDestIdx(
i)->index(),
1378 inst->renamedDestIdx(
i)->className());
1412 while (threads != end) {
1415 DPRINTF(
IEW,
"Issue: Processing [tid:%i]\n",tid);
1436 bool broadcast_free_entries =
false;
1442 broadcast_free_entries =
true;
1454 while (threads != end) {
1460 if (
fromCommit->commitInfo[tid].doneSeqNum != 0 &&
1472 if (
fromCommit->commitInfo[tid].nonSpecSeqNum != 0) {
1475 if (
fromCommit->commitInfo[tid].strictlyOrdered) {
1477 fromCommit->commitInfo[tid].strictlyOrderedLoad);
1478 fromCommit->commitInfo[tid].strictlyOrderedLoad->setAtCommit();
1485 if (broadcast_free_entries) {
1486 toFetch->iewInfo[tid].iqCount =
1488 toFetch->iewInfo[tid].ldstqCount =
1491 toRename->iewInfo[tid].usedIQ =
true;
1492 toRename->iewInfo[tid].freeIQEntries =
1494 toRename->iewInfo[tid].usedLSQ =
true;
1496 toRename->iewInfo[tid].freeLQEntries =
1498 toRename->iewInfo[tid].freeSQEntries =
1504 DPRINTF(
IEW,
"[tid:%i], Dispatch dispatched %i instructions.\n",
1505 tid,
toRename->iewInfo[tid].dispatched);
1508 DPRINTF(
IEW,
"IQ has %i free entries (Can schedule: %i). "
1509 "LQ has %i free entries. SQ has %i free entries.\n",
1516 DPRINTF(Activity,
"Activity this cycle.\n");
1529 if (debug::O3PipeView) {
1530 inst->completeTick =
curTick() - inst->fetchTick;
1537 if (inst->isControl()) {
1544 if (inst->isMemRef()) {
1547 if (inst->isLoad()) {
1560 toCommit->squashedSeqNum[tid] > inst->seqNum) {
1562 if (inst->mispredicted()) {
1566 "Branch mispredict detected.\n",
1568 DPRINTF(
IEW,
"[tid:%i] [sn:%llu] Predicted target was PC: %s\n",
1569 tid, inst->seqNum, inst->readPredTarg());
1571 "Redirecting fetch to PC: %s\n",
1572 tid, inst->seqNum, inst->pcState());
1576 if (inst->readPredTaken()) {
void rescheduleMemInst(const DynInstPtr &resched_inst)
Reschedules a memory instruction.
Tick curTick()
The universal simulation clock.
#define fatal(...)
This implements a cprintf based fatal() function.
void insertStore(const DynInstPtr &store_inst)
Inserts a store into the LSQ.
void drainSanityCheck() const
Perform sanity checks after a drain.
int skidCount()
Returns the max of the number of entries in all of the skid buffers.
statistics::Scalar unblockCycles
Stat for total number of unblocking cycles.
statistics::Scalar dispStoreInsts
Stat for total number of dispatched store instructions.
void commitLoads(InstSeqNum &youngest_inst, ThreadID tid)
Commits loads up until the given sequence number for a specific thread.
constexpr decltype(nullptr) NoFault
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets main time buffer used for backwards communication.
TimeBuffer< TimeStruct >::wire toFetch
Wire to write information heading to previous stages.
std::queue< DynInstPtr > insts[MaxThreads]
Queue of all instructions coming from rename this cycle.
bool skidsEmpty()
Returns if all of the skid buffers are empty.
gem5::o3::IEW::IEWStats::ExecutedInstStats executedInstStats
ProbePointArg< DynInstPtr > * ppToCommit
To probe when instruction execution is complete.
statistics::Formula wbRate
Number of instructions per cycle written back.
TimeBuffer< RenameStruct > * renameQueue
Rename instruction queue interface.
statistics::Scalar blockCycles
Stat for total number of blocking cycles.
bool isFull()
Returns whether or not the IQ is full.
statistics::Vector producerInst
Number of instructions that wake consumers.
void checkSignalsAndUpdate(ThreadID tid)
Processes inputs and changes state accordingly.
void updateExeInstStats(const DynInstPtr &inst)
Updates execution stats based on the instruction.
int getCount()
Returns the number of instructions in all of the queues.
void writebackStores()
Attempts to write back stores until all cache ports are used or the interface becomes blocked.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets the pointer to the list of active threads.
StageStatus dispatchStatus[MaxThreads]
Dispatch status.
void updateStatus()
Updates overall IEW status based on all of the stages' statuses.
void replayMemInst(const DynInstPtr &inst)
Re-executes all rescheduled memory instructions.
ProbePointArg< DynInstPtr > * ppMispredict
Probe points.
statistics::Scalar predictedNotTakenIncorrect
Stat for total number of incorrect predicted not taken branches.
void takeOverFrom()
Takes over from another CPU's thread.
void takeOverFrom()
Takes over from another CPU's thread.
void checkMisprediction(const DynInstPtr &inst)
Check misprediction
TimeBuffer< RenameStruct >::wire fromRename
Wire to get rename's output from rename queue.
gem5::o3::IEW::IEWStats iewStats
void commit(const InstSeqNum &inst, ThreadID tid=0)
Commits all instructions up to and including the given sequence number, for a specific thread.
void clearStates(ThreadID tid)
Clear all thread-specific states.
void wakeDependents(const DynInstPtr &inst)
Wakes all dependents of a completed instruction.
Cycles commitToIEWDelay
Commit to IEW delay.
statistics::Scalar iqFullEvents
Stat for number of times the IQ becomes full.
TimeBuffer< IssueStruct > issueToExecQueue
Issue stage queue.
statistics::Formula wbFanout
Average number of woken instructions per writeback.
Implements a simple scoreboard to track which registers are ready.
void skidInsert(ThreadID tid)
Inserts unused instructions of a thread into the skid buffer.
void writebackInsts()
Writebacks instructions.
statistics::Scalar intInstQueueReads
void emptyRenameInsts(ThreadID tid)
Removes instructions from rename from a thread's instruction list.
std::list< ThreadID > * activeThreads
Pointer to list of active threads.
StageStatus exeStatus
Execute status.
TimeBuffer< IEWStruct >::wire toCommit
Wire to write infromation heading to commit.
void dispatchInsts(ThreadID tid)
Dispatches instructions to IQ and LSQ.
void sortInsts()
Sorts instructions coming from rename into lists separated by thread.
IEW(CPU *_cpu, const BaseO3CPUParams ¶ms)
Constructs a IEW with the given parameters.
bool checkStall(ThreadID tid)
Checks if any of the stall conditions are currently true.
void recordProducer(const DynInstPtr &inst)
Records the instruction as the producer of a register without adding it to the rest of the IQ.
void cacheUnblocked()
Notify instruction queue that a previous blockage has resolved.
void takeOverFrom()
Takes over execution from another CPU's thread.
TimeBuffer< TimeStruct >::wire toRename
Wire to write information heading to previous stages.
void squash(ThreadID tid)
Squashes instructions in IEW for a specific thread.
statistics::Scalar numSquashedInsts
Stat for total number of squashed instructions skipped at execute.
statistics::Vector writebackCount
Number of instructions that writeback.
void setIssueToExecuteQueue(TimeBuffer< IssueStruct > *i2eQueue)
Sets the timer buffer between issue and execute.
Fault executeStore(const DynInstPtr &inst)
Executes a store.
void wakeCPU()
Tells the CPU to wakeup if it has descheduled itself due to no activity.
void startupStage()
Initializes stage; sends back the number of free IQ and LSQ entries.
void rescheduleMemInst(const DynInstPtr &inst)
Tells memory dependence unit that a memory instruction needs to be rescheduled.
bool sqFull()
Returns if any of the SQs are full.
gem5::Checker< DynInstPtr > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
bool violation()
Returns whether or not there was a memory ordering violation.
int wakeDependents(const DynInstPtr &completed_inst)
Wakes all dependents of a completed instruction.
void deactivateStage(const StageIdx idx)
Changes a stage's status to inactive within the activity recorder.
bool wroteToTimeBuffer
Records if IEW has written to the time buffer this cycle, so that the CPU can deschedule itself if th...
gem5::o3::InstructionQueue::IQIOStats iqIOStats
TimeBuffer< TimeStruct >::wire fromCommit
Wire to get commit's output from backwards time buffer.
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
InstructionQueue instQueue
Instruction queue.
int numHtmStarts(ThreadID tid) const
statistics::Vector consumerInst
Number of instructions that wake up from producers.
void block(ThreadID tid)
Sets Dispatch to blocked, and signals back to other stages to block.
statistics::Scalar dispSquashedInsts
Stat for total number of squashed instructions dispatch skips.
gem5::BaseCPU::BaseCPUStats baseStats
Status _status
Overall stage status.
bool isDrained() const
Have all the FUs drained?
void tick()
Ticks the LSQ.
statistics::Vector instsToCommit
Number of instructions sent to commit.
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
bool isDrained() const
Has the stage drained?
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets the global time buffer.
virtual std::string name() const
std::shared_ptr< FaultBase > Fault
bool isDrained() const
Has the LSQ drained?
void squashDueToBranch(const DynInstPtr &inst, ThreadID tid)
Sends commit proper information for a squash due to a branch mispredict.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
void setReg(PhysRegIdPtr phys_reg)
Sets the register as ready.
statistics::Scalar numCycles
IEW handles both single threaded and SMT IEW (issue/execute/writeback).
void deferMemInst(const DynInstPtr &deferred_inst)
Defers a memory instruction when its DTB translation incurs a hw page table walk.
std::queue< DynInstPtr > skidBuffer[MaxThreads]
Skid buffer between rename and IEW.
FUPool * fuPool
Pointer to the functional unit pool.
void activateStage(const StageIdx idx)
Changes a stage's status to active within the activity recorder.
uint64_t getLatestHtmUid(ThreadID tid) const
bool willWB()
Returns if the LSQ will write back to memory this cycle.
unsigned numFreeLoadEntries()
Returns the number of free load entries.
unsigned numFreeEntries()
Returns total number of free entries.
StageStatus wbStatus
Writeback status.
void activityThisCycle()
Reports to the CPU that there is activity this cycle.
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
Cycles renameToIEWDelay
Rename to IEW delay.
TimeBuffer< IEWStruct > * iewQueue
IEW stage time buffer.
void processFreeUnits()
Frees all FUs on the list.
static constexpr int MaxWidth
unsigned dispatchWidth
Width of dispatch, in instructions.
void scheduleNonSpec(const InstSeqNum &inst)
Schedules a single specific non-speculative instruction.
statistics::Scalar memOrderViolationEvents
Stat for total number of memory ordering violation events.
void tick()
Ticks IEW stage, causing Dispatch, the IQ, the LSQ, Execute, and Writeback to run for one cycle.
statistics::Scalar dispatchedInsts
Stat for total number of instructions dispatched.
void printAvailableInsts()
Debug function to print instructions that are issued this cycle.
ExecutedInstStats(CPU *cpu)
DynInstPtr getMemDepViolator(ThreadID tid)
Gets the instruction that caused the memory ordering violation.
DynInstPtr getInstToExecute()
Returns the oldest scheduled instruction, and removes it from the list of instructions waiting to exe...
std::vector< std::unique_ptr< ExecuteCPUStats > > executeStats
unsigned wbWidth
Writeback width.
void squash(const InstSeqNum &squashed_num, ThreadID tid)
Squash instructions from a thread until the specified sequence number.
TimeBuffer< TimeStruct > * timeBuffer
Pointer to main time buffer used for backwards communication.
void drainSanityCheck() const
Perform sanity checks after a drain.
statistics::Scalar predictedTakenIncorrect
Stat for total number of incorrect predicted taken branches.
ProbePointArg generates a point for the class of Arg.
bool fetchRedirect[MaxThreads]
Records if there is a fetch redirect on this cycle for each thread.
statistics::Scalar squashCycles
Stat for total number of squashing cycles.
void insertBarrier(const DynInstPtr &barr_inst)
Inserts a memory or write barrier into the IQ to make sure loads and stores are ordered properly.
statistics::Scalar dispLoadInsts
Stat for total number of dispatched load instructions.
ProbeManager * getProbeManager()
Get the probe manager for this object.
TimeBuffer< IssueStruct >::wire fromIssue
Wire to read information from the issue stage time queue.
static constexpr int MaxThreads
void activityThisCycle()
Records that there was time buffer activity this cycle.
void unblock(ThreadID tid)
Unblocks Dispatch if the skid buffer is empty, and signals back to other stages to unblock.
void squash(ThreadID tid)
Squashes instructions for a thread.
unsigned issueWidth
Width of issue, in instructions.
void insertLoad(const DynInstPtr &load_inst)
Inserts a load into the LSQ.
void instToCommit(const DynInstPtr &inst)
Sends an instruction to commit through the time buffer.
void drainSanityCheck() const
Perform sanity checks after a drain.
ProbePointArg< DynInstPtr > * ppExecute
To probe when instruction execution begins.
statistics::Scalar dispNonSpecInsts
Stat for total number of dispatched non speculative insts.
void blockMemInst(const DynInstPtr &inst)
Moves memory instruction onto the list of cache blocked instructions.
unsigned wbCycle
Cycle number within the queue of instructions being written back.
void cacheUnblocked()
Notifies that the cache has become unblocked.
bool isDrained() const
Determine if we are drained.
statistics::Scalar lsqFullEvents
Stat for number of times the LSQ becomes full.
void insertNonSpec(const DynInstPtr &new_inst)
Inserts a new, non-speculative instruction into the IQ.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets active threads list.
void blockMemInst(const DynInstPtr &blocked_inst)
Defers a memory instruction when it is cache blocked.
unsigned numFreeStoreEntries()
Returns the number of free store entries.
unsigned wbNumInst
Index into queue of instructions being written back.
unsigned skidBufferMax
Maximum size of the skid buffer.
void deactivateStage()
Tells CPU that the IEW stage is inactive and idle.
Scoreboard * scoreboard
Scoreboard pointer.
ProbePointArg< DynInstPtr > * ppDispatch
void setRenameQueue(TimeBuffer< RenameStruct > *rq_ptr)
Sets time buffer for getting instructions coming from rename.
void insert(const DynInstPtr &new_inst)
Inserts a new instruction into the IQ.
bool updateLSQNextCycle
Records if the LSQ needs to be updated on the next cycle, so that IEW knows if there will be activity...
void replayMemInst(const DynInstPtr &replay_inst)
Replays a memory instruction.
ThreadID numThreads
Number of active threads.
statistics::Vector numSwp
Number of executed software prefetches.
void squashDueToMemOrder(const DynInstPtr &inst, ThreadID tid)
Sends commit proper information for a squash due to a memory order violation.
RequestPort & getDataPort()
void takeOverFrom()
Takes over execution from another CPU's thread.
void commitStores(InstSeqNum &youngest_inst, ThreadID tid)
Commits stores up until the given sequence number for a specific thread.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
void scheduleReadyInsts()
Schedules ready instructions, adding the ready ones (oldest first) to the queue to execute.
LSQ ldstQueue
Load / store queue.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
const FlagsType total
Print the total.
void setIEWQueue(TimeBuffer< IEWStruct > *iq_ptr)
Sets time buffer to pass on instructions to commit.
Derived & init(size_type size)
Set this vector to have the given size.
bool lqFull()
Returns if any of the LQs are full.
void dispatch(ThreadID tid)
Determines proper actions to take given Dispatch's status.
int numHtmStops(ThreadID tid) const
bool updatedQueues
Records if the queues have been changed (inserted or issued insts), so that IEW knows to broadcast th...
Cycles issueToExecuteDelay
Issue to execute delay.
Fault executeLoad(const DynInstPtr &inst)
Executes a load.
void activateStage()
Tells CPU that the IEW stage is active and running.
int16_t ThreadID
Thread index/ID type.
std::string name() const
Returns the name of the IEW stage.
void violation(const DynInstPtr &store, const DynInstPtr &faulting_load)
Indicates an ordering violation between a store and a load.
#define panic(...)
This implements a cprintf based panic() function.
void setScoreboard(Scoreboard *sb_ptr)
Sets pointer to the scoreboard.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to list of active threads.
bool hasReadyInsts()
Returns if there are any ready instructions in the IQ.
void executeInsts()
Executes instructions.
void regProbePoints()
Registers probes.
unsigned getCount(ThreadID tid)
Returns the number of used entries for a thread.
Generated on Sun Jul 30 2023 01:56:52 for gem5 by doxygen 1.8.17