Ignore:
Timestamp:
Jun 8, 2009, 10:43:30 PM (15 years ago)
Author:
rosiere
Message:

1) Fix performance
2) add auto generation to SPECINT2000
3) add reset in genMoore and genMealy

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/src/Branch_Target_Buffer_Glue.cpp

    r88 r123  
    3939    log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"Begin");
    4040
    41 #if DEBUG_Branch_Target_Buffer_Glue == true
    42     log_printf(INFO,Branch_Target_Buffer_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    43 
    44     std::cout << *param << std::endl;
    45 #endif   
     41// #if DEBUG_Branch_Target_Buffer_Glue == true
     42//     log_printf(INFO,Branch_Target_Buffer_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     43
     44//     std::cout << *param << std::endl;
     45// #endif   
    4646
    4747    log_printf(INFO,Branch_Target_Buffer_Glue,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/src/Branch_Target_Buffer_Glue_genMealy_decod.cpp

    r98 r123  
    2525    log_function(Branch_Target_Buffer_Glue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    2830      {
     
    6264          }
    6365      }
     66      }
     67    else
     68      {
     69        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     70          {
     71            PORT_WRITE(out_DECOD_ACK            [i], 0);
     72            PORT_WRITE(out_DECOD_REGISTER_VAL   [i], 0);
     73            if (_param->_have_port_victim)
     74            PORT_WRITE(out_DECOD_VICTIM_VAL     [i], 0);
     75          }
     76      }
    6477
    6578    log_end(Branch_Target_Buffer_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/src/Branch_Target_Buffer_Glue_genMealy_predict.cpp

    r108 r123  
    2525    log_function(Branch_Target_Buffer_Glue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
    2830      {
     
    8385          }
    8486      }
     87      }
     88    else
     89      {
     90        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     91          {
     92            PORT_WRITE(out_PREDICT_ACK            [i], 0);
     93            PORT_WRITE(out_PREDICT_REGISTER_VAL   [i], 0);
     94            if (_param->_have_port_victim)
     95            PORT_WRITE(out_PREDICT_VICTIM_VAL     [i], 0);
     96          }
     97      }
    8598
    8699    log_end(Branch_Target_Buffer_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/src/Branch_Target_Buffer_Glue_genMealy_update.cpp

    r98 r123  
    2525    log_function(Branch_Target_Buffer_Glue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
    2830      {
     
    5254          }
    5355      }
     56      }
     57    else
     58      {
     59        for (uint32_t i=0; i<_param->_nb_inst_update; i++)
     60          {
     61            PORT_WRITE(out_UPDATE_ACK            [i], 0);
     62            PORT_WRITE(out_UPDATE_REGISTER_VAL   [i], 0);
     63            if (_param->_have_port_victim)
     64            PORT_WRITE(out_UPDATE_VICTIM_VAL     [i], 0);
     65          }
     66      }
    5467
    5568    log_end(Branch_Target_Buffer_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register.cpp

    r113 r123  
    3838    log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"Begin");
    3939
    40 #if DEBUG_Branch_Target_Buffer_Register == true
    41     log_printf(INFO,Branch_Target_Buffer_Register,FUNCTION,_("<%s> Parameters"),_name.c_str());
    42 
    43     std::cout << *param << std::endl;
    44 #endif   
     40// #if DEBUG_Branch_Target_Buffer_Register == true
     41//     log_printf(INFO,Branch_Target_Buffer_Register,FUNCTION,_("<%s> Parameters"),_name.c_str());
     42
     43//     std::cout << *param << std::endl;
     44// #endif   
    4545
    4646    log_printf(INFO,Branch_Target_Buffer_Register,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register_genMealy_decod.cpp

    r88 r123  
    2525    log_function(Branch_Target_Buffer_Register,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    2830      {
     
    5557          }
    5658      }
    57 
     59      }
     60    else
     61      {
     62//      internal_DECOD_HIT       [i] = hit      ;
     63//      internal_DECOD_NUM_BANK  [i] = num_bank ;
     64//      internal_DECOD_NUM_ENTRY [i] = num_entry;
     65      }
     66   
    5867    log_end(Branch_Target_Buffer_Register,FUNCTION);
    5968  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register_genMealy_predict.cpp

    r108 r123  
    2525    log_function(Branch_Target_Buffer_Register,FUNCTION,_name.c_str());
    2626   
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
    2830      {
     
    6466          }
    6567      }
     68      }
     69//     else
     70//       {
     71//       }
    6672
    6773    log_end(Branch_Target_Buffer_Register,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register_genMealy_update.cpp

    r88 r123  
    2525    log_function(Branch_Target_Buffer_Register,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
    2830      {
     
    5557          }
    5658      }
     59      }
     60//     else
     61//       {
     62//      internal_UPDATE_HIT       [i] = hit      ;
     63//      internal_UPDATE_NUM_BANK  [i] = num_bank ;
     64//      internal_UPDATE_NUM_ENTRY [i] = num_entry;
     65//       }
    5766
    5867    log_end(Branch_Target_Buffer_Register,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/src/Branch_Target_Buffer.cpp

    r88 r123  
    4040    log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Allocation");
    4141
    42 #if DEBUG_Branch_Target_Buffer == true
    43     log_printf(INFO,Branch_Target_Buffer,FUNCTION,_("<%s> Parameters"),_name.c_str());
     42// #if DEBUG_Branch_Target_Buffer == true
     43//     log_printf(INFO,Branch_Target_Buffer,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4444
    45     std::cout << *param << std::endl;
    46 #endif   
     45//     std::cout << *param << std::endl;
     46// #endif   
    4747
    4848    allocation (
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/src/Direction_Glue.cpp

    r112 r123  
    4040
    4141
    42 #if DEBUG_Direction_Glue == true
    43     log_printf(INFO,Direction_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    44 
    45     std::cout << *param << std::endl;
    46 #endif   
     42// #if DEBUG_Direction_Glue == true
     43//     log_printf(INFO,Direction_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     44
     45//     std::cout << *param << std::endl;
     46// #endif   
    4747
    4848    log_printf(INFO,Direction_Glue,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/src/Direction_Glue_genMealy_predict.cpp

    r107 r123  
    2626    log_function(Direction_Glue,FUNCTION,_name.c_str());
    2727
     28    if (PORT_READ(in_NRESET))
     29      {
     30//         std::cout << "Kane (before) " << std::endl;
     31//         std::cout << _param << std::endl;
     32//         std::cout << _param->_nb_inst_update << std::endl;
     33//         std::cout << _param->_nb_inst_predict<< std::endl;
     34//         std::cout << "Kane (end) " << std::endl;
     35
     36
    2837    // constant direction : never / always
    2938    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     
    3140        log_printf(TRACE,Direction_Glue,FUNCTION,"  * PREDICT [%d]",i);
    3241
    33         Tcontrol_t direction;
     42        Tcontrol_t direction = false;
    3443
    3544        switch (_param->_predictor_scheme)
     
    8695        PORT_WRITE(out_PREDICT_DIRECTION   [i], direction);
    8796      }
     97      }
     98    else
     99      {
     100        //RESET
     101        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     102          {
     103            if (_param->_have_component_meta_predictor)
     104              {
     105            PORT_WRITE(out_PREDICT_PREDICTOR_VAL [i], 0);
     106            PORT_WRITE(out_PREDICT_ACK           [i], 0);
     107              }
     108          }
     109      }
    88110
    89111    log_end(Direction_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/src/Direction_Glue_genMealy_update.cpp

    r112 r123  
    2626    log_function(Direction_Glue,FUNCTION,_name.c_str());
    2727
     28    if (PORT_READ(in_NRESET))
     29      {
    2830    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
    2931      {
     
    3537        PORT_WRITE(out_UPDATE_PREDICTOR_PREDICTION_IFETCH [i], PORT_READ(in_UPDATE_PREDICTION_IFETCH [i]));
    3638      }
    37    
     39      }
     40    else
     41      {
     42        // RESET
     43        for (uint32_t i=0; i<_param->_nb_inst_update; i++)
     44          {
     45            PORT_WRITE(out_UPDATE_PREDICTOR_VAL [i], 0);
     46            PORT_WRITE(out_UPDATE_ACK           [i], 0);
     47          }
     48      }
     49
    3850    log_end(Direction_Glue,FUNCTION);
    3951  };
  • 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_predict.cpp

    r111 r123  
    2727    log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str());
    2828
     29    if (PORT_READ(in_NRESET))
     30      {
    2931    for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
    3032      {
     
    8991        PORT_WRITE(out_PREDICT_DIRECTION [i],direction);
    9092      }
     93      }
     94//     else
     95//       {
     96//       }
    9197
    9298    log_end(Meta_Predictor_Glue,FUNCTION);
  • 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_predict_valack.cpp

    r111 r123  
    2727    log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str());
    2828
     29    if (PORT_READ(in_NRESET))
     30      {
    2931    for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
    3032      {
     
    4042
    4143        PORT_WRITE(out_PREDICT_ACK [i],ack);
     44      }
     45      }
     46    else
     47      {
     48        // Reset
     49        for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
     50          {
     51            for (uint32_t j=0; j<_param->_nb_predictor; ++j)
     52              PORT_WRITE(out_PREDICT_PREDICTOR_VAL [j][i],0);
     53            PORT_WRITE(out_PREDICT_ACK [i],0);
     54          }
    4255      }
    4356
  • 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

    r112 r123  
    2727    log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str());
    2828
     29    if (PORT_READ(in_NRESET))
     30      {
    2931    for (uint32_t i=0; i<_param->_nb_inst_update; ++i)
    3032      {
     
    112114          }
    113115      }
     116      }
     117//     else
     118//       {
     119//         // RESET
     120//       }
    114121
    115122    log_end(Meta_Predictor_Glue,FUNCTION);
  • 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_valack.cpp

    r111 r123  
    2727    log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str());
    2828
     29    if (PORT_READ(in_NRESET))
     30      {
    2931    for (uint32_t i=0; i<_param->_nb_inst_update; ++i)
    3032      {
     
    4042
    4143        PORT_WRITE(out_UPDATE_ACK [i],ack);
     44      }
     45      }
     46    else
     47      {
     48        // RESET
     49        for (uint32_t i=0; i<_param->_nb_inst_update; ++i)
     50          {
     51            for (uint32_t j=0; j<_param->_nb_predictor; ++j)
     52              PORT_WRITE(out_UPDATE_PREDICTOR_VAL [j][i],0);
     53            PORT_WRITE(out_UPDATE_ACK [i],0);
     54          }
    4255      }
    4356
  • 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_genMealy_predict.cpp

    r119 r123  
    2929    log_function(Two_Level_Branch_Predictor,FUNCTION,_name.c_str());
    3030
     31    if (PORT_READ(in_NRESET))
     32      {
    3133    // ===================================================================
    3234    // =====[ PREDICT ]===================================================
     
    9597          PORT_WRITE(out_PREDICT_HISTORY   [i],history  );
    9698        }
     99      }
    97100
    98101    log_end(Two_Level_Branch_Predictor,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/src/Direction.cpp

    r88 r123  
    3838    log_printf(FUNC,Direction,FUNCTION,"Begin");
    3939
    40 #if DEBUG_Direction == true
    41     log_printf(INFO,Direction,FUNCTION,_("<%s> Parameters"),_name.c_str());
     40// #if DEBUG_Direction == true
     41//     log_printf(INFO,Direction,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4242
    43     std::cout << *param << std::endl;
    44 #endif
     43//     std::cout << *param << std::endl;
     44// #endif
    4545
    4646    log_printf(INFO,Direction,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue.cpp

    r110 r123  
    4040    usage_environment(_usage);
    4141
    42 #if DEBUG_Prediction_unit_Glue == true
    43     log_printf(INFO,Prediction_unit_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    44 
    45     std::cout << *param << std::endl;
    46 #endif   
     42// #if DEBUG_Prediction_unit_Glue == true
     43//     log_printf(INFO,Prediction_unit_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     44
     45//     std::cout << *param << std::endl;
     46// #endif   
    4747
    4848    log_printf(INFO,Prediction_unit_Glue,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_decod.cpp

    r110 r123  
    290290          PORT_WRITE(out_DECOD_ACK [i][j], ack[j]);
    291291      }
     292    else
     293      {
     294        // Reset
     295        for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++)
     296          {
     297            PORT_WRITE(out_DECOD_BTB_VAL [i], 0);
     298            PORT_WRITE(out_DECOD_RAS_VAL [i], 0);
     299            PORT_WRITE(out_DECOD_UPT_VAL [i], 0);
     300          }
     301       
     302        for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
     303          for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
     304            PORT_WRITE(out_DECOD_ACK [i][j], 0);
     305      }
    292306    log_end(Prediction_unit_Glue,FUNCTION);
    293307  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp

    r111 r123  
    420420      PORT_WRITE(out_PREDICT_ACK[i],ack[i]);
    421421      }
     422    else
     423      {
     424        // RESET
     425        for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
     426          {
     427            PORT_WRITE(out_PREDICT_BTB_VAL [i], 0);
     428            PORT_WRITE(out_PREDICT_DIR_VAL [i], 0);
     429            PORT_WRITE(out_PREDICT_RAS_VAL [i], 0);
     430            PORT_WRITE(out_PREDICT_UPT_VAL [i], 0);
     431          }
     432        for (uint32_t i=0; i<_param->_nb_context; i++)
     433          PORT_WRITE(out_PREDICT_ACK[i],0);
     434      }
    422435
    423436    log_end(Prediction_unit_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_update.cpp

    r98 r123  
    2525    log_function(Prediction_unit_Glue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
    2830      {
     
    8890        PORT_WRITE(out_UPDATE_UPT_ACK [i], upt_ack);
    8991      }
     92      }
     93    else
     94      {
     95        // RESET
     96        for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
     97          {
     98            PORT_WRITE(out_UPDATE_BTB_VAL [i], 0);
     99            PORT_WRITE(out_UPDATE_DIR_VAL [i], 0);
     100            PORT_WRITE(out_UPDATE_RAS_VAL [i], 0);
     101            PORT_WRITE(out_UPDATE_UPT_ACK [i], 0);
     102          }
     103      }
    90104
    91105    log_end(Prediction_unit_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack.cpp

    r88 r123  
    3838    log_printf(FUNC,Return_Address_Stack,FUNCTION,"Begin");
    3939
    40 #if DEBUG_Return_Address_Stac == true
    41     log_printf(INFO,Return_Address_Stac,FUNCTION,_("<%s> Parameters"),_name.c_str());
     40// #if DEBUG_Return_Address_Stac == true
     41//     log_printf(INFO,Return_Address_Stac,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4242
    43     std::cout << *param << std::endl;
    44 #endif   
     43//     std::cout << *param << std::endl;
     44// #endif   
    4545
    4646    log_printf(INFO,Return_Address_Stack,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_decod.cpp

    r118 r123  
    6666      }
    6767      }
     68    else
     69      {
     70//      internal_DECOD_HIT [i] = (push or (reg_NB_ELT[context]>0));
     71      }
     72
    6873    log_end(Return_Address_Stack,FUNCTION);
    6974  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_predict.cpp

    r118 r123  
    2525    log_function(Return_Address_Stack,FUNCTION,_name.c_str());
    2626
    27     if (PORT_READ(in_NRESET) == 1)
     27    if (PORT_READ(in_NRESET))
    2828      {
    2929#ifdef DEBUG_TEST
     
    6969      }
    7070      }
     71    else
     72      {
     73//     for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     74//      internal_PREDICT_HIT [i] = (push or (reg_PREDICT_NB_ELT[context]>0));
     75
     76      }
    7177
    7278    log_end(Return_Address_Stack,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h

    r122 r123  
    5454      UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT        , // prediction unit is ok, wait the end of event (send by Context State)
    5555      UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT        , // prediction unit is update, send signal to context manager
    56       UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT          // prediction unit is ok, wait the end of event (send by Context State)
     56      UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT        , // prediction unit is ok, wait the end of event (send by Context State)
     57      UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE         // prediction unit is ok, wait the end of event (send by Context State)
    5758    } upt_event_state_t;
    5859
     
    226227      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT  : return "UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT"  ; break;
    227228      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT  : return "UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT"  ; break;
     229      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE : return "UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE" ; break;
    228230      default    : return ""; break;
    229231      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table.cpp

    r111 r123  
    4040    usage_environment(_usage);
    4141
    42 #if DEBUG_Update_Prediction_Table == true
    43     log_printf(INFO,Update_Prediction_Table,FUNCTION,_("<%s> Parameters"),_name.c_str());
    44 
    45     std::cout << *param << std::endl;
    46 #endif   
     42// #if DEBUG_Update_Prediction_Table == true
     43//     log_printf(INFO,Update_Prediction_Table,FUNCTION,_("<%s> Parameters"),_name.c_str());
     44
     45//     std::cout << *param << std::endl;
     46// #endif   
    4747
    4848    log_printf(INFO,Update_Prediction_Table,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_branch_complete.cpp

    r122 r123  
    2424    log_begin(Update_Prediction_Table,FUNCTION);
    2525    log_function(Update_Prediction_Table,FUNCTION,_name.c_str());
    26    
     26
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
    2830#ifdef DEBUG_TEST
     
    129131//      PORT_WRITE(out_BRANCH_COMPLETE_ADDRESS_DEST    [i], internal_BRANCH_COMPLETE_ADDRESS_DEST    [i]);
    130132      }
    131 
     133      }
    132134    log_end(Update_Prediction_Table,FUNCTION);
    133135  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp

    r122 r123  
    6868      }
    6969      }
     70    else
     71      {
     72        // RESET
     73        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     74          PORT_WRITE(out_DECOD_ACK          [i], 0);
     75      }
     76
    7077    log_end(Update_Prediction_Table,FUNCTION);
    7178  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_predict.cpp

    r122 r123  
    5757        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ACK         : %d",internal_PREDICT_ACK [i]);
    5858
    59         PORT_WRITE(out_PREDICT_ACK                  [i], internal_PREDICT_ACK                  [i]);
    6059        if (_param->_have_port_depth)
    6160        PORT_WRITE(out_PREDICT_UPDATE_PREDICTION_ID [i], internal_PREDICT_UPDATE_PREDICTION_ID [i]);
     
    6362
    6463      }//don't reset
     64    else
     65      {
     66        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     67          {
     68            internal_PREDICT_ACK [i] = 0;
     69//          internal_PREDICT_UPDATE_PREDICTION_ID [i] = top;
     70          }
     71      }
     72
     73    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     74      PORT_WRITE(out_PREDICT_ACK [i], internal_PREDICT_ACK [i]);
    6575
    6676    log_end(Update_Prediction_Table,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp

    r122 r123  
    248248        internal_UPDATE_CONTEXT_ID      [i] = context;
    249249
    250         PORT_WRITE(out_UPDATE_VAL                   [i],internal_UPDATE_VAL [i]);
    251250        if (val)
    252251          {
     
    282281        Tcontrol_t val = ((reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT) or
    283282                          (reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT));
    284         PORT_WRITE(out_BRANCH_EVENT_VAL              [i],val);
    285283        if (_param->_have_port_depth)
    286284        PORT_WRITE(out_BRANCH_EVENT_DEPTH            [i],reg_EVENT_DEPTH            [i]);
     
    301299            internal_UPDATE_VAL             [i] = 0;
    302300            internal_UPDATE_VAL_WITHOUT_ACK [i] = 0;
     301            internal_UPDATE_CONTEXT_ID      [i] = 0;
     302       
    303303          }
    304304        for (uint32_t i=0; i<_param->_nb_context; i++)
     
    308308      }
    309309
     310    // Write output
     311    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
     312      PORT_WRITE(out_UPDATE_VAL       [i],internal_UPDATE_VAL [i]);
     313    for (uint32_t i=0; i<_param->_nb_context; i++)
     314      PORT_WRITE(out_BRANCH_EVENT_VAL [i],internal_BRANCH_EVENT_VAL [i]);
    310315
    311316    log_end(Update_Prediction_Table,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r122 r123  
    545545                        }
    546546                     
     547                      // Test if freeing the branch with no accurate ?
     548                      if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
     549                        reg_IS_ACCURATE [context] = true;
     550
    547551                      // Update pointer
    548552                      //  * if update RAS : update pointer is decreaste until it equal at top pointer
     
    577581                                }
    578582                             
    579                               reg_UPT_EVENT_STATE [context] = upt_event_state;
    580583                            }
    581584                          else
     
    593596                        }
    594597                     
    595                       // Test if freeing the branch with no accurate ?
    596                       if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
    597                         reg_IS_ACCURATE [context] = true;
     598                      // special case :
     599                      if ((upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE) and
     600                          (reg_UPT_UPDATE [context] == reg_EVENT_UPT_PTR [context]))
     601                        {
     602                          reg_UPT_TOP     [context] = reg_UPT_TOP_EVENT [context];
     603                          reg_UPT_UPDATE  [context] = reg_UPT_TOP_EVENT [context];
     604                          reg_IS_ACCURATE [context] = true;
     605
     606                          upt_event_state = UPT_EVENT_STATE_OK;
     607                        }
     608
     609                      reg_UPT_EVENT_STATE [context] = upt_event_state;
    598610
    599611                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE (after ) : %d",reg_UPT_UPDATE[context]);
     
    654666                       
    655667                        Taddress_t        address_src         = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src;
    656                         upt_state_t       event_top           = reg_UPDATE_PREDICTION_TABLE [context][top]._state;
     668                        upt_state_t       top_state           = reg_UPDATE_PREDICTION_TABLE [context][top]._state;
    657669                       
    658670                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * upt_event_state     : %s",toString(upt_event_state).c_str());
    659                         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * event_top           : %s",toString(event_top).c_str());
     671                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top_state           : %s",toString(top_state).c_str());
    660672                       
    661673                        bool              previous_ufpt_event = (reg_UFPT_EVENT_STATE [i] == UFPT_EVENT_STATE_KO_FLUSH);
     
    667679                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT)
    668680                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT)
    669                                                                  or (event_top       == UPDATE_PREDICTION_STATE_END_KO    )
    670                                                                  or (event_top       == UPDATE_PREDICTION_STATE_KO        )
     681                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE)
     682                                                                 or (top_state       == UPDATE_PREDICTION_STATE_END_KO    )
     683                                                                 or (top_state       == UPDATE_PREDICTION_STATE_KO        )
    671684                                                                 );
    672685                       
     
    706719                                reg_UPDATE_PREDICTION_TABLE [context][top]._retire_ok = false;
    707720                               
    708                                 switch (event_top)
     721                                switch (top_state)
    709722                                  {
    710723                                  case UPDATE_PREDICTION_STATE_END_KO :
     724                                  case UPDATE_PREDICTION_STATE_END    :
    711725                                    {
    712726                                      // Have already update predictor
     
    867881                      case UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT :
    868882                        {
    869                           Tdepth_t depth = reg_EVENT_UPT_PTR [i];
     883                          Tdepth_t depth  = reg_EVENT_UPT_PTR [i];
     884                          Tdepth_t update = reg_UPT_UPDATE    [i];
    870885                         
    871886                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth : %d",depth);
     
    878893                            }
    879894
    880                             reg_UPT_TOP    [i] = reg_UPT_TOP_EVENT [i];
    881                             reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i];
    882 
    883                           // break; continue
     895                          // Special case : branch_complete a speculative branch and the context_state signal the end of this event before the complete of previous branch
     896                          if (depth != update)
     897                            {
     898                              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_COMMIT_WAIT_END_UPDATE (event)",i);
     899                              upt_event_state = UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE;
     900
     901                              break; // stop here
     902                             }
     903
     904                          reg_UPT_TOP    [i] = reg_UPT_TOP_EVENT [i];
     905                          reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i];
     906
     907//                             break; continue
    884908                        }
    885909                      case UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT :
     
    906930                    // Flush UPFT
    907931                    flush_UFPT [i] = true;
     932
     933                    if (upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE)
     934                      {
     935                        reg_UPT_TOP     [i] = reg_UPT_TOP_EVENT [i];
     936                        reg_UPT_UPDATE  [i] = reg_UPT_TOP_EVENT [i];
     937                        reg_IS_ACCURATE [i] = true;
     938                       
     939                        upt_event_state = UPT_EVENT_STATE_OK;
     940                      }
    908941                   
    909942                    // Flush UPT
     
    9781011                    reg_EVENT_UPT_PTR         [i] = top;
    9791012                    reg_EVENT_UPT_FULL        [i] = (not empty and (bottom == reg_UPT_TOP [i]));
     1013//                  reg_EVENT_DEPTH           [i] = PORT_READ(in_EVENT_DEPTH [i]);//(top+1)%_param->_size_upt_queue[i];
    9801014                    reg_EVENT_DEPTH           [i] = top;
     1015
    9811016//                  reg_EVENT_ADDRESS_SRC     [i] = address_src; // delay_slot is compute in I_State
    9821017//                  reg_EVENT_ADDRESS_DEST_VAL[i] = good_take;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit.cpp

    r88 r123  
    3737    log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
    3838
    39 #if DEBUG_Prediction_unit == true
    40     log_printf(INFO,Prediction_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
     39// #if DEBUG_Prediction_unit == true
     40//     log_printf(INFO,Prediction_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4141
    42     std::cout << *param << std::endl;
    43 #endif   
     42//     std::cout << *param << std::endl;
     43// #endif   
    4444
    4545    log_printf(INFO,Prediction_unit,FUNCTION,"Allocation");
Note: See TracChangeset for help on using the changeset viewer.