56#include "debug/Fetch.hh"
57#include "debug/Tage.hh"
62namespace branch_prediction
87 if (
bi->tageBranchInfo->condBranch) {
88 DPRINTF(Tage,
"Updating tables for branch:%lx; taken?:%d\n",
105 DPRINTF(Tage,
"Deleting branch info: %lx\n",
bi->tageBranchInfo->branchPC);
107 bp_history =
nullptr;
121 bool retval =
predict(tid,
pc,
true, bp_history);
123 DPRINTF(Tage,
"Lookup branch: %lx; predict:%d\n",
pc, retval);
130 bool taken,
Addr target,
void * &bp_history)
132 assert(uncond || bp_history);
134 DPRINTF(Tage,
"UnConditionalBranch: %lx\n",
pc);
Basically a wrapper class to hold both the branch predictor and the BTB.
virtual void updateHistories(ThreadID tid, Addr branch_pc, bool taken, BranchInfo *b, bool speculative, const StaticInstPtr &inst=nullStaticInstPtr, Addr target=MaxAddr)
(Speculatively) updates global histories (path and direction).
virtual void updateStats(bool taken, BranchInfo *bi)
Update the stats.
virtual void squash(ThreadID tid, bool taken, BranchInfo *bi, Addr target)
Restores speculatively updated path and direction histories.
bool tagePredict(ThreadID tid, Addr branch_pc, bool cond_branch, BranchInfo *bi)
TAGE prediction called from TAGE::predict.
virtual void condBranchUpdate(ThreadID tid, Addr branch_pc, bool taken, BranchInfo *bi, int nrand, Addr corrTarget, bool pred, bool preAdjustAlloc=false)
Update TAGE for conditional branches.
TAGE(const TAGEParams ¶ms)
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.
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.
virtual bool predict(ThreadID tid, Addr branch_pc, bool cond_branch, void *&b)
virtual void squash(ThreadID tid, void *&bp_history) override
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.
std::enable_if_t< std::is_integral_v< T >, T > random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
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.