39#ifndef __CPU_PRED_INDIRECT_HH__
40#define __CPU_PRED_INDIRECT_HH__
47#include "params/SimpleIndirectPredictor.hh"
52namespace branch_prediction
61 void reset()
override;
64 Addr pc,
void * &iHistory)
override;
67 BranchType br_type,
void * &iHistory)
override;
162 return (
type == BranchType::CallIndirect) ||
163 (
type == BranchType::IndirectUncond) ||
164 (
type == BranchType::IndirectCond);
void reset() override
Indirect predictor interface.
const unsigned pathLength
std::vector< std::vector< IPredEntry > > targetCache
std::vector< ThreadInfo > threadInfo
const unsigned ghrNumBits
void genIndirectInfo(ThreadID tid, void *&iHistory)
const PCStateBase * lookup(ThreadID tid, InstSeqNum sn, Addr pc, void *&iHistory) override
Predicts the indirect target of an indirect branch.
void recordTarget(ThreadID tid, InstSeqNum sn, const PCStateBase &target, IndirectHistory *&history)
void update(ThreadID tid, InstSeqNum sn, Addr pc, bool squash, bool taken, const PCStateBase &target, BranchType br_type, void *&iHistory) override
Updates the indirect predictor with history information of a branch.
gem5::branch_prediction::SimpleIndirectPredictor::IndirectStats stats
void commit(ThreadID tid, InstSeqNum sn, void *&iHistory) override
A branch gets finally commited.
void squash(ThreadID tid, InstSeqNum sn, void *&iHistory) override
Squashes a branch.
SimpleIndirectPredictor(const SimpleIndirectPredictorParams ¶ms)
const unsigned speculativePathLength
void updateDirectionInfo(ThreadID tid, bool taken, Addr pc, Addr target)
Addr getSetIndex(Addr br_addr, ThreadID tid)
Addr getTag(Addr br_addr)
bool isIndirectNoReturn(BranchType type)
This is a simple scalar statistic, like a counter.
const Params & params() const
enums::BranchType BranchType
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.
Declaration of Statistics objects.
HistoryEntry(Addr br_addr, Addr tgt_addr, InstSeqNum seq_num)
std::unique_ptr< PCStateBase > target
Indirect branch history information Used for prediction, update and recovery.
IndirectStats(statistics::Group *parent)
statistics::Scalar lookups
statistics::Scalar speculativeOverflows
statistics::Scalar misses
statistics::Scalar targetRecords
statistics::Scalar indirectRecords
Per thread path and global history registers.
std::deque< HistoryEntry > pathHist