gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 (DynInstPtr &new_inst)
 Inserts a new instruction into the IQ. More...
 
void insertNonSpec (DynInstPtr &new_inst)
 Inserts a new, non-speculative instruction into the IQ. More...
 
void insertBarrier (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 (DynInstPtr &inst)
 Records the instruction as the producer of a register without adding it to the rest of the IQ. More...
 
void processFUCompletion (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 (DynInstPtr &completed_inst)
 Wakes all dependents of a completed instruction. More...
 
void addReadyMemInst (DynInstPtr &ready_inst)
 Adds a ready memory instruction to the ready list. More...
 
void rescheduleMemInst (DynInstPtr &resched_inst)
 Reschedules a memory instruction. More...
 
void replayMemInst (DynInstPtr &replay_inst)
 Replays a memory instruction. More...
 
void completeMemInst (DynInstPtr &completed_inst)
 Completes a memory operation. More...
 
void deferMemInst (DynInstPtr &deferred_inst)
 Defers a memory instruction when its DTB translation incurs a hw page table walk. More...
 
void blockMemInst (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 (DynInstPtr &store, 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 fpInstQueueWakeupQccesses
 
Stats::Scalar intAluAccesses
 
Stats::Scalar fpAluAccesses
 

Private Types

enum  IQPolicy { Dynamic, Partitioned, Threshold }
 IQ Resource Sharing Policy. More...
 
typedef std::priority_queue
< DynInstPtr, std::vector
< DynInstPtr >, pqCompare
ReadyInstQueue
 
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 (DynInstPtr &new_inst)
 Adds an instruction to the dependency graph, as a consumer. More...
 
void addToProducers (DynInstPtr &new_inst)
 Adds an instruction to the dependency graph, as a producer. More...
 
void addIfReady (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...
 
MemInterface * dcacheInterface
 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
 
IQPolicy 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 82 of file inst_queue.hh.

Member Typedef Documentation

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

Definition at line 87 of file inst_queue.hh.

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

Definition at line 89 of file inst_queue.hh.

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

Definition at line 91 of file inst_queue.hh.

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

Definition at line 95 of file inst_queue.hh.

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

Definition at line 381 of file inst_queue.hh.

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

Definition at line 90 of file inst_queue.hh.

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

Definition at line 364 of file inst_queue.hh.

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

Definition at line 86 of file inst_queue.hh.

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

Definition at line 348 of file inst_queue.hh.

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

Definition at line 92 of file inst_queue.hh.

Member Enumeration Documentation

template<class Impl>
enum InstructionQueue::IQPolicy
private

IQ Resource Sharing Policy.

Enumerator
Dynamic 
Partitioned 
Threshold 

Definition at line 407 of file inst_queue.hh.

Constructor & Destructor Documentation

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

Destructs the IQ.

Definition at line 168 of file inst_queue_impl.hh.

References cprintf().

Member Function Documentation

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

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

Definition at line 1372 of file inst_queue_impl.hh.

References DPRINTF.

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

Adds a ready memory instruction to the ready list.

Definition at line 1031 of file inst_queue_impl.hh.

References DPRINTF.

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

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

Definition at line 1290 of file inst_queue_impl.hh.

References DPRINTF.

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

Add an op class to the age order list.

Definition at line 670 of file inst_queue_impl.hh.

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

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

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

Definition at line 1336 of file inst_queue_impl.hh.

References panic.

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

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

Defers a memory instruction when it is cache blocked.

Definition at line 1099 of file inst_queue_impl.hh.

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

Notify instruction queue that a previous blockage has resolved.

Definition at line 1111 of file inst_queue_impl.hh.

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 931 of file inst_queue_impl.hh.

References DPRINTF.

template<class Impl >
void InstructionQueue< Impl >::completeMemInst ( DynInstPtr completed_inst)

Completes a memory operation.

Definition at line 1075 of file inst_queue_impl.hh.

References X86ISA::count, and DPRINTF.

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 1412 of file inst_queue_impl.hh.

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

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

Definition at line 1092 of file inst_queue_impl.hh.

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

Does the actual squashing.

Definition at line 1174 of file inst_queue_impl.hh.

References X86ISA::count, DPRINTF, and NoFault.

template<class Impl >
void InstructionQueue< Impl >::drainSanityCheck ( ) const

Perform sanity checks after a drain.

Definition at line 459 of file inst_queue_impl.hh.

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

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

Definition at line 1491 of file inst_queue_impl.hh.

References cprintf().

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 1448 of file inst_queue_impl.hh.

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

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

Number of entries needed for given amount of threads.

Definition at line 476 of file inst_queue_impl.hh.

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 1135 of file inst_queue_impl.hh.

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

Returns the number of used entries for a thread.

Definition at line 269 of file inst_queue.hh.

References InstructionQueue< Impl >::count.

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 1120 of file inst_queue_impl.hh.

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 655 of file inst_queue_impl.hh.

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

Returns if there are any ready instructions in the IQ.

Definition at line 548 of file inst_queue_impl.hh.

References ArmISA::i, and Num_OpClasses.

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

Inserts a new instruction into the IQ.

Definition at line 565 of file inst_queue_impl.hh.

References X86ISA::count, and DPRINTF.

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

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

Definition at line 646 of file inst_queue_impl.hh.

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

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

Definition at line 605 of file inst_queue_impl.hh.

References X86ISA::count, and DPRINTF.

template<class Impl >
bool InstructionQueue< Impl >::isDrained ( ) const

Determine if we are drained.

Definition at line 446 of file inst_queue_impl.hh.

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

Returns whether or not the IQ is full.

Definition at line 526 of file inst_queue_impl.hh.

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

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

Definition at line 537 of file inst_queue_impl.hh.

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 697 of file inst_queue_impl.hh.

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

template<class Impl >
std::string InstructionQueue< Impl >::name ( ) const

Returns the name of the IQ.

Definition at line 179 of file inst_queue_impl.hh.

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

Returns total number of free entries.

Definition at line 510 of file inst_queue_impl.hh.

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

Returns number of free entries for a thread.

Definition at line 517 of file inst_queue_impl.hh.

References X86ISA::count.

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

Debug function to print all instructions.

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

Process FU completion event.

Definition at line 723 of file inst_queue_impl.hh.

References DPRINTF.

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

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

Definition at line 208 of file inst_queue.hh.

References InstructionQueue< Impl >::addToProducers().

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

Registers statistics.

Definition at line 186 of file inst_queue_impl.hh.

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

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

Replays a memory instruction.

It must be rescheduled first.

Definition at line 1068 of file inst_queue_impl.hh.

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

Reschedules a memory instruction.

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

Definition at line 1054 of file inst_queue_impl.hh.

References DPRINTF.

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

Resets max entries for all threads.

Definition at line 488 of file inst_queue_impl.hh.

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

Resets all instruction queue state.

Definition at line 383 of file inst_queue_impl.hh.

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

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

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

Schedules a single specific non-speculative instruction.

Definition at line 903 of file inst_queue_impl.hh.

References DPRINTF.

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

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

Definition at line 747 of file inst_queue_impl.hh.

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

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

Sets active threads list.

Definition at line 423 of file inst_queue_impl.hh.

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

Sets the timer buffer between issue and execute.

Definition at line 430 of file inst_queue_impl.hh.

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

Sets the global time buffer.

Definition at line 437 of file inst_queue_impl.hh.

References TimeBuffer< T >::getWire().

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 1157 of file inst_queue_impl.hh.

References DPRINTF.

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

Takes over execution from another CPU's thread.

Definition at line 469 of file inst_queue_impl.hh.

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

Indicates an ordering violation between a store and a load.

Definition at line 1148 of file inst_queue_impl.hh.

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

Wakes all dependents of a completed instruction.

Definition at line 949 of file inst_queue_impl.hh.

References DPRINTF.

Member Data Documentation

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

Pointer to list of active threads.

Definition at line 420 of file inst_queue.hh.

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

List of instructions that have been cache blocked.

Definition at line 326 of file inst_queue.hh.

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 446 of file inst_queue.hh.

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

Per Thread IQ count.

Definition at line 423 of file inst_queue.hh.

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

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

Pointer to the CPU.

Definition at line 283 of file inst_queue.hh.

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

Cache interface.

Definition at line 286 of file inst_queue.hh.

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 323 of file inst_queue.hh.

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

Definition at line 400 of file inst_queue.hh.

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

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

Definition at line 549 of file inst_queue.hh.

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

Definition at line 544 of file inst_queue.hh.

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

Definition at line 546 of file inst_queue.hh.

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

Definition at line 545 of file inst_queue.hh.

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

Number of free IQ entries left.

Definition at line 429 of file inst_queue.hh.

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

Wire to read information from timebuffer.

Definition at line 305 of file inst_queue.hh.

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

Number of times the FU was busy.

Definition at line 537 of file inst_queue.hh.

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

Number of times the FU was busy per instruction issued.

Definition at line 539 of file inst_queue.hh.

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

Function unit pool.

Definition at line 308 of file inst_queue.hh.

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

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

Pointer to IEW stage.

Definition at line 289 of file inst_queue.hh.

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 315 of file inst_queue.hh.

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

List of instructions that are ready to be executed.

Definition at line 318 of file inst_queue.hh.

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

Definition at line 548 of file inst_queue.hh.

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

Definition at line 541 of file inst_queue.hh.

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

Definition at line 543 of file inst_queue.hh.

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

Definition at line 542 of file inst_queue.hh.

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

Stat for number of branch instructions issued.

Definition at line 496 of file inst_queue.hh.

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

Stat for number of floating point instructions issued.

Definition at line 494 of file inst_queue.hh.

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

Stat for number of instructions added.

Definition at line 486 of file inst_queue.hh.

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

Definition at line 490 of file inst_queue.hh.

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

Stat for number of integer instructions issued.

Definition at line 492 of file inst_queue.hh.

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

Stat for number of memory instructions issued.

Definition at line 498 of file inst_queue.hh.

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

Stat for number of miscellaneous instructions issued.

Definition at line 500 of file inst_queue.hh.

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

Stat for number of non-speculative instructions added.

Definition at line 488 of file inst_queue.hh.

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

IQ sharing policy for SMT.

Definition at line 414 of file inst_queue.hh.

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

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

Stat for number of squashed instructions examined when squashing.

Definition at line 504 of file inst_queue.hh.

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

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

Definition at line 502 of file inst_queue.hh.

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

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

Definition at line 511 of file inst_queue.hh.

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

Stat for number of squashed instruction operands examined when squashing.

Definition at line 508 of file inst_queue.hh.

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

Number of instructions issued per cycle.

Definition at line 534 of file inst_queue.hh.

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 299 of file inst_queue.hh.

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 379 of file inst_queue.hh.

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

Max IQ Entries Per Thread.

Definition at line 426 of file inst_queue.hh.

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

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

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

Definition at line 294 of file inst_queue.hh.

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

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 362 of file inst_queue.hh.

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

The number of entries in the instruction queue.

Definition at line 432 of file inst_queue.hh.

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

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 519 of file inst_queue.hh.

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

The number of physical registers in the CPU.

Definition at line 438 of file inst_queue.hh.

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

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

Number of Total Threads.

Definition at line 417 of file inst_queue.hh.

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

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

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

Definition at line 384 of file inst_queue.hh.

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 353 of file inst_queue.hh.

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 389 of file inst_queue.hh.

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 457 of file inst_queue.hh.

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

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 331 of file inst_queue.hh.

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

The sequence number of the squashed instruction.

Definition at line 449 of file inst_queue.hh.

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 528 of file inst_queue.hh.

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

Stat for total number issued for each instruction type.

Definition at line 531 of file inst_queue.hh.

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

The backwards time buffer.

Definition at line 302 of file inst_queue.hh.

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

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

Definition at line 435 of file inst_queue.hh.

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

Number of instructions currently in flight to FUs.

Definition at line 441 of file inst_queue.hh.


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

Generated on Fri Jun 9 2017 13:04:13 for gem5 by doxygen 1.8.6