Changeset 107 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp
- Timestamp:
- Feb 11, 2009, 12:03:25 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp
r106 r107 117 117 // if pc_current is a delay slot, then pc_previous is a branchement instruction, also hit must be set. 118 118 // else : an another branch instruction have eject this branch : can't accurate 119 Tcontrol_t hit = PORT_READ(in_PREDICT_BTB_HIT[i]); 120 Tcontrol_t is_accurate = PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i]) and not (pc_current_is_ds_take and not hit); 119 Tcontrol_t hit = PORT_READ(in_PREDICT_BTB_HIT[i]); 120 Tcontrol_t is_accurate = not (pc_current_is_ds_take and not hit); 121 Tcontrol_t btb_is_accurate = PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i]); 121 122 122 123 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * hit : %d" ,hit); 123 124 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * is_accurate : %d" ,is_accurate); 125 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * btb_is_accurate : %d" ,btb_is_accurate); 124 126 125 127 // STEP (3) : Test if BTB find a branch instruction in the packet … … 158 160 else 159 161 { 162 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * branch is not in the last slot of the packet"); 163 160 164 Tbranch_condition_t condition = PORT_READ(in_PREDICT_BTB_CONDITION [i]); 161 165 Taddress_t address_dest = PORT_READ(in_PREDICT_BTB_ADDRESS_DEST [i]); … … 166 170 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * address_src : 0x%.8x (0x%.8x)",address_src ,address_src <<2); 167 171 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * address_dest : 0x%.8x (0x%.8x)",address_dest,address_dest<<2); 168 172 169 173 switch (condition) 170 174 { … … 178 182 pc_next = address_dest; 179 183 branch_state = BRANCH_STATE_NSPEC_TAKE; 184 // is_accurate &= btb_is_accurate; 185 180 186 break; 181 187 } … … 190 196 pc_next = address_dest; 191 197 branch_state = BRANCH_STATE_NSPEC_TAKE; 198 // is_accurate &= btb_is_accurate; 199 192 200 break; 193 201 } … … 201 209 // Test direction 202 210 direction = PORT_READ(in_PREDICT_DIR_DIRECTION [i]); // Direction is not the "flag predict" ... also flag_unset and flag_set is the same 203 if (direction = 1)211 if (direction == 1) 204 212 { 205 213 branch_state = BRANCH_STATE_SPEC_TAKE; … … 211 219 pc_next = address_src+2; // +1 = delay slot 212 220 } 221 222 // is_accurate &= btb_is_accurate; 213 223 break; 214 224 } … … 223 233 pc_next = address_dest; 224 234 branch_state = BRANCH_STATE_SPEC_TAKE; 235 is_accurate &= btb_is_accurate; 236 225 237 break; 226 238 } … … 235 247 pc_next = address_dest; 236 248 branch_state = BRANCH_STATE_NSPEC_TAKE; 249 is_accurate &= btb_is_accurate; 250 237 251 break; 238 252 } … … 244 258 push = false; 245 259 direction = true; 246 pc_next = PORT_READ(in_PREDICT_RAS_ ADDRESS_POP [i]);260 pc_next = PORT_READ(in_PREDICT_RAS_HIT [i])?PORT_READ(in_PREDICT_RAS_ADDRESS_POP [i]):address_dest; 247 261 branch_state = BRANCH_STATE_SPEC_TAKE; 262 is_accurate &= (PORT_READ(in_PREDICT_RAS_HIT [i]) or btb_is_accurate); // if miss - prediction is not accurate 263 248 264 break; 249 265 } … … 255 271 } 256 272 273 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * direction : %d",direction); 274 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * branch_state : %d",branch_state); 275 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * pc_next : %.8x",pc_next); 276 257 277 if (use_dir) 258 278 { … … 270 290 PORT_WRITE(out_PREDICT_RAS_PUSH [i], push); 271 291 PORT_WRITE(out_PREDICT_RAS_ADDRESS_PUSH [i], address_src+2); 272 273 is_accurate &= PORT_READ(in_PREDICT_RAS_HIT [i]); // if miss - prediction is not accurate274 292 } 275 293
Note: See TracChangeset
for help on using the changeset viewer.