Changeset 5 for trunk/IPs/systemC
- Timestamp:
- Mar 9, 2007, 7:16:58 PM (18 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor
- Files:
-
- 38 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp
r4 r5 45 45 46 46 // Interface Branch_complete 47 sc_signal<Tcontrol_t> ** BRANCH_COMPLETE_VAL ; 48 sc_signal<Tcontrol_t> ** BRANCH_COMPLETE_PREDICTOR_2_VAL ; 49 47 50 sc_signal<Tcontrol_t> ** BRANCH_COMPLETE_PREDICTOR_0_ACK ; 48 51 sc_signal<Tcontrol_t> ** BRANCH_COMPLETE_PREDICTOR_1_ACK ; … … 57 60 sc_signal<Tpht_history_t> ** BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY; 58 61 sc_signal<Thistory_t> ** BRANCH_COMPLETE_HISTORY ; 59 62 sc_signal<Tcontrol_t> ** BRANCH_COMPLETE_DIRECTION ; 63 sc_signal<Tcontrol_t> ** BRANCH_COMPLETE_PREDICTOR_2_DIRECTION ; 60 64 string rename; 61 65 … … 108 112 109 113 // Interface Branch_complete 110 114 BRANCH_COMPLETE_VAL = new sc_signal<Tcontrol_t> * [_param._nb_branch_complete ]; 115 BRANCH_COMPLETE_PREDICTOR_2_VAL = new sc_signal<Tcontrol_t> * [_param._nb_branch_complete ]; 111 116 BRANCH_COMPLETE_PREDICTOR_0_ACK = new sc_signal<Tcontrol_t> * [_param._nb_branch_complete ]; 112 117 BRANCH_COMPLETE_PREDICTOR_1_ACK = new sc_signal<Tcontrol_t> * [_param._nb_branch_complete ]; … … 120 125 BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY = new sc_signal<Tpht_history_t> * [_param._nb_branch_complete ]; 121 126 BRANCH_COMPLETE_HISTORY = new sc_signal<Thistory_t> * [_param._nb_branch_complete ]; 127 BRANCH_COMPLETE_DIRECTION = new sc_signal<Tcontrol_t> * [_param._nb_branch_complete ]; 128 BRANCH_COMPLETE_PREDICTOR_2_DIRECTION = new sc_signal<Tcontrol_t> * [_param._nb_branch_complete ]; 122 129 123 130 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 124 131 { 132 rename = "BRANCH_COMPLETE_VAL_" +toString(i); 133 BRANCH_COMPLETE_VAL [i] = new sc_signal<Tcontrol_t> (rename.c_str()); 134 rename = "BRANCH_COMPLETE_PREDICTOR_2_VAL_" +toString(i); 135 BRANCH_COMPLETE_PREDICTOR_2_VAL [i] = new sc_signal<Tcontrol_t> (rename.c_str()); 125 136 rename = "BRANCH_COMPLETE_PREDICTOR_0_ACK_" +toString(i); 126 137 BRANCH_COMPLETE_PREDICTOR_0_ACK [i] = new sc_signal<Tcontrol_t> (rename.c_str()); … … 145 156 rename = "BRANCH_COMPLETE_HISTORY_" +toString(i); 146 157 BRANCH_COMPLETE_HISTORY [i] = new sc_signal<Thistory_t> (rename.c_str()); 158 rename = "BRANCH_COMPLETE_DIRECTION_" +toString(i); 159 BRANCH_COMPLETE_DIRECTION [i] = new sc_signal<Tcontrol_t> (rename.c_str()); 160 rename = "BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_" +toString(i); 161 BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i] = new sc_signal<Tcontrol_t> (rename.c_str()); 147 162 } 148 163 … … 192 207 if (_param._have_meta_predictor) 193 208 { 209 (*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_VAL [i])) (*(BRANCH_COMPLETE_VAL [i])); 210 (*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i])) (*(BRANCH_COMPLETE_PREDICTOR_2_VAL [i])); 211 194 212 (*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i])) (*(BRANCH_COMPLETE_PREDICTOR_0_ACK [i])); 195 213 (*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i])) (*(BRANCH_COMPLETE_PREDICTOR_1_ACK [i])); … … 214 232 (*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])) (*(BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])); 215 233 (*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_HISTORY [i])) (*(BRANCH_COMPLETE_HISTORY [i])); 234 if (_param._have_meta_predictor) 235 { 236 (*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_DIRECTION [i])) (*(BRANCH_COMPLETE_DIRECTION [i])); 237 (*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])) (*(BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])); 238 } 216 239 } 217 240 … … 241 264 Tcontrol_t predict_direction [_param._nb_prediction]; 242 265 266 Tcontrol_t branch_complete_predictor_2_val [_param._nb_branch_complete]; 243 267 Tcontrol_t branch_complete_ack [_param._nb_branch_complete]; 244 268 Tbht_history_t branch_complete_predictor_0_bht_history [_param._nb_branch_complete]; … … 248 272 Tbht_history_t branch_complete_predictor_2_bht_history [_param._nb_branch_complete]; 249 273 Tpht_history_t branch_complete_predictor_2_pht_history [_param._nb_branch_complete]; 274 Tcontrol_t branch_complete_predictor_2_direction [_param._nb_branch_complete]; 250 275 251 276 uint32_t shift_0 = 0; … … 255 280 uint32_t shift_4 = shift_3 + _param._predictor_1_pht_size_counter; 256 281 uint32_t shift_5 = shift_4 + _param._predictor_2_bht_size_shifter; 257 //uint32_t shift_ 5= shift_5 + _param._predictor_2_pht_size_counter;282 //uint32_t shift_6 = shift_5 + _param._predictor_2_pht_size_counter; 258 283 259 284 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) … … 353 378 (branch_complete_predictor_2_bht_history [i] << shift_4) | 354 379 (branch_complete_predictor_2_pht_history [i] << shift_5) ); 380 381 Tcontrol_t direction_0 = ((_param._predictor_0_have_pht)?(branch_complete_predictor_0_pht_history [i] >> (_param._predictor_0_pht_size_counter-1)):(branch_complete_predictor_0_bht_history [i] >> (_param._predictor_0_bht_size_shifter-1)))&1; 382 Tcontrol_t direction_1 = ((_param._predictor_1_have_pht)?(branch_complete_predictor_1_pht_history [i] >> (_param._predictor_1_pht_size_counter-1)):(branch_complete_predictor_1_bht_history [i] >> (_param._predictor_1_bht_size_shifter-1)))&1; 383 Tcontrol_t direction_2 = ((_param._predictor_2_have_pht)?(branch_complete_predictor_2_pht_history [i] >> (_param._predictor_2_pht_size_counter-1)):(branch_complete_predictor_2_bht_history [i] >> (_param._predictor_2_bht_size_shifter-1)))&1; 384 385 Tcontrol_t direction = ((rand()%2) != 0); 386 Tcontrol_t val = ((rand()%2) != 0); 387 388 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << endl 389 << " * val : " << val << endl 390 << " * direction_good : " << direction << endl 391 << " * direction_0 : " << direction_0 << endl 392 << " * direction_1 : " << direction_1 << endl 393 << " * direction_2 : " << direction_2 << endl; 394 395 BRANCH_COMPLETE_VAL [i] ->write (val); 396 BRANCH_COMPLETE_DIRECTION [i] ->write (direction); 397 398 if (val == 0) 399 { 400 branch_complete_predictor_2_val [i] = val; 401 } 402 else 403 { 404 branch_complete_predictor_2_val [i] = (direction_0 xor direction_1); 405 if (direction_2 == 0) 406 if (direction_0 == direction) 407 branch_complete_predictor_2_direction [i] = 0; 408 else 409 branch_complete_predictor_2_direction [i] = 1; 410 else 411 if (direction_1 == direction) 412 branch_complete_predictor_2_direction [i] = 1; 413 else 414 branch_complete_predictor_2_direction [i] = 0; 415 } 355 416 } 356 417 … … 370 431 if (_param._have_meta_predictor) 371 432 { 433 TEST(Tcontrol_t , BRANCH_COMPLETE_PREDICTOR_2_VAL [i]->read(), branch_complete_predictor_2_val [i]); 434 435 if (branch_complete_predictor_2_val [i]) 436 TEST(Tcontrol_t , BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i]->read(), branch_complete_predictor_2_direction [i]); 437 372 438 if (_param._predictor_0_have_bht) 373 439 TEST(Tbht_history_t, BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]->read(), branch_complete_predictor_0_bht_history [i]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h
r4 r5 82 82 83 83 // Interface Branch_complete 84 public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_VAL ; 85 public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_VAL ; 86 84 87 public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PREDICTOR_0_ACK ; 85 88 public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PREDICTOR_1_ACK ; … … 94 97 public : SC_OUT(Tpht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY; 95 98 public : SC_IN (Thistory_t) ** in_BRANCH_COMPLETE_HISTORY ; 99 public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_DIRECTION ; 100 public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION ; 96 101 97 102 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 130 135 public : void genMealy_predict_ack (void); 131 136 public : void genMealy_predict_history (void); 137 public : void genMealy_branch_complete_val (void); 132 138 public : void genMealy_branch_complete_ack (void); 133 139 public : void genMealy_branch_complete_history (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h
r4 r5 46 46 public : const uint32_t _size_history ; 47 47 48 public : const uint32_t _shift_0; 49 public : const uint32_t _shift_1; 50 public : const uint32_t _shift_2; 51 public : const uint32_t _shift_3; 52 public : const uint32_t _shift_4; 53 public : const uint32_t _shift_5; 54 public : const uint32_t _shift_6; 55 48 56 //-----[ methods ]----------------------------------------------------------- 49 57 public : Parameters (bool have_meta_predictor , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue.cpp
r4 r5 163 163 } 164 164 #endif 165 166 if (_param._have_meta_predictor) 167 { 168 log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - genMealy_branch_complete_val"); 169 SC_METHOD (genMealy_branch_complete_val); 170 dont_initialize (); 171 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 172 { 173 sensitive << *(in_BRANCH_COMPLETE_VAL [i]) 174 << *(in_BRANCH_COMPLETE_HISTORY [i]) 175 << *(in_BRANCH_COMPLETE_DIRECTION [i]); 176 } 177 178 #ifdef SYSTEMCASS_SPECIFIC 179 // List dependency information 180 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 181 { 182 (*(out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i])) (*(in_BRANCH_COMPLETE_VAL [i])); 183 (*(out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i])) (*(in_BRANCH_COMPLETE_HISTORY [i])); 184 (*(out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i])) (*(in_BRANCH_COMPLETE_DIRECTION [i])); 185 186 (*(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])) (*(in_BRANCH_COMPLETE_VAL [i])); 187 (*(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])) (*(in_BRANCH_COMPLETE_HISTORY [i])); 188 (*(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])) (*(in_BRANCH_COMPLETE_DIRECTION [i])); 189 } 190 #endif 191 } 165 192 166 193 log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - genMealy_branch_complete_ack"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_allocation.cpp
r4 r5 114 114 if (_param._have_meta_predictor) 115 115 { 116 in_BRANCH_COMPLETE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete ]; 117 out_BRANCH_COMPLETE_PREDICTOR_2_VAL = new SC_OUT(Tcontrol_t) * [_param._nb_branch_complete ]; 118 116 119 in_BRANCH_COMPLETE_PREDICTOR_0_ACK = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete ]; 117 120 in_BRANCH_COMPLETE_PREDICTOR_1_ACK = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete ]; … … 135 138 out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY = new SC_OUT(Tpht_history_t) * [_param._nb_branch_complete ]; 136 139 in_BRANCH_COMPLETE_HISTORY = new SC_IN (Thistory_t) * [_param._nb_branch_complete ]; 137 140 if (_param._have_meta_predictor) 141 { 142 in_BRANCH_COMPLETE_DIRECTION = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete ]; 143 out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION = new SC_OUT(Tcontrol_t) * [_param._nb_branch_complete ]; 144 } 138 145 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 139 146 { 140 147 if (_param._have_meta_predictor) 141 148 { 149 rename = " in_BRANCH_COMPLETE_VAL_" +toString(i); 150 in_BRANCH_COMPLETE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 151 152 rename = "out_BRANCH_COMPLETE_PREDICTOR_2_VAL_" +toString(i); 153 out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 154 142 155 rename = " in_BRANCH_COMPLETE_PREDICTOR_0_ACK_" +toString(i); 143 156 in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); … … 187 200 rename = " in_BRANCH_COMPLETE_HISTORY_" +toString(i); 188 201 in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str()); 189 } 190 202 203 if (_param._have_meta_predictor) 204 { 205 rename = " in_BRANCH_COMPLETE_DIRECTION_" +toString(i); 206 in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 207 208 rename = "out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_" +toString(i); 209 out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 210 } 211 } 191 212 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 192 213 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.cpp
r4 r5 84 84 if (_param._have_meta_predictor) 85 85 { 86 delete in_BRANCH_COMPLETE_VAL [i]; 87 delete out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i]; 88 86 89 delete in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i]; 87 90 delete in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i]; … … 106 109 delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]; 107 110 delete in_BRANCH_COMPLETE_HISTORY [i]; 111 if (_param._have_meta_predictor) 112 { 113 delete in_BRANCH_COMPLETE_DIRECTION [i]; 114 delete out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i]; 115 } 108 116 } 109 117 110 118 if (_param._have_meta_predictor) 111 119 { 120 delete in_BRANCH_COMPLETE_VAL ; 121 delete out_BRANCH_COMPLETE_PREDICTOR_2_VAL ; 122 112 123 delete in_BRANCH_COMPLETE_PREDICTOR_0_ACK ; 113 124 delete in_BRANCH_COMPLETE_PREDICTOR_1_ACK ; … … 131 142 delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY ; 132 143 delete in_BRANCH_COMPLETE_HISTORY ; 133 144 if (_param._have_meta_predictor) 145 { 146 delete in_BRANCH_COMPLETE_DIRECTION ; 147 delete out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION ; 148 } 134 149 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 135 150 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_history.cpp
r4 r5 28 28 { 29 29 if (_param._predictor_0_have_bht) 30 { 31 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i], history & gen_mask<Tbht_history_t>(_param._predictor_0_bht_size_shifter)); 32 history >>= _param._predictor_0_bht_size_shifter; 33 } 30 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i], (history >> _param._shift_0) & gen_mask<Tbht_history_t>(_param._predictor_0_bht_size_shifter)); 34 31 if (_param._predictor_0_have_pht) 35 { 36 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i], history & gen_mask<Tpht_history_t>(_param._predictor_0_pht_size_counter)); 37 history >>= _param._predictor_0_pht_size_counter; 32 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i], (history >> _param._shift_1) & gen_mask<Tpht_history_t>(_param._predictor_0_pht_size_counter)); 38 33 } 39 34 40 35 if (_param._predictor_1_have_bht) 41 36 { 42 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i], history & gen_mask<Tbht_history_t>(_param._predictor_1_bht_size_shifter)); 43 history >>= _param._predictor_1_bht_size_shifter; 44 } 37 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i], (history >> _param._shift_2) & gen_mask<Tbht_history_t>(_param._predictor_1_bht_size_shifter)); 38 45 39 if (_param._predictor_1_have_pht) 46 { 47 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i], history & gen_mask<Tpht_history_t>(_param._predictor_1_pht_size_counter)); 48 history >>= _param._predictor_1_pht_size_counter; 49 } 40 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i], (history >> _param._shift_3) & gen_mask<Tpht_history_t>(_param._predictor_1_pht_size_counter)); 50 41 } 51 42 52 43 if (_param._predictor_2_have_bht) 53 { 54 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i], history & gen_mask<Tbht_history_t>(_param._predictor_2_bht_size_shifter)); 55 history >>= _param._predictor_2_bht_size_shifter; 56 } 44 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i], (history >> _param._shift_4) & gen_mask<Tbht_history_t>(_param._predictor_2_bht_size_shifter)); 57 45 if (_param._predictor_2_have_pht) 58 { 59 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i], history & gen_mask<Tpht_history_t>(_param._predictor_2_pht_size_counter)); 60 history >>= _param._predictor_2_pht_size_counter; 61 } 46 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i], (history >> _param._shift_5) & gen_mask<Tpht_history_t>(_param._predictor_2_pht_size_counter)); 62 47 } 63 48 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_predict_history.cpp
r4 r5 35 35 predictor_2_pht_history = PORT_READ(in_PREDICT_PREDICTOR_2_PHT_HISTORY [i]); 36 36 predictor_2_pht_direction = predictor_2_pht_history >> (_param._predictor_2_pht_size_counter-1); 37 history = (history << _param._predictor_2_pht_size_counter) | predictor_2_pht_history;37 history |= (predictor_2_pht_history << _param._shift_5); 38 38 } 39 39 if (_param._predictor_2_have_bht) … … 41 41 predictor_2_bht_history = PORT_READ(in_PREDICT_PREDICTOR_2_BHT_HISTORY [i]); 42 42 predictor_2_bht_direction = predictor_2_bht_history >> (_param._predictor_2_bht_size_shifter-1); 43 history = (history << _param._predictor_2_bht_size_shifter) | predictor_2_bht_history;43 history |= (predictor_2_bht_history << _param._shift_4); 44 44 } 45 45 … … 52 52 predictor_1_pht_history = PORT_READ(in_PREDICT_PREDICTOR_1_PHT_HISTORY [i]); 53 53 predictor_1_pht_direction = predictor_1_pht_history >> (_param._predictor_1_pht_size_counter-1); 54 history = (history << _param._predictor_1_pht_size_counter) | predictor_1_pht_history;54 history |= (predictor_1_pht_history << _param._shift_3); 55 55 } 56 56 if (_param._predictor_1_have_bht) … … 58 58 predictor_1_bht_history = PORT_READ(in_PREDICT_PREDICTOR_1_BHT_HISTORY [i]); 59 59 predictor_1_bht_direction = predictor_1_bht_history >> (_param._predictor_1_bht_size_shifter-1); 60 history = (history << _param._predictor_1_bht_size_shifter) | predictor_1_bht_history;60 history |= (predictor_1_bht_history << _param._shift_2) ; 61 61 } 62 62 if (_param._predictor_0_have_pht) … … 64 64 predictor_0_pht_history = PORT_READ(in_PREDICT_PREDICTOR_0_PHT_HISTORY [i]); 65 65 predictor_0_pht_direction = predictor_0_pht_history >> (_param._predictor_0_pht_size_counter-1); 66 history = (history << _param._predictor_0_pht_size_counter) | predictor_0_pht_history;66 history |= (predictor_0_pht_history << _param._shift_1); 67 67 } 68 68 if (_param._predictor_0_have_bht) … … 70 70 predictor_0_bht_history = PORT_READ(in_PREDICT_PREDICTOR_0_BHT_HISTORY [i]); 71 71 predictor_0_bht_direction = predictor_0_bht_history >> (_param._predictor_0_bht_size_shifter-1); 72 history = (history << _param._predictor_0_bht_size_shifter) | predictor_0_bht_history;72 history |= (predictor_0_bht_history << _param._shift_0); 73 73 } 74 74 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_body.cpp
r4 r5 71 71 vhdl.set_body (""); 72 72 if (_param._have_meta_predictor) 73 vhdl.set_body ("out_PREDICT_DIRECTION_"+toString(i)+" <= predict or_0_direction_"+toString(i)+" when predictor_2_direction_"+toString(i)+"='0' elsepredictor_1_direction_"+toString(i)+";");73 vhdl.set_body ("out_PREDICT_DIRECTION_"+toString(i)+" <= predict_predictor_0_direction_"+toString(i)+" when predict_predictor_2_direction_"+toString(i)+"='0' else predict_predictor_1_direction_"+toString(i)+";"); 74 74 else 75 vhdl.set_body ("out_PREDICT_DIRECTION_"+toString(i)+" <= predict or_2_direction_"+toString(i)+";");75 vhdl.set_body ("out_PREDICT_DIRECTION_"+toString(i)+" <= predict_predictor_2_direction_"+toString(i)+";"); 76 76 } 77 77 … … 82 82 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 83 83 { 84 // branch_complete_predictor_2 val and directionn 85 if (_param._have_meta_predictor) 86 { 87 vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i)+" <= (branch_complete_predictor_0_direction_"+toString(i)+" xor branch_complete_predictor_1_direction_"+toString(i)+") and "+"in_BRANCH_COMPLETE_VAL_"+toString(i)+";"); 88 vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i)+" <= (branch_complete_predictor_0_direction_"+toString(i)+" and not in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+") or (branch_complete_predictor_1_direction_"+toString(i)+" and in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+");"); 89 } 90 84 91 string meta_predictor_ack = (_param._have_meta_predictor==true)?("in_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i)+" and in_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i)):"'1'"; 85 92 86 vhdl.set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= "+meta_predictor_ack+" and "+"in_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i)+";");93 vhdl.set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= "+meta_predictor_ack+" and "+"in_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i)+";"); 87 94 88 95 uint32_t index=_param._size_history; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_declaration.cpp
r4 r5 26 26 { 27 27 if (_param._predictor_0_have_pht) 28 vhdl.set_alias ("predict or_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_pht_size_counter-1,_param._predictor_0_pht_size_counter-1));28 vhdl.set_alias ("predict_predictor_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_pht_size_counter-1,_param._predictor_0_pht_size_counter-1)); 29 29 else 30 vhdl.set_alias ("predict or_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_bht_size_shifter-1,_param._predictor_0_bht_size_shifter-1));30 vhdl.set_alias ("predict_predictor_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_bht_size_shifter-1,_param._predictor_0_bht_size_shifter-1)); 31 31 if (_param._predictor_1_have_pht) 32 vhdl.set_alias ("predict or_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_pht_size_counter-1,_param._predictor_1_pht_size_counter-1));32 vhdl.set_alias ("predict_predictor_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_pht_size_counter-1,_param._predictor_1_pht_size_counter-1)); 33 33 else 34 vhdl.set_alias ("predict or_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_bht_size_shifter-1,_param._predictor_1_bht_size_shifter-1));34 vhdl.set_alias ("predict_predictor_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_bht_size_shifter-1,_param._predictor_1_bht_size_shifter-1)); 35 35 } 36 36 37 37 if (_param._predictor_2_have_pht) 38 vhdl.set_alias ("predict or_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_pht_size_counter-1,_param._predictor_2_pht_size_counter-1));38 vhdl.set_alias ("predict_predictor_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_pht_size_counter-1,_param._predictor_2_pht_size_counter-1)); 39 39 else 40 vhdl.set_alias ("predict or_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_bht_size_shifter-1,_param._predictor_2_bht_size_shifter-1));40 vhdl.set_alias ("predict_predictor_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_bht_size_shifter-1,_param._predictor_2_bht_size_shifter-1)); 41 41 } 42 43 if (_param._have_meta_predictor) 44 { 45 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 46 { 47 // if (_param._predictor_2_have_pht) 48 // vhdl.set_alias ("branch_complete_predictor_2_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_6-1, _param._shift_6-1)); 49 // else 50 // vhdl.set_alias ("branch_complete_predictor_2_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_5-1, _param._shift_5-1)); 51 52 if (_param._predictor_1_have_pht) 53 vhdl.set_alias ("branch_complete_predictor_1_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_4-1, _param._shift_4-1)); 54 else 55 vhdl.set_alias ("branch_complete_predictor_1_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_3-1, _param._shift_3-1)); 56 57 if (_param._predictor_0_have_pht) 58 vhdl.set_alias ("branch_complete_predictor_0_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_2-1, _param._shift_2-1)); 59 else 60 vhdl.set_alias ("branch_complete_predictor_0_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_1-1, _param._shift_1-1)); 61 62 } 63 } 64 65 66 42 67 log_printf(FUNC,Meta_Predictor_Glue,"vhdl_declaration","End"); 43 68 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_port.cpp
r4 r5 55 55 if (_param._have_meta_predictor) 56 56 { 57 vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+" ", IN, 1); 58 vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i)+" ",OUT, 1); 59 57 60 vhdl.set_port (" in_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i)+" ", IN, 1); 58 61 vhdl.set_port (" in_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i)+" ", IN, 1); … … 78 81 79 82 vhdl.set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+" ", IN,_param._size_history); 83 if (_param._have_meta_predictor) 84 { 85 vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+" ", IN,1); 86 vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i)+" ",OUT,1); 87 } 80 88 } 81 89 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_port.cpp
r4 r5 55 55 if (_param._have_meta_predictor) 56 56 { 57 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+" ", IN, 1); 58 _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i)+" ",OUT, 1); 59 57 60 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i)+" ", IN, 1); 58 61 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i)+" ", IN, 1); … … 78 81 79 82 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+" ", IN,_param._size_history); 83 if (_param._have_meta_predictor) 84 { 85 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+" ", IN,1); 86 _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i)+" ",OUT,1); 87 } 80 88 } 81 89 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_transition.cpp
r4 r5 62 62 if (_param._have_meta_predictor) 63 63 { 64 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_VAL [i])); 65 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i])); 66 64 67 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i])); 65 68 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i])); … … 84 87 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])); 85 88 86 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_HISTORY [i])); 89 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_HISTORY [i])); 90 if (_param._have_meta_predictor) 91 { 92 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_DIRECTION [i])); 93 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])); 94 } 87 95 } 88 96 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Parameters.cpp
r4 r5 53 53 _size_history (_predictor_0_bht_size_shifter + _predictor_0_pht_size_counter + 54 54 _predictor_1_bht_size_shifter + _predictor_1_pht_size_counter + 55 _predictor_2_bht_size_shifter + _predictor_2_pht_size_counter ) 55 _predictor_2_bht_size_shifter + _predictor_2_pht_size_counter ), 56 57 _shift_0 (0), 58 _shift_1 (_shift_0 + _predictor_0_bht_size_shifter), 59 _shift_2 (_shift_1 + _predictor_0_pht_size_counter), 60 _shift_3 (_shift_2 + _predictor_1_bht_size_shifter), 61 _shift_4 (_shift_3 + _predictor_1_pht_size_counter), 62 _shift_5 (_shift_4 + _predictor_2_bht_size_shifter), 63 _shift_6 (_shift_5 + _predictor_2_pht_size_counter) 56 64 { 57 65 log_printf(FUNC,Meta_Predictor_Glue,"Parameters","Begin"); … … 81 89 _nb_branch_complete (param._nb_branch_complete ), 82 90 83 _size_history (param._size_history ) 91 _size_history (param._size_history ), 92 93 _shift_0 (param._shift_0 ), 94 _shift_1 (param._shift_1 ), 95 _shift_2 (param._shift_2 ), 96 _shift_3 (param._shift_3 ), 97 _shift_4 (param._shift_4 ), 98 _shift_5 (param._shift_5 ), 99 _shift_6 (param._shift_6 ) 100 84 101 { 85 102 log_printf(FUNC,Meta_Predictor_Glue,"Parameters","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/configuration.cfg
r3 r5 1 1 Two_Level_Branch_Predictor 2 2 1 1 +1 # have_bht 3 68 +1 # bht_size_shifter4 64 64*2 # bht_nb_shifter5 01 +1 # have_pht6 4 4+1 # pht_size_counter7 256512 *2 # pht_nb_counter8 02 +1 # pht_size_address_share3 8 8 +1 # bht_size_shifter 4 512 512 *2 # bht_nb_shifter 5 1 1 +1 # have_pht 6 8 8 +1 # pht_size_counter 7 512 512 *2 # pht_nb_counter 8 2 2 +1 # pht_size_address_share 9 9 16 16 +1 # size_address 10 1 1+1 # nb_prediction11 1 1+1 # nb_branch_complete10 2 2 +1 # nb_prediction 11 2 2 +1 # nb_branch_complete -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp
r3 r5 220 220 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Predict : bht_history " << bht_history << " - pht_history " << pht_history[bht_history] << endl; 221 221 222 222 223 // Ask a new prediction 223 224 PREDICT_VAL [num_port_predict ]->write(1); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h
r2 r5 51 51 protected : const Parameters _param; 52 52 //#ifdef STATISTICS 53 // 53 //protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; 54 54 //#endif 55 55 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor.cpp
r2 r5 57 57 allocation (); 58 58 59 #if (defined(STATISTICS) || defined (VHDL_TESTBENCH)) 59 60 SC_METHOD (transition); 60 61 dont_initialize (); 61 62 sensitive_pos << *(in_CLOCK); 63 #endif 62 64 63 65 // SC_METHOD (genMoore);
Note: See TracChangeset
for help on using the changeset viewer.