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());
1007 ThreadID tid = completed_inst->threadNumber;
1008 if (completed_inst->isMemRef()) {
1011 DPRINTF(IQ,
"Completing mem instruction PC: %s [sn:%llu]\n",
1012 completed_inst->pcState(), completed_inst->seqNum);
1015 completed_inst->memOpDone(
true);
1017 }
else if (completed_inst->isMemBarrier() ||
1018 completed_inst->isWriteBarrier()) {
1023 for (
int dest_reg_idx = 0;
1024 dest_reg_idx < completed_inst->numDestRegs();
1028 completed_inst->renamedDestRegIdx(dest_reg_idx);
1033 DPRINTF(IQ,
"Reg %d [%s] is part of a fix mapping, skipping\n",
1041 completed_inst->setPinnedRegsWritten();
1044 DPRINTF(IQ,
"Reg %d [%s] is pinned, skipping\n",
1049 DPRINTF(IQ,
"Waking any dependents on register %i (%s).\n",
1058 DPRINTF(IQ,
"Waking up a dependent instruction, [sn:%llu] " 1059 "PC %s.\n", dep_inst->seqNum, dep_inst->pcState());
1065 dep_inst->markSrcRegReady();
1085 template <
class Impl>
1089 OpClass op_class = ready_inst->opClass();
1098 (*
readyIt[op_class]).oldestInst) {
1103 DPRINTF(IQ,
"Instruction is ready to issue, putting it onto " 1104 "the ready list, PC %s opclass:%i [sn:%llu].\n",
1105 ready_inst->pcState(), op_class, ready_inst->seqNum);
1108 template <
class Impl>
1112 DPRINTF(IQ,
"Rescheduling mem inst [sn:%llu]\n", resched_inst->seqNum);
1115 resched_inst->translationStarted(
false);
1116 resched_inst->translationCompleted(
false);
1118 resched_inst->clearCanIssue();
1122 template <
class Impl>
1129 template <
class Impl>
1136 template <
class Impl>
1140 blocked_inst->clearIssued();
1141 blocked_inst->clearCanIssue();
1145 template <
class Impl>
1154 template <
class Impl>
1155 typename Impl::DynInstPtr
1160 if ((*it)->translationCompleted() || (*it)->isSquashed()) {
1169 template <
class Impl>
1170 typename Impl::DynInstPtr
1182 template <
class Impl>
1191 template <
class Impl>
1195 DPRINTF(IQ,
"[tid:%i] Starting to squash instructions in " 1208 template <
class Impl>
1216 DPRINTF(IQ,
"[tid:%i] Squashing until sequence number %i!\n",
1221 while (squash_it !=
instList[tid].end() &&
1225 if (squashed_inst->isFloating()) {
1227 }
else if (squashed_inst->isVector()) {
1235 if (squashed_inst->threadNumber != tid ||
1236 squashed_inst->isSquashedInIQ()) {
1241 if (!squashed_inst->isIssued() ||
1242 (squashed_inst->isMemRef() &&
1243 !squashed_inst->memOpDone())) {
1245 DPRINTF(IQ,
"[tid:%i] Instruction [sn:%llu] PC %s squashed.\n",
1246 tid, squashed_inst->seqNum, squashed_inst->pcState());
1248 bool is_acq_rel = squashed_inst->isMemBarrier() &&
1249 (squashed_inst->isLoad() ||
1250 (squashed_inst->isStore() &&
1251 !squashed_inst->isStoreConditional()));
1255 (!squashed_inst->isNonSpeculative() &&
1256 !squashed_inst->isStoreConditional() &&
1257 !squashed_inst->isAtomic() &&
1258 !squashed_inst->isMemBarrier() &&
1259 !squashed_inst->isWriteBarrier())) {
1261 for (
int src_reg_idx = 0;
1262 src_reg_idx < squashed_inst->numSrcRegs();
1266 squashed_inst->renamedSrcRegIdx(src_reg_idx);
1277 if (!squashed_inst->isReadySrcRegIdx(src_reg_idx) &&
1286 }
else if (!squashed_inst->isStoreConditional() ||
1287 !squashed_inst->isCompleted()) {
1298 assert(squashed_inst->getFault() !=
NoFault ||
1299 squashed_inst->isMemRef());
1302 (*ns_inst_it).second = NULL;
1313 squashed_inst->setSquashedInIQ();
1317 squashed_inst->setIssued();
1318 squashed_inst->setCanCommit();
1319 squashed_inst->clearInIQ();
1322 count[squashed_inst->threadNumber]--;
1334 for (
int dest_reg_idx = 0;
1335 dest_reg_idx < squashed_inst->numDestRegs();
1339 squashed_inst->renamedDestRegIdx(dest_reg_idx);
1351 template <
class Impl>
1357 int8_t total_src_regs = new_inst->numSrcRegs();
1358 bool return_val =
false;
1360 for (
int src_reg_idx = 0;
1361 src_reg_idx < total_src_regs;
1365 if (!new_inst->isReadySrcRegIdx(src_reg_idx)) {
1366 PhysRegIdPtr src_reg = new_inst->renamedSrcRegIdx(src_reg_idx);
1375 DPRINTF(IQ,
"Instruction PC %s has src reg %i (%s) that " 1376 "is being added to the dependency chain.\n",
1377 new_inst->pcState(), src_reg->
index(),
1386 DPRINTF(IQ,
"Instruction PC %s has src reg %i (%s) that " 1387 "became ready before it reached the IQ.\n",
1388 new_inst->pcState(), src_reg->
index(),
1391 new_inst->markSrcRegReady(src_reg_idx);
1399 template <
class Impl>
1407 int8_t total_dest_regs = new_inst->numDestRegs();
1409 for (
int dest_reg_idx = 0;
1410 dest_reg_idx < total_dest_regs;
1413 PhysRegIdPtr dest_reg = new_inst->renamedDestRegIdx(dest_reg_idx);
1423 panic(
"Dependency graph %i (%s) (flat: %i) not empty!",
1435 template <
class Impl>
1441 if (inst->readyToIssue()) {
1444 if (inst->isMemRef()) {
1446 DPRINTF(IQ,
"Checking if memory instruction can issue.\n");
1455 OpClass op_class = inst->opClass();
1457 DPRINTF(IQ,
"Instruction is ready to issue, putting it onto " 1458 "the ready list, PC %s opclass:%i [sn:%llu].\n",
1459 inst->pcState(), op_class, inst->seqNum);
1468 (*
readyIt[op_class]).oldestInst) {
1475 template <
class Impl>
1482 template <
class Impl>
1497 cprintf(
"Non speculative list: ");
1499 while (non_spec_it != non_spec_end_it) {
1500 cprintf(
"%s [sn:%llu]", (*non_spec_it).second->pcState(),
1501 (*non_spec_it).second->seqNum);
1513 while (list_order_it != list_order_end_it) {
1514 cprintf(
"%i OpClass:%i [sn:%llu] ", i, (*list_order_it).queueType,
1515 (*list_order_it).oldestInst);
1525 template <
class Impl>
1534 while (inst_list_it !=
instList[tid].end()) {
1535 cprintf(
"Instruction:%i\n", num);
1536 if (!(*inst_list_it)->isSquashed()) {
1537 if (!(*inst_list_it)->isIssued()) {
1539 cprintf(
"Count:%i\n", valid_num);
1540 }
else if ((*inst_list_it)->isMemRef() &&
1541 !(*inst_list_it)->memOpDone()) {
1545 cprintf(
"Count:%i\n", valid_num);
1549 cprintf(
"PC: %s\n[sn:%llu]\n[tid:%i]\n" 1550 "Issued:%i\nSquashed:%i\n",
1551 (*inst_list_it)->pcState(),
1552 (*inst_list_it)->seqNum,
1553 (*inst_list_it)->threadNumber,
1554 (*inst_list_it)->isIssued(),
1555 (*inst_list_it)->isSquashed());
1557 if ((*inst_list_it)->isMemRef()) {
1558 cprintf(
"MemOpDone:%i\n", (*inst_list_it)->memOpDone());
1568 cprintf(
"Insts to Execute list:\n");
1578 if (!(*inst_list_it)->isSquashed()) {
1579 if (!(*inst_list_it)->isIssued()) {
1581 cprintf(
"Count:%i\n", valid_num);
1582 }
else if ((*inst_list_it)->isMemRef() &&
1583 !(*inst_list_it)->memOpDone()) {
1587 cprintf(
"Count:%i\n", valid_num);
1591 cprintf(
"PC: %s\n[sn:%llu]\n[tid:%i]\n" 1592 "Issued:%i\nSquashed:%i\n",
1593 (*inst_list_it)->pcState(),
1594 (*inst_list_it)->seqNum,
1595 (*inst_list_it)->threadNumber,
1596 (*inst_list_it)->isIssued(),
1597 (*inst_list_it)->isSquashed());
1599 if ((*inst_list_it)->isMemRef()) {
1600 cprintf(
"MemOpDone:%i\n", (*inst_list_it)->memOpDone());
1610 #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 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.
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
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.
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)...
void completeInst(const DynInstPtr &inst)
Notifies completion of an instruction.
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.