Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

File:
1 edited

Legend:

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

    r82 r88  
    4141                          uint32_t     dir_pht_size_address_share [3],
    4242                          uint32_t *   ras_size_queue                ,//[nb_context]
    43                           uint32_t *   upt_size_queue                 //[nb_context]
     43                          uint32_t *   upt_size_queue                ,//[nb_context]
     44                          bool         is_toplevel
    4445                          )
    4546  {
     
    7273    _ras_size_queue             = ras_size_queue            ;
    7374    _upt_size_queue             = upt_size_queue            ;
    74 
    75     _size_context_id            = log2(_nb_context);
    76 //   public : uint32_t *   _size_inst_ifetch_ptr          ;//[nb_context]
    77 
    78     _size_depth                 = new uint32_t [_nb_context];
     75   
     76    _array_size_depth           = new uint32_t [_nb_context];
    7977    _size_ras_index             = new uint32_t [_nb_context];
     78
    8079    for (uint32_t i=0; i<_nb_context; i++)
    8180      {
    82         _size_depth    [i] = log2(_upt_size_queue [i]);
    83         _size_ras_index [i] = log2(_ras_size_queue [i]);
     81        _array_size_depth [i] = log2(_upt_size_queue [i]);
     82        _size_ras_index   [i] = log2(_ras_size_queue [i]);
    8483      }
    85 
    86     _max_size_depth             = max<uint32_t>(_size_depth,_nb_context);
    87     _have_port_context_id       = (_size_context_id > 0);
    88     _have_port_max_depth        = (_max_size_depth  > 0);
    89 //   public : bool     *   _have_port_inst_ifetch_ptr     ;//[nb_context]
    9084
    9185    _param_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue   ::Parameters
     
    9488       _size_address          ,
    9589       _nb_instruction        ,
    96        _size_depth            ,
     90       _array_size_depth      ,
    9791       _nb_inst_decod         ,
    9892       _nb_inst_branch_predict,
     
    10094       _nb_inst_branch_update );
    10195
    102     _size_inst_ifetch_ptr      = _param_glue->_size_inst_ifetch_ptr     ;
    103     _have_port_depth           = _param_glue->_have_port_depth;
    104     _have_port_inst_ifetch_ptr = _param_glue->_have_port_inst_ifetch_ptr;
    105     _have_port_history         = (_size_history > 0);
    106    
    10796    _param_btb  = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::branch_target_buffer   ::Parameters
    10897      (_nb_context            ,
     
    116105       _nb_inst_branch_update ,
    117106       _btb_victim_scheme     );
    118 
     107   
    119108    _param_dir  = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction              ::Parameters
    120109      (_dir_predictor_scheme      ,
     
    130119       _dir_pht_size_address_share);
    131120
    132     _size_history = _param_dir->_size_history;
     121    _size_history      = _param_dir->_size_history;
     122    _have_port_history = (_size_history > 0);
    133123
    134124    _param_ras  = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::return_address_stack   ::Parameters
     
    150140       _size_history           ,
    151141       _size_ras_index         );
     142
     143
     144    if (is_toplevel)
     145      {
     146        _size_context_id           = log2(_nb_context);
     147        _size_depth                = max<uint32_t>(_array_size_depth,_nb_context);
     148        _size_inst_ifetch_ptr      = log2(max<uint32_t>(_nb_instruction,_nb_context));
     149        _size_instruction_address  = size_address;
     150//      _size_nb_inst_decod        = ;
     151//      _size_nb_inst_commit       = ;
     152//      _size_ifetch_queue_ptr     = ;
     153   
     154        _have_port_context_id      = (_size_context_id > 0);
     155        _have_port_depth           = (_size_depth  > 0);
     156        _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0;
     157//      _have_port_ifetch_queue_ptr= _size_ifetch_queue_ptr > 0;
     158
     159        copy ();
     160      }
    152161
    153162    test();
     
    176185    delete _param_glue;
    177186
    178     delete [] _size_depth    ;
     187    delete [] _array_size_depth;
    179188    delete [] _size_ras_index;
     189
     190    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
     191  };
     192
     193#undef  FUNCTION
     194#define FUNCTION "Prediction_unit::copy"
     195  void Parameters::copy (void)
     196  {
     197    log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
     198 
     199    COPY(_param_btb );
     200    COPY(_param_dir );
     201    COPY(_param_ras );
     202    COPY(_param_upt );
     203    COPY(_param_glue);
    180204
    181205    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
Note: See TracChangeset for help on using the changeset viewer.