Ignore:
Timestamp:
Mar 18, 2009, 11:36:26 PM (15 years ago)
Author:
rosiere
Message:

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp

    r111 r112  
    4444    _bht_nb_shifter          = (have_bht)?(bht_nb_shifter  ):0;
    4545    _have_pht                = have_pht              ;
    46     _pht_size_counter        = (have_pht)?(pht_size_counter      ):0;
    47     _pht_nb_counter          = (have_pht)?(pht_nb_counter        ):0;
     46    _pht_size_counter        = (have_pht)?(pht_size_counter):0;
     47    _pht_nb_counter          = (have_pht)?(pht_nb_counter  ):0;
    4848    _pht_size_address_share  = (have_bht and have_pht)?(pht_size_address_share):0;
    4949    _update_on_prediction    = update_on_prediction  ;
     
    5454    test();                 
    5555
     56    // history to update_prediction_table :
     57    //  MSB : pht_history
     58    //  LSB : bht_history
     59                       
    5660    _size_history            = _bht_size_shifter + _pht_size_counter;
    57                              
    5861    _bht_history_mask        = gen_mask<Thistory_t>(_bht_size_shifter);
    5962    _bht_history_rshift      = 0;
     
    6770    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_history_rshift       : %d",_pht_history_rshift);
    6871
     72    _bht_init_take           = (Thistory_t)(-1)&_bht_history_mask;
     73    _bht_init_ntake          = 0;
     74    _pht_init_take           = (1<<(_pht_size_counter-1)); // size = 4 : 1000/2
     75    _pht_init_ntake          = _pht_init_take-1;           // size = 4 : 0111/2
     76
     77    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_init_take            : 0x%x",_bht_init_take );
     78    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_init_ntake           : 0x%x",_bht_init_ntake);
     79    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_init_take            : 0x%x",_pht_init_take );
     80    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_init_ntake           : 0x%x",_pht_init_ntake);
     81   
    6982    if (_have_bht)
    7083      {
  • 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_allocation.cpp

    r111 r112  
    5959    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6060    {
    61       ALLOC1_INTERFACE("predict",IN,WEST,_("Predict direction interface"),_param->_nb_inst_predict);
     61      ALLOC1_INTERFACE_BEGIN("predict",IN,WEST,_("Predict direction interface"),_param->_nb_inst_predict);
    6262
    6363      ALLOC1_VALACK_IN ( in_PREDICT_VAL          ,VAL);
     
    7171      ALLOC1_SIGNAL_IN ( in_PREDICT_DIRECTION    ,"DIRECTION"    ,Tcontrol_t,1                    );
    7272        }
     73
     74      ALLOC1_INTERFACE_END(_param->_nb_inst_predict);
    7375    }
    7476
    7577    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    7678    {
    77       ALLOC1_INTERFACE("update",IN,WEST,_("Update direction interface"),_param->_nb_inst_update);
     79      ALLOC1_INTERFACE_BEGIN("update",IN,WEST,_("Update direction interface"),_param->_nb_inst_update);
    7880
    7981      ALLOC1_VALACK_IN ( in_UPDATE_VAL           ,VAL);
     
    8183      ALLOC1_SIGNAL_IN ( in_UPDATE_ADDRESS       ,"ADDRESS"      ,Taddress_t,_param->_size_address);
    8284      ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY       ,"HISTORY"      ,Thistory_t,_param->_size_history);
     85      ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY_VAL   ,"HISTORY_VAL"  ,Tcontrol_t,1                    );
    8386      ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION     ,"DIRECTION"    ,Tcontrol_t,1                    );
    8487      if (_param->_update_on_prediction)
    8588      ALLOC1_SIGNAL_IN ( in_UPDATE_MISS          ,"MISS"         ,Tcontrol_t,1                    );
     89
     90      ALLOC1_INTERFACE_END(_param->_nb_inst_update);
    8691    }
     92
     93    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    8794
    8895    if (usage_is_set(_usage,USE_SYSTEMC))
  • 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_deallocation.cpp

    r111 r112  
    4646        DELETE1_SIGNAL( in_UPDATE_ADDRESS       ,_param->_nb_inst_update,_param->_size_address);
    4747        DELETE1_SIGNAL( in_UPDATE_HISTORY       ,_param->_nb_inst_update,_param->_size_history);
     48        DELETE1_SIGNAL( in_UPDATE_HISTORY_VAL   ,_param->_nb_inst_update,1                    );
    4849        DELETE1_SIGNAL( in_UPDATE_DIRECTION     ,_param->_nb_inst_update,1                    );
    4950        if (_param->_update_on_prediction)                             
  • 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_transition.cpp

    r111 r112  
    9090            {
    9191              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * UPDATE [%d]",i);
     92              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * miss             : %d",PORT_READ(in_UPDATE_MISS [i]));
     93              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * update_on_predict: %d",_param->_update_on_prediction);
    9294             
    9395              // Update if
    9496              //  * update_on_prediction and miss
    9597              //  * not update_on_prediction
    96               if (not _param->_update_on_prediction or (_param->_update_on_prediction and PORT_READ(in_UPDATE_MISS [i])))
    97                 {
    98                   Taddress_t address     = PORT_READ(in_UPDATE_ADDRESS   [i]);
    99                   Thistory_t history     = PORT_READ(in_UPDATE_HISTORY   [i]);
    100                   Tcontrol_t direction   = PORT_READ(in_UPDATE_DIRECTION [i])&1;
     98              Tcontrol_t history_val = PORT_READ(in_UPDATE_HISTORY_VAL [i]);
     99
     100              if (not _param->_update_on_prediction or
     101                  (_param->_update_on_prediction and PORT_READ(in_UPDATE_MISS [i])) or
     102                  not history_val // static_prediction
     103                  )
     104                {
     105                  Taddress_t address     = PORT_READ(in_UPDATE_ADDRESS     [i]);
     106                  Thistory_t history     = PORT_READ(in_UPDATE_HISTORY     [i]);
     107                  Tcontrol_t direction   = PORT_READ(in_UPDATE_DIRECTION   [i])&1;
    101108
    102109                  log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * address          : %.8x",address);
    103110                  log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * direction        : %d",direction);
     111                  log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * history_val      : %d",direction);
    104112
    105113                  Thistory_t pht_bht_history = 0;
     
    107115                  if (_param->_have_bht)
    108116                    {
     117                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht");
     118
    109119                      Thistory_t bht_history = (history>>_param->_bht_history_rshift)&_param->_bht_history_mask;
    110120                      Thistory_t bht_num_reg = address & _param->_bht_address_mask;
    111121                     
     122                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_history (old): %x",bht_history);
     123                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_num_reg      : %x",bht_num_reg);
     124                     
     125                      // BHT : shift register
     126                      if (not history_val)
     127                        bht_history = (direction)?_param->_bht_init_take:_param->_bht_init_ntake;
     128                      else
     129                        bht_history = ((bht_history<<1) | direction)&_param->_bht_history_mask ;
     130                       
    112131                      pht_bht_history = bht_history;
    113                      
    114                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history (old): %x",bht_history);
    115                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_num_reg      : %x",bht_num_reg);
    116                      
    117                       // BHT : shift register
    118                      
    119                       bht_history = ((bht_history<<1) | direction)&_param->_bht_history_mask ;
    120                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history (new): %x",bht_history);
     132                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_history (new): %x",bht_history);
    121133                      reg_BHT [bht_num_reg]               = bht_history;
    122134                    }
     
    124136                  if (_param->_have_pht)
    125137                    {
     138                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht");
     139
    126140                      Thistory_t pht_history = (history>>_param->_pht_history_rshift)&_param->_pht_history_mask;
    127141                      Thistory_t pht_num_reg = pht_bht_history xor ((address&_param->_pht_address_share_mask)<<_param->_pht_address_share_lshift);
    128142                      Thistory_t pht_num_bank= (address>>_param->_pht_address_bank_rshift)&_param->_pht_address_bank_mask;
    129143                     
    130                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history (old): %x",pht_bht_history);
    131                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history (old): %x",pht_history);
    132                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_reg      : %x",pht_num_reg);
    133                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_bank     : %x",pht_num_bank);
     144                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_history (old): %x",pht_bht_history);
     145                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_history (old): %x",pht_history);
     146                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_num_reg      : %x",pht_num_reg);
     147                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_num_bank     : %x",pht_num_bank);
    134148                     
    135149                      // PHT : saturation counter
    136                       pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history));
    137                      
    138                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history (new): %x",pht_history);
     150                      if (not history_val)
     151                        pht_history = (direction)?_param->_pht_init_take:_param->_pht_init_ntake;
     152                      else
     153                        pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history));
     154                     
     155                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_history (new): %x",pht_history);
    139156                     
    140157                      reg_PHT [pht_num_bank][pht_num_reg] = pht_history;
     
    145162
    146163#if defined(DEBUG) and DEBUG_Two_Level_Branch_Predictor and (DEBUG >= DEBUG_TRACE)
    147     if (0)
     164    if (1)
    148165    {
    149166      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * Dump Two_Level_Branch_Predictor");
     
    180197          for (uint32_t num_bank=0; num_bank <_param->_pht_nb_bank; ++num_bank)
    181198            {
    182               log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  [%.4d]",num_bank);
    183 
    184               for (uint32_t i=0; i<_param->_pht_size_bank; i+=limit)
    185                 {
    186                   std::string str = "";
     199              if (_param->_pht_size_bank == 1)
     200                {
     201                  log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  [%.4d][0000] %4x",num_bank,reg_PHT[num_bank][0]);
     202                }
     203              else
     204                {
     205                  log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  [%.4d]",num_bank);
    187206                 
    188                   for (uint32_t j=0; j<limit; j++)
     207                  for (uint32_t i=0; i<_param->_pht_size_bank; i+=limit)
    189208                    {
    190                       uint32_t index = i+j;
    191                       if (index >= _param->_pht_nb_counter)
    192                         break;
    193                       else
    194                         str+=toString("[%.4d] %.4x ",index,reg_PHT[num_bank][index]);
     209                      std::string str = "";
     210                     
     211                      for (uint32_t j=0; j<limit; j++)
     212                        {
     213                          uint32_t index = i+j;
     214                          if (index >= _param->_pht_size_bank)
     215                            break;
     216                          else
     217                            str+=toString("[%.4d] %.4x ",index,reg_PHT[num_bank][index]);
     218                        }
     219                     
     220                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    %s",str.c_str());
    195221                    }
    196                  
    197                   log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    %s",str.c_str());
    198222                }
    199223            }
Note: See TracChangeset for help on using the changeset viewer.