Changeset 112 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor
- Timestamp:
- Mar 18, 2009, 11:36:26 PM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp
r111 r112 64 64 ALLOC1_SC_SIGNAL(out_UPDATE_ACK ,"out_UPDATE_ACK ",Tcontrol_t,_param->_nb_inst_update); 65 65 ALLOC1_SC_SIGNAL( in_UPDATE_HISTORY ," in_UPDATE_HISTORY ",Thistory_t,_param->_nb_inst_update); 66 ALLOC1_SC_SIGNAL( in_UPDATE_HISTORY_VAL ," in_UPDATE_HISTORY_VAL ",Tcontrol_t,_param->_nb_inst_update); 66 67 ALLOC1_SC_SIGNAL( in_UPDATE_DIRECTION ," in_UPDATE_DIRECTION ",Tcontrol_t,_param->_nb_inst_update); 67 68 ALLOC2_SC_SIGNAL(out_UPDATE_PREDICTOR_VAL ,"out_UPDATE_PREDICTOR_VAL ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_update); 68 69 ALLOC2_SC_SIGNAL( in_UPDATE_PREDICTOR_ACK ," in_UPDATE_PREDICTOR_ACK ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_update); 69 70 ALLOC2_SC_SIGNAL(out_UPDATE_PREDICTOR_HISTORY ,"out_UPDATE_PREDICTOR_HISTORY ",Thistory_t,_param->_nb_predictor,_param->_nb_inst_update); 71 ALLOC2_SC_SIGNAL(out_UPDATE_PREDICTOR_HISTORY_VAL ,"out_UPDATE_PREDICTOR_HISTORY_VAL ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_update); 70 72 ALLOC2_SC_SIGNAL(out_UPDATE_PREDICTOR_DIRECTION ,"out_UPDATE_PREDICTOR_DIRECTION ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_update); 71 73 ALLOC2_SC_SIGNAL(out_UPDATE_PREDICTOR_MISS ,"out_UPDATE_PREDICTOR_MISS ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_update); … … 100 102 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue,out_UPDATE_ACK ,_param->_nb_inst_update); 101 103 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue, in_UPDATE_HISTORY ,_param->_nb_inst_update); 104 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue, in_UPDATE_HISTORY_VAL ,_param->_nb_inst_update); 102 105 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue, in_UPDATE_DIRECTION ,_param->_nb_inst_update); 103 106 … … 105 108 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue, in_UPDATE_PREDICTOR_ACK ,_param->_nb_predictor,_param->_nb_inst_update); 106 109 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue,out_UPDATE_PREDICTOR_HISTORY ,_param->_nb_predictor,_param->_nb_inst_update); 110 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue,out_UPDATE_PREDICTOR_HISTORY_VAL ,_param->_nb_predictor,_param->_nb_inst_update); 107 111 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue,out_UPDATE_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_update); 108 112 for (uint32_t i=0; i<_param->_nb_predictor; ++i) … … 169 173 DELETE1_SC_SIGNAL(out_UPDATE_ACK ,_param->_nb_inst_update); 170 174 DELETE1_SC_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update); 175 DELETE1_SC_SIGNAL( in_UPDATE_HISTORY_VAL ,_param->_nb_inst_update); 171 176 DELETE1_SC_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update); 172 177 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h
r111 r112 83 83 public : SC_OUT(Tcontrol_t) ** out_UPDATE_ACK ;// [nb_inst_update] 84 84 public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ;// [nb_inst_update] 85 public : SC_IN (Tcontrol_t) ** in_UPDATE_HISTORY_VAL ;// [nb_inst_update] 85 86 public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ;// [nb_inst_update] 86 87 … … 88 89 public : SC_IN (Tcontrol_t) *** in_UPDATE_PREDICTOR_ACK ;//[nb_predictor][nb_inst_update] 89 90 public : SC_OUT(Thistory_t) *** out_UPDATE_PREDICTOR_HISTORY ;//[nb_predictor][nb_inst_update] 91 public : SC_OUT(Tcontrol_t) *** out_UPDATE_PREDICTOR_HISTORY_VAL ;//[nb_predictor][nb_inst_update] 90 92 public : SC_OUT(Tcontrol_t) *** out_UPDATE_PREDICTOR_DIRECTION ;//[nb_predictor][nb_inst_update] 91 93 public : SC_OUT(Tcontrol_t) *** out_UPDATE_PREDICTOR_MISS ;//[nb_predictor][nb_inst_update] // if update_on_prediction -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue.cpp
r111 r112 101 101 // sensitive << (*(in_CLOCK)).neg(); // don't need internal register 102 102 for (uint32_t i=0; i<_param->_nb_inst_update; ++i) 103 sensitive << (*(in_UPDATE_HISTORY [i])) 104 << (*(in_UPDATE_DIRECTION [i])); 103 sensitive << (*(in_UPDATE_HISTORY [i])) 104 << (*(in_UPDATE_HISTORY_VAL [i])) 105 << (*(in_UPDATE_DIRECTION [i])); 105 106 106 107 # ifdef SYSTEMCASS_SPECIFIC -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_allocation.cpp
r111 r112 61 61 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 62 { 63 ALLOC1_INTERFACE ("predict",IN,NORTH,_("Predict next address"),_param->_nb_inst_predict);63 ALLOC1_INTERFACE_BEGIN("predict",IN,NORTH,_("Predict next address"),_param->_nb_inst_predict); 64 64 65 65 ALLOC1_SIGNAL_IN ( in_PREDICT_VAL ,"VAL" ,Tcontrol_t,1); … … 67 67 ALLOC1_SIGNAL_OUT(out_PREDICT_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 68 68 ALLOC1_SIGNAL_OUT(out_PREDICT_DIRECTION ,"DIRECTION" ,Tcontrol_t,1); 69 70 ALLOC1_INTERFACE_END(_param->_nb_inst_predict); 69 71 } 70 72 71 73 { 72 ALLOC2_INTERFACE ("predict_predictor",IN,NORTH,_("Predict next address"),_param->_nb_predictor,_param->_nb_inst_predict);74 ALLOC2_INTERFACE_BEGIN("predict_predictor",IN,NORTH,_("Predict next address"),_param->_nb_predictor,_param->_nb_inst_predict); 73 75 74 76 ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_VAL ,"VAL" ,Tcontrol_t,1); … … 78 80 ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_DIRECTION_VAL,"DIRECTION_VAL",Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0); 79 81 ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_DIRECTION ,"DIRECTION" ,Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0); 82 83 ALLOC2_INTERFACE_END(_param->_nb_predictor,_param->_nb_inst_predict); 80 84 } 81 85 82 86 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 87 { 84 ALLOC1_INTERFACE ("update",IN,NORTH,_("Update predictor"),_param->_nb_inst_update);88 ALLOC1_INTERFACE_BEGIN("update",IN,NORTH,_("Update predictor"),_param->_nb_inst_update); 85 89 86 90 ALLOC1_SIGNAL_IN ( in_UPDATE_VAL ,"VAL" ,Tcontrol_t,1); 87 91 ALLOC1_SIGNAL_OUT(out_UPDATE_ACK ,"ACK" ,Tcontrol_t,1); 88 92 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 93 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY_VAL ,"HISTORY_VAL" ,Tcontrol_t,1); 89 94 ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION ,"DIRECTION" ,Tcontrol_t,1); 95 96 ALLOC1_INTERFACE_END(_param->_nb_inst_update); 90 97 } 91 98 { 92 ALLOC2_INTERFACE ("update_predictor",IN,NORTH,_("Update predictor"),_param->_nb_predictor,_param->_nb_inst_update);99 ALLOC2_INTERFACE_BEGIN("update_predictor",IN,NORTH,_("Update predictor"),_param->_nb_predictor,_param->_nb_inst_update); 93 100 94 101 ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_VAL ,"VAL" ,Tcontrol_t,1); 95 102 ALLOC2_SIGNAL_IN ( in_UPDATE_PREDICTOR_ACK ,"ACK" ,Tcontrol_t,1); 96 103 ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_HISTORY ,"HISTORY" ,Thistory_t,_param->_predictor_size_history[it1]); 104 ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_HISTORY_VAL ,"HISTORY_VAL" ,Tcontrol_t,1); 97 105 ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_DIRECTION ,"DIRECTION" ,Tcontrol_t,1); 98 106 ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_MISS ,"MISS" ,Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0); 107 108 ALLOC2_INTERFACE_END(_param->_nb_predictor,_param->_nb_inst_update); 99 109 } 100 110 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.cpp
r111 r112 46 46 DELETE1_SIGNAL(out_UPDATE_ACK ,_param->_nb_inst_update,1); 47 47 DELETE1_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update,_param->_size_history); 48 DELETE1_SIGNAL( in_UPDATE_HISTORY_VAL ,_param->_nb_inst_update,1); 48 49 DELETE1_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update,1); 49 50 … … 51 52 DELETE2_SIGNAL( in_UPDATE_PREDICTOR_ACK ,_param->_nb_predictor,_param->_nb_inst_update,1); 52 53 DELETE2_SIGNAL(out_UPDATE_PREDICTOR_HISTORY ,_param->_nb_predictor,_param->_nb_inst_update,_param->_predictor_size_history[it1]); 54 DELETE2_SIGNAL(out_UPDATE_PREDICTOR_HISTORY_VAL ,_param->_nb_predictor,_param->_nb_inst_update,1); 53 55 DELETE2_SIGNAL(out_UPDATE_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_update,1); 54 56 DELETE2_SIGNAL(out_UPDATE_PREDICTOR_MISS ,_param->_nb_predictor,_param->_nb_inst_update,(_param->_predictor_update_on_prediction [it1])?1:0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_update.cpp
r111 r112 29 29 for (uint32_t i=0; i<_param->_nb_inst_update; ++i) 30 30 { 31 Thistory_t history = PORT_READ(in_UPDATE_HISTORY [i]); 32 Tcontrol_t direction = PORT_READ(in_UPDATE_DIRECTION [i]); 31 Thistory_t history = PORT_READ(in_UPDATE_HISTORY [i]); 32 Tcontrol_t history_val = PORT_READ(in_UPDATE_HISTORY_VAL [i]); 33 Tcontrol_t direction = PORT_READ(in_UPDATE_DIRECTION [i]); 33 34 34 35 switch (_param->_nb_predictor) … … 38 39 Thistory_t history_0 = history; 39 40 Tcontrol_t direction_old_0 = (history_0>>_param->_predictor_history_shift_msb[0])&1; 40 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY [0][i],history_0); 41 PORT_WRITE(out_UPDATE_PREDICTOR_DIRECTION [0][i],direction); 41 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY [0][i],history_0); 42 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY_VAL [0][i],history_val); 43 PORT_WRITE(out_UPDATE_PREDICTOR_DIRECTION [0][i],direction); 42 44 if (_param->_predictor_update_on_prediction [0]) 43 PORT_WRITE(out_UPDATE_PREDICTOR_MISS [0][i],direction xor direction_old_0);45 PORT_WRITE(out_UPDATE_PREDICTOR_MISS [0][i],direction xor direction_old_0); 44 46 45 47 break; … … 83 85 (not direction and direction_old_0)); 84 86 85 PORT_WRITE(out_UPDATE_PREDICTOR_DIRECTION [0][i],direction);86 PORT_WRITE(out_UPDATE_PREDICTOR_DIRECTION [1][i],direction);87 PORT_WRITE(out_UPDATE_PREDICTOR_DIRECTION [2][i],direction_new_2);87 PORT_WRITE(out_UPDATE_PREDICTOR_DIRECTION [0][i],direction); 88 PORT_WRITE(out_UPDATE_PREDICTOR_DIRECTION [1][i],direction); 89 PORT_WRITE(out_UPDATE_PREDICTOR_DIRECTION [2][i],direction_new_2); 88 90 89 91 if (_param->_predictor_update_on_prediction [0]) 90 PORT_WRITE(out_UPDATE_PREDICTOR_MISS [0][i],direction xor direction_old_0);92 PORT_WRITE(out_UPDATE_PREDICTOR_MISS [0][i],direction xor direction_old_0); 91 93 if (_param->_predictor_update_on_prediction [1]) 92 PORT_WRITE(out_UPDATE_PREDICTOR_MISS [1][i],direction xor direction_old_1);94 PORT_WRITE(out_UPDATE_PREDICTOR_MISS [1][i],direction xor direction_old_1); 93 95 if (_param->_predictor_update_on_prediction [2]) 94 PORT_WRITE(out_UPDATE_PREDICTOR_MISS [2][i],direction_new_2 xor direction_old_2);96 PORT_WRITE(out_UPDATE_PREDICTOR_MISS [2][i],direction_new_2 xor direction_old_2); 95 97 96 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY [0][i],history_0); 97 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY [1][i],history_1); 98 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY [2][i],history_2); 98 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY [0][i],history_0); 99 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY [1][i],history_1); 100 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY [2][i],history_2); 101 102 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY_VAL [0][i],history_val); 103 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY_VAL [1][i],history_val); 104 PORT_WRITE(out_UPDATE_PREDICTOR_HISTORY_VAL [2][i],history_val); 99 105 100 106 break; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/src/test.cpp
r111 r112 60 60 ALLOC1_SC_SIGNAL( in_UPDATE_ADDRESS ," in_UPDATE_ADDRESS ",Taddress_t,_param->_nb_inst_update); 61 61 ALLOC1_SC_SIGNAL( in_UPDATE_HISTORY ," in_UPDATE_HISTORY ",Thistory_t,_param->_nb_inst_update); 62 ALLOC1_SC_SIGNAL( in_UPDATE_HISTORY_VAL ," in_UPDATE_HISTORY_VAL ",Tcontrol_t,_param->_nb_inst_update); 62 63 ALLOC1_SC_SIGNAL( in_UPDATE_DIRECTION ," in_UPDATE_DIRECTION ",Tcontrol_t,_param->_nb_inst_update); 63 64 … … 81 82 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_UPDATE_ADDRESS ,_param->_nb_inst_update); 82 83 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_UPDATE_HISTORY ,_param->_nb_inst_update); 84 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_UPDATE_HISTORY_VAL ,_param->_nb_inst_update); 83 85 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_UPDATE_DIRECTION ,_param->_nb_inst_update); 84 86 … … 137 139 DELETE1_SC_SIGNAL( in_UPDATE_ADDRESS ,_param->_nb_inst_update); 138 140 DELETE1_SC_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update); 141 DELETE1_SC_SIGNAL( in_UPDATE_HISTORY_VAL ,_param->_nb_inst_update); 139 142 DELETE1_SC_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update); 140 143 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp
r111 r112 63 63 ALLOC1_SC_SIGNAL( in_UPDATE_ADDRESS ," in_UPDATE_ADDRESS ",Taddress_t,_param->_nb_inst_update); 64 64 ALLOC1_SC_SIGNAL( in_UPDATE_HISTORY ," in_UPDATE_HISTORY ",Thistory_t,_param->_nb_inst_update); 65 ALLOC1_SC_SIGNAL( in_UPDATE_HISTORY_VAL ," in_UPDATE_HISTORY_VAL ",Tcontrol_t,_param->_nb_inst_update); 65 66 ALLOC1_SC_SIGNAL( in_UPDATE_DIRECTION ," in_UPDATE_DIRECTION ",Tcontrol_t,_param->_nb_inst_update); 66 67 ALLOC1_SC_SIGNAL( in_UPDATE_MISS ," in_UPDATE_MISS ",Tcontrol_t,_param->_nb_inst_update); … … 90 91 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_UPDATE_ADDRESS ,_param->_nb_inst_update); 91 92 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_UPDATE_HISTORY ,_param->_nb_inst_update); 93 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_UPDATE_HISTORY_VAL ,_param->_nb_inst_update); 92 94 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_UPDATE_DIRECTION ,_param->_nb_inst_update); 93 95 if (_param->_update_on_prediction) … … 155 157 { 156 158 bool val = ((rand()%2)<percent_transaction_update); 157 in_UPDATE_VAL [port]->write(val);158 in_UPDATE_DIRECTION [port]->write(0);159 in_UPDATE_VAL [port]->write(val); 160 in_UPDATE_DIRECTION [port]->write(0); 159 161 160 162 if (_param->_update_on_prediction) 161 in_UPDATE_MISS [port]->write(1); // miss 162 in_UPDATE_HISTORY [port]->write(0); 163 in_UPDATE_ADDRESS [port]->write(bht_num_reg); 163 in_UPDATE_MISS [port]->write(1); // miss 164 in_UPDATE_HISTORY [port]->write(0); 165 in_UPDATE_HISTORY_VAL [port]->write(0); 166 in_UPDATE_ADDRESS [port]->write(bht_num_reg); 164 167 165 168 SC_START(0); … … 185 188 { 186 189 bool val = ((rand()%2)<percent_transaction_update); 187 in_UPDATE_VAL [port]->write(val);188 in_UPDATE_DIRECTION [port]->write(0);190 in_UPDATE_VAL [port]->write(val); 191 in_UPDATE_DIRECTION [port]->write(0); 189 192 190 193 if (_param->_update_on_prediction) 191 in_UPDATE_MISS [port]->write(1); // miss 192 in_UPDATE_HISTORY [port]->write(i<<_param->_bht_history_rshift); 193 in_UPDATE_ADDRESS [port]->write(pht_num_bank<<_param->_pht_address_bank_rshift); 194 in_UPDATE_MISS [port]->write(1); // miss 195 in_UPDATE_HISTORY [port]->write(i<<_param->_bht_history_rshift); 196 in_UPDATE_HISTORY_VAL [port]->write(1); 197 in_UPDATE_ADDRESS [port]->write(pht_num_bank<<_param->_pht_address_bank_rshift); 194 198 195 199 SC_START(0); … … 241 245 DELETE1_SC_SIGNAL( in_UPDATE_ADDRESS ,_param->_nb_inst_update); 242 246 DELETE1_SC_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update); 247 DELETE1_SC_SIGNAL( in_UPDATE_HISTORY_VAL ,_param->_nb_inst_update); 243 248 DELETE1_SC_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update); 244 249 DELETE1_SC_SIGNAL( in_UPDATE_MISS ,_param->_nb_inst_update); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h
r111 r112 59 59 public : Taddress_t _pht_address_bank_rshift ; 60 60 61 public : Thistory_t _bht_init_take ; 62 public : Thistory_t _bht_init_ntake ; 63 64 public : Thistory_t _pht_init_take ; 65 public : Thistory_t _pht_init_ntake ; 66 61 67 //-----[ methods ]----------------------------------------------------------- 62 68 public : Parameters (uint32_t nb_inst_predict , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h
r111 r112 80 80 public : SC_IN (Taddress_t) ** in_UPDATE_ADDRESS ;//[nb_inst_update] 81 81 public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ;//[nb_inst_update] 82 public : SC_IN (Tcontrol_t) ** in_UPDATE_HISTORY_VAL ;//[nb_inst_update] 82 83 public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ;//[nb_inst_update] 83 84 public : SC_IN (Tcontrol_t) ** in_UPDATE_MISS ;//[nb_inst_update] // if update_on_prediction -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp
r111 r112 44 44 _bht_nb_shifter = (have_bht)?(bht_nb_shifter ):0; 45 45 _have_pht = have_pht ; 46 _pht_size_counter = (have_pht)?(pht_size_counter 47 _pht_nb_counter = (have_pht)?(pht_nb_counter 46 _pht_size_counter = (have_pht)?(pht_size_counter):0; 47 _pht_nb_counter = (have_pht)?(pht_nb_counter ):0; 48 48 _pht_size_address_share = (have_bht and have_pht)?(pht_size_address_share):0; 49 49 _update_on_prediction = update_on_prediction ; … … 54 54 test(); 55 55 56 // history to update_prediction_table : 57 // MSB : pht_history 58 // LSB : bht_history 59 56 60 _size_history = _bht_size_shifter + _pht_size_counter; 57 58 61 _bht_history_mask = gen_mask<Thistory_t>(_bht_size_shifter); 59 62 _bht_history_rshift = 0; … … 67 70 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_history_rshift : %d",_pht_history_rshift); 68 71 72 _bht_init_take = (Thistory_t)(-1)&_bht_history_mask; 73 _bht_init_ntake = 0; 74 _pht_init_take = (1<<(_pht_size_counter-1)); // size = 4 : 1000/2 75 _pht_init_ntake = _pht_init_take-1; // size = 4 : 0111/2 76 77 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _bht_init_take : 0x%x",_bht_init_take ); 78 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _bht_init_ntake : 0x%x",_bht_init_ntake); 79 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_init_take : 0x%x",_pht_init_take ); 80 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_init_ntake : 0x%x",_pht_init_ntake); 81 69 82 if (_have_bht) 70 83 { -
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_allocation.cpp
r111 r112 59 59 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 60 { 61 ALLOC1_INTERFACE ("predict",IN,WEST,_("Predict direction interface"),_param->_nb_inst_predict);61 ALLOC1_INTERFACE_BEGIN("predict",IN,WEST,_("Predict direction interface"),_param->_nb_inst_predict); 62 62 63 63 ALLOC1_VALACK_IN ( in_PREDICT_VAL ,VAL); … … 71 71 ALLOC1_SIGNAL_IN ( in_PREDICT_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 72 72 } 73 74 ALLOC1_INTERFACE_END(_param->_nb_inst_predict); 73 75 } 74 76 75 77 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 78 { 77 ALLOC1_INTERFACE ("update",IN,WEST,_("Update direction interface"),_param->_nb_inst_update);79 ALLOC1_INTERFACE_BEGIN("update",IN,WEST,_("Update direction interface"),_param->_nb_inst_update); 78 80 79 81 ALLOC1_VALACK_IN ( in_UPDATE_VAL ,VAL); … … 81 83 ALLOC1_SIGNAL_IN ( in_UPDATE_ADDRESS ,"ADDRESS" ,Taddress_t,_param->_size_address); 82 84 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 85 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY_VAL ,"HISTORY_VAL" ,Tcontrol_t,1 ); 83 86 ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 84 87 if (_param->_update_on_prediction) 85 88 ALLOC1_SIGNAL_IN ( in_UPDATE_MISS ,"MISS" ,Tcontrol_t,1 ); 89 90 ALLOC1_INTERFACE_END(_param->_nb_inst_update); 86 91 } 92 93 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 87 94 88 95 if (usage_is_set(_usage,USE_SYSTEMC)) -
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_deallocation.cpp
r111 r112 46 46 DELETE1_SIGNAL( in_UPDATE_ADDRESS ,_param->_nb_inst_update,_param->_size_address); 47 47 DELETE1_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update,_param->_size_history); 48 DELETE1_SIGNAL( in_UPDATE_HISTORY_VAL ,_param->_nb_inst_update,1 ); 48 49 DELETE1_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update,1 ); 49 50 if (_param->_update_on_prediction) -
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
r111 r112 90 90 { 91 91 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * UPDATE [%d]",i); 92 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * miss : %d",PORT_READ(in_UPDATE_MISS [i])); 93 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * update_on_predict: %d",_param->_update_on_prediction); 92 94 93 95 // Update if 94 96 // * update_on_prediction and miss 95 97 // * not update_on_prediction 96 if (not _param->_update_on_prediction or (_param->_update_on_prediction and PORT_READ(in_UPDATE_MISS [i]))) 97 { 98 Taddress_t address = PORT_READ(in_UPDATE_ADDRESS [i]); 99 Thistory_t history = PORT_READ(in_UPDATE_HISTORY [i]); 100 Tcontrol_t direction = PORT_READ(in_UPDATE_DIRECTION [i])&1; 98 Tcontrol_t history_val = PORT_READ(in_UPDATE_HISTORY_VAL [i]); 99 100 if (not _param->_update_on_prediction or 101 (_param->_update_on_prediction and PORT_READ(in_UPDATE_MISS [i])) or 102 not history_val // static_prediction 103 ) 104 { 105 Taddress_t address = PORT_READ(in_UPDATE_ADDRESS [i]); 106 Thistory_t history = PORT_READ(in_UPDATE_HISTORY [i]); 107 Tcontrol_t direction = PORT_READ(in_UPDATE_DIRECTION [i])&1; 101 108 102 109 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * address : %.8x",address); 103 110 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * direction : %d",direction); 111 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * history_val : %d",direction); 104 112 105 113 Thistory_t pht_bht_history = 0; … … 107 115 if (_param->_have_bht) 108 116 { 117 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht"); 118 109 119 Thistory_t bht_history = (history>>_param->_bht_history_rshift)&_param->_bht_history_mask; 110 120 Thistory_t bht_num_reg = address & _param->_bht_address_mask; 111 121 122 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (old): %x",bht_history); 123 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_num_reg : %x",bht_num_reg); 124 125 // BHT : shift register 126 if (not history_val) 127 bht_history = (direction)?_param->_bht_init_take:_param->_bht_init_ntake; 128 else 129 bht_history = ((bht_history<<1) | direction)&_param->_bht_history_mask ; 130 112 131 pht_bht_history = bht_history; 113 114 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (old): %x",bht_history); 115 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_num_reg : %x",bht_num_reg); 116 117 // BHT : shift register 118 119 bht_history = ((bht_history<<1) | direction)&_param->_bht_history_mask ; 120 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (new): %x",bht_history); 132 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (new): %x",bht_history); 121 133 reg_BHT [bht_num_reg] = bht_history; 122 134 } … … 124 136 if (_param->_have_pht) 125 137 { 138 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht"); 139 126 140 Thistory_t pht_history = (history>>_param->_pht_history_rshift)&_param->_pht_history_mask; 127 141 Thistory_t pht_num_reg = pht_bht_history xor ((address&_param->_pht_address_share_mask)<<_param->_pht_address_share_lshift); 128 142 Thistory_t pht_num_bank= (address>>_param->_pht_address_bank_rshift)&_param->_pht_address_bank_mask; 129 143 130 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (old): %x",pht_bht_history);131 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (old): %x",pht_history);132 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_num_reg : %x",pht_num_reg);133 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_num_bank : %x",pht_num_bank);144 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (old): %x",pht_bht_history); 145 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (old): %x",pht_history); 146 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_num_reg : %x",pht_num_reg); 147 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_num_bank : %x",pht_num_bank); 134 148 135 149 // PHT : saturation counter 136 pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history)); 137 138 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (new): %x",pht_history); 150 if (not history_val) 151 pht_history = (direction)?_param->_pht_init_take:_param->_pht_init_ntake; 152 else 153 pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history)); 154 155 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (new): %x",pht_history); 139 156 140 157 reg_PHT [pht_num_bank][pht_num_reg] = pht_history; … … 145 162 146 163 #if defined(DEBUG) and DEBUG_Two_Level_Branch_Predictor and (DEBUG >= DEBUG_TRACE) 147 if ( 0)164 if (1) 148 165 { 149 166 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * Dump Two_Level_Branch_Predictor"); … … 180 197 for (uint32_t num_bank=0; num_bank <_param->_pht_nb_bank; ++num_bank) 181 198 { 182 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," [%.4d]",num_bank); 183 184 for (uint32_t i=0; i<_param->_pht_size_bank; i+=limit) 185 { 186 std::string str = ""; 199 if (_param->_pht_size_bank == 1) 200 { 201 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," [%.4d][0000] %4x",num_bank,reg_PHT[num_bank][0]); 202 } 203 else 204 { 205 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," [%.4d]",num_bank); 187 206 188 for (uint32_t j=0; j<limit; j++)207 for (uint32_t i=0; i<_param->_pht_size_bank; i+=limit) 189 208 { 190 uint32_t index = i+j; 191 if (index >= _param->_pht_nb_counter) 192 break; 193 else 194 str+=toString("[%.4d] %.4x ",index,reg_PHT[num_bank][index]); 209 std::string str = ""; 210 211 for (uint32_t j=0; j<limit; j++) 212 { 213 uint32_t index = i+j; 214 if (index >= _param->_pht_size_bank) 215 break; 216 else 217 str+=toString("[%.4d] %.4x ",index,reg_PHT[num_bank][index]); 218 } 219 220 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," %s",str.c_str()); 195 221 } 196 197 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," %s",str.c_str());198 222 } 199 223 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Meta_Predictor.h
r111 r112 80 80 public : SC_IN (Taddress_t) ** in_UPDATE_ADDRESS ;//[nb_inst_update] 81 81 public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ;//[nb_inst_update] 82 public : SC_IN (Tcontrol_t) ** in_UPDATE_HISTORY_VAL ;//[nb_inst_update] 82 83 public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ;//[nb_inst_update] 83 84 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Meta_Predictor_allocation.cpp
r111 r112 58 58 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 59 { 60 ALLOC1_INTERFACE ("predict",IN,WEST,_("Predict direction interface"),_param->_nb_inst_predict);60 ALLOC1_INTERFACE_BEGIN("predict",IN,WEST,_("Predict direction interface"),_param->_nb_inst_predict); 61 61 62 62 ALLOC1_VALACK_IN ( in_PREDICT_VAL ,VAL); … … 65 65 ALLOC1_SIGNAL_OUT(out_PREDICT_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 66 66 ALLOC1_SIGNAL_OUT(out_PREDICT_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 67 68 ALLOC1_INTERFACE_END(_param->_nb_inst_predict); 67 69 } 68 70 69 71 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 72 { 71 ALLOC1_INTERFACE ("update",IN,WEST,_("Update direction interface"),_param->_nb_inst_update);73 ALLOC1_INTERFACE_BEGIN("update",IN,WEST,_("Update direction interface"),_param->_nb_inst_update); 72 74 73 75 ALLOC1_VALACK_IN ( in_UPDATE_VAL ,VAL); … … 75 77 ALLOC1_SIGNAL_IN ( in_UPDATE_ADDRESS ,"ADDRESS" ,Taddress_t,_param->_size_address); 76 78 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 79 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY_VAL ,"HISTORY_VAL" ,Tcontrol_t,1 ); 77 80 ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 81 82 ALLOC1_INTERFACE_END(_param->_nb_inst_update); 78 83 } 79 84 … … 218 223 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_HISTORY" , 219 224 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_HISTORY" ); 225 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_HISTORY_VAL" , 226 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_HISTORY_VAL" ); 220 227 if (_param->_predictor_update_on_prediction [i]) 221 228 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_MISS" , … … 286 293 #endif 287 294 288 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_VAL" , 289 dest, "in_UPDATE_"+toString(i)+"_VAL" ); 290 PORT_MAP(_component,src ,"out_UPDATE_"+toString(i)+"_ACK" , 291 dest,"out_UPDATE_"+toString(i)+"_ACK" ); 292 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_HISTORY" , 293 dest, "in_UPDATE_"+toString(i)+"_HISTORY" ); 294 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_DIRECTION", 295 dest, "in_UPDATE_"+toString(i)+"_DIRECTION"); 296 } 297 298 // out_UPDATE_PREDICTOR_VAL -> two_level_branch_predictor. in_UPDATE_PREDICTOR_VAL 299 // in_UPDATE_PREDICTOR_ACK -> two_level_branch_predictor.out_UPDATE_PREDICTOR_ACK 300 // out_UPDATE_PREDICTOR_HISTORY -> two_level_branch_predictor. in_UPDATE_PREDICTOR_HISTORY 301 // out_UPDATE_PREDICTOR_DIRECTION -> two_level_branch_predictor. in_UPDATE_PREDICTOR_DIRECTION 302 // out_UPDATE_PREDICTOR_MISS -> two_level_branch_predictor. in_UPDATE_PREDICTOR_MISS 295 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_VAL" , 296 dest, "in_UPDATE_"+toString(i)+"_VAL" ); 297 PORT_MAP(_component,src ,"out_UPDATE_"+toString(i)+"_ACK" , 298 dest,"out_UPDATE_"+toString(i)+"_ACK" ); 299 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_HISTORY" , 300 dest, "in_UPDATE_"+toString(i)+"_HISTORY" ); 301 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_HISTORY_VAL", 302 dest, "in_UPDATE_"+toString(i)+"_HISTORY_VAL"); 303 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_DIRECTION" , 304 dest, "in_UPDATE_"+toString(i)+"_DIRECTION" ); 305 } 306 307 // out_UPDATE_PREDICTOR_VAL -> two_level_branch_predictor. in_UPDATE_PREDICTOR_VAL 308 // in_UPDATE_PREDICTOR_ACK -> two_level_branch_predictor.out_UPDATE_PREDICTOR_ACK 309 // out_UPDATE_PREDICTOR_HISTORY -> two_level_branch_predictor. in_UPDATE_PREDICTOR_HISTORY 310 // out_UPDATE_PREDICTOR_HISTORY_VAL-> two_level_branch_predictor. in_UPDATE_PREDICTOR_HISTORY 311 // out_UPDATE_PREDICTOR_DIRECTION -> two_level_branch_predictor. in_UPDATE_PREDICTOR_DIRECTION 312 // out_UPDATE_PREDICTOR_MISS -> two_level_branch_predictor. in_UPDATE_PREDICTOR_MISS 303 313 304 314 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Meta_Predictor_deallocation.cpp
r111 r112 40 40 DELETE1_SIGNAL( in_UPDATE_ADDRESS ,_param->_nb_inst_update,_param->_size_address); 41 41 DELETE1_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update,_param->_size_history); 42 DELETE1_SIGNAL( in_UPDATE_HISTORY_VAL ,_param->_nb_inst_update,1 ); 42 43 DELETE1_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update,1 ); 43 44 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Parameters.cpp
r111 r112 64 64 if (_have_meta_predictor) 65 65 _predictor_update_on_prediction [_nb_predictor-1] = false; 66 67 // // All predictor can't update on prediction .... 68 // for (uint32_t i=0; i<_nb_predictor; ++i) 69 // _predictor_update_on_prediction [i] = false; 66 70 67 71 _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];
Note: See TracChangeset
for help on using the changeset viewer.