41#ifndef __CPU_PRED_RAS_HH__
42#define __CPU_PRED_RAS_HH__
51#include "params/ReturnAddrStack.hh"
57namespace branch_prediction
180 const BranchType brType,
void * &ras_history);
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Abstract superclass for simulation objects.
Subclass that implements the actual address stack.
void decrTos()
Decrements the top of stack index.
const PCStateBase * top()
Returns the top address on the RAS.
unsigned topIdx()
Returns the index of the top of the RAS.
void pop()
Pops the top address from the RAS.
std::string toString(int n)
Returns the top n entries of the stack as string.
unsigned usedEntries
The number of used entries in the RAS.
unsigned numEntries
The number of entries in the RAS.
unsigned tos
The top of stack index.
AddrStack(ReturnAddrStack &_parent)
void push(const PCStateBase &return_addr)
Pushes an address onto the RAS.
std::vector< std::unique_ptr< PCStateBase > > addrStack
The Stack itself.
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.
void incrTos()
Increments the top of stack index.
std::unique_ptr< PCStateBase > ras_entry
The entry that poped from the RAS (only valid if a return).
unsigned tos
The RAS index (top of stack pointer) of the instruction.
Return address stack class, implements a simple RAS.
unsigned numThreads
The number of threads.
ReturnAddrStack(const Params &p)
const PCStateBase * pop(ThreadID tid, void *&ras_history)
Pops the top address from the RAS.
void makeRASHistory(void *&ras_history)
ReturnAddrStackParams Params
std::vector< AddrStack > addrStacks
The RAS itself.
void squash(ThreadID tid, void *&ras_history)
The branch (call/return) got squashed.
gem5::branch_prediction::ReturnAddrStack::ReturnAddrStackStats stats
unsigned numEntries
The number of entries in the RAS.
void commit(ThreadID tid, bool misp, const BranchType brType, void *&ras_history)
A branch got finally got finally commited.
void push(ThreadID tid, const PCStateBase &pc, void *&ras_history)
Pushes an address onto the RAS.
This is a simple scalar statistic, like a counter.
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
enums::BranchType BranchType
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
int16_t ThreadID
Thread index/ID type.
Declaration of Statistics objects.
statistics::Scalar squashes
statistics::Scalar pushes
ReturnAddrStackStats(statistics::Group *parent)
statistics::Scalar incorrect
statistics::Scalar correct