42#ifndef __CPU_PRED_2BIT_LOCAL_PRED_HH__
43#define __CPU_PRED_2BIT_LOCAL_PRED_HH__
50#include "params/LocalBP.hh"
55namespace branch_prediction
77 Addr target,
void * &bp_history)
override;
80 void * &bp_history,
bool squashed,
84 { assert(bp_history == NULL); }
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Basically a wrapper class to hold both the branch predictor and the BTB.
Implements a local predictor that uses the PC to index into a table of counters.
const unsigned localPredictorSize
Size of the local predictor.
bool getPrediction(uint8_t &count)
Returns the taken/not taken prediction given the value of the counter.
const unsigned localCtrBits
Number of bits of the local predictor's counters.
const unsigned localPredictorSets
Number of sets.
void update(ThreadID tid, Addr pc, bool taken, void *&bp_history, bool squashed, const StaticInstPtr &inst, Addr target) override
Updates the BP with taken/not taken information.
LocalBP(const LocalBPParams ¶ms)
Default branch predictor constructor.
void updateHistories(ThreadID tid, Addr pc, bool uncond, bool taken, Addr target, void *&bp_history) override
Ones done with the prediction this function updates the path and global history.
bool lookup(ThreadID tid, Addr pc, void *&bp_history) override
Looks up a given conditional branch PC of in the BP to see if it is taken or not taken.
const unsigned indexMask
Mask to get index bits.
std::vector< SatCounter8 > localCtrs
Array of counters that make up the local predictor.
unsigned getLocalIndex(Addr &PC)
Calculates the local index based on the PC.
void squash(ThreadID tid, void *&bp_history) override
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.