gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ReturnAddrStack Class Reference

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. More...
 
void init (unsigned numEntries)
 Initializes RAS with a specified number of entries. More...
 
void reset ()
 
TheISA::PCState top ()
 Returns the top address on the RAS. More...
 
unsigned topIdx ()
 Returns the index of the top of the RAS. More...
 
void push (const TheISA::PCState &return_addr)
 Pushes an address onto the RAS. More...
 
void pop ()
 Pops the top address from the RAS. More...
 
void restore (unsigned top_entry_idx, const TheISA::PCState &restored)
 Changes index to the top of the RAS, and replaces the top address with a new target. More...
 
bool empty ()
 
bool full ()
 

Private Member Functions

void incrTos ()
 Increments the top of stack index. More...
 
void decrTos ()
 Decrements the top of stack index. More...
 

Private Attributes

std::vector< TheISA::PCState > addrStack
 The RAS itself. More...
 
unsigned numEntries
 The number of entries in the RAS. More...
 
unsigned usedEntries
 The number of used entries in the RAS. More...
 
unsigned tos
 The top of stack index. More...
 

Detailed Description

Return address stack class, implements a simple RAS.

Definition at line 41 of file ras.hh.

Constructor & Destructor Documentation

ReturnAddrStack::ReturnAddrStack ( )
inline

Creates a return address stack, but init() must be called prior to use.

Definition at line 47 of file ras.hh.

Member Function Documentation

void ReturnAddrStack::decrTos ( )
inlineprivate

Decrements the top of stack index.

Definition at line 86 of file ras.hh.

References numEntries, and tos.

Referenced by pop().

bool ReturnAddrStack::empty ( )
inline

Definition at line 77 of file ras.hh.

References usedEntries.

bool ReturnAddrStack::full ( )
inline

Definition at line 79 of file ras.hh.

References numEntries, and usedEntries.

void ReturnAddrStack::incrTos ( )
inlineprivate

Increments the top of stack index.

Definition at line 82 of file ras.hh.

References numEntries, and tos.

Referenced by push().

void ReturnAddrStack::init ( unsigned  numEntries)

Initializes RAS with a specified number of entries.

Parameters
numEntriesNumber of entries in the RAS.

Definition at line 34 of file ras.cc.

References addrStack, numEntries, and reset().

void ReturnAddrStack::pop ( )

Pops the top address from the RAS.

Definition at line 63 of file ras.cc.

References decrTos(), and usedEntries.

void ReturnAddrStack::push ( const TheISA::PCState &  return_addr)

Pushes an address onto the RAS.

Definition at line 51 of file ras.cc.

References addrStack, incrTos(), numEntries, tos, and usedEntries.

void ReturnAddrStack::reset ( )

Definition at line 42 of file ras.cc.

References addrStack, ArmISA::i, numEntries, tos, and usedEntries.

Referenced by init().

void ReturnAddrStack::restore ( unsigned  top_entry_idx,
const TheISA::PCState &  restored 
)

Changes index to the top of the RAS, and replaces the top address with a new target.

Parameters
top_entry_idxThe index of the RAS that will now be the top.
restoredThe new target address of the new top of the RAS.

Definition at line 73 of file ras.cc.

References addrStack, and tos.

TheISA::PCState ReturnAddrStack::top ( )
inline

Returns the top address on the RAS.

Definition at line 57 of file ras.hh.

References addrStack, and tos.

unsigned ReturnAddrStack::topIdx ( )
inline

Returns the index of the top of the RAS.

Definition at line 61 of file ras.hh.

References tos.

Member Data Documentation

std::vector<TheISA::PCState> ReturnAddrStack::addrStack
private

The RAS itself.

Definition at line 90 of file ras.hh.

Referenced by init(), push(), reset(), restore(), and top().

unsigned ReturnAddrStack::numEntries
private

The number of entries in the RAS.

Definition at line 93 of file ras.hh.

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

unsigned ReturnAddrStack::tos
private

The top of stack index.

Definition at line 99 of file ras.hh.

Referenced by decrTos(), incrTos(), push(), reset(), restore(), top(), and topIdx().

unsigned ReturnAddrStack::usedEntries
private

The number of used entries in the RAS.

Definition at line 96 of file ras.hh.

Referenced by empty(), full(), pop(), push(), and reset().


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

Generated on Fri Jun 9 2017 13:04:18 for gem5 by doxygen 1.8.6