gem5  v20.1.0.0
Classes | Public Types | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
InstructionQueue< Impl > Class Template Reference

A standard instruction queue class. More...

#include <inst_queue.hh>

Classes

class  FUCompletion
 FU completion event class. More...
 
struct  ListOrderEntry
 Entry for the list age ordering by op class. More...
 
struct  pqCompare
 Struct for comparing entries to be added to the priority queue. More...
 

Public Types

typedef Impl::O3CPU O3CPU
 
typedef Impl::DynInstPtr DynInstPtr
 
typedef Impl::CPUPol::IEW IEW
 
typedef Impl::CPUPol::MemDepUnit MemDepUnit
 
typedef Impl::CPUPol::IssueStruct IssueStruct
 
typedef Impl::CPUPol::TimeStruct TimeStruct
 
typedef std::list< DynInstPtr >::iterator ListIt
 

Public Member Functions

 InstructionQueue (O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params)
 Constructs an IQ. More...
 
 ~InstructionQueue ()
 Destructs the IQ. More...
 
std::string name () const
 Returns the name of the IQ. More...
 
void regStats ()
 Registers statistics. More...
 
void resetState ()
 Resets all instruction queue state. More...
 
void setActiveThreads (std::list< ThreadID > *at_ptr)
 Sets active threads list. More...
 
void setIssueToExecuteQueue (TimeBuffer< IssueStruct > *i2eQueue)
 Sets the timer buffer between issue and execute. More...
 
void setTimeBuffer (TimeBuffer< TimeStruct > *tb_ptr)
 Sets the global time buffer. More...
 
bool isDrained () const
 Determine if we are drained. More...
 
void drainSanityCheck () const
 Perform sanity checks after a drain. More...
 
void takeOverFrom ()
 Takes over execution from another CPU's thread. More...
 
int entryAmount (ThreadID num_threads)
 Number of entries needed for given amount of threads. More...
 
void resetEntries ()
 Resets max entries for all threads. More...
 
unsigned numFreeEntries ()
 Returns total number of free entries. More...
 
unsigned numFreeEntries (ThreadID tid)
 Returns number of free entries for a thread. More...
 
bool isFull ()
 Returns whether or not the IQ is full. More...
 
bool isFull (ThreadID tid)
 Returns whether or not the IQ is full for a specific thread. More...
 
bool hasReadyInsts ()
 Returns if there are any ready instructions in the IQ. More...
 
void insert (const DynInstPtr &new_inst)
 Inserts a new instruction into the IQ. More...
 
void insertNonSpec (const DynInstPtr &new_inst)
 Inserts a new, non-speculative instruction into the IQ. More...
 
void insertBarrier (const DynInstPtr &barr_inst)
 Inserts a memory or write barrier into the IQ to make sure loads and stores are ordered properly. More...
 
DynInstPtr getInstToExecute ()
 Returns the oldest scheduled instruction, and removes it from the list of instructions waiting to execute. More...
 
DynInstPtr getDeferredMemInstToExecute ()
 Gets a memory instruction that was referred due to a delayed DTB translation if it is now ready to execute. More...
 
DynInstPtr getBlockedMemInstToExecute ()
 Gets a memory instruction that was blocked on the cache. More...
 
void recordProducer (const DynInstPtr &inst)
 Records the instruction as the producer of a register without adding it to the rest of the IQ. More...
 
void processFUCompletion (const DynInstPtr &inst, int fu_idx)
 Process FU completion event. More...
 
void scheduleReadyInsts ()
 Schedules ready instructions, adding the ready ones (oldest first) to the queue to execute. More...
 
void scheduleNonSpec (const InstSeqNum &inst)
 Schedules a single specific non-speculative instruction. More...
 
void commit (const InstSeqNum &inst, ThreadID tid=0)
 Commits all instructions up to and including the given sequence number, for a specific thread. More...
 
int wakeDependents (const DynInstPtr &completed_inst)
 Wakes all dependents of a completed instruction. More...
 
void addReadyMemInst (const DynInstPtr &ready_inst)
 Adds a ready memory instruction to the ready list. More...
 
void rescheduleMemInst (const DynInstPtr &resched_inst)
 Reschedules a memory instruction. More...
 
void replayMemInst (const DynInstPtr &replay_inst)
 Replays a memory instruction. More...
 
void deferMemInst (const DynInstPtr &deferred_inst)
 Defers a memory instruction when its DTB translation incurs a hw page table walk. More...
 
void blockMemInst (const DynInstPtr &blocked_inst)
 Defers a memory instruction when it is cache blocked. More...
 
void cacheUnblocked ()
 Notify instruction queue that a previous blockage has resolved. More...
 
void violation (const DynInstPtr &store, const DynInstPtr &faulting_load)
 Indicates an ordering violation between a store and a load. More...
 
void squash (ThreadID tid)
 Squashes instructions for a thread. More...
 
unsigned getCount (ThreadID tid)
 Returns the number of used entries for a thread. More...
 
void printInsts ()
 Debug function to print all instructions. More...
 

Public Attributes

Stats::Scalar intInstQueueReads
 
Stats::Scalar intInstQueueWrites
 
Stats::Scalar intInstQueueWakeupAccesses
 
Stats::Scalar fpInstQueueReads
 
Stats::Scalar fpInstQueueWrites
 
Stats::Scalar fpInstQueueWakeupAccesses
 
Stats::Scalar vecInstQueueReads
 
Stats::Scalar vecInstQueueWrites
 
Stats::Scalar vecInstQueueWakeupAccesses
 
Stats::Scalar intAluAccesses
 
Stats::Scalar fpAluAccesses
 
Stats::Scalar vecAluAccesses
 

Private Types

typedef std::priority_queue< DynInstPtr, std::vector< DynInstPtr >, pqCompareReadyInstQueue
 
typedef std::map< InstSeqNum, DynInstPtr >::iterator NonSpecMapIt
 
typedef std::list< ListOrderEntry >::iterator ListOrderIt
 

Private Member Functions

void doSquash (ThreadID tid)
 Does the actual squashing. More...
 
void addToOrderList (OpClass op_class)
 Add an op class to the age order list. More...
 
void moveToYoungerInst (ListOrderIt age_order_it)
 Called when the oldest instruction has been removed from a ready queue; this places that ready queue into the proper spot in the age order list. More...
 
bool addToDependents (const DynInstPtr &new_inst)
 Adds an instruction to the dependency graph, as a consumer. More...
 
void addToProducers (const DynInstPtr &new_inst)
 Adds an instruction to the dependency graph, as a producer. More...
 
void addIfReady (const DynInstPtr &inst)
 Moves an instruction to the ready queue if it is ready. More...
 
int countInsts ()
 Debugging function to count how many entries are in the IQ. More...
 
void dumpLists ()
 Debugging function to dump all the list sizes, as well as print out the list of nonspeculative instructions. More...
 
void dumpInsts ()
 Debugging function to dump out all instructions that are in the IQ. More...
 

Private Attributes

O3CPUcpu
 Pointer to the CPU. More...
 
MemInterfacedcacheInterface
 Cache interface. More...
 
IEWiewStage
 Pointer to IEW stage. More...
 
MemDepUnit memDepUnit [Impl::MaxThreads]
 The memory dependence unit, which tracks/predicts memory dependences between instructions. More...
 
TimeBuffer< IssueStruct > * issueToExecuteQueue
 The queue to the execute stage. More...
 
TimeBuffer< TimeStruct > * timeBuffer
 The backwards time buffer. More...
 
TimeBuffer< TimeStruct >::wire fromCommit
 Wire to read information from timebuffer. More...
 
FUPoolfuPool
 Function unit pool. More...
 
std::list< DynInstPtrinstList [Impl::MaxThreads]
 List of all the instructions in the IQ (some of which may be issued). More...
 
std::list< DynInstPtrinstsToExecute
 List of instructions that are ready to be executed. More...
 
std::list< DynInstPtrdeferredMemInsts
 List of instructions waiting for their DTB translation to complete (hw page table walk in progress). More...
 
std::list< DynInstPtrblockedMemInsts
 List of instructions that have been cache blocked. More...
 
std::list< DynInstPtrretryMemInsts
 List of instructions that were cache blocked, but a retry has been seen since, so they can now be retried. More...
 
ReadyInstQueue readyInsts [Num_OpClasses]
 List of ready instructions, per op class. More...
 
std::map< InstSeqNum, DynInstPtrnonSpecInsts
 List of non-speculative instructions that will be scheduled once the IQ gets a signal from commit. More...
 
std::list< ListOrderEntrylistOrder
 List that contains the age order of the oldest instruction of each ready queue. More...
 
bool queueOnList [Num_OpClasses]
 Tracks if each ready queue is on the age order list. More...
 
ListOrderIt readyIt [Num_OpClasses]
 Iterators of each ready queue. More...
 
DependencyGraph< DynInstPtrdependGraph
 
SMTQueuePolicy iqPolicy
 IQ sharing policy for SMT. More...
 
ThreadID numThreads
 Number of Total Threads. More...
 
std::list< ThreadID > * activeThreads
 Pointer to list of active threads. More...
 
unsigned count [Impl::MaxThreads]
 Per Thread IQ count. More...
 
unsigned maxEntries [Impl::MaxThreads]
 Max IQ Entries Per Thread. More...
 
unsigned freeEntries
 Number of free IQ entries left. More...
 
unsigned numEntries
 The number of entries in the instruction queue. More...
 
unsigned totalWidth
 The total number of instructions that can be issued in one cycle. More...
 
unsigned numPhysRegs
 The number of physical registers in the CPU. More...
 
int wbOutstanding
 Number of instructions currently in flight to FUs. More...
 
Cycles commitToIEWDelay
 Delay between commit stage and the IQ. More...
 
InstSeqNum squashedSeqNum [Impl::MaxThreads]
 The sequence number of the squashed instruction. More...
 
std::vector< bool > regScoreboard
 A cache of the recently woken registers. More...
 
Stats::Scalar iqInstsAdded
 Stat for number of instructions added. More...
 
Stats::Scalar iqNonSpecInstsAdded
 Stat for number of non-speculative instructions added. More...
 
Stats::Scalar iqInstsIssued
 
Stats::Scalar iqIntInstsIssued
 Stat for number of integer instructions issued. More...
 
Stats::Scalar iqFloatInstsIssued
 Stat for number of floating point instructions issued. More...
 
Stats::Scalar iqBranchInstsIssued
 Stat for number of branch instructions issued. More...
 
Stats::Scalar iqMemInstsIssued
 Stat for number of memory instructions issued. More...
 
Stats::Scalar iqMiscInstsIssued
 Stat for number of miscellaneous instructions issued. More...
 
Stats::Scalar iqSquashedInstsIssued
 Stat for number of squashed instructions that were ready to issue. More...
 
Stats::Scalar iqSquashedInstsExamined
 Stat for number of squashed instructions examined when squashing. More...
 
Stats::Scalar iqSquashedOperandsExamined
 Stat for number of squashed instruction operands examined when squashing. More...
 
Stats::Scalar iqSquashedNonSpecRemoved
 Stat for number of non-speculative instructions removed due to a squash. More...
 
Stats::Distribution numIssuedDist
 Distribution of number of instructions in the queue. More...
 
Stats::Vector statFuBusy
 Distribution of the cycles it takes to issue an instruction. More...
 
Stats::Vector2d statIssuedInstType
 Stat for total number issued for each instruction type. More...
 
Stats::Formula issueRate
 Number of instructions issued per cycle. More...
 
Stats::Vector fuBusy
 Number of times the FU was busy. More...
 
Stats::Formula fuBusyRate
 Number of times the FU was busy per instruction issued. More...
 

Detailed Description

template<class Impl>
class InstructionQueue< Impl >

A standard instruction queue class.

It holds ready instructions, in order, in seperate priority queues to facilitate the scheduling of instructions. The IQ uses a separate linked list to track dependencies. Similar to the rename map and the free list, it expects that floating point registers have their indices start after the integer registers (ie with 96 int and 96 fp registers, regs 0-95 are integer and 96-191 are fp). This remains true even for both logical and physical register indices. The IQ depends on the memory dependence unit to track when memory operations are ready in terms of ordering; register dependencies are tracked normally. Right now the IQ also handles the execution timing; this is mainly to allow back-to-back scheduling without requiring IEW to be able to peek into the IQ. At the end of the execution latency, the instruction is put into the queue to execute, where it will have the execute() function called on it.

Todo:
: Make IQ able to handle multiple FU pools.

Definition at line 81 of file inst_queue.hh.

Member Typedef Documentation

◆ DynInstPtr

template<class Impl >
typedef Impl::DynInstPtr InstructionQueue< Impl >::DynInstPtr

Definition at line 86 of file inst_queue.hh.

◆ IEW

template<class Impl >
typedef Impl::CPUPol::IEW InstructionQueue< Impl >::IEW

Definition at line 88 of file inst_queue.hh.

◆ IssueStruct

template<class Impl >
typedef Impl::CPUPol::IssueStruct InstructionQueue< Impl >::IssueStruct

Definition at line 90 of file inst_queue.hh.

◆ ListIt

template<class Impl >
typedef std::list<DynInstPtr>::iterator InstructionQueue< Impl >::ListIt

Definition at line 94 of file inst_queue.hh.

◆ ListOrderIt

template<class Impl >
typedef std::list<ListOrderEntry>::iterator InstructionQueue< Impl >::ListOrderIt
private

Definition at line 377 of file inst_queue.hh.

◆ MemDepUnit

template<class Impl >
typedef Impl::CPUPol::MemDepUnit InstructionQueue< Impl >::MemDepUnit

Definition at line 89 of file inst_queue.hh.

◆ NonSpecMapIt

template<class Impl >
typedef std::map<InstSeqNum, DynInstPtr>::iterator InstructionQueue< Impl >::NonSpecMapIt
private

Definition at line 360 of file inst_queue.hh.

◆ O3CPU

template<class Impl >
typedef Impl::O3CPU InstructionQueue< Impl >::O3CPU

Definition at line 85 of file inst_queue.hh.

◆ ReadyInstQueue

template<class Impl >
typedef std::priority_queue<DynInstPtr, std::vector<DynInstPtr>, pqCompare> InstructionQueue< Impl >::ReadyInstQueue
private

Definition at line 344 of file inst_queue.hh.

◆ TimeStruct

template<class Impl >
typedef Impl::CPUPol::TimeStruct InstructionQueue< Impl >::TimeStruct

Definition at line 91 of file inst_queue.hh.

Constructor & Destructor Documentation

◆ InstructionQueue()

template<class Impl >
InstructionQueue< Impl >::InstructionQueue ( O3CPU cpu_ptr,
IEW iew_ptr,
DerivO3CPUParams *  params 
)

◆ ~InstructionQueue()

template<class Impl >
InstructionQueue< Impl >::~InstructionQueue

Destructs the IQ.

Definition at line 159 of file inst_queue_impl.hh.

References cprintf().

Member Function Documentation

◆ addIfReady()

template<class Impl >
void InstructionQueue< Impl >::addIfReady ( const DynInstPtr inst)
private

Moves an instruction to the ready queue if it is ready.

Definition at line 1437 of file inst_queue_impl.hh.

References DPRINTF.

◆ addReadyMemInst()

template<class Impl >
void InstructionQueue< Impl >::addReadyMemInst ( const DynInstPtr ready_inst)

Adds a ready memory instruction to the ready list.

Definition at line 1087 of file inst_queue_impl.hh.

References DPRINTF.

◆ addToDependents()

template<class Impl >
bool InstructionQueue< Impl >::addToDependents ( const DynInstPtr new_inst)
private

Adds an instruction to the dependency graph, as a consumer.

Definition at line 1353 of file inst_queue_impl.hh.

References PhysRegId::className(), DPRINTF, PhysRegId::flatIndex(), PhysRegId::index(), and PhysRegId::isFixedMapping().

◆ addToOrderList()

template<class Impl >
void InstructionQueue< Impl >::addToOrderList ( OpClass  op_class)
private

Add an op class to the age order list.

Definition at line 696 of file inst_queue_impl.hh.

References InstructionQueue< Impl >::ListOrderEntry::oldestInst, and InstructionQueue< Impl >::ListOrderEntry::queueType.

◆ addToProducers()

template<class Impl >
void InstructionQueue< Impl >::addToProducers ( const DynInstPtr new_inst)
private

Adds an instruction to the dependency graph, as a producer.

Definition at line 1401 of file inst_queue_impl.hh.

References PhysRegId::className(), PhysRegId::flatIndex(), PhysRegId::index(), PhysRegId::isFixedMapping(), and panic.

Referenced by InstructionQueue< Impl >::recordProducer().

◆ blockMemInst()

template<class Impl >
void InstructionQueue< Impl >::blockMemInst ( const DynInstPtr blocked_inst)

Defers a memory instruction when it is cache blocked.

Definition at line 1138 of file inst_queue_impl.hh.

◆ cacheUnblocked()

template<class Impl >
void InstructionQueue< Impl >::cacheUnblocked

Notify instruction queue that a previous blockage has resolved.

Definition at line 1147 of file inst_queue_impl.hh.

◆ commit()

template<class Impl >
void InstructionQueue< Impl >::commit ( const InstSeqNum inst,
ThreadID  tid = 0 
)

Commits all instructions up to and including the given sequence number, for a specific thread.

Definition at line 969 of file inst_queue_impl.hh.

References DPRINTF.

◆ countInsts()

template<class Impl >
int InstructionQueue< Impl >::countInsts
private

Debugging function to count how many entries are in the IQ.

It does a linear walk through the instructions, so do not call this function during normal execution.

Definition at line 1477 of file inst_queue_impl.hh.

◆ deferMemInst()

template<class Impl >
void InstructionQueue< Impl >::deferMemInst ( const DynInstPtr deferred_inst)

Defers a memory instruction when its DTB translation incurs a hw page table walk.

Definition at line 1131 of file inst_queue_impl.hh.

◆ doSquash()

template<class Impl >
void InstructionQueue< Impl >::doSquash ( ThreadID  tid)
private

Does the actual squashing.

Definition at line 1210 of file inst_queue_impl.hh.

References X86ISA::count, DPRINTF, PhysRegId::flatIndex(), PhysRegId::isFixedMapping(), and NoFault.

◆ drainSanityCheck()

template<class Impl >
void InstructionQueue< Impl >::drainSanityCheck

Perform sanity checks after a drain.

Definition at line 470 of file inst_queue_impl.hh.

◆ dumpInsts()

template<class Impl >
void InstructionQueue< Impl >::dumpInsts
private

Debugging function to dump out all instructions that are in the IQ.

Definition at line 1527 of file inst_queue_impl.hh.

References cprintf().

◆ dumpLists()

template<class Impl >
void InstructionQueue< Impl >::dumpLists
private

Debugging function to dump all the list sizes, as well as print out the list of nonspeculative instructions.

Should not be used in any other capacity, but it has no harmful sideaffects.

Definition at line 1484 of file inst_queue_impl.hh.

References cprintf(), ArmISA::i, and Num_OpClasses.

◆ entryAmount()

template<class Impl >
int InstructionQueue< Impl >::entryAmount ( ThreadID  num_threads)

Number of entries needed for given amount of threads.

Definition at line 487 of file inst_queue_impl.hh.

◆ getBlockedMemInstToExecute()

template<class Impl >
Impl::DynInstPtr InstructionQueue< Impl >::getBlockedMemInstToExecute

Gets a memory instruction that was blocked on the cache.

NULL if none available.

Definition at line 1171 of file inst_queue_impl.hh.

◆ getCount()

template<class Impl >
unsigned InstructionQueue< Impl >::getCount ( ThreadID  tid)
inline

Returns the number of used entries for a thread.

Definition at line 265 of file inst_queue.hh.

References InstructionQueue< Impl >::count.

◆ getDeferredMemInstToExecute()

template<class Impl >
Impl::DynInstPtr InstructionQueue< Impl >::getDeferredMemInstToExecute

Gets a memory instruction that was referred due to a delayed DTB translation if it is now ready to execute.

NULL if none available.

Definition at line 1156 of file inst_queue_impl.hh.

◆ getInstToExecute()

template<class Impl >
Impl::DynInstPtr InstructionQueue< Impl >::getInstToExecute

Returns the oldest scheduled instruction, and removes it from the list of instructions waiting to execute.

Definition at line 679 of file inst_queue_impl.hh.

◆ hasReadyInsts()

template<class Impl >
bool InstructionQueue< Impl >::hasReadyInsts

Returns if there are any ready instructions in the IQ.

Definition at line 560 of file inst_queue_impl.hh.

References ArmISA::i, and Num_OpClasses.

◆ insert()

template<class Impl >
void InstructionQueue< Impl >::insert ( const DynInstPtr new_inst)

Inserts a new instruction into the IQ.

Definition at line 577 of file inst_queue_impl.hh.

References X86ISA::count, and DPRINTF.

◆ insertBarrier()

template<class Impl >
void InstructionQueue< Impl >::insertBarrier ( const DynInstPtr barr_inst)

Inserts a memory or write barrier into the IQ to make sure loads and stores are ordered properly.

Definition at line 670 of file inst_queue_impl.hh.

◆ insertNonSpec()

template<class Impl >
void InstructionQueue< Impl >::insertNonSpec ( const DynInstPtr new_inst)

Inserts a new, non-speculative instruction into the IQ.

Definition at line 623 of file inst_queue_impl.hh.

References X86ISA::count, and DPRINTF.

◆ isDrained()

template<class Impl >
bool InstructionQueue< Impl >::isDrained

Determine if we are drained.

Definition at line 457 of file inst_queue_impl.hh.

◆ isFull() [1/2]

template<class Impl >
bool InstructionQueue< Impl >::isFull

Returns whether or not the IQ is full.

Definition at line 538 of file inst_queue_impl.hh.

◆ isFull() [2/2]

template<class Impl >
bool InstructionQueue< Impl >::isFull ( ThreadID  tid)

Returns whether or not the IQ is full for a specific thread.

Definition at line 549 of file inst_queue_impl.hh.

◆ moveToYoungerInst()

template<class Impl >
void InstructionQueue< Impl >::moveToYoungerInst ( ListOrderIt  age_order_it)
private

Called when the oldest instruction has been removed from a ready queue; this places that ready queue into the proper spot in the age order list.

Definition at line 723 of file inst_queue_impl.hh.

References InstructionQueue< Impl >::ListOrderEntry::oldestInst, and InstructionQueue< Impl >::ListOrderEntry::queueType.

◆ name()

template<class Impl >
std::string InstructionQueue< Impl >::name

Returns the name of the IQ.

Definition at line 170 of file inst_queue_impl.hh.

◆ numFreeEntries() [1/2]

template<class Impl >
unsigned InstructionQueue< Impl >::numFreeEntries

Returns total number of free entries.

Definition at line 522 of file inst_queue_impl.hh.

◆ numFreeEntries() [2/2]

template<class Impl >
unsigned InstructionQueue< Impl >::numFreeEntries ( ThreadID  tid)

Returns number of free entries for a thread.

Definition at line 529 of file inst_queue_impl.hh.

References X86ISA::count.

◆ printInsts()

template<class Impl >
void InstructionQueue< Impl >::printInsts ( )

Debug function to print all instructions.

◆ processFUCompletion()

template<class Impl >
void InstructionQueue< Impl >::processFUCompletion ( const DynInstPtr inst,
int  fu_idx 
)

Process FU completion event.

Definition at line 749 of file inst_queue_impl.hh.

References DPRINTF.

◆ recordProducer()

template<class Impl >
void InstructionQueue< Impl >::recordProducer ( const DynInstPtr inst)
inline

Records the instruction as the producer of a register without adding it to the rest of the IQ.

Definition at line 207 of file inst_queue.hh.

References InstructionQueue< Impl >::addToProducers().

◆ regStats()

template<class Impl >
void InstructionQueue< Impl >::regStats

Registers statistics.

Definition at line 177 of file inst_queue_impl.hh.

References Stats::dist, ArmISA::i, name(), Num_OpClasses, Stats::pdf, and Stats::total.

◆ replayMemInst()

template<class Impl >
void InstructionQueue< Impl >::replayMemInst ( const DynInstPtr replay_inst)

Replays a memory instruction.

It must be rescheduled first.

Definition at line 1124 of file inst_queue_impl.hh.

◆ rescheduleMemInst()

template<class Impl >
void InstructionQueue< Impl >::rescheduleMemInst ( const DynInstPtr resched_inst)

Reschedules a memory instruction.

It will be ready to issue once replayMemInst() is called.

Definition at line 1110 of file inst_queue_impl.hh.

References DPRINTF.

◆ resetEntries()

template<class Impl >
void InstructionQueue< Impl >::resetEntries

Resets max entries for all threads.

Definition at line 499 of file inst_queue_impl.hh.

◆ resetState()

template<class Impl >
void InstructionQueue< Impl >::resetState

Resets all instruction queue state.

Definition at line 394 of file inst_queue_impl.hh.

References X86ISA::count, ArmISA::i, and Num_OpClasses.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ scheduleNonSpec()

template<class Impl >
void InstructionQueue< Impl >::scheduleNonSpec ( const InstSeqNum inst)

Schedules a single specific non-speculative instruction.

Definition at line 941 of file inst_queue_impl.hh.

References DPRINTF.

◆ scheduleReadyInsts()

template<class Impl >
void InstructionQueue< Impl >::scheduleReadyInsts

Schedules ready instructions, adding the ready ones (oldest first) to the queue to execute.

Definition at line 773 of file inst_queue_impl.hh.

References X86ISA::count, curTick(), DPRINTF, FUPool::NoCapableFU, FUPool::NoFreeFU, InstructionQueue< Impl >::FUCompletion::setFreeFU(), and IssueStruct< Impl >::size.

◆ setActiveThreads()

template<class Impl >
void InstructionQueue< Impl >::setActiveThreads ( std::list< ThreadID > *  at_ptr)

Sets active threads list.

Definition at line 434 of file inst_queue_impl.hh.

◆ setIssueToExecuteQueue()

template<class Impl >
void InstructionQueue< Impl >::setIssueToExecuteQueue ( TimeBuffer< IssueStruct > *  i2eQueue)

Sets the timer buffer between issue and execute.

Definition at line 441 of file inst_queue_impl.hh.

◆ setTimeBuffer()

template<class Impl >
void InstructionQueue< Impl >::setTimeBuffer ( TimeBuffer< TimeStruct > *  tb_ptr)

Sets the global time buffer.

Definition at line 448 of file inst_queue_impl.hh.

References TimeBuffer< T >::getWire().

◆ squash()

template<class Impl >
void InstructionQueue< Impl >::squash ( ThreadID  tid)

Squashes instructions for a thread.

Squashing information is obtained from the time buffer.

Definition at line 1193 of file inst_queue_impl.hh.

References DPRINTF.

◆ takeOverFrom()

template<class Impl >
void InstructionQueue< Impl >::takeOverFrom

Takes over execution from another CPU's thread.

Definition at line 480 of file inst_queue_impl.hh.

◆ violation()

template<class Impl >
void InstructionQueue< Impl >::violation ( const DynInstPtr store,
const DynInstPtr faulting_load 
)

Indicates an ordering violation between a store and a load.

Definition at line 1184 of file inst_queue_impl.hh.

◆ wakeDependents()

template<class Impl >
int InstructionQueue< Impl >::wakeDependents ( const DynInstPtr completed_inst)

Member Data Documentation

◆ activeThreads

template<class Impl >
std::list<ThreadID>* InstructionQueue< Impl >::activeThreads
private

Pointer to list of active threads.

Definition at line 409 of file inst_queue.hh.

◆ blockedMemInsts

template<class Impl >
std::list<DynInstPtr> InstructionQueue< Impl >::blockedMemInsts
private

List of instructions that have been cache blocked.

Definition at line 322 of file inst_queue.hh.

◆ commitToIEWDelay

template<class Impl >
Cycles InstructionQueue< Impl >::commitToIEWDelay
private

Delay between commit stage and the IQ.

Todo:
: Make there be a distinction between the delays within IEW.

Definition at line 435 of file inst_queue.hh.

◆ count

template<class Impl >
unsigned InstructionQueue< Impl >::count[Impl::MaxThreads]
private

Per Thread IQ count.

Definition at line 412 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::getCount().

◆ cpu

template<class Impl >
O3CPU* InstructionQueue< Impl >::cpu
private

Pointer to the CPU.

Definition at line 279 of file inst_queue.hh.

◆ dcacheInterface

template<class Impl >
MemInterface* InstructionQueue< Impl >::dcacheInterface
private

Cache interface.

Definition at line 282 of file inst_queue.hh.

◆ deferredMemInsts

template<class Impl >
std::list<DynInstPtr> InstructionQueue< Impl >::deferredMemInsts
private

List of instructions waiting for their DTB translation to complete (hw page table walk in progress).

Definition at line 319 of file inst_queue.hh.

◆ dependGraph

template<class Impl >
DependencyGraph<DynInstPtr> InstructionQueue< Impl >::dependGraph
private

Definition at line 396 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ fpAluAccesses

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::fpAluAccesses

Definition at line 541 of file inst_queue.hh.

◆ fpInstQueueReads

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::fpInstQueueReads

Definition at line 533 of file inst_queue.hh.

◆ fpInstQueueWakeupAccesses

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::fpInstQueueWakeupAccesses

Definition at line 535 of file inst_queue.hh.

◆ fpInstQueueWrites

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::fpInstQueueWrites

Definition at line 534 of file inst_queue.hh.

◆ freeEntries

template<class Impl >
unsigned InstructionQueue< Impl >::freeEntries
private

Number of free IQ entries left.

Definition at line 418 of file inst_queue.hh.

◆ fromCommit

template<class Impl >
TimeBuffer<TimeStruct>::wire InstructionQueue< Impl >::fromCommit
private

Wire to read information from timebuffer.

Definition at line 301 of file inst_queue.hh.

◆ fuBusy

template<class Impl >
Stats::Vector InstructionQueue< Impl >::fuBusy
private

Number of times the FU was busy.

Definition at line 526 of file inst_queue.hh.

◆ fuBusyRate

template<class Impl >
Stats::Formula InstructionQueue< Impl >::fuBusyRate
private

Number of times the FU was busy per instruction issued.

Definition at line 528 of file inst_queue.hh.

◆ fuPool

template<class Impl >
FUPool* InstructionQueue< Impl >::fuPool
private

Function unit pool.

Definition at line 304 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ iewStage

template<class Impl >
IEW* InstructionQueue< Impl >::iewStage
private

Pointer to IEW stage.

Definition at line 285 of file inst_queue.hh.

◆ instList

template<class Impl >
std::list<DynInstPtr> InstructionQueue< Impl >::instList[Impl::MaxThreads]
private

List of all the instructions in the IQ (some of which may be issued).

Definition at line 311 of file inst_queue.hh.

◆ instsToExecute

template<class Impl >
std::list<DynInstPtr> InstructionQueue< Impl >::instsToExecute
private

List of instructions that are ready to be executed.

Definition at line 314 of file inst_queue.hh.

◆ intAluAccesses

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::intAluAccesses

Definition at line 540 of file inst_queue.hh.

◆ intInstQueueReads

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::intInstQueueReads

Definition at line 530 of file inst_queue.hh.

◆ intInstQueueWakeupAccesses

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::intInstQueueWakeupAccesses

Definition at line 532 of file inst_queue.hh.

◆ intInstQueueWrites

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::intInstQueueWrites

Definition at line 531 of file inst_queue.hh.

◆ iqBranchInstsIssued

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqBranchInstsIssued
private

Stat for number of branch instructions issued.

Definition at line 485 of file inst_queue.hh.

◆ iqFloatInstsIssued

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqFloatInstsIssued
private

Stat for number of floating point instructions issued.

Definition at line 483 of file inst_queue.hh.

◆ iqInstsAdded

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqInstsAdded
private

Stat for number of instructions added.

Definition at line 475 of file inst_queue.hh.

◆ iqInstsIssued

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqInstsIssued
private

Definition at line 479 of file inst_queue.hh.

◆ iqIntInstsIssued

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqIntInstsIssued
private

Stat for number of integer instructions issued.

Definition at line 481 of file inst_queue.hh.

◆ iqMemInstsIssued

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqMemInstsIssued
private

Stat for number of memory instructions issued.

Definition at line 487 of file inst_queue.hh.

◆ iqMiscInstsIssued

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqMiscInstsIssued
private

Stat for number of miscellaneous instructions issued.

Definition at line 489 of file inst_queue.hh.

◆ iqNonSpecInstsAdded

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqNonSpecInstsAdded
private

Stat for number of non-speculative instructions added.

Definition at line 477 of file inst_queue.hh.

◆ iqPolicy

template<class Impl >
SMTQueuePolicy InstructionQueue< Impl >::iqPolicy
private

IQ sharing policy for SMT.

Definition at line 403 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ iqSquashedInstsExamined

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqSquashedInstsExamined
private

Stat for number of squashed instructions examined when squashing.

Definition at line 493 of file inst_queue.hh.

◆ iqSquashedInstsIssued

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqSquashedInstsIssued
private

Stat for number of squashed instructions that were ready to issue.

Definition at line 491 of file inst_queue.hh.

◆ iqSquashedNonSpecRemoved

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqSquashedNonSpecRemoved
private

Stat for number of non-speculative instructions removed due to a squash.

Definition at line 500 of file inst_queue.hh.

◆ iqSquashedOperandsExamined

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::iqSquashedOperandsExamined
private

Stat for number of squashed instruction operands examined when squashing.

Definition at line 497 of file inst_queue.hh.

◆ issueRate

template<class Impl >
Stats::Formula InstructionQueue< Impl >::issueRate
private

Number of instructions issued per cycle.

Definition at line 523 of file inst_queue.hh.

◆ issueToExecuteQueue

template<class Impl >
TimeBuffer<IssueStruct>* InstructionQueue< Impl >::issueToExecuteQueue
private

The queue to the execute stage.

Issued instructions will be written into it.

Definition at line 295 of file inst_queue.hh.

◆ listOrder

template<class Impl >
std::list<ListOrderEntry> InstructionQueue< Impl >::listOrder
private

List that contains the age order of the oldest instruction of each ready queue.

Used to select the oldest instruction available among op classes.

Todo:
: Might be better to just move these entries around instead of creating new ones every time the position changes due to an instruction issuing. Not sure std::list supports this.

Definition at line 375 of file inst_queue.hh.

◆ maxEntries

template<class Impl >
unsigned InstructionQueue< Impl >::maxEntries[Impl::MaxThreads]
private

Max IQ Entries Per Thread.

Definition at line 415 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ memDepUnit

template<class Impl >
MemDepUnit InstructionQueue< Impl >::memDepUnit[Impl::MaxThreads]
private

The memory dependence unit, which tracks/predicts memory dependences between instructions.

Definition at line 290 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ nonSpecInsts

template<class Impl >
std::map<InstSeqNum, DynInstPtr> InstructionQueue< Impl >::nonSpecInsts
private

List of non-speculative instructions that will be scheduled once the IQ gets a signal from commit.

While it's redundant to have the key be a part of the value (the sequence number is stored inside of DynInst), when these instructions are woken up only the sequence number will be available. Thus it is most efficient to be able to search by the sequence number alone.

Definition at line 358 of file inst_queue.hh.

◆ numEntries

template<class Impl >
unsigned InstructionQueue< Impl >::numEntries
private

The number of entries in the instruction queue.

Definition at line 421 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ numIssuedDist

template<class Impl >
Stats::Distribution InstructionQueue< Impl >::numIssuedDist
private

Distribution of number of instructions in the queue.

Todo:
: Need to create struct to track the entry time for each instruction.

Distribution of the number of instructions issued.

Definition at line 508 of file inst_queue.hh.

◆ numPhysRegs

template<class Impl >
unsigned InstructionQueue< Impl >::numPhysRegs
private

The number of physical registers in the CPU.

Definition at line 427 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ numThreads

template<class Impl >
ThreadID InstructionQueue< Impl >::numThreads
private

Number of Total Threads.

Definition at line 406 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ queueOnList

template<class Impl >
bool InstructionQueue< Impl >::queueOnList[Num_OpClasses]
private

Tracks if each ready queue is on the age order list.

Definition at line 380 of file inst_queue.hh.

◆ readyInsts

template<class Impl >
ReadyInstQueue InstructionQueue< Impl >::readyInsts[Num_OpClasses]
private

List of ready instructions, per op class.

They are separated by op class to allow for easy mapping to FUs.

Definition at line 349 of file inst_queue.hh.

◆ readyIt

template<class Impl >
ListOrderIt InstructionQueue< Impl >::readyIt[Num_OpClasses]
private

Iterators of each ready queue.

Points to their spot in the age order list.

Definition at line 385 of file inst_queue.hh.

◆ regScoreboard

template<class Impl >
std::vector<bool> InstructionQueue< Impl >::regScoreboard
private

A cache of the recently woken registers.

It is 1 if the register has been woken up recently, and 0 if the register has been added to the dependency graph and has not yet received its value. It is basically a secondary scoreboard, and should pretty much mirror the scoreboard that exists in the rename map.

Definition at line 446 of file inst_queue.hh.

Referenced by InstructionQueue< Impl >::InstructionQueue().

◆ retryMemInsts

template<class Impl >
std::list<DynInstPtr> InstructionQueue< Impl >::retryMemInsts
private

List of instructions that were cache blocked, but a retry has been seen since, so they can now be retried.

May fail again go on the blocked list.

Definition at line 327 of file inst_queue.hh.

◆ squashedSeqNum

template<class Impl >
InstSeqNum InstructionQueue< Impl >::squashedSeqNum[Impl::MaxThreads]
private

The sequence number of the squashed instruction.

Definition at line 438 of file inst_queue.hh.

◆ statFuBusy

template<class Impl >
Stats::Vector InstructionQueue< Impl >::statFuBusy
private

Distribution of the cycles it takes to issue an instruction.

Todo:
: Need to create struct to track the ready time for each instruction.

Number of times an instruction could not be issued because a FU was busy.

Definition at line 517 of file inst_queue.hh.

◆ statIssuedInstType

template<class Impl >
Stats::Vector2d InstructionQueue< Impl >::statIssuedInstType
private

Stat for total number issued for each instruction type.

Definition at line 520 of file inst_queue.hh.

◆ timeBuffer

template<class Impl >
TimeBuffer<TimeStruct>* InstructionQueue< Impl >::timeBuffer
private

The backwards time buffer.

Definition at line 298 of file inst_queue.hh.

◆ totalWidth

template<class Impl >
unsigned InstructionQueue< Impl >::totalWidth
private

The total number of instructions that can be issued in one cycle.

Definition at line 424 of file inst_queue.hh.

◆ vecAluAccesses

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::vecAluAccesses

Definition at line 542 of file inst_queue.hh.

◆ vecInstQueueReads

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::vecInstQueueReads

Definition at line 536 of file inst_queue.hh.

◆ vecInstQueueWakeupAccesses

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::vecInstQueueWakeupAccesses

Definition at line 538 of file inst_queue.hh.

◆ vecInstQueueWrites

template<class Impl >
Stats::Scalar InstructionQueue< Impl >::vecInstQueueWrites

Definition at line 537 of file inst_queue.hh.

◆ wbOutstanding

template<class Impl >
int InstructionQueue< Impl >::wbOutstanding
private

Number of instructions currently in flight to FUs.

Definition at line 430 of file inst_queue.hh.


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:26 for gem5 by doxygen 1.8.17