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

File:
1 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/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.