bpred_unit.hh (10417:710ee116eb68) bpred_unit.hh (10462:e975e8afba8b)
1/*
2 * Copyright (c) 2011-2012, 2014 ARM Limited
3 * Copyright (c) 2010 The University of Edinburgh
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

--- 42 unchanged lines hidden (view full) ---

51
52#include "base/statistics.hh"
53#include "base/types.hh"
54#include "cpu/pred/btb.hh"
55#include "cpu/pred/ras.hh"
56#include "cpu/inst_seq.hh"
57#include "cpu/static_inst.hh"
58#include "params/BranchPredictor.hh"
1/*
2 * Copyright (c) 2011-2012, 2014 ARM Limited
3 * Copyright (c) 2010 The University of Edinburgh
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

--- 42 unchanged lines hidden (view full) ---

51
52#include "base/statistics.hh"
53#include "base/types.hh"
54#include "cpu/pred/btb.hh"
55#include "cpu/pred/ras.hh"
56#include "cpu/inst_seq.hh"
57#include "cpu/static_inst.hh"
58#include "params/BranchPredictor.hh"
59#include "sim/probe/pmu.hh"
59#include "sim/sim_object.hh"
60
61/**
62 * Basically a wrapper class to hold both the branch predictor
63 * and the BTB.
64 */
65class BPredUnit : public SimObject
66{

--- 4 unchanged lines hidden (view full) ---

71 */
72 BPredUnit(const Params *p);
73
74 /**
75 * Registers statistics.
76 */
77 void regStats();
78
60#include "sim/sim_object.hh"
61
62/**
63 * Basically a wrapper class to hold both the branch predictor
64 * and the BTB.
65 */
66class BPredUnit : public SimObject
67{

--- 4 unchanged lines hidden (view full) ---

72 */
73 BPredUnit(const Params *p);
74
75 /**
76 * Registers statistics.
77 */
78 void regStats();
79
80 void regProbePoints() M5_ATTR_OVERRIDE;
81
79 /** Perform sanity checks after a drain. */
80 void drainSanityCheck() const;
81
82 /**
83 * Predicts whether or not the instruction is a taken branch, and the
84 * target of the branch if it is taken.
85 * @param inst The branch instruction.
86 * @param PC The predicted PC is passed back through this parameter.

--- 198 unchanged lines hidden (view full) ---

285 /** Stat for number of times the BTB is correct. */
286 Stats::Scalar BTBCorrect;
287 /** Stat for percent times an entry in BTB found. */
288 Stats::Formula BTBHitPct;
289 /** Stat for number of times the RAS is used to get a target. */
290 Stats::Scalar usedRAS;
291 /** Stat for number of times the RAS is incorrect. */
292 Stats::Scalar RASIncorrect;
82 /** Perform sanity checks after a drain. */
83 void drainSanityCheck() const;
84
85 /**
86 * Predicts whether or not the instruction is a taken branch, and the
87 * target of the branch if it is taken.
88 * @param inst The branch instruction.
89 * @param PC The predicted PC is passed back through this parameter.

--- 198 unchanged lines hidden (view full) ---

288 /** Stat for number of times the BTB is correct. */
289 Stats::Scalar BTBCorrect;
290 /** Stat for percent times an entry in BTB found. */
291 Stats::Formula BTBHitPct;
292 /** Stat for number of times the RAS is used to get a target. */
293 Stats::Scalar usedRAS;
294 /** Stat for number of times the RAS is incorrect. */
295 Stats::Scalar RASIncorrect;
296
297 protected:
298 /**
299 * @{
300 * @name PMU Probe points.
301 */
302
303 /**
304 * Helper method to instantiate probe points belonging to this
305 * object.
306 *
307 * @param name Name of the probe point.
308 * @return A unique_ptr to the new probe point.
309 */
310 ProbePoints::PMUUPtr pmuProbePoint(const char *name);
311
312
313 /**
314 * Branches seen by the branch predictor
315 *
316 * @note This counter includes speculative branches.
317 */
318 ProbePoints::PMUUPtr ppBranches;
319
320 /** Miss-predicted branches */
321 ProbePoints::PMUUPtr ppMisses;
322
323 /** @} */
293};
294
295#endif // __CPU_PRED_BPRED_UNIT_HH__
324};
325
326#endif // __CPU_PRED_BPRED_UNIT_HH__