56#include "debug/Fetch.hh"
57#include "debug/Tage.hh"
82 tage->squash(tid, taken, target, inst, tage_bi);
86 int nrand =
rng->random<
int>() & 3;
87 if (
bi->tageBranchInfo->condBranch) {
88 DPRINTF(Tage,
"Updating tables for branch:%lx; taken?:%d\n",
90 tage->updateStats(taken,
bi->tageBranchInfo);
91 tage->condBranchUpdate(tid,
pc, taken, tage_bi, nrand,
92 target,
bi->tageBranchInfo->tagePred);
96 tage->updateHistories(tid,
pc,
false, taken, target, inst, tage_bi);
105 tage->restoreHistState(tid,
bi->tageBranchInfo);
106 DPRINTF(Tage,
"Deleting branch info: %lx\n",
bi->tageBranchInfo->branchPC);
108 bp_history =
nullptr;
116 return tage->tagePredict(tid,
pc, cond_branch,
bi->tageBranchInfo);
122 bool retval =
predict(tid,
pc,
true, bp_history);
124 DPRINTF(Tage,
"Lookup branch: %lx; predict:%d\n",
pc, retval);
134 if (bp_history ==
nullptr) {
144 tage->updateHistories(tid,
pc,
true, taken, target, inst,
152 bpHistory = (
void*)(
bi);
BPredUnit(const Params &p)
Branch Predictor Unit (BPU) interface functions.
TAGE(const TAGEParams ¶ms)
void updateHistories(ThreadID tid, Addr pc, bool uncond, bool taken, Addr target, const StaticInstPtr &inst, 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.
virtual bool predict(ThreadID tid, Addr branch_pc, bool cond_branch, void *&b)
void squash(ThreadID tid, void *&bp_history) override
void branchPlaceholder(ThreadID tid, Addr pc, bool uncond, void *&bp_history) override
Special function for the decoupled front-end.
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.
const Params & params() const
Copyright (c) 2024 Arm Limited 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.
RefCountingPtr< StaticInst > StaticInstPtr