42 #ifndef __CPU_O3_INST_QUEUE_HH__ 43 #define __CPU_O3_INST_QUEUE_HH__ 56 #include "enums/SMTQueuePolicy.hh" 59 struct DerivO3CPUParams;
85 typedef typename Impl::O3CPU
O3CPU;
88 typedef typename Impl::CPUPol::IEW
IEW;
130 std::string
name()
const;
178 void insert(
const DynInstPtr &new_inst);
259 void violation(
const DynInstPtr &store,
const DynInstPtr &faulting_load);
340 bool operator() (
const DynInstPtr &lhs,
const DynInstPtr &rhs)
const 342 return lhs->seqNum > rhs->seqNum;
346 typedef std::priority_queue<DynInstPtr, std::vector<DynInstPtr>,
pqCompare>
363 typedef typename std::map<InstSeqNum, DynInstPtr>::iterator
NonSpecMapIt;
548 #endif //__CPU_O3_INST_QUEUE_HH__ Stats::Scalar iqMiscInstsIssued
Stat for number of miscellaneous instructions issued.
int wbOutstanding
Number of instructions currently in flight to FUs.
void regStats()
Registers statistics.
std::list< ThreadID > * activeThreads
Pointer to list of active threads.
Stats::Scalar iqFloatInstsIssued
Stat for number of floating point instructions issued.
unsigned getCount(ThreadID tid)
Returns the number of used entries for a thread.
void replayMemInst(const DynInstPtr &replay_inst)
Replays a memory instruction.
Stats::Scalar vecInstQueueReads
Struct for comparing entries to be added to the priority queue.
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...
Stats::Scalar intAluAccesses
void recordProducer(const DynInstPtr &inst)
Records the instruction as the producer of a register without adding it to the rest of the IQ...
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 squash()
Squash the current event.
void dumpInsts()
Debugging function to dump out all instructions that are in the IQ.
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...
Stats::Scalar iqInstsIssued
MemInterface * dcacheInterface
Cache interface.
FU completion event class.
Stats::Scalar iqMemInstsIssued
Stat for number of memory instructions issued.
A vector of scalar stats.
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...
unsigned numEntries
The number of entries in the instruction queue.
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.
Declaration of Statistics objects.
DynInstPtr inst
Executing instruction.
This is a simple scalar statistic, like a counter.
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
Impl::CPUPol::IssueStruct IssueStruct
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.
int fuIdx
Index of the FU used for executing.
bool hasReadyInsts()
Returns if there are any ready instructions in the IQ.
Stats::Scalar intInstQueueWakeupAccesses
virtual const std::string name() const
Stats::Scalar iqSquashedNonSpecRemoved
Stat for number of non-speculative instructions removed due to a squash.
Pool of FU's, specific to the new CPU model.
Array of linked list that maintains the dependencies between producing instructions and consuming ins...
A simple distribution stat.
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 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.
Stats::Scalar iqBranchInstsIssued
Stat for number of branch instructions issued.
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.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
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
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 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...
void drainSanityCheck() const
Perform sanity checks after a drain.
int16_t ThreadID
Thread index/ID type.
Stats::Vector2d statIssuedInstType
Stat for total number issued for each instruction type.
SMTQueuePolicy iqPolicy
IQ sharing policy for SMT.
DependencyGraph< DynInstPtr > dependGraph
int countInsts()
Debugging function to count how many entries are in the IQ.
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::priority_queue< DynInstPtr, std::vector< DynInstPtr >, pqCompare > ReadyInstQueue
void completeMemInst(const DynInstPtr &completed_inst)
Completes a memory operation.
std::map< InstSeqNum, DynInstPtr >::iterator NonSpecMapIt
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.
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.
void printInsts()
Debug function to print all instructions.
Stats::Formula issueRate
Number of instructions issued per cycle.
unsigned numPhysRegs
The number of physical registers in the CPU.
A 2-Dimensional vecto of scalar stats.
Stats::Scalar intInstQueueReads
MemDepUnit memDepUnit[Impl::MaxThreads]
The memory dependence unit, which tracks/predicts memory dependences between instructions.
void addToProducers(const DynInstPtr &new_inst)
Adds an instruction to the dependency graph, as a producer.
FUPool * fuPool
Function unit pool.
std::list< DynInstPtr > deferredMemInsts
List of instructions waiting for their DTB translation to complete (hw page table walk in progress)...
bool isDrained() const
Determine if we are drained.
FUCompletion(const DynInstPtr &_inst, int fu_idx, InstructionQueue< Impl > *iq_ptr)
Construct a FU completion event.
InstructionQueue< Impl > * iqPtr
Pointer back to the instruction queue.
A standard instruction queue class.
unsigned totalWidth
The total number of instructions that can be issued in one cycle.
void dumpLists()
Debugging function to dump all the list sizes, as well as print out the list of nonspeculative instru...
Stats::Distribution numIssuedDist
Distribution of number of instructions in the queue.
unsigned freeEntries
Number of free IQ entries left.
Stats::Vector statFuBusy
Distribution of the cycles it takes to issue an instruction.
Impl::CPUPol::MemDepUnit MemDepUnit
Impl::CPUPol::TimeStruct TimeStruct
ThreadID numThreads
Number of Total Threads.
void insert(const DynInstPtr &new_inst)
Inserts a new instruction into the IQ.