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/Update_Prediction_Table/src/Parameters.cpp

    r82 r88  
    2121#define FUNCTION "Update_Prediction_Table::Parameters"
    2222  Parameters::Parameters (uint32_t   nb_context             ,
    23                           uint32_t * size_queue             ,
     23                          uint32_t * size_upt_queue         ,
     24                          uint32_t * size_ufpt_queue        ,
    2425                          uint32_t   size_address           ,
    2526                          uint32_t   nb_inst_predict        ,
     
    2829                          uint32_t   nb_inst_update         ,
    2930                          uint32_t   size_history           ,
    30                           uint32_t * size_ras_index         )
     31                          uint32_t * size_ras_index         ,
     32                          bool       is_toplevel):
     33    _not_accurate_block_predict (false)
    3134  {
    3235    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
    3336
    3437    _nb_context              = nb_context             ;
    35     _size_queue              = size_queue             ;
    36     _size_address            = size_address           ;
     38    _size_upt_queue          = size_upt_queue         ;
     39    _size_ufpt_queue         = size_ufpt_queue        ;
     40//  _size_address            = size_address           ;
    3741    _nb_inst_predict         = nb_inst_predict        ;
    3842    _nb_inst_decod           = nb_inst_decod          ;
     
    4246    _size_ras_index          = size_ras_index         ;
    4347   
    44     _size_context_id         = log2(nb_context);
    45     _size_depth              = new uint32_t[_nb_context];
    46     _have_port_depth         = new bool    [_nb_context];
    47     for (uint32_t i=0; i<_nb_context; i++)
    48       {
    49         _size_depth      [i] = log2(_size_queue[i]);
    50         _have_port_depth [i] = (_size_depth [i] > 0);
    51       }
    52     _max_size_depth          = max<uint32_t>(_size_depth,_nb_context);
    5348    _max_size_ras_index      = max<uint32_t>(_size_ras_index,nb_context);
    5449
    55     _have_port_context_id    = _size_context_id> 0;
    56     _have_port_max_depth     = _max_size_depth > 0;
    5750    _have_port_history       = _size_history   > 0;
     51
     52    test();
     53
     54    if (is_toplevel)
     55      {
     56        _size_instruction_address = size_address;
     57        _size_context_id          = log2(nb_context);
     58        _size_depth               = log2(max<uint32_t>(_size_upt_queue,_nb_context));
     59
     60        _have_port_context_id    = _size_context_id> 0;
     61        _have_port_depth          = _size_depth > 0;
     62
     63        copy ();
     64      }
    5865   
    59     test();
    6066    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
    6167  };
     
    7581  {
    7682    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
    77     delete [] _size_depth     ;
    78     delete [] _have_port_depth;
     83//     delete [] _size_depth     ;
     84//     delete [] _have_port_depth;
     85    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
     86  };
     87
     88#undef  FUNCTION
     89#define FUNCTION "Update_Prediction_Table::copy"
     90  void Parameters::copy (void)
     91  {
     92    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
    7993    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
    8094  };
Note: See TracChangeset for help on using the changeset viewer.