41#ifndef __CPU_PRED_SIMPLE_BTB_HH__
42#define __CPU_PRED_SIMPLE_BTB_HH__
47#include "params/SimpleBTB.hh"
52namespace branch_prediction
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
void update() const
Align cycle and tick to the next clock edge if not already done.
enums::BranchType BranchType
unsigned log2NumThreads
Log2 NumThreads used for hashing threadid.
bool valid(ThreadID tid, Addr instPC) override
Checks if a branch address is in the BTB.
const PCStateBase * lookup(ThreadID tid, Addr instPC, BranchType type=BranchType::NoBranch) override
Looks up an address in the BTB to get the target of the branch.
void memInvalidate() override
Invalidate the contents of memory buffers.
unsigned tagMask
The tag mask.
unsigned numEntries
The number of entries in the BTB.
Addr getTag(Addr instPC)
Returns the tag bits of a given address.
BTBEntry * findEntry(Addr instPC, ThreadID tid)
Internal call to find an address in the BTB.
unsigned instShiftAmt
Number of bits to shift PC when calculating index.
const StaticInstPtr getInst(ThreadID tid, Addr instPC) override
Looks up an address in the BTB and return the instruction information if existant.
unsigned tagShiftAmt
Number of bits to shift PC when calculating tag.
std::vector< BTBEntry > btb
The actual BTB.
SimpleBTB(const SimpleBTBParams ¶ms)
unsigned getIndex(Addr instPC, ThreadID tid)
Returns the index into the BTB, based on the branch's PC.
unsigned tagBits
The number of tag bits per entry.
unsigned idxMask
The index mask.
const Params & params() const
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
int16_t ThreadID
Thread index/ID type.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::unique_ptr< PCStateBase > target
The entry's target.
StaticInstPtr inst
Pointer to the static branch instruction at this address.
ThreadID tid
The entry's thread id.
bool valid
Whether or not the entry is valid.