|
gem5 v23.0.0.1
|
Return address stack class, implements a simple RAS. More...
#include <ras.hh>
Public Member Functions | |
| ReturnAddrStack () | |
| Creates a return address stack, but init() must be called prior to use. | |
| void | init (unsigned numEntries) |
| Initializes RAS with a specified number of entries. | |
| void | reset () |
| const PCStateBase * | top () |
| Returns the top address on the RAS. | |
| unsigned | topIdx () |
| Returns the index of the top of the RAS. | |
| void | push (const PCStateBase &return_addr) |
| Pushes an address onto the RAS. | |
| void | pop () |
| Pops the top address from the RAS. | |
| void | restore (unsigned top_entry_idx, const PCStateBase *restored) |
| Changes index to the top of the RAS, and replaces the top address with a new target. | |
| bool | empty () |
| bool | full () |
Private Member Functions | |
| void | incrTos () |
| Increments the top of stack index. | |
| void | decrTos () |
| Decrements the top of stack index. | |
Private Attributes | |
| std::vector< std::unique_ptr< PCStateBase > > | addrStack |
| The RAS itself. | |
| unsigned | numEntries |
| The number of entries in the RAS. | |
| unsigned | usedEntries |
| The number of used entries in the RAS. | |
| unsigned | tos |
| The top of stack index. | |
|
inline |
|
inlineprivate |
Decrements the top of stack index.
Definition at line 92 of file ras.hh.
References numEntries, and tos.
Referenced by pop().
|
inline |
Definition at line 78 of file ras.hh.
References usedEntries.
|
inline |
Definition at line 80 of file ras.hh.
References numEntries, and usedEntries.
|
inlineprivate |
Increments the top of stack index.
Definition at line 84 of file ras.hh.
References numEntries, and tos.
Referenced by push().
| void gem5::branch_prediction::ReturnAddrStack::init | ( | unsigned | numEntries | ) |
Initializes RAS with a specified number of entries.
| numEntries | Number of entries in the RAS. |
Definition at line 38 of file ras.cc.
References addrStack, numEntries, and reset().
| void gem5::branch_prediction::ReturnAddrStack::pop | ( | ) |
Pops the top address from the RAS.
Definition at line 65 of file ras.cc.
References decrTos(), and usedEntries.
| void gem5::branch_prediction::ReturnAddrStack::push | ( | const PCStateBase & | return_addr | ) |
Pushes an address onto the RAS.
Definition at line 53 of file ras.cc.
References addrStack, incrTos(), numEntries, gem5::ArmISA::set, tos, and usedEntries.
| void gem5::branch_prediction::ReturnAddrStack::reset | ( | ) |
| void gem5::branch_prediction::ReturnAddrStack::restore | ( | unsigned | top_entry_idx, |
| const PCStateBase * | restored | ||
| ) |
Changes index to the top of the RAS, and replaces the top address with a new target.
| top_entry_idx | The index of the RAS that will now be the top. |
| restored | The new target address of the new top of the RAS. |
Definition at line 75 of file ras.cc.
References addrStack, numEntries, gem5::ArmISA::set, tos, and usedEntries.
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |