2bit_local.hh (11427:fb512311295e) | 2bit_local.hh (11429:cf5af0cc3be4) |
---|---|
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 --- 52 unchanged lines hidden (view full) --- 61class LocalBP : public BPredUnit 62{ 63 public: 64 /** 65 * Default branch predictor constructor. 66 */ 67 LocalBP(const LocalBPParams *params); 68 | 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 --- 52 unchanged lines hidden (view full) --- 61class LocalBP : public BPredUnit 62{ 63 public: 64 /** 65 * Default branch predictor constructor. 66 */ 67 LocalBP(const LocalBPParams *params); 68 |
69 virtual void uncondBranch(ThreadID tid, Addr pc, void * &bp_history); | 69 virtual void uncondBranch(Addr pc, void * &bp_history); |
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 */ | 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 */ |
78 bool lookup(ThreadID tid, Addr branch_addr, void * &bp_history); | 78 bool lookup(Addr branch_addr, void * &bp_history); |
79 80 /** 81 * Updates the branch predictor to Not Taken if a BTB entry is 82 * invalid or not found. 83 * @param branch_addr The address of the branch to look up. 84 * @param bp_history Pointer to any bp history state. 85 * @return Whether or not the branch is taken. 86 */ | 79 80 /** 81 * Updates the branch predictor to Not Taken if a BTB entry is 82 * invalid or not found. 83 * @param branch_addr The address of the branch to look up. 84 * @param bp_history Pointer to any bp history state. 85 * @return Whether or not the branch is taken. 86 */ |
87 void btbUpdate(ThreadID tid, Addr branch_addr, void * &bp_history); | 87 void btbUpdate(Addr branch_addr, void * &bp_history); |
88 89 /** 90 * Updates the branch predictor with the actual result of a branch. 91 * @param branch_addr The address of the branch to update. 92 * @param taken Whether or not the branch was taken. 93 */ | 88 89 /** 90 * Updates the branch predictor with the actual result of a branch. 91 * @param branch_addr The address of the branch to update. 92 * @param taken Whether or not the branch was taken. 93 */ |
94 void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, 95 bool squashed); | 94 void update(Addr branch_addr, bool taken, void *bp_history, bool squashed); |
96 | 95 |
97 void retireSquashed(ThreadID tid, void *bp_history) | 96 void retireSquashed(void *bp_history) |
98 { assert(bp_history == NULL); } 99 | 97 { assert(bp_history == NULL); } 98 |
100 void squash(ThreadID tid, void *bp_history) | 99 void squash(void *bp_history) |
101 { assert(bp_history == NULL); } 102 103 void reset(); 104 105 private: 106 /** 107 * Returns the taken/not taken prediction given the value of the 108 * counter. --- 25 unchanged lines hidden --- | 100 { assert(bp_history == NULL); } 101 102 void reset(); 103 104 private: 105 /** 106 * Returns the taken/not taken prediction given the value of the 107 * counter. --- 25 unchanged lines hidden --- |