2bit_local.hh (10330:f54586c894e3) | 2bit_local.hh (10785:f56c10663a01) |
---|---|
1/* 2 * Copyright (c) 2011, 2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 35 unchanged lines hidden (view full) --- 44#ifndef __CPU_PRED_2BIT_LOCAL_PRED_HH__ 45#define __CPU_PRED_2BIT_LOCAL_PRED_HH__ 46 47#include <vector> 48 49#include "base/types.hh" 50#include "cpu/pred/bpred_unit.hh" 51#include "cpu/pred/sat_counter.hh" | 1/* 2 * Copyright (c) 2011, 2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 35 unchanged lines hidden (view full) --- 44#ifndef __CPU_PRED_2BIT_LOCAL_PRED_HH__ 45#define __CPU_PRED_2BIT_LOCAL_PRED_HH__ 46 47#include <vector> 48 49#include "base/types.hh" 50#include "cpu/pred/bpred_unit.hh" 51#include "cpu/pred/sat_counter.hh" |
52#include "params/LocalBP.hh" |
|
52 53/** 54 * Implements a local predictor that uses the PC to index into a table of 55 * counters. Note that any time a pointer to the bp_history is given, it 56 * should be NULL using this predictor because it does not have any branch 57 * predictor state that needs to be recorded or updated; the update can be 58 * determined solely by the branch being taken or not taken. 59 */ 60class LocalBP : public BPredUnit 61{ 62 public: 63 /** 64 * Default branch predictor constructor. 65 */ | 53 54/** 55 * Implements a local predictor that uses the PC to index into a table of 56 * counters. Note that any time a pointer to the bp_history is given, it 57 * should be NULL using this predictor because it does not have any branch 58 * predictor state that needs to be recorded or updated; the update can be 59 * determined solely by the branch being taken or not taken. 60 */ 61class LocalBP : public BPredUnit 62{ 63 public: 64 /** 65 * Default branch predictor constructor. 66 */ |
66 LocalBP(const Params *params); | 67 LocalBP(const LocalBPParams *params); |
67 | 68 |
68 virtual void uncondBranch(void * &bp_history); | 69 virtual void uncondBranch(Addr pc, void * &bp_history); |
69 70 /** 71 * Looks up the given address in the branch predictor and returns 72 * a true/false value as to whether it is taken. 73 * @param branch_addr The address of the branch to look up. 74 * @param bp_history Pointer to any bp history state. 75 * @return Whether or not the branch is taken. 76 */ --- 42 unchanged lines hidden (view full) --- 119 unsigned localPredictorSize; 120 121 /** Number of sets. */ 122 unsigned localPredictorSets; 123 124 /** Number of bits of the local predictor's counters. */ 125 unsigned localCtrBits; 126 | 70 71 /** 72 * Looks up the given address in the branch predictor and returns 73 * a true/false value as to whether it is taken. 74 * @param branch_addr The address of the branch to look up. 75 * @param bp_history Pointer to any bp history state. 76 * @return Whether or not the branch is taken. 77 */ --- 42 unchanged lines hidden (view full) --- 120 unsigned localPredictorSize; 121 122 /** Number of sets. */ 123 unsigned localPredictorSets; 124 125 /** Number of bits of the local predictor's counters. */ 126 unsigned localCtrBits; 127 |
127 /** Number of bits to shift the PC when calculating index. */ 128 unsigned instShiftAmt; 129 | |
130 /** Mask to get index bits. */ 131 unsigned indexMask; 132}; 133 134#endif // __CPU_PRED_2BIT_LOCAL_PRED_HH__ | 128 /** Mask to get index bits. */ 129 unsigned indexMask; 130}; 131 132#endif // __CPU_PRED_2BIT_LOCAL_PRED_HH__ |