Changeset 146 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_transition.cpp
- Timestamp:
- Feb 1, 2011, 9:57:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_transition.cpp
r124 r146 10 10 // #include <assert.h> 11 11 12 namespace morpheo 12 namespace morpheo { 13 13 namespace behavioural { 14 14 namespace core { … … 77 77 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (old): %llx",pht_history); 78 78 79 // TODO -> don't change PHT here ! 80 Thistory_t min = 0; 81 Thistory_t max = _param->_pht_counter_max; 82 79 83 // PHT : saturation counter 80 pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history)); 81 84 switch (_param->_pht_scheme) 85 { 86 case PHT_SCHEME_COUNTER : 87 { 88 pht_history = (direction==1)?((pht_history<max)?(pht_history+1):(max)):((pht_history>min)?(pht_history-1):(min)); 89 break; 90 } 91 case PHT_SCHEME_FSM : 92 { 93 Thistory_t down = _param->_pht_threshold_down; 94 Thistory_t up = _param->_pht_threshold_up; 95 96 pht_history = (direction==1)?(((pht_history==max) or (pht_history==up))?(max):(pht_history+1)):(((pht_history==min) or (pht_history==down))?(min):(pht_history-1)); 97 break; 98 } 99 default : 100 { 101 break; 102 } 103 } 104 82 105 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (new): %llx",pht_history); 83 106 … … 169 192 else 170 193 { 171 pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history)); 194 Thistory_t min = 0; 195 Thistory_t max = _param->_pht_counter_max; 196 197 // PHT : saturation counter 198 switch (_param->_pht_scheme) 199 { 200 case PHT_SCHEME_COUNTER : 201 { 202 // [ 11 ] -- NT -> [ 10 ] 203 // [ ] <- T -- [ ] 204 // ^ | 205 // | | 206 // T NT 207 // | | 208 // | V 209 // [ 00 ] -- T -> [ 01 ] 210 // [ ] <- NT -- [ ] 211 212 pht_history = (direction==1)?((pht_history<max)?(pht_history+1):(max)):((pht_history>min)?(pht_history-1):(min)); 213 break; 214 } 215 case PHT_SCHEME_FSM : 216 { 217 // [11] -- NT -> [10] 218 // [ ] <- T -- [ ] 219 // ^ | 220 // | | 221 // T NT 222 // | | 223 // | V 224 // [00] -- NT -> [00] 225 // [ ] <- T -- [ ] 226 227 Thistory_t down = _param->_pht_threshold_down; 228 Thistory_t up = _param->_pht_threshold_up; 229 230 pht_history = (direction==1)?(((pht_history==max) or (pht_history==up))?(max):(pht_history+1)):(((pht_history==min) or (pht_history==down))?(min):(pht_history-1)); 231 break; 232 } 233 default : 234 { 235 break; 236 } 237 } 172 238 } 173 239
Note: See TracChangeset
for help on using the changeset viewer.