gem5 v24.0.0.0
|
Subclass that implements the actual address stack. More...
#include <ras.hh>
Public Member Functions | |
AddrStack (ReturnAddrStack &_parent) | |
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_of_stack, const PCStateBase *restored) |
Changes index to the top of the RAS, and replaces the top address with a new target. | |
bool | empty () |
bool | full () |
std::string | toString (int n) |
Returns the top n entries of the stack as string. | |
void | incrTos () |
Increments the top of stack index. | |
void | decrTos () |
Decrements the top of stack index. | |
Public Attributes | |
std::vector< std::unique_ptr< PCStateBase > > | addrStack |
The Stack 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. | |
Protected Attributes | |
ReturnAddrStack & | parent |
|
inline |
|
inline |
Decrements the top of stack index.
Definition at line 118 of file ras.hh.
References numEntries, and tos.
|
inline |
Definition at line 101 of file ras.hh.
References usedEntries.
|
inline |
Definition at line 103 of file ras.hh.
References numEntries, and usedEntries.
|
inline |
Increments the top of stack index.
Definition at line 110 of file ras.hh.
References numEntries, and tos.
void gem5::branch_prediction::ReturnAddrStack::AddrStack::init | ( | unsigned | numEntries | ) |
Initializes RAS with a specified number of entries.
numEntries | Number of entries in the RAS. |
Definition at line 55 of file ras.cc.
References addrStack, gem5::ArmISA::i, numEntries, and reset().
void gem5::branch_prediction::ReturnAddrStack::AddrStack::pop | ( | ) |
void gem5::branch_prediction::ReturnAddrStack::AddrStack::push | ( | const PCStateBase & | return_addr | ) |
Pushes an address onto the RAS.
Definition at line 80 of file ras.cc.
References gem5::branch_prediction::ReturnAddrStack::numEntries, and gem5::ArmISA::set.
void gem5::branch_prediction::ReturnAddrStack::AddrStack::reset | ( | ) |
void gem5::branch_prediction::ReturnAddrStack::AddrStack::restore | ( | unsigned | top_of_stack, |
const PCStateBase * | restored ) |
Changes index to the top of the RAS, and replaces the top address with a new target.
top_of_stack | the index saved at the time of the prediction. |
restored | The new target address of the new top of the RAS. |
Definition at line 103 of file ras.cc.
References gem5::branch_prediction::ReturnAddrStack::numEntries, and gem5::ArmISA::set.
const PCStateBase * gem5::branch_prediction::ReturnAddrStack::AddrStack::top | ( | ) |
|
inline |
std::string gem5::branch_prediction::ReturnAddrStack::AddrStack::toString | ( | int | n | ) |
Returns the top n entries of the stack as string.
For debugging.
Definition at line 116 of file ras.cc.
References gem5::ArmISA::i, gem5::ArmISA::n, and gem5::ArmISA::ss.
std::vector<std::unique_ptr<PCStateBase> > gem5::branch_prediction::ReturnAddrStack::AddrStack::addrStack |
unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::numEntries |
|
protected |
unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::tos |
unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::usedEntries |