Ignore:
Timestamp:
May 1, 2008, 6:48:45 PM (16 years ago)
Author:
rosiere
Message:
  • support locale (now must "just" translate)
  • update all component with new test format
  • update all component with usage
  • New component : decod queue and prediction_unit
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  
    2626    Tcontrol_t ack [_param->_nb_context];
    2727    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++)
    3139      {
    3240        log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"PREDICT [%d]",i);
     
    136144                        {
    137145                          branch_state = BRANCH_STATE_SPEC_NTAKE;
    138                           pc_next      = address_src+8; // +4 = delay slot
     146                          pc_next      = address_src+2; // +1 = delay slot
    139147                        }
    140148                      break;
     
    191199                    PORT_WRITE(out_PREDICT_RAS_CONTEXT_ID   [i], context);
    192200                    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);
    194202
    195203                    is_accurate &= PORT_READ(in_PREDICT_RAS_HIT [i]); // if miss - prediction is not accurate
     
    221229//                               (use_upt and PORT_READ(in_PREDICT_UPT_ACK [i])));
    222230
    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]))));
    234245
    235246//              pc_next      - is previously computed
     
    238249                Taddress_t address_src_lsb  = address_src%_param->_nb_instruction [context];
    239250
     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);
    240253                if (address_src_lsb == (_param->_nb_instruction [context]-1))
    241254                  {
    242255                    // 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               
    243258                    address_msb        = _param->_nb_instruction [context]; // == (address_src_lsb+1)
    244259                    pc_next_is_ds_take = 1;
     
    250265                    pc_next_is_ds_take = 0;
    251266                  }
     267                log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * address_msb     : %d",address_msb);
    252268
    253269                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;
    255271              }
    256272            else
     
    270286              PORT_WRITE(out_PREDICT_PC_NEXT                     [context]   , pc_next                    );
    271287              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
    272295              for (uint32_t j=0; j<address_lsb; j++)
    273296              PORT_WRITE(out_PREDICT_INSTRUCTION_ENABLE          [context][j], 0); // Before the address : not valid
Note: See TracChangeset for help on using the changeset viewer.