gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::branch_prediction::ReturnAddrStack::AddrStack Class Reference

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 PCStateBasetop ()
 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

ReturnAddrStackparent
 

Detailed Description

Subclass that implements the actual address stack.

******

Definition at line 67 of file ras.hh.

Constructor & Destructor Documentation

◆ AddrStack()

gem5::branch_prediction::ReturnAddrStack::AddrStack::AddrStack ( ReturnAddrStack & _parent)
inline

Definition at line 70 of file ras.hh.

Member Function Documentation

◆ decrTos()

void gem5::branch_prediction::ReturnAddrStack::AddrStack::decrTos ( )
inline

Decrements the top of stack index.

Definition at line 118 of file ras.hh.

References numEntries, and tos.

◆ empty()

bool gem5::branch_prediction::ReturnAddrStack::AddrStack::empty ( )
inline

Definition at line 101 of file ras.hh.

References usedEntries.

◆ full()

bool gem5::branch_prediction::ReturnAddrStack::AddrStack::full ( )
inline

Definition at line 103 of file ras.hh.

References numEntries, and usedEntries.

◆ incrTos()

void gem5::branch_prediction::ReturnAddrStack::AddrStack::incrTos ( )
inline

Increments the top of stack index.

Definition at line 110 of file ras.hh.

References numEntries, and tos.

◆ init()

void gem5::branch_prediction::ReturnAddrStack::AddrStack::init ( unsigned numEntries)

Initializes RAS with a specified number of entries.

Parameters
numEntriesNumber of entries in the RAS.

Definition at line 55 of file ras.cc.

References addrStack, gem5::ArmISA::i, numEntries, and reset().

◆ pop()

void gem5::branch_prediction::ReturnAddrStack::AddrStack::pop ( )

Pops the top address from the RAS.

Definition at line 93 of file ras.cc.

◆ push()

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.

◆ reset()

void gem5::branch_prediction::ReturnAddrStack::AddrStack::reset ( )

Definition at line 66 of file ras.cc.

Referenced by init().

◆ restore()

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.

Parameters
top_of_stackthe index saved at the time of the prediction.
restoredThe 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.

◆ top()

const PCStateBase * gem5::branch_prediction::ReturnAddrStack::AddrStack::top ( )

Returns the top address on the RAS.

Definition at line 73 of file ras.cc.

◆ topIdx()

unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::topIdx ( )
inline

Returns the index of the top of the RAS.

Definition at line 86 of file ras.hh.

References tos.

◆ toString()

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.

Member Data Documentation

◆ addrStack

std::vector<std::unique_ptr<PCStateBase> > gem5::branch_prediction::ReturnAddrStack::AddrStack::addrStack

The Stack itself.

Definition at line 124 of file ras.hh.

Referenced by init().

◆ numEntries

unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::numEntries

The number of entries in the RAS.

Definition at line 127 of file ras.hh.

Referenced by decrTos(), full(), incrTos(), and init().

◆ parent

ReturnAddrStack& gem5::branch_prediction::ReturnAddrStack::AddrStack::parent
protected

Definition at line 136 of file ras.hh.

◆ tos

unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::tos

The top of stack index.

Definition at line 133 of file ras.hh.

Referenced by decrTos(), incrTos(), and topIdx().

◆ usedEntries

unsigned gem5::branch_prediction::ReturnAddrStack::AddrStack::usedEntries

The number of used entries in the RAS.

Definition at line 130 of file ras.hh.

Referenced by empty(), and full().


The documentation for this class was generated from the following files:

Generated on Tue Jun 18 2024 16:24:18 for gem5 by doxygen 1.11.0