|
gem5
|
#include <rob.hh>
Public Types | |
| enum | Status { Running, Idle, ROBSquashing } |
| Possible ROB statuses. More... | |
| enum | ROBPolicy { Dynamic, Partitioned, Threshold } |
| SMT ROB Sharing Policy. 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 (DynInstPtr &inst) |
| Function to insert an instruction into the ROB. More... | |
| 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... | |
| int | 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... | |
Protected Types | |
| typedef TheISA::RegIndex | RegIndex |
Private Member Functions | |
| void | resetState () |
| Reset the ROB state. More... | |
Private Attributes | |
| Status | robStatus [Impl::MaxThreads] |
| Per-thread ROB status. More... | |
| ROBPolicy | 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::ROBPolicy |
| enum ROB::Status |
ROB constructor.
| _cpu | The cpu object pointer. |
| params | The cpu params including several ROB-specific parameters. |
Definition at line 57 of file rob_impl.hh.
References DPRINTF, ROB< Impl >::Dynamic, ROB< Impl >::maxEntries, ROB< Impl >::numEntries, ROB< Impl >::numThreads, ROB< Impl >::Partitioned, ROB< Impl >::resetState(), ROB< Impl >::robPolicy, and ROB< Impl >::Threshold.
| bool ROB< Impl >::canCommit | ( | ) |
Is there any commitable head instruction across all threads ready.
Definition at line 297 of file rob_impl.hh.
| 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 193 of file rob_impl.hh.
References Stats::total.
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 205 of file rob_impl.hh.
Executes the squash, marking squashed instructions.
Definition at line 330 of file rob_impl.hh.
References DPRINTF.
| void ROB< Impl >::drainSanityCheck | ( | ) | const |
Perform sanity checks after a drain.
Definition at line 144 of file rob_impl.hh.
Number of entries needed For 'num_threads' amount of threads.
Definition at line 182 of file rob_impl.hh.
| 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 556 of file rob_impl.hh.
Returns the maximum number of entries for a specific thread.
Definition at line 180 of file rob.hh.
References ROB< Impl >::maxEntries.
Returns the number of entries being used by a specific thread.
Definition at line 184 of file rob.hh.
References ROB< Impl >::threadEntries.
| void ROB< Impl >::insertInst | ( | DynInstPtr & | inst | ) |
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 251 of file rob.hh.
References ROB< Impl >::doneSquashing.
| bool ROB< Impl >::isDoneSquashing | ( | ) |
Checks if the ROB is still in the process of squashing instructions for any thread.
|
inline |
Returns if the ROB is empty.
Definition at line 196 of file rob.hh.
References ROB< Impl >::numInstsInROB.
Returns if a specific thread's partition is empty.
Definition at line 200 of file rob.hh.
References ROB< Impl >::threadEntries.
|
inline |
Returns if the ROB is full.
Definition at line 188 of file rob.hh.
References ROB< Impl >::numEntries, and ROB< Impl >::numInstsInROB.
Returns if a specific thread's partition is full.
Definition at line 192 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 285 of file rob_impl.hh.
| std::string ROB< Impl >::name | ( | ) | const |
Definition at line 129 of file rob_impl.hh.
| unsigned ROB< Impl >::numFreeEntries | ( | ) |
Returns the number of total free entries in the ROB.
Definition at line 316 of file rob_impl.hh.
Returns the number of free entries in a specific ROB paritition.
Definition at line 323 of file rob_impl.hh.
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 517 of file rob_impl.hh.
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 532 of file rob_impl.hh.
| void ROB< Impl >::regStats | ( | ) |
| void ROB< Impl >::resetEntries | ( | ) |
Re-adjust ROB partitioning.
Definition at line 160 of file rob_impl.hh.
|
private |
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 249 of file rob_impl.hh.
References DPRINTF.
Sets pointer to the list of active threads.
| at_ptr | Pointer to the list of active threads. |
Definition at line 136 of file rob_impl.hh.
References DPRINTF.
| 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 487 of file rob_impl.hh.
References DPRINTF.
| void ROB< Impl >::takeOverFrom | ( | ) |
Takes over another CPU's thread.
Definition at line 153 of file rob_impl.hh.
| void ROB< Impl >::updateHead | ( | ) |
Updates the head instruction with the new oldest instruction.
Definition at line 407 of file rob_impl.hh.
| void ROB< Impl >::updateTail | ( | ) |
Updates the tail instruction with the new youngest instruction.
Definition at line 449 of file rob_impl.hh.
|
private |
Is the ROB done squashing.
Definition at line 332 of file rob.hh.
Referenced by ROB< Impl >::isDoneSquashing().
| DynInstPtr ROB< Impl >::dummyInst |
|
private |
|
private |
Max Insts a Thread Can Have in the ROB.
Definition at line 291 of file rob.hh.
Referenced by ROB< Impl >::getMaxEntries(), and ROB< Impl >::ROB().
|
private |
Number of instructions in the ROB.
Definition at line 285 of file rob.hh.
Referenced by ROB< Impl >::isFull(), and ROB< Impl >::ROB().
| int ROB< Impl >::numInstsInROB |
Number of instructions in the ROB.
Definition at line 322 of file rob.hh.
Referenced by ROB< Impl >::isEmpty(), and ROB< Impl >::isFull().
ROB resource sharing policy for SMT mode.
Definition at line 92 of file rob.hh.
Referenced by ROB< Impl >::ROB().
|
private |
|
private |
|
private |
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.
|
private |
|
private |
Entries Per Thread.
Definition at line 288 of file rob.hh.
Referenced by ROB< Impl >::getThreadEntries(), ROB< Impl >::isEmpty(), and ROB< Impl >::isFull().