|
gem5 [DEVELOP-FOR-25.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 |
Definition at line 70 of file ras.hh.
References parent, and gem5::branch_prediction::ReturnAddrStack::ReturnAddrStack().
|
inline |
Decrements the top of stack index.
Definition at line 118 of file ras.hh.
References numEntries, and tos.
Referenced by pop().
|
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.
Referenced by push().
| 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 | ( | ) |
Pops the top address from the RAS.
Definition at line 93 of file ras.cc.
References decrTos(), and usedEntries.
| 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 addrStack, incrTos(), numEntries, gem5::ArmISA::set, tos, and usedEntries.
| 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 addrStack, numEntries, gem5::ArmISA::set, tos, and usedEntries.
| 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 addrStack, gem5::ArmISA::i, gem5::ArmISA::n, gem5::ArmISA::ss, and tos.
| std::vector<std::unique_ptr<PCStateBase> > gem5::branch_prediction::ReturnAddrStack::AddrStack::addrStack |
| unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::numEntries |
|
protected |
Definition at line 136 of file ras.hh.
Referenced by AddrStack().
| unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::tos |
| unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::usedEntries |