42 #ifndef __CPU_O3_INST_QUEUE_IMPL_HH__ 43 #define __CPU_O3_INST_QUEUE_IMPL_HH__ 51 #include "debug/IQ.hh" 52 #include "enums/OpClass.hh" 53 #include "params/DerivO3CPU.hh" 63 :
Event(Stat_Event_Pri, AutoDelete),
64 inst(_inst), fuIdx(fu_idx), iqPtr(iq_ptr), freeFU(false)
81 return "Functional unit completion";
86 DerivO3CPUParams *params)
101 numPhysRegs = params->numPhysIntRegs + params->numPhysFloatRegs +
102 params->numPhysVecRegs +
104 params->numPhysVecPredRegs +
105 params->numPhysCCRegs;
115 for (
ThreadID tid = 0; tid < Impl::MaxThreads; tid++) {
123 if (
iqPolicy == SMTQueuePolicy::Dynamic) {
129 }
else if (
iqPolicy == SMTQueuePolicy::Partitioned) {
138 DPRINTF(IQ,
"IQ sharing policy set to Partitioned:" 139 "%i entries per thread.\n",part_amt);
140 }
else if (
iqPolicy == SMTQueuePolicy::Threshold) {
141 double threshold = (double)params->smtIQThreshold / 100;
143 int thresholdIQ = (
int)((double)threshold *
numEntries);
150 DPRINTF(IQ,
"IQ sharing policy set to Threshold:" 151 "%i entries per thread.\n",thresholdIQ);
158 template <
class Impl>
163 cprintf(
"Nodes traversed: %i, removed: %i\n",
168 template <
class Impl>
172 return cpu->name() +
".iq";
175 template <
class Impl>
179 using namespace Stats;
182 .
desc(
"Number of instructions added to the IQ (excludes non-spec)")
186 .
name(
name() +
".iqNonSpecInstsAdded")
187 .
desc(
"Number of non-speculative instructions added to the IQ")
192 .
desc(
"Number of instructions issued")
197 .
desc(
"Number of integer instructions issued")
201 .
name(
name() +
".iqFloatInstsIssued")
202 .
desc(
"Number of float instructions issued")
206 .
name(
name() +
".iqBranchInstsIssued")
207 .
desc(
"Number of branch instructions issued")
212 .
desc(
"Number of memory instructions issued")
216 .
name(
name() +
".iqMiscInstsIssued")
217 .
desc(
"Number of miscellaneous instructions issued")
221 .
name(
name() +
".iqSquashedInstsIssued")
222 .
desc(
"Number of squashed instructions issued")
226 .
name(
name() +
".iqSquashedInstsExamined")
227 .
desc(
"Number of squashed instructions iterated over during squash;" 228 " mainly for profiling")
232 .
name(
name() +
".iqSquashedOperandsExamined")
233 .
desc(
"Number of squashed operands that are examined and possibly " 234 "removed from graph")
238 .
name(
name() +
".iqSquashedNonSpecRemoved")
239 .
desc(
"Number of squashed non-spec instructions that were removed")
255 .
desc(
"Number of insts issued each cycle")
272 .
desc(
"Type of FU issued")
296 .
desc(
"Inst issue rate")
304 .
desc(
"attempts to use FU when none available")
314 .
desc(
"FU busy when requested")
320 .
desc(
"FU busy rate (busy events/executed inst)")
331 .
name(
name() +
".int_inst_queue_reads")
332 .
desc(
"Number of integer instruction queue reads")
336 .
name(
name() +
".int_inst_queue_writes")
337 .
desc(
"Number of integer instruction queue writes")
341 .
name(
name() +
".int_inst_queue_wakeup_accesses")
342 .
desc(
"Number of integer instruction queue wakeup accesses")
346 .
name(
name() +
".fp_inst_queue_reads")
347 .
desc(
"Number of floating instruction queue reads")
351 .
name(
name() +
".fp_inst_queue_writes")
352 .
desc(
"Number of floating instruction queue writes")
356 .
name(
name() +
".fp_inst_queue_wakeup_accesses")
357 .
desc(
"Number of floating instruction queue wakeup accesses")
361 .
name(
name() +
".vec_inst_queue_reads")
362 .
desc(
"Number of vector instruction queue reads")
366 .
name(
name() +
".vec_inst_queue_writes")
367 .
desc(
"Number of vector instruction queue writes")
371 .
name(
name() +
".vec_inst_queue_wakeup_accesses")
372 .
desc(
"Number of vector instruction queue wakeup accesses")
377 .
desc(
"Number of integer alu accesses")
382 .
desc(
"Number of floating point alu accesses")
387 .
desc(
"Number of vector alu accesses")
392 template <
class Impl>
397 for (
ThreadID tid = 0; tid < Impl::MaxThreads; tid++) {
414 for (
ThreadID tid = 0; tid < Impl::MaxThreads; ++tid) {
432 template <
class Impl>
439 template <
class Impl>
446 template <
class Impl>
455 template <
class Impl>
468 template <
class Impl>
478 template <
class Impl>
485 template <
class Impl>
489 if (
iqPolicy == SMTQueuePolicy::Partitioned) {
497 template <
class Impl>
507 while (threads != end) {
510 if (
iqPolicy == SMTQueuePolicy::Partitioned) {
512 }
else if (
iqPolicy == SMTQueuePolicy::Threshold &&
513 active_threads == 1) {
520 template <
class Impl>
527 template <
class Impl>
536 template <
class Impl>
547 template <
class Impl>
558 template <
class Impl>
575 template <
class Impl>
579 if (new_inst->isFloating()) {
581 }
else if (new_inst->isVector()) {
589 DPRINTF(IQ,
"Adding instruction [sn:%llu] PC %s to the IQ.\n",
590 new_inst->seqNum, new_inst->pcState());
594 instList[new_inst->threadNumber].push_back(new_inst);
608 if (new_inst->isMemRef()) {
616 count[new_inst->threadNumber]++;
621 template <
class Impl>
627 if (new_inst->isFloating()) {
629 }
else if (new_inst->isVector()) {
639 DPRINTF(IQ,
"Adding non-speculative instruction [sn:%llu] PC %s " 641 new_inst->seqNum, new_inst->pcState());
645 instList[new_inst->threadNumber].push_back(new_inst);
657 if (new_inst->isMemRef()) {
663 count[new_inst->threadNumber]++;
668 template <
class Impl>
677 template <
class Impl>
678 typename Impl::DynInstPtr
684 if (inst->isFloating()) {
686 }
else if (inst->isVector()) {
694 template <
class Impl>
709 while (list_it != list_end_it) {
710 if ((*list_it).oldestInst > queue_entry.
oldestInst) {
721 template <
class Impl>
731 OpClass op_class = (*list_order_it).
queueType;
740 (*next_it).oldestInst < queue_entry.
oldestInst) {
747 template <
class Impl>
751 DPRINTF(IQ,
"Processing FU completion [sn:%llu]\n", inst->seqNum);
752 assert(!
cpu->switchedOut());
771 template <
class Impl>
775 DPRINTF(IQ,
"Attempting to schedule ready instructions from " 798 int total_issued = 0;
802 while (total_issued <
totalWidth && order_it != order_end_it) {
803 OpClass op_class = (*order_it).queueType;
809 if (issuing_inst->isFloating()) {
811 }
else if (issuing_inst->isVector()) {
817 assert(issuing_inst->seqNum == (*order_it).oldestInst);
819 if (issuing_inst->isSquashed()) {
838 ThreadID tid = issuing_inst->threadNumber;
840 if (op_class != No_OpClass) {
842 if (issuing_inst->isFloating()) {
844 }
else if (issuing_inst->isVector()) {
857 if (op_latency ==
Cycles(1)) {
872 cpu->schedule(execution,
885 DPRINTF(IQ,
"Thread %i: Issuing instruction PC %s " 887 tid, issuing_inst->pcState(),
888 issuing_inst->seqNum);
899 issuing_inst->setIssued();
903 issuing_inst->issueTick =
curTick() - issuing_inst->fetchTick;
906 if (!issuing_inst->isMemRef()) {
911 issuing_inst->clearInIQ();
933 cpu->activityThisCycle();
935 DPRINTF(IQ,
"Not able to schedule any instructions.\n");
939 template <
class Impl>
943 DPRINTF(IQ,
"Marking nonspeculative instruction [sn:%llu] as ready " 944 "to execute.\n", inst);
950 ThreadID tid = (*inst_it).second->threadNumber;
952 (*inst_it).second->setAtCommit();
954 (*inst_it).second->setCanIssue();
956 if (!(*inst_it).second->isMemRef()) {
962 (*inst_it).second = NULL;
967 template <
class Impl>
971 DPRINTF(IQ,
"[tid:%i] Committing instructions older than [sn:%llu]\n",
976 while (iq_it !=
instList[tid].end() &&
977 (*iq_it)->seqNum <= inst) {
985 template <
class Impl>
992 if (completed_inst->isFloating()) {
994 }
else if (completed_inst->isVector()) {
1000 DPRINTF(IQ,
"Waking dependents of completed instruction.\n");
1002 assert(!completed_inst->isSquashed());
1010 if (completed_inst->isMemRef()) {
1013 }
else if (completed_inst->isMemBarrier() ||
1014 completed_inst->isWriteBarrier()) {
1018 for (
int dest_reg_idx = 0;
1019 dest_reg_idx < completed_inst->numDestRegs();
1023 completed_inst->renamedDestRegIdx(dest_reg_idx);
1028 DPRINTF(IQ,
"Reg %d [%s] is part of a fix mapping, skipping\n",
1036 completed_inst->setPinnedRegsWritten();
1039 DPRINTF(IQ,
"Reg %d [%s] is pinned, skipping\n",
1044 DPRINTF(IQ,
"Waking any dependents on register %i (%s).\n",
1053 DPRINTF(IQ,
"Waking up a dependent instruction, [sn:%llu] " 1054 "PC %s.\n", dep_inst->seqNum, dep_inst->pcState());
1060 dep_inst->markSrcRegReady();
1080 template <
class Impl>
1084 OpClass op_class = ready_inst->opClass();
1093 (*
readyIt[op_class]).oldestInst) {
1098 DPRINTF(IQ,
"Instruction is ready to issue, putting it onto " 1099 "the ready list, PC %s opclass:%i [sn:%llu].\n",
1100 ready_inst->pcState(), op_class, ready_inst->seqNum);
1103 template <
class Impl>
1107 DPRINTF(IQ,
"Rescheduling mem inst [sn:%llu]\n", resched_inst->seqNum);
1110 resched_inst->translationStarted(
false);
1111 resched_inst->translationCompleted(
false);
1113 resched_inst->clearCanIssue();
1117 template <
class Impl>
1124 template <
class Impl>
1128 ThreadID tid = completed_inst->threadNumber;
1130 DPRINTF(IQ,
"Completing mem instruction PC: %s [sn:%llu]\n",
1131 completed_inst->pcState(), completed_inst->seqNum);
1135 completed_inst->memOpDone(
true);
1141 template <
class Impl>
1148 template <
class Impl>
1152 blocked_inst->clearIssued();
1153 blocked_inst->clearCanIssue();
1157 template <
class Impl>
1166 template <
class Impl>
1167 typename Impl::DynInstPtr
1172 if ((*it)->translationCompleted() || (*it)->isSquashed()) {
1181 template <
class Impl>
1182 typename Impl::DynInstPtr
1194 template <
class Impl>
1203 template <
class Impl>
1207 DPRINTF(IQ,
"[tid:%i] Starting to squash instructions in " 1220 template <
class Impl>
1228 DPRINTF(IQ,
"[tid:%i] Squashing until sequence number %i!\n",
1233 while (squash_it !=
instList[tid].end() &&
1237 if (squashed_inst->isFloating()) {
1239 }
else if (squashed_inst->isVector()) {
1247 if (squashed_inst->threadNumber != tid ||
1248 squashed_inst->isSquashedInIQ()) {
1253 if (!squashed_inst->isIssued() ||
1254 (squashed_inst->isMemRef() &&
1255 !squashed_inst->memOpDone())) {
1257 DPRINTF(IQ,
"[tid:%i] Instruction [sn:%llu] PC %s squashed.\n",
1258 tid, squashed_inst->seqNum, squashed_inst->pcState());
1260 bool is_acq_rel = squashed_inst->isMemBarrier() &&
1261 (squashed_inst->isLoad() ||
1262 (squashed_inst->isStore() &&
1263 !squashed_inst->isStoreConditional()));
1267 (!squashed_inst->isNonSpeculative() &&
1268 !squashed_inst->isStoreConditional() &&
1269 !squashed_inst->isAtomic() &&
1270 !squashed_inst->isMemBarrier() &&
1271 !squashed_inst->isWriteBarrier())) {
1273 for (
int src_reg_idx = 0;
1274 src_reg_idx < squashed_inst->numSrcRegs();
1278 squashed_inst->renamedSrcRegIdx(src_reg_idx);
1289 if (!squashed_inst->isReadySrcRegIdx(src_reg_idx) &&
1298 }
else if (!squashed_inst->isStoreConditional() ||
1299 !squashed_inst->isCompleted()) {
1310 assert(squashed_inst->getFault() !=
NoFault ||
1311 squashed_inst->isMemRef());
1314 (*ns_inst_it).second = NULL;
1325 squashed_inst->setSquashedInIQ();
1329 squashed_inst->setIssued();
1330 squashed_inst->setCanCommit();
1331 squashed_inst->clearInIQ();
1334 count[squashed_inst->threadNumber]--;
1346 for (
int dest_reg_idx = 0;
1347 dest_reg_idx < squashed_inst->numDestRegs();
1351 squashed_inst->renamedDestRegIdx(dest_reg_idx);
1363 template <
class Impl>
1369 int8_t total_src_regs = new_inst->numSrcRegs();
1370 bool return_val =
false;
1372 for (
int src_reg_idx = 0;
1373 src_reg_idx < total_src_regs;
1377 if (!new_inst->isReadySrcRegIdx(src_reg_idx)) {
1378 PhysRegIdPtr src_reg = new_inst->renamedSrcRegIdx(src_reg_idx);
1387 DPRINTF(IQ,
"Instruction PC %s has src reg %i (%s) that " 1388 "is being added to the dependency chain.\n",
1389 new_inst->pcState(), src_reg->
index(),
1398 DPRINTF(IQ,
"Instruction PC %s has src reg %i (%s) that " 1399 "became ready before it reached the IQ.\n",
1400 new_inst->pcState(), src_reg->
index(),
1403 new_inst->markSrcRegReady(src_reg_idx);
1411 template <
class Impl>
1419 int8_t total_dest_regs = new_inst->numDestRegs();
1421 for (
int dest_reg_idx = 0;
1422 dest_reg_idx < total_dest_regs;
1425 PhysRegIdPtr dest_reg = new_inst->renamedDestRegIdx(dest_reg_idx);
1435 panic(
"Dependency graph %i (%s) (flat: %i) not empty!",
1447 template <
class Impl>
1453 if (inst->readyToIssue()) {
1456 if (inst->isMemRef()) {
1458 DPRINTF(IQ,
"Checking if memory instruction can issue.\n");
1467 OpClass op_class = inst->opClass();
1469 DPRINTF(IQ,
"Instruction is ready to issue, putting it onto " 1470 "the ready list, PC %s opclass:%i [sn:%llu].\n",
1471 inst->pcState(), op_class, inst->seqNum);
1480 (*
readyIt[op_class]).oldestInst) {
1487 template <
class Impl>
1494 template <
class Impl>
1509 cprintf(
"Non speculative list: ");
1511 while (non_spec_it != non_spec_end_it) {
1512 cprintf(
"%s [sn:%llu]", (*non_spec_it).second->pcState(),
1513 (*non_spec_it).second->seqNum);
1525 while (list_order_it != list_order_end_it) {
1526 cprintf(
"%i OpClass:%i [sn:%llu] ", i, (*list_order_it).queueType,
1527 (*list_order_it).oldestInst);
1537 template <
class Impl>
1546 while (inst_list_it !=
instList[tid].end()) {
1547 cprintf(
"Instruction:%i\n", num);
1548 if (!(*inst_list_it)->isSquashed()) {
1549 if (!(*inst_list_it)->isIssued()) {
1551 cprintf(
"Count:%i\n", valid_num);
1552 }
else if ((*inst_list_it)->isMemRef() &&
1553 !(*inst_list_it)->memOpDone()) {
1557 cprintf(
"Count:%i\n", valid_num);
1561 cprintf(
"PC: %s\n[sn:%llu]\n[tid:%i]\n" 1562 "Issued:%i\nSquashed:%i\n",
1563 (*inst_list_it)->pcState(),
1564 (*inst_list_it)->seqNum,
1565 (*inst_list_it)->threadNumber,
1566 (*inst_list_it)->isIssued(),
1567 (*inst_list_it)->isSquashed());
1569 if ((*inst_list_it)->isMemRef()) {
1570 cprintf(
"MemOpDone:%i\n", (*inst_list_it)->memOpDone());
1580 cprintf(
"Insts to Execute list:\n");
1590 if (!(*inst_list_it)->isSquashed()) {
1591 if (!(*inst_list_it)->isIssued()) {
1593 cprintf(
"Count:%i\n", valid_num);
1594 }
else if ((*inst_list_it)->isMemRef() &&
1595 !(*inst_list_it)->memOpDone()) {
1599 cprintf(
"Count:%i\n", valid_num);
1603 cprintf(
"PC: %s\n[sn:%llu]\n[tid:%i]\n" 1604 "Issued:%i\nSquashed:%i\n",
1605 (*inst_list_it)->pcState(),
1606 (*inst_list_it)->seqNum,
1607 (*inst_list_it)->threadNumber,
1608 (*inst_list_it)->isIssued(),
1609 (*inst_list_it)->isSquashed());
1611 if ((*inst_list_it)->isMemRef()) {
1612 cprintf(
"MemOpDone:%i\n", (*inst_list_it)->memOpDone());
1622 #endif//__CPU_O3_INST_QUEUE_IMPL_HH__ Stats::Scalar iqMiscInstsIssued
Stat for number of miscellaneous instructions issued.
int wbOutstanding
Number of instructions currently in flight to FUs.
#define panic(...)
This implements a cprintf based panic() function.
void regStats()
Registers statistics.
const FlagsType pdf
Print the percent of the total that this entry represents.
std::list< ThreadID > * activeThreads
Pointer to list of active threads.
Stats::Scalar iqFloatInstsIssued
Stat for number of floating point instructions issued.
void completed(const DynInstPtr &inst)
Completes a memory instruction.
void replayMemInst(const DynInstPtr &replay_inst)
Replays a memory instruction.
Stats::Scalar vecInstQueueReads
Derived & init(size_type _x, size_type _y)
decltype(nullptr) constexpr NoFault
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation...
Cycles is a wrapper class for representing cycle counts, i.e.
void insertNonSpec(const DynInstPtr &new_inst)
Inserts a new, non-speculative instruction into the IQ.
Stats::Scalar fpAluAccesses
void doSquash(ThreadID tid)
Does the actual squashing.
void scheduleReadyInsts()
Schedules ready instructions, adding the ready ones (oldest first) to the queue to execute...
int getNumPinnedWritesToComplete() const
Stats::Scalar intAluAccesses
void violation(const DynInstPtr &store_inst, const DynInstPtr &violating_load)
Indicates an ordering violation between a store and a younger load.
Stats::Scalar iqInstsAdded
Stat for number of instructions added.
InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params)
Constructs an IQ.
bool queueOnList[Num_OpClasses]
Tracks if each ready queue is on the age order list.
Stats::Scalar fpInstQueueWakeupAccesses
std::list< DynInstPtr > instsToExecute
List of instructions that are ready to be executed.
void regStats()
Registers statistics.
void dumpInsts()
Debugging function to dump out all instructions that are in the IQ.
void replay()
Replays all instructions that have been rescheduled by moving them to the ready list.
InstSeqNum squashedSeqNum[Impl::MaxThreads]
The sequence number of the squashed instruction.
Impl::DynInstPtr DynInstPtr
void violation(const DynInstPtr &store, const DynInstPtr &faulting_load)
Indicates an ordering violation between a store and a load.
void scheduleNonSpec(const InstSeqNum &inst)
Schedules a single specific non-speculative instruction.
DynInstPtr getInstToExecute()
Returns the oldest scheduled instruction, and removes it from the list of instructions waiting to exe...
Cycles getOpLatency(OpClass capability)
Returns the operation execution latency of the given capability.
Stats::Scalar iqInstsIssued
FU completion event class.
Stats::Scalar iqMemInstsIssued
Stat for number of memory instructions issued.
void freeUnitNextCycle(int fu_idx)
Frees a FU at the end of this cycle.
constexpr unsigned NumVecElemPerVecReg
void addToOrderList(OpClass op_class)
Add an op class to the age order list.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets active threads list.
void insertBarrier(const DynInstPtr &barr_inst)
Inserts a memory or write barrier into the IQ to make sure loads and stores are ordered properly...
void setIQ(InstructionQueue< Impl > *iq_ptr)
Sets the pointer to the IQ.
unsigned numEntries
The number of entries in the instruction queue.
static constexpr auto NoCapableFU
std::list< DynInstPtr > instList[Impl::MaxThreads]
List of all the instructions in the IQ (some of which may be issued).
bool addToDependents(const DynInstPtr &new_inst)
Adds an instruction to the dependency graph, as a consumer.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
void decrNumPinnedWritesToComplete()
DynInstPtr inst
Executing instruction.
void wakeDependents(const DynInstPtr &inst)
Wakes any dependents of a memory instruction.
Derived & init(size_type size)
Set this vector to have the given size.
void rescheduleMemInst(const DynInstPtr &resched_inst)
Reschedules a memory instruction.
void setTimeBuffer(TimeBuffer< TimeStruct > *tb_ptr)
Sets the global time buffer.
std::vector< bool > regScoreboard
A cache of the recently woken registers.
Stats::Scalar fpInstQueueWrites
void nonSpecInstReady(const DynInstPtr &inst)
Indicate that a non-speculative instruction is ready.
std::list< DynInstPtr > blockedMemInsts
List of instructions that have been cache blocked.
bool isFull()
Returns whether or not the IQ is full.
unsigned numFreeEntries()
Returns total number of free entries.
Tick curTick()
The current simulated tick.
int fuIdx
Index of the FU used for executing.
bool hasReadyInsts()
Returns if there are any ready instructions in the IQ.
Stats::Scalar intInstQueueWakeupAccesses
Stats::Scalar iqSquashedNonSpecRemoved
Stat for number of non-speculative instructions removed due to a squash.
void insertNonSpec(const DynInstPtr &inst)
Inserts a non-speculative memory instruction.
void issue(const DynInstPtr &inst)
Issues the given instruction.
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
TimeBuffer< IssueStruct > * issueToExecuteQueue
The queue to the execute stage.
int wakeDependents(const DynInstPtr &completed_inst)
Wakes all dependents of a completed instruction.
IEW * iewStage
Pointer to IEW stage.
Stats::Scalar intInstQueueWrites
void addReadyMemInst(const DynInstPtr &ready_inst)
Adds a ready memory instruction to the ready list.
ReadyInstQueue readyInsts[Num_OpClasses]
List of ready instructions, per op class.
void regsReady(const DynInstPtr &inst)
Indicate that an instruction has its registers ready.
void commit(const InstSeqNum &inst, ThreadID tid=0)
Commits all instructions up to and including the given sequence number, for a specific thread...
std::map< InstSeqNum, DynInstPtr > nonSpecInsts
List of non-speculative instructions that will be scheduled once the IQ gets a signal from commit...
std::list< ListOrderEntry > listOrder
List that contains the age order of the oldest instruction of each ready queue.
void addIfReady(const DynInstPtr &inst)
Moves an instruction to the ready queue if it is ready.
Distribution & init(Counter min, Counter max, Counter bkt)
Set the parameters of this distribution.
Stats::Scalar iqBranchInstsIssued
Stat for number of branch instructions issued.
static scfx_rep_node * list
virtual const char * description() const
Return a C string describing the event.
unsigned count[Impl::MaxThreads]
Per Thread IQ count.
void takeOverFrom()
Takes over execution from another CPU's thread.
TimeBuffer< TimeStruct > * timeBuffer
The backwards time buffer.
Cycles commitToIEWDelay
Delay between commit stage and the IQ.
Stats::Scalar iqSquashedInstsIssued
Stat for number of squashed instructions that were ready to issue.
Stats::Formula fuBusyRate
Number of times the FU was busy per instruction issued.
std::list< ListOrderEntry >::iterator ListOrderIt
Stats::Scalar vecAluAccesses
void reschedule(const DynInstPtr &inst)
Reschedules an instruction to be re-executed.
std::string name() const
Returns the name of the IQ.
const FlagsType total
Print the total.
std::list< DynInstPtr > retryMemInsts
List of instructions that were cache blocked, but a retry has been seen since, so they can now be ret...
TimeBuffer< TimeStruct >::wire fromCommit
Wire to read information from timebuffer.
void insert(const DynInstPtr &inst)
Inserts a memory instruction.
void deferMemInst(const DynInstPtr &deferred_inst)
Defers a memory instruction when its DTB translation incurs a hw page table walk. ...
DynInstPtr getBlockedMemInstToExecute()
Gets a memory instruction that was blocked on the cache.
void resetState()
Resets all instruction queue state.
~InstructionQueue()
Destructs the IQ.
DynInstPtr getDeferredMemInstToExecute()
Gets a memory instruction that was referred due to a delayed DTB translation if it is now ready to ex...
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
void drainSanityCheck() const
Perform sanity checks after a drain.
int16_t ThreadID
Thread index/ID type.
void squash(ThreadID tid)
Squashes instructions for a thread.
Stats::Vector2d statIssuedInstType
Stat for total number issued for each instruction type.
void init(DerivO3CPUParams *params, ThreadID tid)
Initializes the unit with parameters and a thread id.
SMTQueuePolicy iqPolicy
IQ sharing policy for SMT.
DependencyGraph< DynInstPtr > dependGraph
int countInsts()
Debugging function to count how many entries are in the IQ.
const PhysRegIndex & flatIndex() const
Flat index accessor.
bool freeFU
Should the FU be added to the list to be freed upon completing this event.
Stats::Scalar iqSquashedOperandsExamined
Stat for number of squashed instruction operands examined when squashing.
void blockMemInst(const DynInstPtr &blocked_inst)
Defers a memory instruction when it is cache blocked.
void resetEntries()
Resets max entries for all threads.
Stats::Scalar fpInstQueueReads
Stats::Scalar vecInstQueueWrites
static const OpClass Num_OpClasses
void completeMemInst(const DynInstPtr &completed_inst)
Completes a memory operation.
std::map< InstSeqNum, DynInstPtr >::iterator NonSpecMapIt
void squash(const InstSeqNum &squashed_num, ThreadID tid)
Squashes all instructions up until a given sequence number for a specific thread. ...
int entryAmount(ThreadID num_threads)
Number of entries needed for given amount of threads.
Stats::Scalar iqSquashedInstsExamined
Stat for number of squashed instructions examined when squashing.
O3CPU * cpu
Pointer to the CPU.
ListOrderIt readyIt[Num_OpClasses]
Iterators of each ready queue.
void processFUCompletion(const DynInstPtr &inst, int fu_idx)
Process FU completion event.
Stats::Scalar iqIntInstsIssued
Stat for number of integer instructions issued.
const RegIndex & index() const
Index accessors.
Stats::Vector fuBusy
Number of times the FU was busy.
void completeBarrier(const DynInstPtr &inst)
Completes a barrier instruction.
Entry for the list age ordering by op class.
std::list< DynInstPtr >::iterator ListIt
unsigned maxEntries[Impl::MaxThreads]
Max IQ Entries Per Thread.
Stats::Scalar vecInstQueueWakeupAccesses
void setIssueToExecuteQueue(TimeBuffer< IssueStruct > *i2eQueue)
Sets the timer buffer between issue and execute.
void cacheUnblocked()
Notify instruction queue that a previous blockage has resolved.
void moveToYoungerInst(ListOrderIt age_order_it)
Called when the oldest instruction has been removed from a ready queue; this places that ready queue ...
Stats::Scalar iqNonSpecInstsAdded
Stat for number of non-speculative instructions added.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
int getUnit(OpClass capability)
Gets a FU providing the requested capability.
Stats::Formula issueRate
Number of instructions issued per cycle.
unsigned numPhysRegs
The number of physical registers in the CPU.
Stats::Scalar intInstQueueReads
MemDepUnit memDepUnit[Impl::MaxThreads]
The memory dependence unit, which tracks/predicts memory dependences between instructions.
Derived & ysubnames(const char **names)
void addToProducers(const DynInstPtr &new_inst)
Adds an instruction to the dependency graph, as a producer.
bool isPipelined(OpClass capability)
Returns the issue latency of the given capability.
void insertBarrier(const DynInstPtr &barr_inst)
Inserts a barrier instruction.
FUPool * fuPool
Function unit pool.
const FlagsType dist
Print the distribution.
bool isFixedMapping() const
Returns true if this register is always associated to the same architectural register.
std::list< DynInstPtr > deferredMemInsts
List of instructions waiting for their DTB translation to complete (hw page table walk in progress)...
bool isDrained() const
Determine if we are drained.
FUCompletion(const DynInstPtr &_inst, int fu_idx, InstructionQueue< Impl > *iq_ptr)
Construct a FU completion event.
InstructionQueue< Impl > * iqPtr
Pointer back to the instruction queue.
A standard instruction queue class.
unsigned totalWidth
The total number of instructions that can be issued in one cycle.
void dumpLists()
Debugging function to dump all the list sizes, as well as print out the list of nonspeculative instru...
Stats::Distribution numIssuedDist
Distribution of number of instructions in the queue.
unsigned freeEntries
Number of free IQ entries left.
Stats::Vector statFuBusy
Distribution of the cycles it takes to issue an instruction.
const char * className() const
Return a const char* with the register class name.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
ThreadID numThreads
Number of Total Threads.
void cprintf(const char *format, const Args &...args)
static constexpr auto NoFreeFU
void insert(const DynInstPtr &new_inst)
Inserts a new instruction into the IQ.