Ignore:
Timestamp:
Mar 6, 2007, 3:34:04 PM (17 years ago)
Author:
kane
Message:

1) Ajout d'un "printer" XML pour la configuration de paramètres

2) Fin du composant "Two_Level_Branch_Predictor"

validation * systemc

  • vhdl
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp

    r2 r3  
    3535    signal_PREDICT_BHT_ACK          = new SC_SIGNAL(Tcontrol_t)     * [_param._nb_prediction];
    3636    signal_PREDICT_BHT_ADDRESS      = new SC_SIGNAL(Taddress_t)     * [_param._nb_prediction];
    37     signal_PREDICT_BHT_HISTORY      = new SC_SIGNAL(Tbht_history_t) * [_param._nb_prediction];
    3837      }
    3938    if (_param._have_pht)
     
    4544    for (uint32_t i=0; i<_param._nb_prediction; i++)
    4645      {
    47         rename = " in_PREDICT_VAL_"        +toString(i);
     46        rename = "in_PREDICT_VAL_"         +toString(i);
    4847         in_PREDICT_VAL                 [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    4948
     
    5150        out_PREDICT_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    5251
    53         rename = " in_PREDICT_ADDRESS_"    +toString(i);
     52        rename = "in_PREDICT_ADDRESS_"     +toString(i);
    5453         in_PREDICT_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
    5554
     
    7372        rename = "signal_PREDICT_BHT_ADDRESS_"+toString(i);
    7473        signal_PREDICT_BHT_ADDRESS      [i] = new SC_SIGNAL(Taddress_t)     (rename.c_str());
    75 
    76         rename = "signal_PREDICT_BHT_HISTORY_"+toString(i);
    77         signal_PREDICT_BHT_HISTORY      [i] = new SC_SIGNAL(Tbht_history_t) (rename.c_str());
    7874          }
    7975
     
    9591    if (_param._have_pht)
    9692     in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete];
    97      in_BRANCH_COMPLETE_HIT         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
     93     in_BRANCH_COMPLETE_DIRECTION   = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
    9894    if (_param._have_bht)
    9995      {
     
    109105    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    110106      {
    111         rename = " in_BRANCH_COMPLETE_VAL_"        +toString(i);
     107        rename = "in_BRANCH_COMPLETE_VAL_"         +toString(i);
    112108         in_BRANCH_COMPLETE_VAL         [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    113109
     
    115111        out_BRANCH_COMPLETE_ACK         [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    116112
    117         rename = " in_BRANCH_COMPLETE_ADDRESS_"    +toString(i);
     113        rename = "in_BRANCH_COMPLETE_ADDRESS_"     +toString(i);
    118114         in_BRANCH_COMPLETE_ADDRESS     [i] = new SC_IN (Taddress_t)     (rename.c_str());
    119115
    120116        if (_param._have_bht)
    121117          {
    122         rename = " in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i);
     118        rename = "in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i);
    123119         in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str());
    124120          }
    125         if (_param._have_bht)
    126           {
    127         rename = " in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);
     121        if (_param._have_pht)
     122          {
     123        rename = "in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);
    128124         in_BRANCH_COMPLETE_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str());
    129125          }
    130         rename = " in_BRANCH_COMPLETE_HIT_"        +toString(i);
    131          in_BRANCH_COMPLETE_HIT         [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
     126        rename = "in_BRANCH_COMPLETE_DIRECTION_"  +toString(i);
     127         in_BRANCH_COMPLETE_DIRECTION   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    132128        if (_param._have_bht)
    133129          {
     
    155151      {
    156152        name_component = _name+"_Branch_History_Table";
     153
     154        log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
    157155       
    158156        component_Branch_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table (name_component.c_str()               ,
     
    170168            (*(component_Branch_History_Table->out_PREDICT_ACK             [i]))    (*(signal_PREDICT_BHT_ACK      [i]));
    171169            (*(component_Branch_History_Table-> in_PREDICT_ADDRESS         [i]))    (*(signal_PREDICT_BHT_ADDRESS  [i]));
    172             (*(component_Branch_History_Table->out_PREDICT_HISTORY         [i]))    (*(signal_PREDICT_BHT_HISTORY  [i]));
     170            (*(component_Branch_History_Table->out_PREDICT_HISTORY         [i]))    (*(   out_PREDICT_BHT_HISTORY  [i]));
    173171          }
    174172       
    175173        for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    176174          {
    177             (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL     [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
    178             (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK     [i]))    (*(signal_BRANCH_COMPLETE_BHT_ACK     [i]));
    179             (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i]))    (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i]));
    180             (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY [i]))    (*(    in_BRANCH_COMPLETE_BHT_HISTORY [i]));
    181             (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HIT     [i]))    (*(    in_BRANCH_COMPLETE_HIT         [i]));
     175            (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
     176            (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK       [i]))    (*(signal_BRANCH_COMPLETE_BHT_ACK     [i]));
     177            (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))    (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i]));
     178            (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))    (*(    in_BRANCH_COMPLETE_BHT_HISTORY [i]));
     179            (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION   [i]));
    182180          }
    183181      }
     
    187185      {
    188186        name_component = _name+"_Pattern_History_Table";
     187       
     188        log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
    189189       
    190190        component_Pattern_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Pattern_History_Table (name_component.c_str()               ,
     
    207207        for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    208208          {
    209             (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL     [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
    210             (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK     [i]))    (*(signal_BRANCH_COMPLETE_PHT_ACK     [i]));
    211             (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i]))    (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i]));
    212             (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY [i]))    (*(    in_BRANCH_COMPLETE_PHT_HISTORY [i]));
    213             (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HIT     [i]))    (*(    in_BRANCH_COMPLETE_HIT         [i]));
     209            (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
     210            (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK       [i]))    (*(signal_BRANCH_COMPLETE_PHT_ACK     [i]));
     211            (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))    (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i]));
     212            (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))    (*(    in_BRANCH_COMPLETE_PHT_HISTORY [i]));
     213            (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION   [i]));
    214214          }
    215215      }
    216216
    217217    // =====[ component_Two_Level_Branch_Predictor_Glue ]===========================   
    218     if (_param._have_pht)
    219       {
    220         name_component = _name+"_Two_Level_Branch_Predictor_Glue";
    221        
    222         component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str()               ,
     218    name_component = _name+"_Two_Level_Branch_Predictor_Glue";
     219   
     220    log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
     221   
     222    component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str()               ,
    223223#ifdef STATISTICS
    224                                                                                                                                                                                                                        _param_statistics                    ,
    225 #endif
    226                                                                                                                                                                                                                        *(_param._param_two_level_branch_predictor_glue));
    227        
    228         // Instantiation
     224                                                                                                                                                                                                                   _param_statistics                    ,
     225#endif
     226                                                                                                                                                                                                                   *(_param._param_two_level_branch_predictor_glue));
     227   
     228    // Instantiation
    229229#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    230         (*(component_Two_Level_Branch_Predictor_Glue->in_CLOCK))        (*(in_CLOCK));
     230    (*(component_Two_Level_Branch_Predictor_Glue->in_CLOCK))        (*(in_CLOCK));
    231231#endif 
    232         for (uint32_t i=0; i<_param._nb_prediction; i++)
    233           {
    234             if (_param._have_bht)
    235               {
     232    for (uint32_t i=0; i<_param._nb_prediction; i++)
     233      {
     234        if (_param._have_bht)
     235          {
    236236            (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_ACK             [i])) (*(signal_PREDICT_BHT_ACK              [i]));
    237237            (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_BHT_ADDRESS         [i])) (*(signal_PREDICT_BHT_ADDRESS          [i]));
    238               }                                                                                                                                                                   
    239             if (_param._have_pht)                                                                                                                         
    240               {                                                                                                                                                                   
     238          }                                                                                                                                                                       
     239        if (_param._have_pht)                                                                                                                     
     240          {                                                                                                                                                                       
    241241            (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_PHT_ACK             [i])) (*(signal_PREDICT_PHT_ACK              [i]));
    242242            (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_PHT_ADDRESS         [i])) (*(signal_PREDICT_PHT_ADDRESS          [i]));
    243               }                                                                                                                                                                   
    244             if (_param._have_bht and _param._have_pht)                                                                                   
    245               {                                                                                                                                                                   
    246             (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY         [i])) (*(signal_PREDICT_BHT_HISTORY          [i]));
    247               }                                                                                                                                                                   
    248             (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK                 [i])) (*(   out_PREDICT_ACK                  [i]));
    249             (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS              [i]));
    250           }
    251        
    252         for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    253           {
    254             if (_param._have_bht)
    255               {
     243          }                                                                                                                                                                       
     244        if (_param._have_bht and _param._have_pht)                                                                                       
     245          {                                                                                                                                                                       
     246            (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY         [i])) (*(   out_PREDICT_BHT_HISTORY          [i]));
     247          }                                                                                                                                                                       
     248        (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK                 [i])) (*(   out_PREDICT_ACK                  [i]));
     249        (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS              [i]));
     250      }
     251   
     252    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
     253      {
     254        if (_param._have_bht)
     255          {
    256256            (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_ACK     [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK      [i]));
    257257            (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS  [i]));
    258               }                                                                                                                                                   
    259             if (_param._have_pht)                                                                                                         
    260               {                                                                                                                                                   
     258          }                                                                                                                                                       
     259        if (_param._have_pht)                                                                                                     
     260          {                                                                                                                                                       
    261261            (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_PHT_ACK     [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK      [i]));
    262262            (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS  [i]));
    263               }                                                                                                                                                   
    264             if (_param._have_bht and _param._have_pht)                                                                           
    265               {                                                                                                                                                   
     263          }                                                                                                                                                       
     264        if (_param._have_bht and _param._have_pht)                                                                               
     265          {                                                                                                                                                       
    266266            (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(    in_BRANCH_COMPLETE_BHT_HISTORY  [i]));
    267               }                                                                                                                                                   
    268             (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK         [i])) (*(   out_BRANCH_COMPLETE_ACK          [i]));
    269             (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS      [i]));
    270           }
    271       }
    272 
     267          }                                                                                                                                                       
     268        (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK         [i])) (*(   out_BRANCH_COMPLETE_ACK          [i]));
     269        (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS      [i]));
     270      }
     271 
    273272    log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End");
    274273  };
    275 
     274 
    276275}; // end namespace two_level_branch_predictor
    277276}; // end namespace meta_predictor
Note: See TracChangeset for help on using the changeset viewer.