41#ifndef __CPU_O3_ROB_HH__
42#define __CPU_O3_ROB_HH__
54#include "enums/SMTQueuePolicy.hh"
59struct BaseO3CPUParams;
66struct DerivO3CPUParams;
97 ROB(
CPU *_cpu,
const BaseO3CPUParams ¶ms);
99 std::string
name()
const;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
bool isFull()
Returns if the ROB is full.
bool canCommit()
Is there any commitable head instruction across all threads ready.
int countInsts()
This is more of a debugging function than anything.
void insertInst(const DynInstPtr &inst)
Function to insert an instruction into the ROB.
unsigned getMaxEntries(ThreadID tid)
Returns the maximum number of entries for a specific thread.
bool isDoneSquashing()
Checks if the ROB is still in the process of squashing instructions for any thread.
gem5::o3::ROB::ROBStats stats
unsigned numFreeEntries()
Returns the number of total free entries in the ROB.
void updateTail()
Updates the tail instruction with the new youngest instruction.
InstIt tail
Iterator pointing to the instruction which is the last instruction in the ROB.
void resetEntries()
Re-adjust ROB partitioning.
void squash(InstSeqNum squash_num, ThreadID tid)
Squashes all instructions younger than the given sequence number for the specific thread.
bool isEmpty(ThreadID tid) const
Returns if a specific thread's partition is empty.
bool isHeadReady(ThreadID tid)
Is the oldest instruction across all threads ready.
ROB(CPU *_cpu, const BaseO3CPUParams ¶ms)
ROB constructor.
void retireHead(ThreadID tid)
Retires the head instruction, removing it from the ROB.
std::list< DynInstPtr > instList[MaxThreads]
ROB List of Instructions.
DynInstPtr findInst(ThreadID tid, InstSeqNum squash_inst)
Returns a pointer to the instruction with the given sequence if it is in the ROB.
Status
Possible ROB statuses.
InstSeqNum squashedSeqNum[MaxThreads]
The sequence number of the squashed instruction.
std::list< ThreadID > * activeThreads
Active Threads in CPU.
void updateHead()
Updates the head instruction with the new oldest instruction.
void drainSanityCheck() const
Perform sanity checks after a drain.
Status robStatus[MaxThreads]
Per-thread ROB status.
void doSquash(ThreadID tid)
Executes the squash, marking squashed instructions.
const DynInstPtr & readHeadInst(ThreadID tid)
Returns pointer to the head instruction within the ROB.
unsigned maxEntries[MaxThreads]
Max Insts a Thread Can Have in the ROB.
InstIt head
Iterator pointing to the instruction which is the first instruction in in the ROB.
bool isFull(ThreadID tid)
Returns if a specific thread's partition is full.
int entryAmount(ThreadID num_threads)
Number of entries needed For 'num_threads' amount of threads.
SMTQueuePolicy robPolicy
ROB resource sharing policy for SMT mode.
DynInstPtr readTailInst(ThreadID tid)
Returns pointer to the tail instruction within the ROB.
unsigned getThreadEntries(ThreadID tid)
Returns the number of entries being used by a specific thread.
InstIt squashIt[MaxThreads]
Iterator used for walking through the list of instructions when squashing.
void setActiveThreads(std::list< ThreadID > *at_ptr)
Sets pointer to the list of active threads.
unsigned numEntries
Number of instructions in the ROB.
void resetState()
Reset the ROB state.
ThreadID numThreads
Number of active threads.
bool doneSquashing[MaxThreads]
Is the ROB done squashing.
CPU * cpu
Pointer to the CPU.
unsigned squashWidth
Number of instructions that can be squashed in a single cycle.
std::list< DynInstPtr >::iterator InstIt
bool isEmpty() const
Returns if the ROB is empty.
void takeOverFrom()
Takes over another CPU's thread.
DynInstPtr dummyInst
Dummy instruction returned if there are no insts left.
int numInstsInROB
Number of instructions in the ROB.
unsigned threadEntries[MaxThreads]
Entries Per Thread.
std::pair< RegIndex, RegIndex > UnmapInfo
bool isDoneSquashing(ThreadID tid) const
Reads the PC of the oldest head instruction.
This is a simple scalar statistic, like a counter.
static constexpr int MaxThreads
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
int16_t ThreadID
Thread index/ID type.
Declaration of Statistics objects.
ROBStats(statistics::Group *parent)
statistics::Scalar writes