X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcpu%2Fpred%2Fbpred_unit.hh;h=c90d450bc064590beab359888b4e740da32e6b06;hb=cd21b5a5519940a0fa9b9a2dde68f30403d17f7e;hp=c4dbad2b00fec2193472cbb1ddbca5d9874e1d6c;hpb=990b7a7f114a1d4f6da434eb0288626a6d6b29ec;p=gem5.git diff --git a/src/cpu/pred/bpred_unit.hh b/src/cpu/pred/bpred_unit.hh index c4dbad2b0..c90d450bc 100644 --- a/src/cpu/pred/bpred_unit.hh +++ b/src/cpu/pred/bpred_unit.hh @@ -68,11 +68,6 @@ class BPredUnit : public SimObject */ BPredUnit(const Params *p); - /** - * Registers statistics. - */ - void regStats() override; - void regProbePoints() override; /** Perform sanity checks after a drain. */ @@ -177,8 +172,7 @@ class BPredUnit : public SimObject */ virtual void update(ThreadID tid, Addr instPC, bool taken, void *bp_history, bool squashed, - const StaticInstPtr & inst = StaticInst::nullStaticInstPtr, - Addr corrTarget = MaxAddr) = 0; + const StaticInstPtr &inst, Addr corrTarget) = 0; /** * Updates the BTB with the target of a branch. * @param inst_PC The branch's PC that will be updated. @@ -283,33 +277,35 @@ class BPredUnit : public SimObject /** The indirect target predictor. */ IndirectPredictor * iPred; - /** Stat for number of BP lookups. */ - Stats::Scalar lookups; - /** Stat for number of conditional branches predicted. */ - Stats::Scalar condPredicted; - /** Stat for number of conditional branches predicted incorrectly. */ - Stats::Scalar condIncorrect; - /** Stat for number of BTB lookups. */ - Stats::Scalar BTBLookups; - /** Stat for number of BTB hits. */ - Stats::Scalar BTBHits; - /** Stat for number of times the BTB is correct. */ - Stats::Scalar BTBCorrect; - /** Stat for percent times an entry in BTB found. */ - Stats::Formula BTBHitPct; - /** Stat for number of times the RAS is used to get a target. */ - Stats::Scalar usedRAS; - /** Stat for number of times the RAS is incorrect. */ - Stats::Scalar RASIncorrect; - - /** Stat for the number of indirect target lookups.*/ - Stats::Scalar indirectLookups; - /** Stat for the number of indirect target hits.*/ - Stats::Scalar indirectHits; - /** Stat for the number of indirect target misses.*/ - Stats::Scalar indirectMisses; - /** Stat for the number of indirect target mispredictions.*/ - Stats::Scalar indirectMispredicted; + struct BPredUnitStats : public Stats::Group { + BPredUnitStats(Stats::Group *parent); + + /** Stat for number of BP lookups. */ + Stats::Scalar lookups; + /** Stat for number of conditional branches predicted. */ + Stats::Scalar condPredicted; + /** Stat for number of conditional branches predicted incorrectly. */ + Stats::Scalar condIncorrect; + /** Stat for number of BTB lookups. */ + Stats::Scalar BTBLookups; + /** Stat for number of BTB hits. */ + Stats::Scalar BTBHits; + /** Stat for percent times an entry in BTB found. */ + Stats::Formula BTBHitPct; + /** Stat for number of times the RAS is used to get a target. */ + Stats::Scalar RASUsed; + /** Stat for number of times the RAS is incorrect. */ + Stats::Scalar RASIncorrect; + + /** Stat for the number of indirect target lookups.*/ + Stats::Scalar indirectLookups; + /** Stat for the number of indirect target hits.*/ + Stats::Scalar indirectHits; + /** Stat for the number of indirect target misses.*/ + Stats::Scalar indirectMisses; + /** Stat for the number of indirect target mispredictions.*/ + Stats::Scalar indirectMispredicted; + } stats; protected: /** Number of bits to shift instructions by for predictor addresses. */