gem5
v20.0.0.0
|
#include <rob.hh>
Public Types | |
enum | Status { Running, Idle, ROBSquashing } |
Possible ROB statuses. More... | |
typedef Impl::O3CPU | O3CPU |
typedef Impl::DynInstPtr | DynInstPtr |
typedef std::pair< RegIndex, PhysRegIndex > | UnmapInfo |
typedef std::list< DynInstPtr >::iterator | InstIt |
Public Member Functions | |
ROB (O3CPU *_cpu, DerivO3CPUParams *params) | |
ROB constructor. More... | |
std::string | name () const |
void | setActiveThreads (std::list< ThreadID > *at_ptr) |
Sets pointer to the list of active threads. More... | |
void | drainSanityCheck () const |
Perform sanity checks after a drain. More... | |
void | takeOverFrom () |
Takes over another CPU's thread. More... | |
void | insertInst (const DynInstPtr &inst) |
Function to insert an instruction into the ROB. More... | |
const DynInstPtr & | readHeadInst (ThreadID tid) |
Returns pointer to the head instruction within the ROB. More... | |
DynInstPtr | findInst (ThreadID tid, InstSeqNum squash_inst) |
Returns a pointer to the instruction with the given sequence if it is in the ROB. More... | |
DynInstPtr | readTailInst (ThreadID tid) |
Returns pointer to the tail instruction within the ROB. More... | |
void | retireHead (ThreadID tid) |
Retires the head instruction, removing it from the ROB. More... | |
bool | isHeadReady (ThreadID tid) |
Is the oldest instruction across all threads ready. More... | |
bool | canCommit () |
Is there any commitable head instruction across all threads ready. More... | |
void | resetEntries () |
Re-adjust ROB partitioning. More... | |
int | entryAmount (ThreadID num_threads) |
Number of entries needed For 'num_threads' amount of threads. More... | |
unsigned | numFreeEntries () |
Returns the number of total free entries in the ROB. More... | |
unsigned | numFreeEntries (ThreadID tid) |
Returns the number of free entries in a specific ROB paritition. More... | |
unsigned | getMaxEntries (ThreadID tid) |
Returns the maximum number of entries for a specific thread. More... | |
unsigned | getThreadEntries (ThreadID tid) |
Returns the number of entries being used by a specific thread. More... | |
bool | isFull () |
Returns if the ROB is full. More... | |
bool | isFull (ThreadID tid) |
Returns if a specific thread's partition is full. More... | |
bool | isEmpty () const |
Returns if the ROB is empty. More... | |
bool | isEmpty (ThreadID tid) const |
Returns if a specific thread's partition is empty. More... | |
void | doSquash (ThreadID tid) |
Executes the squash, marking squashed instructions. More... | |
void | squash (InstSeqNum squash_num, ThreadID tid) |
Squashes all instructions younger than the given sequence number for the specific thread. More... | |
void | updateHead () |
Updates the head instruction with the new oldest instruction. More... | |
void | updateTail () |
Updates the tail instruction with the new youngest instruction. More... | |
bool | isDoneSquashing (ThreadID tid) const |
Reads the PC of the oldest head instruction. More... | |
bool | isDoneSquashing () |
Checks if the ROB is still in the process of squashing instructions for any thread. More... | |
int | countInsts () |
This is more of a debugging function than anything. More... | |
size_t | countInsts (ThreadID tid) |
This is more of a debugging function than anything. More... | |
void | regStats () |
Registers statistics. More... | |
Public Attributes | |
InstIt | tail |
Iterator pointing to the instruction which is the last instruction in the ROB. More... | |
InstIt | head |
Iterator pointing to the instruction which is the first instruction in in the ROB. More... | |
int | numInstsInROB |
Number of instructions in the ROB. More... | |
DynInstPtr | dummyInst |
Dummy instruction returned if there are no insts left. More... | |
Private Member Functions | |
void | resetState () |
Reset the ROB state. More... | |
Private Attributes | |
Status | robStatus [Impl::MaxThreads] |
Per-thread ROB status. More... | |
SMTQueuePolicy | robPolicy |
ROB resource sharing policy for SMT mode. More... | |
O3CPU * | cpu |
Pointer to the CPU. More... | |
std::list< ThreadID > * | activeThreads |
Active Threads in CPU. More... | |
unsigned | numEntries |
Number of instructions in the ROB. More... | |
unsigned | threadEntries [Impl::MaxThreads] |
Entries Per Thread. More... | |
unsigned | maxEntries [Impl::MaxThreads] |
Max Insts a Thread Can Have in the ROB. More... | |
std::list< DynInstPtr > | instList [Impl::MaxThreads] |
ROB List of Instructions. More... | |
unsigned | squashWidth |
Number of instructions that can be squashed in a single cycle. More... | |
InstIt | squashIt [Impl::MaxThreads] |
Iterator used for walking through the list of instructions when squashing. More... | |
InstSeqNum | squashedSeqNum [Impl::MaxThreads] |
The sequence number of the squashed instruction. More... | |
bool | doneSquashing [Impl::MaxThreads] |
Is the ROB done squashing. More... | |
ThreadID | numThreads |
Number of active threads. More... | |
Stats::Scalar | robReads |
Stats::Scalar | robWrites |
typedef Impl::DynInstPtr ROB< Impl >::DynInstPtr |
typedef std::list<DynInstPtr>::iterator ROB< Impl >::InstIt |
typedef std::pair<RegIndex, PhysRegIndex> ROB< Impl >::UnmapInfo |
enum ROB::Status |
ROB constructor.
_cpu | The cpu object pointer. |
params | The cpu params including several ROB-specific parameters. |
Definition at line 55 of file rob_impl.hh.
References DPRINTF, ROB< Impl >::maxEntries, ROB< Impl >::numEntries, ROB< Impl >::numThreads, ROB< Impl >::resetState(), and ROB< Impl >::robPolicy.
bool ROB< Impl >::canCommit | ( | ) |
Is there any commitable head instruction across all threads ready.
Definition at line 287 of file rob_impl.hh.
References ROB< Impl >::activeThreads, and ROB< Impl >::isHeadReady().
int ROB< Impl >::countInsts | ( | ) |
This is more of a debugging function than anything.
Use numInstsInROB to get the instructions in the ROB unless you are double checking that variable.
Definition at line 184 of file rob_impl.hh.
References ROB< Impl >::numThreads, and Stats::total.
Referenced by ROB< Impl >::isDoneSquashing(), and DefaultCommit< Impl >::tick().
This is more of a debugging function than anything.
Use threadEntries to get the instructions in the ROB unless you are double checking that variable.
Definition at line 196 of file rob_impl.hh.
References ROB< Impl >::instList.
Executes the squash, marking squashed instructions.
Definition at line 320 of file rob_impl.hh.
References ROB< Impl >::doneSquashing, DPRINTF, ROB< Impl >::instList, ROB< Impl >::robWrites, ROB< Impl >::squashedSeqNum, ROB< Impl >::squashIt, ROB< Impl >::squashWidth, and ROB< Impl >::updateTail().
Referenced by ROB< Impl >::isEmpty(), ROB< Impl >::squash(), and DefaultCommit< Impl >::tick().
void ROB< Impl >::drainSanityCheck | ( | ) | const |
Perform sanity checks after a drain.
Definition at line 134 of file rob_impl.hh.
References ROB< Impl >::instList, ROB< Impl >::isEmpty(), and ROB< Impl >::numThreads.
Referenced by DefaultCommit< Impl >::drainSanityCheck().
Number of entries needed For 'num_threads' amount of threads.
Definition at line 173 of file rob_impl.hh.
References ROB< Impl >::numEntries, and ROB< Impl >::robPolicy.
Impl::DynInstPtr ROB< Impl >::findInst | ( | ThreadID | tid, |
InstSeqNum | squash_inst | ||
) |
Returns a pointer to the instruction with the given sequence if it is in the ROB.
Definition at line 546 of file rob_impl.hh.
References ROB< Impl >::instList.
Referenced by DefaultCommit< Impl >::commit().
Returns the maximum number of entries for a specific thread.
Definition at line 169 of file rob.hh.
References ROB< Impl >::maxEntries.
Referenced by DefaultCommit< Impl >::getInsts().
Returns the number of entries being used by a specific thread.
Definition at line 173 of file rob.hh.
References ROB< Impl >::threadEntries.
Referenced by DefaultCommit< Impl >::getInsts().
void ROB< Impl >::insertInst | ( | const DynInstPtr & | inst | ) |
Function to insert an instruction into the ROB.
Note that whatever calls this function must ensure that there is enough space within the ROB for the new instruction.
inst | The instruction being inserted into the ROB. |
Definition at line 203 of file rob_impl.hh.
References DPRINTF, ROB< Impl >::head, ROB< Impl >::instList, ROB< Impl >::numEntries, ROB< Impl >::numInstsInROB, ROB< Impl >::robWrites, ROB< Impl >::tail, and ROB< Impl >::threadEntries.
Referenced by DefaultCommit< Impl >::getInsts().
Reads the PC of the oldest head instruction.
Reads the PC of the head instruction of a specific thread. Reads the next PC of the oldest head instruction. Reads the next PC of the head instruction of a specific thread. Reads the sequence number of the oldest head instruction. Reads the sequence number of the head instruction of a specific thread.Reads the PC of the youngest tail instruction. Reads the PC of the tail instruction of a specific thread. Reads the sequence number of the youngest tail instruction. Reads the sequence number of tail instruction of a specific thread. Checks if the ROB is still in the process of squashing instructions.
Whether | or not the ROB is done squashing. |
Definition at line 240 of file rob.hh.
References ROB< Impl >::countInsts(), ROB< Impl >::doneSquashing, ROB< Impl >::isDoneSquashing(), ROB< Impl >::regStats(), and ROB< Impl >::resetState().
Referenced by DefaultCommit< Impl >::tick().
bool ROB< Impl >::isDoneSquashing | ( | ) |
Checks if the ROB is still in the process of squashing instructions for any thread.
Referenced by ROB< Impl >::isDoneSquashing().
|
inline |
Returns if the ROB is empty.
Definition at line 185 of file rob.hh.
References ROB< Impl >::numInstsInROB.
Referenced by DefaultCommit< Impl >::commit(), ROB< Impl >::drainSanityCheck(), DefaultCommit< Impl >::isDrained(), DefaultCommit< Impl >::oldestReady(), ROB< Impl >::squash(), DefaultCommit< Impl >::squashAll(), and DefaultCommit< Impl >::tick().
Returns if a specific thread's partition is empty.
Definition at line 189 of file rob.hh.
References ROB< Impl >::doSquash(), ROB< Impl >::squash(), ROB< Impl >::threadEntries, ROB< Impl >::updateHead(), and ROB< Impl >::updateTail().
|
inline |
Returns if the ROB is full.
Definition at line 177 of file rob.hh.
References ROB< Impl >::numEntries, and ROB< Impl >::numInstsInROB.
Returns if a specific thread's partition is full.
Definition at line 181 of file rob.hh.
References ROB< Impl >::numEntries, and ROB< Impl >::threadEntries.
Is the oldest instruction across all threads ready.
Is the oldest instruction across a particular thread ready.
Definition at line 275 of file rob_impl.hh.
References ROB< Impl >::instList, ROB< Impl >::robReads, and ROB< Impl >::threadEntries.
Referenced by ROB< Impl >::canCommit(), DefaultCommit< Impl >::commitInsts(), DefaultCommit< Impl >::oldestReady(), and DefaultCommit< Impl >::roundRobin().
std::string ROB< Impl >::name | ( | ) | const |
Definition at line 119 of file rob_impl.hh.
References ROB< Impl >::cpu.
Referenced by ROB< Impl >::regStats().
unsigned ROB< Impl >::numFreeEntries | ( | ) |
Returns the number of total free entries in the ROB.
Definition at line 306 of file rob_impl.hh.
References ROB< Impl >::numEntries, and ROB< Impl >::numInstsInROB.
Referenced by DefaultCommit< Impl >::commit(), DefaultCommit< Impl >::numROBFreeEntries(), DefaultCommit< Impl >::startupStage(), and DefaultCommit< Impl >::tick().
Returns the number of free entries in a specific ROB paritition.
Definition at line 313 of file rob_impl.hh.
References ROB< Impl >::maxEntries, and ROB< Impl >::threadEntries.
Returns pointer to the head instruction within the ROB.
There is no guarantee as to the return value if the ROB is empty.
Pointer | to the DynInst that is at the head of the ROB.Returns a pointer to the head instruction of a specific thread within the ROB. |
Definition at line 507 of file rob_impl.hh.
References ROB< Impl >::dummyInst, ROB< Impl >::instList, and ROB< Impl >::threadEntries.
Referenced by DefaultCommit< Impl >::commitInsts(), DefaultCommit< Impl >::oldestReady(), DefaultCommit< Impl >::squashAll(), and DefaultCommit< Impl >::tick().
Returns pointer to the tail instruction within the ROB.
There is no guarantee as to the return value if the ROB is empty.
Pointer | to the DynInst that is at the tail of the ROB.Returns a pointer to the tail instruction of a specific thread within the ROB. |
Definition at line 522 of file rob_impl.hh.
References ROB< Impl >::instList.
void ROB< Impl >::regStats | ( | ) |
Registers statistics.
Definition at line 532 of file rob_impl.hh.
References Stats::DataWrap< Derived, InfoProxyType >::desc(), ROB< Impl >::name(), Stats::DataWrap< Derived, InfoProxyType >::name(), ROB< Impl >::robReads, and ROB< Impl >::robWrites.
Referenced by ROB< Impl >::isDoneSquashing().
void ROB< Impl >::resetEntries | ( | ) |
Re-adjust ROB partitioning.
Definition at line 150 of file rob_impl.hh.
References ROB< Impl >::activeThreads, ROB< Impl >::maxEntries, ROB< Impl >::numEntries, ROB< Impl >::numThreads, and ROB< Impl >::robPolicy.
Referenced by DefaultCommit< Impl >::startupStage().
|
private |
Reset the ROB state.
Definition at line 101 of file rob_impl.hh.
References ROB< Impl >::doneSquashing, ROB< Impl >::head, ROB< Impl >::instList, ROB< Impl >::numInstsInROB, ROB< Impl >::squashedSeqNum, ROB< Impl >::squashIt, ROB< Impl >::tail, and ROB< Impl >::threadEntries.
Referenced by ROB< Impl >::isDoneSquashing(), ROB< Impl >::ROB(), and ROB< Impl >::takeOverFrom().
Retires the head instruction, removing it from the ROB.
Retires the head instruction of a specific thread, removing it from the ROB.
Definition at line 240 of file rob_impl.hh.
References ROB< Impl >::cpu, DPRINTF, ROB< Impl >::instList, ROB< Impl >::numInstsInROB, ROB< Impl >::robWrites, ROB< Impl >::threadEntries, and ROB< Impl >::updateHead().
Referenced by DefaultCommit< Impl >::commitHead(), and DefaultCommit< Impl >::commitInsts().
Sets pointer to the list of active threads.
at_ptr | Pointer to the list of active threads. |
Definition at line 126 of file rob_impl.hh.
References ROB< Impl >::activeThreads, and DPRINTF.
Referenced by DefaultCommit< Impl >::startupStage().
void ROB< Impl >::squash | ( | InstSeqNum | squash_num, |
ThreadID | tid | ||
) |
Squashes all instructions younger than the given sequence number for the specific thread.
Definition at line 477 of file rob_impl.hh.
References ROB< Impl >::doneSquashing, ROB< Impl >::doSquash(), DPRINTF, ROB< Impl >::instList, ROB< Impl >::isEmpty(), ROB< Impl >::ROBSquashing, ROB< Impl >::robStatus, ROB< Impl >::squashedSeqNum, and ROB< Impl >::squashIt.
Referenced by DefaultCommit< Impl >::commit(), ROB< Impl >::isEmpty(), and DefaultCommit< Impl >::squashAll().
void ROB< Impl >::takeOverFrom | ( | ) |
Takes over another CPU's thread.
Definition at line 143 of file rob_impl.hh.
References ROB< Impl >::resetState().
Referenced by DefaultCommit< Impl >::takeOverFrom().
void ROB< Impl >::updateHead | ( | ) |
Updates the head instruction with the new oldest instruction.
Definition at line 397 of file rob_impl.hh.
References ROB< Impl >::activeThreads, ROB< Impl >::head, and ROB< Impl >::instList.
Referenced by ROB< Impl >::isEmpty(), and ROB< Impl >::retireHead().
void ROB< Impl >::updateTail | ( | ) |
Updates the tail instruction with the new youngest instruction.
Definition at line 439 of file rob_impl.hh.
References ROB< Impl >::activeThreads, ROB< Impl >::instList, and ROB< Impl >::tail.
Referenced by ROB< Impl >::doSquash(), and ROB< Impl >::isEmpty().
Active Threads in CPU.
Definition at line 271 of file rob.hh.
Referenced by ROB< Impl >::canCommit(), ROB< Impl >::resetEntries(), ROB< Impl >::setActiveThreads(), ROB< Impl >::updateHead(), and ROB< Impl >::updateTail().
Pointer to the CPU.
Definition at line 268 of file rob.hh.
Referenced by ROB< Impl >::name(), and ROB< Impl >::retireHead().
|
private |
Is the ROB done squashing.
Definition at line 321 of file rob.hh.
Referenced by ROB< Impl >::doSquash(), ROB< Impl >::isDoneSquashing(), ROB< Impl >::resetState(), and ROB< Impl >::squash().
DynInstPtr ROB< Impl >::dummyInst |
Dummy instruction returned if there are no insts left.
Definition at line 314 of file rob.hh.
Referenced by ROB< Impl >::readHeadInst().
Iterator pointing to the instruction which is the first instruction in in the ROB.
Definition at line 297 of file rob.hh.
Referenced by ROB< Impl >::insertInst(), ROB< Impl >::resetState(), and ROB< Impl >::updateHead().
|
private |
ROB List of Instructions.
Definition at line 283 of file rob.hh.
Referenced by ROB< Impl >::countInsts(), ROB< Impl >::doSquash(), ROB< Impl >::drainSanityCheck(), ROB< Impl >::findInst(), ROB< Impl >::insertInst(), ROB< Impl >::isHeadReady(), ROB< Impl >::readHeadInst(), ROB< Impl >::readTailInst(), ROB< Impl >::resetState(), ROB< Impl >::retireHead(), ROB< Impl >::squash(), ROB< Impl >::updateHead(), and ROB< Impl >::updateTail().
|
private |
Max Insts a Thread Can Have in the ROB.
Definition at line 280 of file rob.hh.
Referenced by ROB< Impl >::getMaxEntries(), ROB< Impl >::numFreeEntries(), ROB< Impl >::resetEntries(), and ROB< Impl >::ROB().
|
private |
Number of instructions in the ROB.
Definition at line 274 of file rob.hh.
Referenced by ROB< Impl >::entryAmount(), ROB< Impl >::insertInst(), ROB< Impl >::isFull(), ROB< Impl >::numFreeEntries(), ROB< Impl >::resetEntries(), and ROB< Impl >::ROB().
int ROB< Impl >::numInstsInROB |
Number of instructions in the ROB.
Definition at line 311 of file rob.hh.
Referenced by ROB< Impl >::insertInst(), ROB< Impl >::isEmpty(), ROB< Impl >::isFull(), ROB< Impl >::numFreeEntries(), ROB< Impl >::resetState(), and ROB< Impl >::retireHead().
Number of active threads.
Definition at line 324 of file rob.hh.
Referenced by ROB< Impl >::countInsts(), ROB< Impl >::drainSanityCheck(), ROB< Impl >::resetEntries(), and ROB< Impl >::ROB().
|
private |
ROB resource sharing policy for SMT mode.
Definition at line 81 of file rob.hh.
Referenced by ROB< Impl >::entryAmount(), ROB< Impl >::resetEntries(), and ROB< Impl >::ROB().
|
private |
Definition at line 327 of file rob.hh.
Referenced by ROB< Impl >::isHeadReady(), and ROB< Impl >::regStats().
|
private |
Definition at line 329 of file rob.hh.
Referenced by ROB< Impl >::doSquash(), ROB< Impl >::insertInst(), ROB< Impl >::regStats(), and ROB< Impl >::retireHead().
|
private |
The sequence number of the squashed instruction.
Definition at line 318 of file rob.hh.
Referenced by ROB< Impl >::doSquash(), ROB< Impl >::resetState(), and ROB< Impl >::squash().
Iterator used for walking through the list of instructions when squashing.
Used so that there is persistent state between cycles; when squashing, the instructions are marked as squashed but not immediately removed, meaning the tail iterator remains the same before and after a squash. This will always be set to cpu->instList.end() if it is invalid.
Definition at line 307 of file rob.hh.
Referenced by ROB< Impl >::doSquash(), ROB< Impl >::resetState(), and ROB< Impl >::squash().
|
private |
Number of instructions that can be squashed in a single cycle.
Definition at line 286 of file rob.hh.
Referenced by ROB< Impl >::doSquash().
Iterator pointing to the instruction which is the last instruction in the ROB.
This may at times be invalid (ie when the ROB is empty), however it should never be incorrect.
Definition at line 293 of file rob.hh.
Referenced by ROB< Impl >::insertInst(), ROB< Impl >::resetState(), and ROB< Impl >::updateTail().
|
private |
Entries Per Thread.
Definition at line 277 of file rob.hh.
Referenced by ROB< Impl >::getThreadEntries(), ROB< Impl >::insertInst(), ROB< Impl >::isEmpty(), ROB< Impl >::isFull(), ROB< Impl >::isHeadReady(), ROB< Impl >::numFreeEntries(), ROB< Impl >::readHeadInst(), ROB< Impl >::resetState(), and ROB< Impl >::retireHead().