31 #ifndef __CPU_PRED_BTB_HH__
32 #define __CPU_PRED_BTB_HH__
34 #include "arch/types.hh"
37 #include "config/the_isa.hh"
133 #endif // __CPU_PRED_BTB_HH__
std::vector< BTBEntry > btb
The actual BTB.
unsigned numEntries
The number of entries in the BTB.
TheISA::PCState target
The entry's target.
unsigned getIndex(Addr instPC, ThreadID tid)
Returns the index into the BTB, based on the branch's PC.
unsigned tagShiftAmt
Number of bits to shift PC when calculating tag.
unsigned tagMask
The tag mask.
DefaultBTB(unsigned numEntries, unsigned tagBits, unsigned instShiftAmt, unsigned numThreads)
Creates a BTB with the given number of entries, number of bits per tag, and instruction offset amount...
unsigned instShiftAmt
Number of bits to shift PC when calculating index.
void update(Addr instPC, const TheISA::PCState &targetPC, ThreadID tid)
Updates the BTB with the target of a branch.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
TheISA::PCState lookup(Addr instPC, ThreadID tid)
Looks up an address in the BTB.
ThreadID tid
The entry's thread id.
unsigned log2NumThreads
Log2 NumThreads used for hashing threadid.
int16_t ThreadID
Thread index/ID type.
unsigned idxMask
The index mask.
Addr getTag(Addr instPC)
Returns the tag bits of a given address.
bool valid(Addr instPC, ThreadID tid)
Checks if a branch is in the BTB.
GenericISA::SimplePCState< MachInst > PCState
bool valid
Whether or not the entry is valid.
unsigned tagBits
The number of tag bits per entry.