Ignore:
Timestamp:
Feb 1, 2011, 9:57:54 PM (13 years ago)
Author:
rosiere
Message:

1) Integration of RegisterFile_Internal_Banked in RegisterFile?
2) Erase "read_write" interface in RegisterFile_Monolithic component
3) Add smith predictor parameters in Load_store_pointer_unit.
4) Fix not statistics flags

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

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Types.h

    r139 r146  
    151151  {
    152152    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO  ))) == 0) or
    153          (x.compare("one_fifo")  == 0))
     153         (x.compare(toString(                      morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO   )) == 0))
    154154      return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO;
    155155    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO))) == 0) or
    156          (x.compare("multi_fifo") == 0))
     156         (x.compare(toString(                      morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO )) == 0))
    157157      return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO;
    158158   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/include/Branch_Target_Buffer.h

    r82 r146  
    3535namespace morpheo {
    3636namespace behavioural {
    37 
    3837namespace core {
    3938namespace multi_front_end {
     
    4140namespace prediction_unit {
    4241namespace branch_target_buffer {
    43 
    4442
    4543  class Branch_Target_Buffer
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/src/main.cpp

    r111 r146  
    99#include "Behavioural/include/Selftest.h"
    1010
    11 #define NB_PARAMS 3+7*3
     11#define NB_PARAMS 3+8*3
    1212
    1313void usage (int argc, char * argv[])
     
    1515  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
    1616  err (_("list_params is :\n"));
    17   err (_(" * nb_inst_predict            (uint32_t)\n"));
    18   err (_(" * nb_inst_update             (uint32_t)\n"));
    19   err (_(" * size_address               (uint32_t)\n"));
    20   err (_(" * have_bht               [3] (bool    )\n"));
    21   err (_(" * bht_size_shifter       [3] (uint32_t)\n"));
    22   err (_(" * bht_nb_shifter         [3] (uint32_t)\n"));
    23   err (_(" * have_pht               [3] (bool    )\n"));
    24   err (_(" * pht_size_counter       [3] (uint32_t)\n"));
    25   err (_(" * pht_nb_counter         [3] (uint32_t)\n"));
    26   err (_(" * pht_size_address_share [3] (uint32_t)\n"));
     17  err (_(" * nb_inst_predict            (uint32_t     )\n"));
     18  err (_(" * nb_inst_update             (uint32_t     )\n"));
     19  err (_(" * size_address               (uint32_t     )\n"));
     20  err (_(" * have_bht               [3] (bool         )\n"));
     21  err (_(" * bht_size_shifter       [3] (uint32_t     )\n"));
     22  err (_(" * bht_nb_shifter         [3] (uint32_t     )\n"));
     23  err (_(" * have_pht               [3] (bool         )\n"));
     24  err (_(" * pht_size_counter       [3] (uint32_t     )\n"));
     25  err (_(" * pht_nb_counter         [3] (uint32_t     )\n"));
     26  err (_(" * pht_size_address_share [3] (uint32_t     )\n"));
     27  err (_(" * pht_scheme             [3] (Tpht_scheme_t)\n"));
    2728  exit (1);
    2829}
     
    4041
    4142  string name = argv[x++];
    42   uint32_t _nb_inst_predict           ;
    43   uint32_t _nb_inst_update            ;
    44   uint32_t _size_address              ;
    45   bool     _have_bht               [3];
    46   uint32_t _bht_size_shifter       [3];
    47   uint32_t _bht_nb_shifter         [3];
    48   bool     _have_pht               [3];
    49   uint32_t _pht_size_counter       [3];
    50   uint32_t _pht_nb_counter         [3];
    51   uint32_t _pht_size_address_share [3];
     43  uint32_t      _nb_inst_predict           ;
     44  uint32_t      _nb_inst_update            ;
     45  uint32_t      _size_address              ;
     46  bool          _have_bht               [3];
     47  uint32_t      _bht_size_shifter       [3];
     48  uint32_t      _bht_nb_shifter         [3];
     49  bool          _have_pht               [3];
     50  uint32_t      _pht_size_counter       [3];
     51  uint32_t      _pht_nb_counter         [3];
     52  uint32_t      _pht_size_address_share [3];
     53  Tpht_scheme_t _pht_scheme             [3];
    5254
    53   SELFTEST0(_nb_inst_predict           ,uint32_t,argv,x);
    54   SELFTEST0(_nb_inst_update            ,uint32_t,argv,x);
    55   SELFTEST0(_size_address              ,uint32_t,argv,x);
     55  SELFTEST0(_nb_inst_predict           ,uint32_t     ,argv,x);
     56  SELFTEST0(_nb_inst_update            ,uint32_t     ,argv,x);
     57  SELFTEST0(_size_address              ,uint32_t     ,argv,x);
    5658
    5759  for (uint32_t i=0; i<3; ++i)
    5860    {
    59   SELFTEST0(_have_bht               [i],bool    ,argv,x);
    60   SELFTEST0(_bht_size_shifter       [i],uint32_t,argv,x);
    61   SELFTEST0(_bht_nb_shifter         [i],uint32_t,argv,x);
    62   SELFTEST0(_have_pht               [i],bool    ,argv,x);
    63   SELFTEST0(_pht_size_counter       [i],uint32_t,argv,x);
    64   SELFTEST0(_pht_nb_counter         [i],uint32_t,argv,x);
    65   SELFTEST0(_pht_size_address_share [i],uint32_t,argv,x);
     61  SELFTEST0(_have_bht               [i],bool         ,argv,x);
     62  SELFTEST0(_bht_size_shifter       [i],uint32_t     ,argv,x);
     63  SELFTEST0(_bht_nb_shifter         [i],uint32_t     ,argv,x);
     64  SELFTEST0(_have_pht               [i],bool         ,argv,x);
     65  SELFTEST0(_pht_size_counter       [i],uint32_t     ,argv,x);
     66  SELFTEST0(_pht_nb_counter         [i],uint32_t     ,argv,x);
     67  SELFTEST0(_pht_size_address_share [i],uint32_t     ,argv,x);
     68  SELFTEST0(_pht_scheme             [i],Tpht_scheme_t,argv,x);
    6669    }
    6770
     
    8184         _pht_nb_counter        ,
    8285         _pht_size_address_share,
     86         _pht_scheme            ,
    8387         true // is_toplevel
    8488        );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/main.cpp

    r111 r146  
    99#include "Behavioural/include/Selftest.h"
    1010
    11 #define NB_PARAMS 11
     11#define NB_PARAMS 12
    1212
    1313void usage (int argc, char * argv[])
     
    1515  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
    1616  err (_("list_params is :\n"));
    17   err (_(" * nb_inst_predict        (uint32_t)\n"));
    18   err (_(" * nb_inst_update         (uint32_t)\n"));
    19   err (_(" * size_address           (uint32_t)\n"));
    20   err (_(" * have_bht               (bool    )\n"));
    21   err (_(" * bht_size_shifter       (uint32_t)\n"));
    22   err (_(" * bht_nb_shifter         (uint32_t)\n"));
    23   err (_(" * have_pht               (bool    )\n"));
    24   err (_(" * pht_size_counter       (uint32_t)\n"));
    25   err (_(" * pht_nb_counter         (uint32_t)\n"));
    26   err (_(" * pht_size_address_share (uint32_t)\n"));
    27   err (_(" * update_on_prediction   (bool    )\n"));
     17  err (_(" * nb_inst_predict        (uint32_t     )\n"));
     18  err (_(" * nb_inst_update         (uint32_t     )\n"));
     19  err (_(" * size_address           (uint32_t     )\n"));
     20  err (_(" * have_bht               (bool         )\n"));
     21  err (_(" * bht_size_shifter       (uint32_t     )\n"));
     22  err (_(" * bht_nb_shifter         (uint32_t     )\n"));
     23  err (_(" * have_pht               (bool         )\n"));
     24  err (_(" * pht_size_counter       (uint32_t     )\n"));
     25  err (_(" * pht_nb_counter         (uint32_t     )\n"));
     26  err (_(" * pht_size_address_share (uint32_t     )\n"));
     27  err (_(" * pht_scheme             (Tpht_scheme_t)\n"));
     28  err (_(" * update_on_prediction   (bool         )\n"));
    2829
    2930  exit (1);
     
    4344  string name = argv[x++];
    4445
    45   uint32_t nb_inst_predict       ;
    46   uint32_t nb_inst_update        ;
    47   uint32_t size_address          ;
    48   bool     have_bht              ;
    49   uint32_t bht_size_shifter      ;
    50   uint32_t bht_nb_shifter        ;
    51   bool     have_pht              ;
    52   uint32_t pht_size_counter      ;
    53   uint32_t pht_nb_counter        ;
    54   uint32_t pht_size_address_share;
    55   bool     update_on_prediction  ;
     46  uint32_t      nb_inst_predict       ;
     47  uint32_t      nb_inst_update        ;
     48  uint32_t      size_address          ;
     49  bool          have_bht              ;
     50  uint32_t      bht_size_shifter      ;
     51  uint32_t      bht_nb_shifter        ;
     52  bool          have_pht              ;
     53  uint32_t      pht_size_counter      ;
     54  uint32_t      pht_nb_counter        ;
     55  uint32_t      pht_size_address_share;
     56  Tpht_scheme_t pht_scheme            ;
     57  bool          update_on_prediction  ;
    5658
    57   SELFTEST0(nb_inst_predict       ,uint32_t,argv,x);
    58   SELFTEST0(nb_inst_update        ,uint32_t,argv,x);
    59   SELFTEST0(size_address          ,uint32_t,argv,x);
    60   SELFTEST0(have_bht              ,bool    ,argv,x);
    61   SELFTEST0(bht_size_shifter      ,uint32_t,argv,x);
    62   SELFTEST0(bht_nb_shifter        ,uint32_t,argv,x);
    63   SELFTEST0(have_pht              ,bool    ,argv,x);
    64   SELFTEST0(pht_size_counter      ,uint32_t,argv,x);
    65   SELFTEST0(pht_nb_counter        ,uint32_t,argv,x);
    66   SELFTEST0(pht_size_address_share,uint32_t,argv,x);
    67   SELFTEST0(update_on_prediction  ,bool    ,argv,x);
     59  SELFTEST0(nb_inst_predict       ,uint32_t     ,argv,x);
     60  SELFTEST0(nb_inst_update        ,uint32_t     ,argv,x);
     61  SELFTEST0(size_address          ,uint32_t     ,argv,x);
     62  SELFTEST0(have_bht              ,bool         ,argv,x);
     63  SELFTEST0(bht_size_shifter      ,uint32_t     ,argv,x);
     64  SELFTEST0(bht_nb_shifter        ,uint32_t     ,argv,x);
     65  SELFTEST0(have_pht              ,bool         ,argv,x);
     66  SELFTEST0(pht_size_counter      ,uint32_t     ,argv,x);
     67  SELFTEST0(pht_nb_counter        ,uint32_t     ,argv,x);
     68  SELFTEST0(pht_size_address_share,uint32_t     ,argv,x);
     69  SELFTEST0(pht_scheme            ,Tpht_scheme_t,argv,x);
     70  SELFTEST0(update_on_prediction  ,bool         ,argv,x);
    6871
    6972  int _return = EXIT_SUCCESS;
     
    8285         pht_nb_counter        ,
    8386         pht_size_address_share,
     87         pht_scheme            ,
    8488         update_on_prediction  ,
    8589         true //is_toplevel
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h

    r115 r146  
    2727  {
    2828    //-----[ fields ]------------------------------------------------------------
    29   public : uint32_t   _nb_inst_predict         ;
    30   public : uint32_t   _nb_inst_update          ;
    31   public : uint32_t   _size_address            ;
    32   public : bool       _have_bht                ;
    33   public : uint32_t   _bht_size_shifter        ;
    34   public : uint32_t   _bht_nb_shifter          ;
    35   public : bool       _have_pht                ;
    36   public : uint32_t   _pht_size_counter        ;
    37   public : uint32_t   _pht_nb_counter          ;
    38   public : uint32_t   _pht_size_address_share  ;
    39   public : bool       _update_on_prediction    ;
    40                                        
    41   public : Thistory_t _pht_counter_max         ;
    42        
    43   public : uint32_t   _size_history            ;
    44                                                
    45   public : Thistory_t _bht_history_mask        ;
    46   public : Thistory_t _bht_history_shift       ;
    47   public : Thistory_t _pht_history_mask        ;
    48   public : Thistory_t _pht_history_shift       ;
    49                                                
    50   public : uint32_t   _bht_size_address        ;
    51   public : uint32_t   _pht_size_address        ;
    52                                                
    53   public : Taddress_t _bht_address_mask        ;
    54   public : uint32_t   _pht_nb_bank             ;
    55   public : uint32_t   _pht_size_bank           ;
    56   public : Taddress_t _pht_address_share_mask  ;
    57   public : Taddress_t _pht_address_share_shift ;
    58   public : Taddress_t _pht_address_bank_mask   ;
    59   public : Taddress_t _pht_address_bank_shift  ;
     29  public : uint32_t      _nb_inst_predict         ;
     30  public : uint32_t      _nb_inst_update          ;
     31  public : uint32_t      _size_address            ;
     32  public : bool          _have_bht                ;
     33  public : uint32_t      _bht_size_shifter        ;
     34  public : uint32_t      _bht_nb_shifter          ;
     35  public : bool          _have_pht                ;
     36  public : uint32_t      _pht_size_counter        ;
     37  public : uint32_t      _pht_nb_counter          ;
     38  public : uint32_t      _pht_size_address_share  ;
     39  public : Tpht_scheme_t _pht_scheme              ;
     40  public : bool          _update_on_prediction    ;
    6041
    61   public : Thistory_t _bht_init_take           ;
    62   public : Thistory_t _bht_init_ntake          ;
    63 
    64   public : Thistory_t _pht_init_take           ;
    65   public : Thistory_t _pht_init_ntake          ;
     42  public : Thistory_t    _pht_counter_max         ;
     43  public : Thistory_t    _pht_threshold_up        ;
     44  public : Thistory_t    _pht_threshold_down      ;
     45                         
     46  public : uint32_t      _size_history            ;
     47                                                 
     48  public : Thistory_t    _bht_history_mask        ;
     49  public : Thistory_t    _bht_history_shift       ;
     50  public : Thistory_t    _pht_history_mask        ;
     51  public : Thistory_t    _pht_history_shift       ;
     52                                                 
     53  public : uint32_t      _bht_size_address        ;
     54  public : uint32_t      _pht_size_address        ;
     55  public : Taddress_t    _bht_address_mask        ;
     56  public : uint32_t      _pht_nb_bank             ;
     57  public : uint32_t      _pht_size_bank           ;
     58  public : Taddress_t    _pht_address_share_mask  ;
     59  public : Taddress_t    _pht_address_share_shift ;
     60  public : Taddress_t    _pht_address_bank_mask   ;
     61  public : Taddress_t    _pht_address_bank_shift  ;
     62                         
     63  public : Thistory_t    _bht_init_take           ;
     64  public : Thistory_t    _bht_init_ntake          ;
     65                         
     66  public : Thistory_t    _pht_init_take           ;
     67  public : Thistory_t    _pht_init_ntake          ;
    6668
    6769    //-----[ methods ]-----------------------------------------------------------
    68   public : Parameters  (uint32_t nb_inst_predict       ,
    69                         uint32_t nb_inst_update        ,
    70                         uint32_t size_address          ,
    71                         bool     have_bht              ,
    72                         uint32_t bht_size_shifter      ,
    73                         uint32_t bht_nb_shifter        ,
    74                         bool     have_pht              ,
    75                         uint32_t pht_size_counter      ,
    76                         uint32_t pht_nb_counter        ,
    77                         uint32_t pht_size_address_share,
    78                         bool     update_on_prediction  ,
    79                         bool is_toplevel=false);
     70  public : Parameters  (uint32_t      nb_inst_predict       ,
     71                        uint32_t      nb_inst_update        ,
     72                        uint32_t      size_address          ,
     73                        bool          have_bht              ,
     74                        uint32_t      bht_size_shifter      ,
     75                        uint32_t      bht_nb_shifter        ,
     76                        bool          have_pht              ,
     77                        uint32_t      pht_size_counter      ,
     78                        uint32_t      pht_nb_counter        ,
     79                        uint32_t      pht_size_address_share,
     80                        Tpht_scheme_t pht_scheme            ,
     81                        bool          update_on_prediction  ,
     82                        bool          is_toplevel=false);
    8083//public : Parameters  (Parameters & param) ;
    8184  public : ~Parameters (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h

    r110 r146  
    2121namespace two_level_branch_predictor {
    2222
    23 
    2423}; // end namespace two_level_branch_predictor
    2524}; // end namespace meta_predictor
     
    2928}; // end namespace multi_front_end
    3029}; // end namespace core
    31 
    3230}; // end namespace behavioural
    3331}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp

    r124 r146  
    2222#undef  FUNCTION
    2323#define FUNCTION "Two_Level_Branch_Predictor::Parameters"
    24   Parameters::Parameters (uint32_t nb_inst_predict       ,
    25                           uint32_t nb_inst_update        ,
    26                           uint32_t size_address          ,
    27                           bool     have_bht              ,
    28                           uint32_t bht_size_shifter      ,
    29                           uint32_t bht_nb_shifter        ,
    30                           bool     have_pht              ,
    31                           uint32_t pht_size_counter      ,
    32                           uint32_t pht_nb_counter        ,
    33                           uint32_t pht_size_address_share,
    34                           bool     update_on_prediction  ,
    35                           bool is_toplevel)
     24  Parameters::Parameters (uint32_t      nb_inst_predict       ,
     25                          uint32_t      nb_inst_update        ,
     26                          uint32_t      size_address          ,
     27                          bool          have_bht              ,
     28                          uint32_t      bht_size_shifter      ,
     29                          uint32_t      bht_nb_shifter        ,
     30                          bool          have_pht              ,
     31                          uint32_t      pht_size_counter      ,
     32                          uint32_t      pht_nb_counter        ,
     33                          uint32_t      pht_size_address_share,
     34                          Tpht_scheme_t pht_scheme            ,
     35                          bool          update_on_prediction  ,
     36                          bool          is_toplevel)
    3637  {
    3738    log_begin(Two_Level_Branch_Predictor,FUNCTION);
     
    4748    _pht_nb_counter          = (have_pht)?(pht_nb_counter  ):0;
    4849    _pht_size_address_share  = (have_bht and have_pht)?(pht_size_address_share):0;
     50    _pht_scheme              = pht_scheme            ;
    4951    _update_on_prediction    = update_on_prediction  ;
    5052                             
     
    9799      {
    98100        _pht_counter_max         = (1<<_pht_size_counter)-1;
    99        
     101        _pht_threshold_up        = (1<<(_pht_size_counter-1))+1;
     102        _pht_threshold_down      = (1<<(_pht_size_counter-1))-1;
     103
    100104        _pht_size_bank           = (_have_bht)?(1<<_bht_size_shifter):1;
    101105        _pht_nb_bank             = _pht_nb_counter / _pht_size_bank;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_print.cpp

    r110 r146  
    99#include "Behavioural/include/XML.h"
    1010
    11 namespace morpheo                    {
     11namespace morpheo {
    1212namespace behavioural {
    1313namespace core {
  • 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

    r124 r146  
    1010// #include <assert.h>
    1111
    12 namespace morpheo                    {
     12namespace morpheo {
    1313namespace behavioural {
    1414namespace core {
     
    7777                        log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history (old): %llx",pht_history);
    7878                       
     79                        // TODO -> don't change PHT here !
     80                        Thistory_t min = 0;
     81                        Thistory_t max = _param->_pht_counter_max;
     82
    7983                        // PHT : saturation counter
    80                         pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history));
    81                        
     84                        switch (_param->_pht_scheme)
     85                          {
     86                          case PHT_SCHEME_COUNTER :
     87                            {
     88                              pht_history = (direction==1)?((pht_history<max)?(pht_history+1):(max)):((pht_history>min)?(pht_history-1):(min));
     89                              break;
     90                            }
     91                          case PHT_SCHEME_FSM :
     92                            {
     93                              Thistory_t down = _param->_pht_threshold_down;
     94                              Thistory_t up   = _param->_pht_threshold_up;
     95
     96                              pht_history = (direction==1)?(((pht_history==max) or (pht_history==up))?(max):(pht_history+1)):(((pht_history==min) or (pht_history==down))?(min):(pht_history-1));
     97                              break;
     98                            }
     99                          default :
     100                            {
     101                              break;
     102                            }
     103                          }
     104
    82105                        log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history (new): %llx",pht_history);
    83106                       
     
    169192                      else
    170193                        {
    171                           pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history));
     194                          Thistory_t min = 0;
     195                          Thistory_t max = _param->_pht_counter_max;
     196                         
     197                          // PHT : saturation counter
     198                          switch (_param->_pht_scheme)
     199                            {
     200                            case PHT_SCHEME_COUNTER :
     201                              {
     202                                //  [ 11 ] -- NT -> [ 10 ]
     203                                //  [    ] <-  T -- [    ]
     204                                //                   ^  |
     205                                //                   |  |
     206                                //                   T NT
     207                                //                   |  |
     208                                //                   |  V
     209                                //  [ 00 ] --  T -> [ 01 ]
     210                                //  [    ] <- NT -- [    ]
     211
     212                                pht_history = (direction==1)?((pht_history<max)?(pht_history+1):(max)):((pht_history>min)?(pht_history-1):(min));
     213                                break;
     214                              }
     215                            case PHT_SCHEME_FSM :
     216                              {
     217                                //  [11] -- NT -> [10]
     218                                //  [  ] <-  T -- [  ]
     219                                //   ^              |
     220                                //   |              |
     221                                //   T             NT
     222                                //   |              |
     223                                //   |              V
     224                                //  [00] -- NT -> [00]
     225                                //  [  ] <-  T -- [  ]
     226
     227                                Thistory_t down = _param->_pht_threshold_down;
     228                                Thistory_t up   = _param->_pht_threshold_up;
     229                               
     230                                pht_history = (direction==1)?(((pht_history==max) or (pht_history==up))?(max):(pht_history+1)):(((pht_history==min) or (pht_history==down))?(min):(pht_history-1));
     231                                break;
     232                              }
     233                            default :
     234                              {
     235                                break;
     236                              }
     237                            }
    172238                        }
    173239                     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Parameters.h

    r111 r146  
    1515#include "Common/include/Debug.h"
    1616
    17 
    1817namespace morpheo {
    1918namespace behavioural {
     
    2524namespace meta_predictor {
    2625
    27 
    2826  class Parameters : public morpheo::behavioural::Parameters
    2927  {
    3028    //-----[ fields ]------------------------------------------------------------
    31   public : uint32_t   _nb_inst_predict           ;
    32   public : uint32_t   _nb_inst_update            ;
    33   public : uint32_t   _size_address              ;
    34   public : bool       _have_bht               [3];
    35   public : uint32_t   _bht_size_shifter       [3];
    36   public : uint32_t   _bht_nb_shifter         [3];
    37   public : bool       _have_pht               [3];
    38   public : uint32_t   _pht_size_counter       [3];
    39   public : uint32_t   _pht_nb_counter         [3];
    40   public : uint32_t   _pht_size_address_share [3];
    41                      
    42   public : bool       _have_meta_predictor       ;
    43   public : uint32_t   _nb_predictor              ;
    44 
    45   public : bool     * _predictor_update_on_prediction;//[nb_predictor]
    46   public : uint32_t * _predictor_size_history        ;//[nb_predictor]
    47   public : uint32_t   _size_history                  ;
     29  public : uint32_t      _nb_inst_predict           ;
     30  public : uint32_t      _nb_inst_update            ;
     31  public : uint32_t      _size_address              ;
     32  public : bool          _have_bht               [3];
     33  public : uint32_t      _bht_size_shifter       [3];
     34  public : uint32_t      _bht_nb_shifter         [3];
     35  public : bool          _have_pht               [3];
     36  public : uint32_t      _pht_size_counter       [3];
     37  public : uint32_t      _pht_nb_counter         [3];
     38  public : uint32_t      _pht_size_address_share [3];
     39  public : Tpht_scheme_t _pht_scheme             [3];
     40  public : bool          _have_meta_predictor       ;
     41  public : uint32_t      _nb_predictor              ;
     42                         
     43  public : bool     *    _predictor_update_on_prediction;//[nb_predictor]
     44  public : uint32_t *    _predictor_size_history        ;//[nb_predictor]
     45  public : uint32_t      _size_history                  ;
    4846                       
    4947  public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Parameters ** _param_two_level_branch_predictor;//[nb_predictor]
     
    5149
    5250    //-----[ methods ]-----------------------------------------------------------
    53   public : Parameters  (uint32_t nb_inst_predict           ,
    54                         uint32_t nb_inst_update            ,
    55                         uint32_t size_address              ,
    56                         bool     have_bht               [3],
    57                         uint32_t bht_size_shifter       [3],
    58                         uint32_t bht_nb_shifter         [3],
    59                         bool     have_pht               [3],
    60                         uint32_t pht_size_counter       [3],
    61                         uint32_t pht_nb_counter         [3],
    62                         uint32_t pht_size_address_share [3],
    63                         bool     is_toplevel=false);
     51  public : Parameters  (uint32_t      nb_inst_predict           ,
     52                        uint32_t      nb_inst_update            ,
     53                        uint32_t      size_address              ,
     54                        bool          have_bht               [3],
     55                        uint32_t      bht_size_shifter       [3],
     56                        uint32_t      bht_nb_shifter         [3],
     57                        bool          have_pht               [3],
     58                        uint32_t      pht_size_counter       [3],
     59                        uint32_t      pht_nb_counter         [3],
     60                        uint32_t      pht_size_address_share [3],
     61                        Tpht_scheme_t pht_scheme             [3],
     62                        bool          is_toplevel=false);
    6463//public : Parameters  (Parameters & param) ;
    6564  public : ~Parameters (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Parameters.cpp

    r128 r146  
    2121#undef  FUNCTION
    2222#define FUNCTION "Meta_Predictor::Parameters"
    23   Parameters::Parameters (uint32_t nb_inst_predict           ,
    24                           uint32_t nb_inst_update            ,
    25                           uint32_t size_address              ,
    26                           bool     have_bht               [3],
    27                           uint32_t bht_size_shifter       [3],
    28                           uint32_t bht_nb_shifter         [3],
    29                           bool     have_pht               [3],
    30                           uint32_t pht_size_counter       [3],
    31                           uint32_t pht_nb_counter         [3],
    32                           uint32_t pht_size_address_share [3],
    33                           bool     is_toplevel)
     23  Parameters::Parameters (uint32_t      nb_inst_predict           ,
     24                          uint32_t      nb_inst_update            ,
     25                          uint32_t      size_address              ,
     26                          bool          have_bht               [3],
     27                          uint32_t      bht_size_shifter       [3],
     28                          uint32_t      bht_nb_shifter         [3],
     29                          bool          have_pht               [3],
     30                          uint32_t      pht_size_counter       [3],
     31                          uint32_t      pht_nb_counter         [3],
     32                          uint32_t      pht_size_address_share [3],
     33                          Tpht_scheme_t pht_scheme             [3],
     34                          bool          is_toplevel)
    3435  {
    3536    log_begin(Meta_Predictor,FUNCTION);
     
    4748    _pht_nb_counter         [i] = (_have_pht [i])?pht_nb_counter         [i]:0;
    4849    _pht_size_address_share [i] = (_have_bht[i] and _have_pht [i])?pht_size_address_share [i]:0;
     50    _pht_scheme             [i] = (_have_pht [i])?pht_scheme             [i]:PHT_SCHEME_COUNTER;
    4951      }
    5052
     
    8385           _pht_nb_counter                 [i],
    8486           _pht_size_address_share         [i],
    85            _predictor_update_on_prediction [i]
     87           _pht_scheme                     [i],
     88           _predictor_update_on_prediction [i]
    8689           );
    8790
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Parameters_print.cpp

    r110 r146  
    1717namespace direction {
    1818namespace meta_predictor {
    19 
    2019
    2120#undef  FUNCTION
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/SelfTest/src/main.cpp

    r88 r146  
    88#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/SelfTest/include/test.h"
    99
    10 #define NB_PARAMS 25
     10#define NB_PARAMS 28
    1111
    1212void usage (int argc, char * argv[])
     
    1414  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
    1515  err (_("list_params is :\n"));
    16   err (_(" * predictor_scheme           (Tpredictor_t)\n"));
    17   err (_(" * nb_inst_predict            (uint32_t    )\n"));
    18   err (_(" * nb_inst_update             (uint32_t    )\n"));
    19   err (_(" * size_address               (uint32_t    )\n"));
    20   err (_(" * have_bht               [3] (bool        )\n"));
    21   err (_(" * bht_size_shifter       [3] (uint32_t    )\n"));
    22   err (_(" * bht_nb_shifter         [3] (uint32_t    )\n"));
    23   err (_(" * have_pht               [3] (bool        )\n"));
    24   err (_(" * pht_size_counter       [3] (uint32_t    )\n"));
    25   err (_(" * pht_nb_counter         [3] (uint32_t    )\n"));
    26   err (_(" * pht_size_address_share [3] (uint32_t    )\n"));
     16  err (_(" * predictor_scheme           (Tpredictor_t )\n"));
     17  err (_(" * nb_inst_predict            (uint32_t     )\n"));
     18  err (_(" * nb_inst_update             (uint32_t     )\n"));
     19  err (_(" * size_address               (uint32_t     )\n"));
     20  err (_(" * have_bht               [3] (bool         )\n"));
     21  err (_(" * bht_size_shifter       [3] (uint32_t     )\n"));
     22  err (_(" * bht_nb_shifter         [3] (uint32_t     )\n"));
     23  err (_(" * have_pht               [3] (bool         )\n"));
     24  err (_(" * pht_size_counter       [3] (uint32_t     )\n"));
     25  err (_(" * pht_nb_counter         [3] (uint32_t     )\n"));
     26  err (_(" * pht_size_address_share [3] (uint32_t     )\n"));
     27  err (_(" * pht_scheme             [3] (Tpht_scheme_t)\n"));
    2728
    2829  exit (1);
     
    4243  string name = argv[x++];
    4344
    44   Tpredictor_t _predictor_scheme = fromString<Tpredictor_t>(argv[x++]);
    45   uint32_t     _nb_inst_predict  = fromString<uint32_t    >(argv[x++]);
    46   uint32_t     _nb_inst_update   = fromString<uint32_t    >(argv[x++]);
    47   uint32_t     _size_address     = fromString<uint32_t    >(argv[x++]);
    48   bool         _have_bht               [3];
    49   uint32_t     _bht_size_shifter       [3];
    50   uint32_t     _bht_nb_shifter         [3];
    51   bool         _have_pht               [3];
    52   uint32_t     _pht_size_counter       [3];
    53   uint32_t     _pht_nb_counter         [3];
    54   uint32_t     _pht_size_address_share [3];
     45  Tpredictor_t  _predictor_scheme = fromString<Tpredictor_t>(argv[x++]);
     46  uint32_t      _nb_inst_predict  = fromString<uint32_t    >(argv[x++]);
     47  uint32_t      _nb_inst_update   = fromString<uint32_t    >(argv[x++]);
     48  uint32_t      _size_address     = fromString<uint32_t    >(argv[x++]);
     49  bool          _have_bht               [3];
     50  uint32_t      _bht_size_shifter       [3];
     51  uint32_t      _bht_nb_shifter         [3];
     52  bool          _have_pht               [3];
     53  uint32_t      _pht_size_counter       [3];
     54  uint32_t      _pht_nb_counter         [3];
     55  uint32_t      _pht_size_address_share [3];
     56  Tpht_scheme_t _pht_scheme             [3];
    5557
    5658  for (uint32_t i=0; i<3; i++)
    5759    {
    58       _have_bht               [i] = fromString<bool    >(argv[x++]);
    59       _bht_size_shifter       [i] = fromString<uint32_t>(argv[x++]);
    60       _bht_nb_shifter         [i] = fromString<uint32_t>(argv[x++]);
    61       _have_pht               [i] = fromString<bool    >(argv[x++]);
    62       _pht_size_counter       [i] = fromString<uint32_t>(argv[x++]);
    63       _pht_nb_counter         [i] = fromString<uint32_t>(argv[x++]);
    64       _pht_size_address_share [i] = fromString<uint32_t>(argv[x++]);
     60      _have_bht               [i] = fromString<bool          >(argv[x++]);
     61      _bht_size_shifter       [i] = fromString<uint32_t      >(argv[x++]);
     62      _bht_nb_shifter         [i] = fromString<uint32_t      >(argv[x++]);
     63      _have_pht               [i] = fromString<bool          >(argv[x++]);
     64      _pht_size_counter       [i] = fromString<uint32_t      >(argv[x++]);
     65      _pht_nb_counter         [i] = fromString<uint32_t      >(argv[x++]);
     66      _pht_size_address_share [i] = fromString<uint32_t      >(argv[x++]);
     67      _pht_scheme             [i] = fromString<Tpht_scheme_t >(argv[x++]);
    6568    }
    6669 
     
    8083         _pht_nb_counter        ,
    8184         _pht_size_address_share,
     85         _pht_scheme            ,
    8286         true // is_toplevel
    8387         );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/include/Parameters.h

    r111 r146  
    2424namespace direction {
    2525
    26 
    2726  class Parameters : public morpheo::behavioural::Parameters
    2827  {
    2928    //-----[ fields ]------------------------------------------------------------
    30   public : Tpredictor_t _predictor_scheme          ;
    31   public : uint32_t     _nb_inst_predict           ;
    32   public : uint32_t     _nb_inst_update            ;
    33 //public : uint32_t     _size_address              ;
    34   public : bool         _have_bht               [3];
    35   public : uint32_t     _bht_size_shifter       [3];
    36   public : uint32_t     _bht_nb_shifter         [3];
    37   public : bool         _have_pht               [3];
    38   public : uint32_t     _pht_size_counter       [3];
    39   public : uint32_t     _pht_nb_counter         [3];
    40   public : uint32_t     _pht_size_address_share [3];
     29  public : Tpredictor_t   _predictor_scheme          ;
     30  public : uint32_t       _nb_inst_predict           ;
     31  public : uint32_t       _nb_inst_update            ;
     32//public : uint32_t       _size_address              ;
     33  public : bool           _have_bht               [3];
     34  public : uint32_t       _bht_size_shifter       [3];
     35  public : uint32_t       _bht_nb_shifter         [3];
     36  public : bool           _have_pht               [3];
     37  public : uint32_t       _pht_size_counter       [3];
     38  public : uint32_t       _pht_nb_counter         [3];
     39  public : uint32_t       _pht_size_address_share [3];
     40  public : Tpht_scheme_t  _pht_scheme             [3];
    4141
    42   public : uint32_t     _size_history;
    43 
    44   public : bool         _have_component_meta_predictor;
    45   public : bool         _have_port_history;
     42  public : uint32_t       _size_history;
     43                         
     44  public : bool           _have_component_meta_predictor;
     45  public : bool           _have_port_history;
    4646
    4747  public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::direction_glue::Parameters * _param_glue;
     
    4949
    5050    //-----[ methods ]-----------------------------------------------------------
    51   public : Parameters  (Tpredictor_t predictor_scheme          ,
    52                         uint32_t     nb_inst_predict           ,
    53                         uint32_t     nb_inst_update            ,
    54                         uint32_t     size_address              ,
    55                         bool         have_bht               [3],
    56                         uint32_t     bht_size_shifter       [3],
    57                         uint32_t     bht_nb_shifter         [3],
    58                         bool         have_pht               [3],
    59                         uint32_t     pht_size_counter       [3],
    60                         uint32_t     pht_nb_counter         [3],
    61                         uint32_t     pht_size_address_share [3],
    62                         bool         is_toplevel=false
     51  public : Parameters  (Tpredictor_t   predictor_scheme          ,
     52                        uint32_t       nb_inst_predict           ,
     53                        uint32_t       nb_inst_update            ,
     54                        uint32_t       size_address              ,
     55                        bool           have_bht               [3],
     56                        uint32_t       bht_size_shifter       [3],
     57                        uint32_t       bht_nb_shifter         [3],
     58                        bool           have_pht               [3],
     59                        uint32_t       pht_size_counter       [3],
     60                        uint32_t       pht_nb_counter         [3],
     61                        uint32_t       pht_size_address_share [3],
     62                        Tpht_scheme_t  pht_scheme             [3],
     63                        bool           is_toplevel=false
    6364                        );
    6465
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/src/Parameters.cpp

    r111 r146  
    1919#undef  FUNCTION
    2020#define FUNCTION "Direction::Parameters"
    21   Parameters::Parameters (Tpredictor_t predictor_scheme          ,
    22                           uint32_t     nb_inst_predict           ,
    23                           uint32_t     nb_inst_update            ,
    24                           uint32_t     size_address              ,
    25                           bool         have_bht               [3],
    26                           uint32_t     bht_size_shifter       [3],
    27                           uint32_t     bht_nb_shifter         [3],
    28                           bool         have_pht               [3],
    29                           uint32_t     pht_size_counter       [3],
    30                           uint32_t     pht_nb_counter         [3],
    31                           uint32_t     pht_size_address_share [3],
    32                           bool         is_toplevel)
     21  Parameters::Parameters (Tpredictor_t   predictor_scheme          ,
     22                          uint32_t       nb_inst_predict           ,
     23                          uint32_t       nb_inst_update            ,
     24                          uint32_t       size_address              ,
     25                          bool           have_bht               [3],
     26                          uint32_t       bht_size_shifter       [3],
     27                          uint32_t       bht_nb_shifter         [3],
     28                          bool           have_pht               [3],
     29                          uint32_t       pht_size_counter       [3],
     30                          uint32_t       pht_nb_counter         [3],
     31                          uint32_t       pht_size_address_share [3],
     32                          Tpht_scheme_t  pht_scheme             [3],
     33                          bool           is_toplevel)
    3334  {
    3435    log_printf(FUNC,Direction,FUNCTION,"Begin");
     
    4849        _pht_nb_counter         [i] = pht_nb_counter         [i];
    4950        _pht_size_address_share [i] = pht_size_address_share [i];
     51        _pht_scheme             [i] = pht_scheme             [i];
    5052      }
    5153
     
    148150         _pht_size_counter      ,
    149151         _pht_nb_counter        ,
    150          _pht_size_address_share
     152         _pht_size_address_share,
     153         _pht_scheme
    151154         );
    152155   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/src/Parameters_print.cpp

    r88 r146  
    5151        xml.singleton_begin("predictor_"+toString(i)+"_pht_nb_counter        "); xml.attribut("value",toString(_pht_nb_counter         [i])); xml.singleton_end();
    5252        xml.singleton_begin("predictor_"+toString(i)+"_pht_size_address_share"); xml.attribut("value",toString(_pht_size_address_share [i])); xml.singleton_end();
     53        xml.singleton_begin("predictor_"+toString(i)+"_pht_scheme            "); xml.attribut("value",toString(_pht_scheme             [i])); xml.singleton_end();
    5354      }
    5455    xml.balise_close();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/SelfTest/src/main.cpp

    r111 r146  
    88#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/SelfTest/include/test.h"
    99
    10 #define NB_PARAMS (12+3*7)
     10#define NB_PARAMS (12+3*8)
    1111
    1212void usage (int argc, char * argv[])
     
    1414  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
    1515  err (_("list_params is :\n"));
    16   err (_(" * nb_context                                (uint32_t    )\n"));
    17   err (_(" * nb_decod_unit                             (uint32_t    )\n"));
    18   err (_(" * size_address                              (uint32_t    )\n"));
    19   err (_(" * nb_instruction             [nb_context]   (uint32_t    )\n"));
    20   err (_(" * nb_inst_decod              [nb_decod_unit](uint32_t    )\n"));
    21   err (_(" * nb_inst_branch_predict                    (uint32_t    )\n"));
    22   err (_(" * nb_inst_branch_decod                      (uint32_t    )\n"));
    23   err (_(" * nb_inst_branch_update                     (uint32_t    )\n"));
    24   err (_(" * nb_inst_branch_complete                   (uint32_t    )\n"));
    25   err (_(" * btb_size_queue                            (uint32_t    )\n"));
    26   err (_(" * btb_associativity                         (uint32_t    )\n"));
    27   err (_(" * btb_size_counter                          (uint32_t    )\n"));
    28   err (_(" * btb_victim_scheme                         (Tvictim_t   )\n"));
    29   err (_(" * dir_predictor_scheme                      (Tpredictor_t)\n"));
    30   err (_(" * dir_have_bht               [3]            (bool        )\n"));
    31   err (_(" * dir_bht_size_shifter       [3]            (uint32_t    )\n"));
    32   err (_(" * dir_bht_nb_shifter         [3]            (uint32_t    )\n"));
    33   err (_(" * dir_have_pht               [3]            (bool        )\n"));
    34   err (_(" * dir_pht_size_counter       [3]            (uint32_t    )\n"));
    35   err (_(" * dir_pht_nb_counter         [3]            (uint32_t    )\n"));
    36   err (_(" * dir_pht_size_address_share [3]            (uint32_t    )\n"));
    37   err (_(" * ras_size_queue             [nb_context]   (uint32_t    )\n"));
    38   err (_(" * upt_size_queue             [nb_context]   (uint32_t    )\n"));
    39   err (_(" * ufpt_size_queue            [nb_context]   (uint32_t    )\n"));
     16  err (_(" * nb_context                                (uint32_t     )\n"));
     17  err (_(" * nb_decod_unit                             (uint32_t     )\n"));
     18  err (_(" * size_address                              (uint32_t     )\n"));
     19  err (_(" * nb_instruction             [nb_context]   (uint32_t     )\n"));
     20  err (_(" * nb_inst_decod              [nb_decod_unit](uint32_t     )\n"));
     21  err (_(" * nb_inst_branch_predict                    (uint32_t     )\n"));
     22  err (_(" * nb_inst_branch_decod                      (uint32_t     )\n"));
     23  err (_(" * nb_inst_branch_update                     (uint32_t     )\n"));
     24  err (_(" * nb_inst_branch_complete                   (uint32_t     )\n"));
     25  err (_(" * btb_size_queue                            (uint32_t     )\n"));
     26  err (_(" * btb_associativity                         (uint32_t     )\n"));
     27  err (_(" * btb_size_counter                          (uint32_t     )\n"));
     28  err (_(" * btb_victim_scheme                         (Tvictim_t    )\n"));
     29  err (_(" * dir_predictor_scheme                      (Tpredictor_t )\n"));
     30  err (_(" * dir_have_bht               [3]            (bool         )\n"));
     31  err (_(" * dir_bht_size_shifter       [3]            (uint32_t     )\n"));
     32  err (_(" * dir_bht_nb_shifter         [3]            (uint32_t     )\n"));
     33  err (_(" * dir_have_pht               [3]            (bool         )\n"));
     34  err (_(" * dir_pht_size_counter       [3]            (uint32_t     )\n"));
     35  err (_(" * dir_pht_nb_counter         [3]            (uint32_t     )\n"));
     36  err (_(" * dir_pht_size_address_share [3]            (uint32_t     )\n"));
     37  err (_(" * dir_pht_scheme             [3]            (Tpht_scheme_t)\n"));
     38  err (_(" * ras_size_queue             [nb_context]   (uint32_t     )\n"));
     39  err (_(" * upt_size_queue             [nb_context]   (uint32_t     )\n"));
     40  err (_(" * ufpt_size_queue            [nb_context]   (uint32_t     )\n"));
    4041
    4142  exit (1);
     
    9798  for (uint32_t i=0; i<3; i++)
    9899    _dir_pht_size_address_share [i]            = fromString<uint32_t    >(argv[x++]);
     100  Tpht_scheme_t _dir_pht_scheme             [3];
     101  for (uint32_t i=0; i<3; i++)
     102    _dir_pht_scheme [i]                        = fromString<Tpht_scheme_t>(argv[x++]);
    99103  uint32_t *   _ras_size_queue                 = new uint32_t    [_nb_context];
    100104  for (uint32_t i=0; i<_nb_context; i++)
     
    137141         _dir_pht_nb_counter        ,
    138142         _dir_pht_size_address_share,
     143         _dir_pht_scheme            ,
    139144         _ras_size_queue            ,
    140145         _upt_size_queue            ,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r145 r146  
    364364//                           reg_UPT_EVENT_STATE [context] = UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT;
    365365
    366 //                           // @@@
    367366// //                           // Have an actual event ?
    368367// //                           if (not reg_EVENT_VAL [context])
     
    629628                          reg_UPT_UPDATE [context] = (depth+1)%_param->_size_upt_queue[context];
    630629                        }
    631                      
     630                      // @@@
    632631                      // special case :
    633632                      if ((upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE) and
     
    636635                          reg_UPT_TOP     [context] = reg_UPT_TOP_EVENT [context];
    637636                          reg_UPT_UPDATE  [context] = reg_UPT_TOP_EVENT [context];
     637                          reg_IS_ACCURATE [context] = true;
     638
     639                          upt_event_state = UPT_EVENT_STATE_OK;
     640                        }
     641
     642                      if ((ok and (upt_event_state == UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT)) and
     643                          (depth == reg_EVENT_DEPTH [context]))
     644                        {
     645                          // reg_UPT_TOP     [context] = reg_UPT_TOP_EVENT [context];
     646                          // reg_UPT_UPDATE  [context] = reg_UPT_TOP_EVENT [context];
    638647                          reg_IS_ACCURATE [context] = true;
    639648
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/include/Parameters.h

    r111 r146  
    2828  {
    2929    //-----[ fields ]------------------------------------------------------------
    30   public : uint32_t     _nb_context                    ;
    31   public : uint32_t     _nb_decod_unit                 ;
    32   public : uint32_t     _size_address                  ;
    33   public : uint32_t *   _nb_instruction                ;//[nb_context]
    34   public : uint32_t *   _nb_inst_decod                 ;//[nb_decod_unit]
    35   public : uint32_t     _nb_inst_branch_predict        ;
    36   public : uint32_t     _nb_inst_branch_decod          ;
    37   public : uint32_t     _nb_inst_branch_update         ;
    38   public : uint32_t     _nb_inst_branch_complete       ;
    39   public : uint32_t     _btb_size_queue                ;
    40   public : uint32_t     _btb_associativity             ;
    41   public : uint32_t     _btb_size_counter              ;
    42   public : Tvictim_t    _btb_victim_scheme             ;
    43   public : Tpredictor_t _dir_predictor_scheme          ;
    44   public : bool         _dir_have_bht               [3];
    45   public : uint32_t     _dir_bht_size_shifter       [3];
    46   public : uint32_t     _dir_bht_nb_shifter         [3];
    47   public : bool         _dir_have_pht               [3];
    48   public : uint32_t     _dir_pht_size_counter       [3];
    49   public : uint32_t     _dir_pht_nb_counter         [3];
    50   public : uint32_t     _dir_pht_size_address_share [3];
    51   public : uint32_t *   _ras_size_queue                ;//[nb_context]
    52   public : uint32_t *   _upt_size_queue                ;//[nb_context]
    53   public : uint32_t *   _ufpt_size_queue               ;//[nb_context]
    54   public : uint32_t     _nb_thread                          ;
    55   public : uint32_t *   _translate_num_context_to_num_thread;//[nb_context]                   
     30  public : uint32_t       _nb_context                    ;
     31  public : uint32_t       _nb_decod_unit                 ;
     32  public : uint32_t       _size_address                  ;
     33  public : uint32_t *     _nb_instruction                ;//[nb_context]
     34  public : uint32_t *     _nb_inst_decod                 ;//[nb_decod_unit]
     35  public : uint32_t       _nb_inst_branch_predict        ;
     36  public : uint32_t       _nb_inst_branch_decod          ;
     37  public : uint32_t       _nb_inst_branch_update         ;
     38  public : uint32_t       _nb_inst_branch_complete       ;
     39  public : uint32_t       _btb_size_queue                ;
     40  public : uint32_t       _btb_associativity             ;
     41  public : uint32_t       _btb_size_counter              ;
     42  public : Tvictim_t      _btb_victim_scheme             ;
     43  public : Tpredictor_t   _dir_predictor_scheme          ;
     44  public : bool           _dir_have_bht               [3];
     45  public : uint32_t       _dir_bht_size_shifter       [3];
     46  public : uint32_t       _dir_bht_nb_shifter         [3];
     47  public : bool           _dir_have_pht               [3];
     48  public : uint32_t       _dir_pht_size_counter       [3];
     49  public : uint32_t       _dir_pht_nb_counter         [3];
     50  public : uint32_t       _dir_pht_size_address_share [3];
     51  public : Tpht_scheme_t  _dir_pht_scheme             [3];
     52  public : uint32_t *     _ras_size_queue                ;//[nb_context]
     53  public : uint32_t *     _upt_size_queue                ;//[nb_context]
     54  public : uint32_t *     _ufpt_size_queue               ;//[nb_context]
     55  public : uint32_t       _nb_thread                          ;
     56  public : uint32_t *     _translate_num_context_to_num_thread;//[nb_context]                   
    5657
    5758
     
    7879
    7980    //-----[ methods ]-----------------------------------------------------------
    80   public : Parameters  (uint32_t     nb_context                    ,
    81                         uint32_t     nb_decod_unit                 ,
    82                         uint32_t     size_address                  ,
    83                         uint32_t *   nb_instruction                ,//[nb_context]
    84                         uint32_t *   nb_inst_decod                 ,//[nb_decod_unit]
    85                         uint32_t     nb_inst_branch_predict        ,
    86                         uint32_t     nb_inst_branch_decod          ,
    87                         uint32_t     nb_inst_branch_update         ,
    88                         uint32_t     nb_inst_branch_complete       ,
    89                         uint32_t     btb_size_queue                ,
    90                         uint32_t     btb_associativity             ,
    91                         uint32_t     btb_size_counter              ,
    92                         Tvictim_t    btb_victim_scheme             ,
    93                         Tpredictor_t dir_predictor_scheme          ,
    94                         bool         dir_have_bht               [3],
    95                         uint32_t     dir_bht_size_shifter       [3],
    96                         uint32_t     dir_bht_nb_shifter         [3],
    97                         bool         dir_have_pht               [3],
    98                         uint32_t     dir_pht_size_counter       [3],
    99                         uint32_t     dir_pht_nb_counter         [3],
    100                         uint32_t     dir_pht_size_address_share [3],
    101                         uint32_t *   ras_size_queue                ,//[nb_context]
    102                         uint32_t *   upt_size_queue                ,//[nb_context]
    103                         uint32_t *   ufpt_size_queue               ,//[nb_context]
    104                         uint32_t     nb_thread                           ,
    105                         uint32_t *   translate_num_context_to_num_thread ,//[nb_context]                   
    106                         bool         is_toplevel=false
     81  public : Parameters  (uint32_t       nb_context                    ,
     82                        uint32_t       nb_decod_unit                 ,
     83                        uint32_t       size_address                  ,
     84                        uint32_t *     nb_instruction                ,//[nb_context]
     85                        uint32_t *     nb_inst_decod                 ,//[nb_decod_unit]
     86                        uint32_t       nb_inst_branch_predict        ,
     87                        uint32_t       nb_inst_branch_decod          ,
     88                        uint32_t       nb_inst_branch_update         ,
     89                        uint32_t       nb_inst_branch_complete       ,
     90                        uint32_t       btb_size_queue                ,
     91                        uint32_t       btb_associativity             ,
     92                        uint32_t       btb_size_counter              ,
     93                        Tvictim_t      btb_victim_scheme             ,
     94                        Tpredictor_t   dir_predictor_scheme          ,
     95                        bool           dir_have_bht               [3],
     96                        uint32_t       dir_bht_size_shifter       [3],
     97                        uint32_t       dir_bht_nb_shifter         [3],
     98                        bool           dir_have_pht               [3],
     99                        uint32_t       dir_pht_size_counter       [3],
     100                        uint32_t       dir_pht_nb_counter         [3],
     101                        uint32_t       dir_pht_size_address_share [3],
     102                        Tpht_scheme_t  dir_pht_scheme             [3],
     103                        uint32_t *     ras_size_queue                ,//[nb_context]
     104                        uint32_t *     upt_size_queue                ,//[nb_context]
     105                        uint32_t *     ufpt_size_queue               ,//[nb_context]
     106                        uint32_t       nb_thread                           ,
     107                        uint32_t *     translate_num_context_to_num_thread ,//[nb_context]                   
     108                        bool           is_toplevel=false
    107109                        );
    108110//   public : Parameters  (Parameters & param) ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Parameters.cpp

    r111 r146  
    1919#undef  FUNCTION
    2020#define FUNCTION "Prediction_unit::Parameters"
    21   Parameters::Parameters (uint32_t     nb_context                    ,
    22                           uint32_t     nb_decod_unit                 ,
    23                           uint32_t     size_address                  ,
    24                           uint32_t *   nb_instruction                ,//[nb_context]
    25                           uint32_t *   nb_inst_decod                 ,//[nb_decod_unit]
    26                           uint32_t     nb_inst_branch_predict        ,
    27                           uint32_t     nb_inst_branch_decod          ,
    28                           uint32_t     nb_inst_branch_update         ,
    29                           uint32_t     nb_inst_branch_complete       ,
    30                           uint32_t     btb_size_queue                ,
    31                           uint32_t     btb_associativity             ,
    32                           uint32_t     btb_size_counter              ,
    33                           Tvictim_t    btb_victim_scheme             ,
    34                           Tpredictor_t dir_predictor_scheme          ,
    35                           bool         dir_have_bht               [3],
    36                           uint32_t     dir_bht_size_shifter       [3],
    37                           uint32_t     dir_bht_nb_shifter         [3],
    38                           bool         dir_have_pht               [3],
    39                           uint32_t     dir_pht_size_counter       [3],
    40                           uint32_t     dir_pht_nb_counter         [3],
    41                           uint32_t     dir_pht_size_address_share [3],
    42                           uint32_t *   ras_size_queue                ,//[nb_context]
    43                           uint32_t *   upt_size_queue                ,//[nb_context]
    44                           uint32_t *   ufpt_size_queue               ,//[nb_context]
    45                           uint32_t     nb_thread                           ,
    46                           uint32_t *   translate_num_context_to_num_thread ,//[nb_context]                   
    47                           bool         is_toplevel
     21  Parameters::Parameters (uint32_t       nb_context                    ,
     22                          uint32_t       nb_decod_unit                 ,
     23                          uint32_t       size_address                  ,
     24                          uint32_t *     nb_instruction                ,//[nb_context]
     25                          uint32_t *     nb_inst_decod                 ,//[nb_decod_unit]
     26                          uint32_t       nb_inst_branch_predict        ,
     27                          uint32_t       nb_inst_branch_decod          ,
     28                          uint32_t       nb_inst_branch_update         ,
     29                          uint32_t       nb_inst_branch_complete       ,
     30                          uint32_t       btb_size_queue                ,
     31                          uint32_t       btb_associativity             ,
     32                          uint32_t       btb_size_counter              ,
     33                          Tvictim_t      btb_victim_scheme             ,
     34                          Tpredictor_t   dir_predictor_scheme          ,
     35                          bool           dir_have_bht               [3],
     36                          uint32_t       dir_bht_size_shifter       [3],
     37                          uint32_t       dir_bht_nb_shifter         [3],
     38                          bool           dir_have_pht               [3],
     39                          uint32_t       dir_pht_size_counter       [3],
     40                          uint32_t       dir_pht_nb_counter         [3],
     41                          uint32_t       dir_pht_size_address_share [3],
     42                          Tpht_scheme_t  dir_pht_scheme             [3],
     43                          uint32_t *     ras_size_queue                ,//[nb_context]
     44                          uint32_t *     upt_size_queue                ,//[nb_context]
     45                          uint32_t *     ufpt_size_queue               ,//[nb_context]
     46                          uint32_t       nb_thread                           ,
     47                          uint32_t *     translate_num_context_to_num_thread ,//[nb_context]                   
     48                          bool           is_toplevel
    4849                          )
    4950  {
     
    7374        _dir_pht_nb_counter         [i] = dir_pht_nb_counter         [i];
    7475        _dir_pht_size_address_share [i] = dir_pht_size_address_share [i];
     76        _dir_pht_scheme             [i] = dir_pht_scheme             [i];
    7577      }
    7678    _ras_size_queue             = ras_size_queue            ;
     
    123125       _dir_pht_size_counter      ,
    124126       _dir_pht_nb_counter        ,
    125        _dir_pht_size_address_share);
     127       _dir_pht_size_address_share,
     128       _dir_pht_scheme
     129       );
    126130
    127131    _size_history      = _param_dir->_size_history;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Parameters_print.cpp

    r95 r146  
    5757        xml.singleton_begin("dir_predictor_"+toString(i)+"_pht_nb_counter        "); xml.attribut("value",toString(_dir_pht_nb_counter         [i])); xml.singleton_end();
    5858        xml.singleton_begin("dir_predictor_"+toString(i)+"_pht_size_address_share"); xml.attribut("value",toString(_dir_pht_size_address_share [i])); xml.singleton_end();
     59        xml.singleton_begin("dir_predictor_"+toString(i)+"_pht_scheme            "); xml.attribut("value",toString(_dir_pht_scheme             [i])); xml.singleton_end();
    5960      }
    6061
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/SelfTest/src/main.cpp

    r128 r146  
    99#include "Behavioural/Custom/include/Custom_example.h"
    1010
    11 #define NB_PARAMS 13+7*3
     11#define NB_PARAMS 13+8*3
    1212
    1313void usage (int argc, char * argv[])
     
    4343  err (_(" * dir_pht_nb_counter            [3]                          (uint32_t             )\n"));
    4444  err (_(" * dir_pht_size_address_share    [3]                          (uint32_t             )\n"));
     45  err (_(" * dir_pht_scheme                [3]                          (Tpht_scheme_t        )\n"));
    4546  err (_(" * ras_size_queue                [nb_context]                 (uint32_t             )\n"));
    4647  err (_(" * upt_size_queue                [nb_context]                 (uint32_t             )\n"));
     
    134135  Tvictim_t            _btb_victim_scheme                 = fromString<Tvictim_t        >(argv[x++]);
    135136  Tpredictor_t         _dir_predictor_scheme              = fromString<Tpredictor_t     >(argv[x++]);
    136   bool               * _dir_have_bht                      = new bool    [3];
    137   uint32_t           * _dir_bht_size_shifter              = new uint32_t[3];
    138   uint32_t           * _dir_bht_nb_shifter                = new uint32_t[3];
    139   bool               * _dir_have_pht                      = new bool    [3];
    140   uint32_t           * _dir_pht_size_counter              = new uint32_t[3];
    141   uint32_t           * _dir_pht_nb_counter                = new uint32_t[3];
    142   uint32_t           * _dir_pht_size_address_share        = new uint32_t[3];
    143 
    144   for (uint32_t i=0; i<3; i++)
    145     _dir_have_bht               [i] = fromString<bool    >(argv[x++]);
    146   for (uint32_t i=0; i<3; i++)
    147     _dir_bht_size_shifter       [i] = fromString<uint32_t>(argv[x++]);
    148   for (uint32_t i=0; i<3; i++)
    149     _dir_bht_nb_shifter         [i] = fromString<uint32_t>(argv[x++]);
    150   for (uint32_t i=0; i<3; i++)
    151     _dir_have_pht               [i] = fromString<bool    >(argv[x++]);
    152   for (uint32_t i=0; i<3; i++)
    153     _dir_pht_size_counter       [i] = fromString<uint32_t>(argv[x++]);
    154   for (uint32_t i=0; i<3; i++)
    155     _dir_pht_nb_counter         [i] = fromString<uint32_t>(argv[x++]);
    156   for (uint32_t i=0; i<3; i++)
    157     _dir_pht_size_address_share [i] = fromString<uint32_t>(argv[x++]);
     137  bool               * _dir_have_bht                      = new bool          [3];
     138  uint32_t           * _dir_bht_size_shifter              = new uint32_t      [3];
     139  uint32_t           * _dir_bht_nb_shifter                = new uint32_t      [3];
     140  bool               * _dir_have_pht                      = new bool          [3];
     141  uint32_t           * _dir_pht_size_counter              = new uint32_t      [3];
     142  uint32_t           * _dir_pht_nb_counter                = new uint32_t      [3];
     143  uint32_t           * _dir_pht_size_address_share        = new uint32_t      [3];
     144  Tpht_scheme_t      * _dir_pht_scheme                    = new Tpht_scheme_t [3];
     145
     146  for (uint32_t i=0; i<3; i++)
     147    _dir_have_bht               [i] = fromString<bool         >(argv[x++]);
     148  for (uint32_t i=0; i<3; i++)
     149    _dir_bht_size_shifter       [i] = fromString<uint32_t     >(argv[x++]);
     150  for (uint32_t i=0; i<3; i++)
     151    _dir_bht_nb_shifter         [i] = fromString<uint32_t     >(argv[x++]);
     152  for (uint32_t i=0; i<3; i++)
     153    _dir_have_pht               [i] = fromString<bool         >(argv[x++]);
     154  for (uint32_t i=0; i<3; i++)
     155    _dir_pht_size_counter       [i] = fromString<uint32_t     >(argv[x++]);
     156  for (uint32_t i=0; i<3; i++)
     157    _dir_pht_nb_counter         [i] = fromString<uint32_t     >(argv[x++]);
     158  for (uint32_t i=0; i<3; i++)
     159    _dir_pht_size_address_share [i] = fromString<uint32_t     >(argv[x++]);
     160  for (uint32_t i=0; i<3; i++)
     161    _dir_pht_scheme             [i] = fromString<Tpht_scheme_t>(argv[x++]);
    158162
    159163  uint32_t           * _ras_size_queue                    = new uint32_t [_nb_context];
     
    211215         _dir_pht_nb_counter                  ,
    212216         _dir_pht_size_address_share          ,
     217         _dir_pht_scheme                      ,
    213218         _ras_size_queue                      ,
    214219         _upt_size_queue                      ,
     
    253258  delete [] _dir_pht_nb_counter                  ;
    254259  delete [] _dir_pht_size_address_share          ;
     260  delete [] _dir_pht_scheme                      ;
    255261  delete [] _ufpt_size_queue                   ;
    256262  delete [] _upt_size_queue                    ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/include/Parameters.h

    r136 r146  
    7171  public : uint32_t                _dir_pht_nb_counter         [3]       ;
    7272  public : uint32_t                _dir_pht_size_address_share [3]       ;
     73  public : Tpht_scheme_t           _dir_pht_scheme             [3]       ;
    7374  public : uint32_t              * _ras_size_queue                       ;//[nb_context]
    7475  public : uint32_t              * _upt_size_queue                       ;//[nb_context]
     
    144145                        uint32_t              * dir_pht_nb_counter                  ,//[3]
    145146                        uint32_t              * dir_pht_size_address_share          ,//[3]
     147                        Tpht_scheme_t         * dir_pht_scheme                      ,//[3]
    146148                        uint32_t              * ras_size_queue                      ,
    147149                        uint32_t              * upt_size_queue                      ,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Parameters.cpp

    r136 r146  
    5555                          uint32_t              * dir_pht_nb_counter                  ,//[3]
    5656                          uint32_t              * dir_pht_size_address_share          ,//[3]
     57                          Tpht_scheme_t         * dir_pht_scheme                      ,//[3]
    5758                          uint32_t              * ras_size_queue                      ,
    5859                          uint32_t              * upt_size_queue                      ,
     
    104105        _dir_pht_nb_counter         [i] = dir_pht_nb_counter         [i];
    105106        _dir_pht_size_address_share [i] = dir_pht_size_address_share [i];
     107        _dir_pht_scheme             [i] = dir_pht_scheme             [i];
    106108      }
    107109    _ras_size_queue                      = ras_size_queue                      ;
     
    157159       _dir_pht_nb_counter                 ,
    158160       _dir_pht_size_address_share         ,
     161       _dir_pht_scheme                     ,
    159162       _ras_size_queue                     ,
    160163       _upt_size_queue                     ,
Note: See TracChangeset for help on using the changeset viewer.