Changeset 111 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Parameters.cpp
- Timestamp:
- Feb 27, 2009, 7:37:40 PM (15 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/src/Parameters.cpp
r110 r111 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Parameters.h" 9 #include "Behavioural/include/Allocation.h" 9 10 10 11 namespace morpheo { … … 20 21 #undef FUNCTION 21 22 #define FUNCTION "Meta_Predictor::Parameters" 22 Parameters::Parameters (bool is_toplevel) 23 Parameters::Parameters (uint32_t nb_inst_predict , 24 uint32_t nb_inst_update , 25 uint32_t size_address , 26 bool have_bht [3], 27 uint32_t bht_size_shifter [3], 28 uint32_t bht_nb_shifter [3], 29 bool have_pht [3], 30 uint32_t pht_size_counter [3], 31 uint32_t pht_nb_counter [3], 32 uint32_t pht_size_address_share [3], 33 bool is_toplevel) 23 34 { 24 35 log_begin(Meta_Predictor,FUNCTION); 25 36 37 _nb_inst_predict = nb_inst_predict ; 38 _nb_inst_update = nb_inst_update ; 39 _size_address = size_address ; 40 for (uint32_t i=0; i<3; ++i) 41 { 42 _have_bht [i] = have_bht [i]; 43 _bht_size_shifter [i] = (_have_bht [i])?bht_size_shifter [i]:0; 44 _bht_nb_shifter [i] = (_have_bht [i])?bht_nb_shifter [i]:0; 45 _have_pht [i] = have_pht [i]; 46 _pht_size_counter [i] = (_have_pht [i])?pht_size_counter [i]:0; 47 _pht_nb_counter [i] = (_have_pht [i])?pht_nb_counter [i]:0; 48 _pht_size_address_share [i] = (_have_bht[i] and _have_pht [i])?pht_size_address_share [i]:0; 49 } 50 26 51 test(); 27 52 53 _have_meta_predictor = (_have_bht [2] or _have_pht [2]); 54 _nb_predictor = (_have_meta_predictor)?3:1; 55 56 ALLOC1(_predictor_update_on_prediction,bool , _nb_predictor); 57 ALLOC1(_predictor_size_history ,uint32_t, _nb_predictor); 58 59 // All predictor can update on prediction .... 60 for (uint32_t i=0; i<_nb_predictor; ++i) 61 _predictor_update_on_prediction [i] = true; 62 63 // ... But the selector prediction can't 64 if (_have_meta_predictor) 65 _predictor_update_on_prediction [_nb_predictor-1] = false; 66 67 _param_two_level_branch_predictor = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Parameters * [_nb_predictor]; 68 for (uint32_t i=0; i<_nb_predictor; ++i) 69 { 70 _param_two_level_branch_predictor [i] = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Parameters 71 (_nb_inst_predict , 72 _nb_inst_update , 73 _size_address , 74 _have_bht [i], 75 _bht_size_shifter [i], 76 _bht_nb_shifter [i], 77 _have_pht [i], 78 _pht_size_counter [i], 79 _pht_nb_counter [i], 80 _pht_size_address_share [i], 81 _predictor_update_on_prediction [i] 82 ); 83 84 _predictor_size_history [i] = _param_two_level_branch_predictor [i]->_size_history; 85 } 86 87 _param_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Parameters 88 ( 89 _nb_inst_predict , 90 _nb_inst_update , 91 _nb_predictor , 92 _predictor_size_history , 93 _predictor_update_on_prediction 94 ); 95 _size_history = _param_glue->_size_history; 96 28 97 if (is_toplevel) 29 98 { … … 48 117 { 49 118 log_begin(Meta_Predictor,FUNCTION); 119 120 DELETE1(_param_two_level_branch_predictor, _nb_predictor); 121 122 DELETE1(_predictor_size_history , _nb_predictor); 123 DELETE1(_predictor_update_on_prediction , _nb_predictor); 124 50 125 log_end(Meta_Predictor,FUNCTION); 51 126 }; … … 56 131 { 57 132 log_begin(Meta_Predictor,FUNCTION); 133 134 COPY(_param_glue); 135 for (uint32_t i=0; i<_nb_predictor; ++i) 136 COPY(_param_two_level_branch_predictor [i]); 137 58 138 log_end(Meta_Predictor,FUNCTION); 59 139 };
Note: See TracChangeset
for help on using the changeset viewer.