Changeset 82 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:
- May 1, 2008, 6:48:45 PM (16 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
r81 r82 26 26 Tcontrol_t ack [_param->_nb_context]; 27 27 for (uint32_t i=0; i<_param->_nb_context; i++) 28 ack [i] = 0; 29 30 for (uint32_t i=0; i<_param->_nb_inst_predict; i++) 28 { 29 ack [i] = 0; 30 31 if (_param->_have_port_depth[i]) 32 { 33 PORT_WRITE(out_DEPTH_TAIL [i],PORT_READ(in_DEPTH_UPT_TAIL [i])); 34 } 35 PORT_WRITE(out_DEPTH_NB_BRANCH [i],PORT_READ(in_DEPTH_UPT_NB_BRANCH [i])); 36 } 37 38 for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++) 31 39 { 32 40 log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"PREDICT [%d]",i); … … 136 144 { 137 145 branch_state = BRANCH_STATE_SPEC_NTAKE; 138 pc_next = address_src+ 8; // +4= delay slot146 pc_next = address_src+2; // +1 = delay slot 139 147 } 140 148 break; … … 191 199 PORT_WRITE(out_PREDICT_RAS_CONTEXT_ID [i], context); 192 200 PORT_WRITE(out_PREDICT_RAS_PUSH [i], push); 193 PORT_WRITE(out_PREDICT_RAS_ADDRESS_PUSH [i], address_src+ 8);201 PORT_WRITE(out_PREDICT_RAS_ADDRESS_PUSH [i], address_src+2); 194 202 195 203 is_accurate &= PORT_READ(in_PREDICT_RAS_HIT [i]); // if miss - prediction is not accurate … … 221 229 // (use_upt and PORT_READ(in_PREDICT_UPT_ACK [i]))); 222 230 223 dir_val = (PORT_READ(in_PREDICT_BTB_ACK [i]) and 224 (use_ras and PORT_READ(in_PREDICT_RAS_ACK [i])) and 225 (use_upt and PORT_READ(in_PREDICT_UPT_ACK [i]))); 226 227 ras_val = (PORT_READ(in_PREDICT_BTB_ACK [i]) and 228 (use_dir and PORT_READ(in_PREDICT_DIR_ACK [i])) and 229 (use_upt and PORT_READ(in_PREDICT_UPT_ACK [i]))); 230 231 upt_val = (PORT_READ(in_PREDICT_BTB_ACK [i]) and 232 (use_dir and PORT_READ(in_PREDICT_DIR_ACK [i])) and 233 (use_ras and PORT_READ(in_PREDICT_RAS_ACK [i]))); 231 dir_val = (use_dir and 232 PORT_READ(in_PREDICT_BTB_ACK [i]) and 233 (not use_ras or (use_ras and PORT_READ(in_PREDICT_RAS_ACK [i]))) and 234 (not use_upt or (use_upt and PORT_READ(in_PREDICT_UPT_ACK [i])))); 235 236 ras_val = (use_ras and 237 PORT_READ(in_PREDICT_BTB_ACK [i]) and 238 (not use_dir or (use_dir and PORT_READ(in_PREDICT_DIR_ACK [i]))) and 239 (not use_upt or (use_upt and PORT_READ(in_PREDICT_UPT_ACK [i])))); 240 241 upt_val = (use_upt and 242 PORT_READ(in_PREDICT_BTB_ACK [i]) and 243 (not use_dir or (use_dir and PORT_READ(in_PREDICT_DIR_ACK [i]))) and 244 (not use_ras or (use_ras and PORT_READ(in_PREDICT_RAS_ACK [i])))); 234 245 235 246 // pc_next - is previously computed … … 238 249 Taddress_t address_src_lsb = address_src%_param->_nb_instruction [context]; 239 250 251 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * address_src : 0x%x",address_src); 252 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * address_src_lsb : %d",address_src_lsb); 240 253 if (address_src_lsb == (_param->_nb_instruction [context]-1)) 241 254 { 242 255 // branch is in the last slot of the packet 256 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * branch is in the last slot of the packet"); 257 243 258 address_msb = _param->_nb_instruction [context]; // == (address_src_lsb+1) 244 259 pc_next_is_ds_take = 1; … … 250 265 pc_next_is_ds_take = 0; 251 266 } 267 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * address_msb : %d",address_msb); 252 268 253 269 inst_ifetch_ptr = address_src_lsb; 254 branch_update_prediction_id = ( PORT_READ(in_DEPTH_UPT_TAIL[context])+PORT_READ(in_DEPTH_UPT_NB_BRANCH [context]))%_param->_size_depth[context];270 branch_update_prediction_id = (_param->_have_port_depth[context])?((PORT_READ(in_DEPTH_UPT_TAIL[context])+PORT_READ(in_DEPTH_UPT_NB_BRANCH [context]))%_param->_size_depth[context]):0; 255 271 } 256 272 else … … 270 286 PORT_WRITE(out_PREDICT_PC_NEXT [context] , pc_next ); 271 287 PORT_WRITE(out_PREDICT_PC_NEXT_IS_DS_TAKE [context] , pc_next_is_ds_take ); 288 289 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * instruction enable :"); 290 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * nb_inst : %d",_param->_nb_instruction [context]); 291 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * [0:%d[ = 0",address_lsb); 292 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * [%d:%d[ = 1",address_lsb,((pc_current_is_ds_take)?1:address_msb)); 293 log_printf(TRACE,Prediction_unit_Glue,FUNCTION," * [%d:%d[ = 0",((pc_current_is_ds_take)?1:address_msb),_param->_nb_instruction [context]); 294 272 295 for (uint32_t j=0; j<address_lsb; j++) 273 296 PORT_WRITE(out_PREDICT_INSTRUCTION_ENABLE [context][j], 0); // Before the address : not valid
Note: See TracChangeset
for help on using the changeset viewer.