Ignore:
Timestamp:
Jul 5, 2007, 5:50:19 PM (17 years ago)
Author:
rosiere
Message:

Modification des classes d'encapsulation des interfaces :

  • gère les signaux à écrire dans le vhdl
  • les traces pour le testbench
  • la génération des vhdl structurelles

-> test sur la Pattern History Table

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src
Files:
2 deleted
8 edited

Legend:

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

    r3 r42  
    3434    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Two_Level_Branch_Predictor_Glue","Begin");
    3535
     36#ifdef SYSTEMC
     37    allocation ();
     38#endif
     39
    3640#ifdef STATISTICS
    3741    // Allocation of statistics
     
    4145#endif
    4246
    43 #ifdef VHDL_TESTBENCH
    44     // Creation of a testbench
    45     //  -> port
    46     //  -> clock's signals
    47     _vhdl_testbench = new Vhdl_Testbench (_name);
    48     vhdl_testbench_port           ();
    49     _vhdl_testbench->set_clock    ("in_CLOCK",false);
    50 #endif
    51 
    5247#ifdef VHDL
    5348    // generate the vhdl
     
    5651
    5752#ifdef SYSTEMC
    58     allocation ();
    59 
    6053#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    6154    SC_METHOD (transition);
     
    192185    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"~Two_Level_Branch_Predictor_Glue","Begin");
    193186
    194 #ifdef VHDL_TESTBENCH
    195     // generate the test bench
    196     _vhdl_testbench->generate_file();
    197     delete _vhdl_testbench;
    198 #endif
    199 
    200187#ifdef STATISTICS
    201188    _stat->generate_file(statistics(0));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_allocation.cpp

    r2 r42  
    2424    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","Begin");
    2525
    26 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    27     in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
     26    _component   = new Component ();
     27
     28    Entity * entity = _component->set_entity (_name                 
     29                                             ,"Two_Level_Branch_Predictor_Glue"
     30#ifdef POSITION
     31                                             ,COMBINATORY
    2832#endif
     33                                              );
    2934   
     35    _interfaces = entity->set_interfaces();
     36
     37    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     38    {
     39      Interface * interface = _interfaces->set_interface(""
     40#ifdef POSITION
     41                                                         , IN 
     42                                                         , SOUTH
     43                                                         , "Generalist interface"
     44#endif
     45                                                         );
     46     
     47      in_CLOCK              = interface->set_signal_clk              ("clock" ,1,CLOCK_VHDL_NO);
     48      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_NO);
     49    }
     50   
     51    // ~~~~~[ Interface : "Predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3052    if (_param._have_bht)
    3153      {
     
    4567    for (uint32_t i=0; i<_param._nb_prediction; i++)
    4668      {
     69        Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
     70#ifdef POSITION
     71                                                                , IN 
     72                                                                , WEST
     73                                                                , "Interface Predict"
     74#endif
     75                                                                );
     76
    4777        if (_param._have_bht)
    4878          {
    49         rename = " in_PREDICT_BHT_ACK_"    +toString(i);
    50          in_PREDICT_BHT_ACK             [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    51 
    52         rename = "out_PREDICT_BHT_ADDRESS_"+toString(i);
    53         out_PREDICT_BHT_ADDRESS         [i] = new SC_OUT(Taddress_t)     (rename.c_str());
     79         in_PREDICT_BHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("bht_ack"    ,1);
     80        out_PREDICT_BHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("bht_address",_param._bht_size_address);
    5481          }
    5582        if (_param._have_pht)
    5683          {
    57         rename = " in_PREDICT_PHT_ACK_"    +toString(i);
    58          in_PREDICT_PHT_ACK             [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    59        
    60         rename = "out_PREDICT_PHT_ADDRESS_"+toString(i);
    61         out_PREDICT_PHT_ADDRESS         [i] = new SC_OUT(Taddress_t)     (rename.c_str());
     84         in_PREDICT_PHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("pht_ack"    ,1);
     85        out_PREDICT_PHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("pht_address",_param._pht_size_address);
    6286          }
    6387        if (_param._have_bht and _param._have_pht)
    64           {
    65         rename = " in_PREDICT_BHT_HISTORY_"+toString(i);
    66          in_PREDICT_BHT_HISTORY         [i] = new SC_IN (Tbht_history_t) (rename.c_str());
    67           }
    68         rename = "out_PREDICT_ACK_"        +toString(i);
    69         out_PREDICT_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    70        
    71         rename = " in_PREDICT_ADDRESS_"    +toString(i);
    72          in_PREDICT_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
     88         in_PREDICT_BHT_HISTORY         [i] = interface->set_signal_in  <Tbht_history_t> ("bht_history",_param._bht_size_history);
     89        out_PREDICT_ACK                 [i] = interface->set_signal_out <Tcontrol_t>     ("ack"        ,1);
     90         in_PREDICT_ADDRESS             [i] = interface->set_signal_in  <Taddress_t>     ("address"    ,_param._size_address);
    7391      }
     92
     93    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    7494
    7595    if (_param._have_bht)
     
    91111    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    92112      {
     113        Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
     114#ifdef POSITION
     115                                                                , IN 
     116                                                                , EAST
     117                                                                , "Interface branch complete"
     118#endif
     119                                                                );
    93120        if (_param._have_bht)
    94121          {
    95         rename = " in_BRANCH_COMPLETE_BHT_ACK_"    +toString(i);
    96          in_BRANCH_COMPLETE_BHT_ACK             [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    97        
    98         rename = "out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i);
    99         out_BRANCH_COMPLETE_BHT_ADDRESS         [i] = new SC_OUT(Taddress_t)     (rename.c_str());
     122         in_BRANCH_COMPLETE_BHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("bht_ack"    ,1);
     123        out_BRANCH_COMPLETE_BHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("bht_address",_param._bht_size_address);
    100124          }
    101125        if (_param._have_pht)
    102126          {
    103         rename = " in_BRANCH_COMPLETE_PHT_ACK_"    +toString(i);
    104          in_BRANCH_COMPLETE_PHT_ACK             [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    105 
    106         rename = "out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i);
    107         out_BRANCH_COMPLETE_PHT_ADDRESS         [i] = new SC_OUT(Taddress_t)     (rename.c_str());
     127         in_BRANCH_COMPLETE_PHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("pht_ack"    ,1);
     128        out_BRANCH_COMPLETE_PHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("pht_address",_param._pht_size_address);
    108129          }
    109130        if (_param._have_bht and _param._have_pht)
    110           {
    111         rename = " in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i);
    112          in_BRANCH_COMPLETE_BHT_HISTORY         [i] = new SC_IN (Tbht_history_t) (rename.c_str());
    113           }
    114         rename = "out_BRANCH_COMPLETE_ACK_"        +toString(i);
    115         out_BRANCH_COMPLETE_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    116        
    117         rename = " in_BRANCH_COMPLETE_ADDRESS_"    +toString(i);
    118          in_BRANCH_COMPLETE_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
     131         in_BRANCH_COMPLETE_BHT_HISTORY         [i] = interface->set_signal_in  <Tbht_history_t> ("bht_history",_param._bht_size_history);
     132
     133        out_BRANCH_COMPLETE_ACK                 [i] = interface->set_signal_out <Tcontrol_t>     ("ack"        ,1);
     134         in_BRANCH_COMPLETE_ADDRESS             [i] = interface->set_signal_in  <Taddress_t>     ("address"    ,_param._size_address);
    119135      }
    120136
    121137    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     138
     139#ifdef POSITION
     140    _component->generate_file();
     141#endif
    122142
    123143    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_deallocation.cpp

    r2 r42  
    2222    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"deallocation","Begin");
    2323
    24     delete in_CLOCK;
     24    delete     in_CLOCK;
     25    delete     in_NRESET;
    2526
    26     for (uint32_t i=0; i<_param._nb_prediction; i++)
    27       {
    28         if (_param._have_bht)
    29           {
    30         delete  in_PREDICT_BHT_ACK             [i];
    31         delete out_PREDICT_BHT_ADDRESS         [i];
    32           }
    33         if (_param._have_pht)
    34           {
    35         delete  in_PREDICT_PHT_ACK             [i];
    36         delete out_PREDICT_PHT_ADDRESS         [i];
    37           }
    38         if (_param._have_bht and _param._have_pht)
    39         delete  in_PREDICT_BHT_HISTORY         [i];
    40         delete out_PREDICT_ACK                 [i];
    41         delete  in_PREDICT_ADDRESS             [i];
    42       }
    4327    if (_param._have_bht)
    4428      {
    45     delete in_PREDICT_BHT_ACK    ;
    46     delete out_PREDICT_BHT_ADDRESS;
     29    delete [] in_PREDICT_BHT_ACK    ;
     30    delete [] out_PREDICT_BHT_ADDRESS;
    4731      }
    4832    if (_param._have_pht)
    4933      {
    50     delete in_PREDICT_PHT_ACK    ;
    51     delete out_PREDICT_PHT_ADDRESS;
     34    delete [] in_PREDICT_PHT_ACK    ;
     35    delete [] out_PREDICT_PHT_ADDRESS;
    5236      }
    5337    if (_param._have_bht and _param._have_pht)
    54     delete in_PREDICT_BHT_HISTORY;
     38    delete [] in_PREDICT_BHT_HISTORY;
    5539   
    56     delete out_PREDICT_ACK        ;
    57     delete in_PREDICT_ADDRESS    ;
     40    delete [] out_PREDICT_ACK        ;
     41    delete [] in_PREDICT_ADDRESS    ;
    5842
    59     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    60       {
    61         if (_param._have_bht)
    62           {
    63         delete  in_BRANCH_COMPLETE_BHT_ACK             [i];
    64         delete out_BRANCH_COMPLETE_BHT_ADDRESS         [i];
    65           }
    66         if (_param._have_pht)
    67           {
    68         delete  in_BRANCH_COMPLETE_PHT_ACK             [i];
    69         delete out_BRANCH_COMPLETE_PHT_ADDRESS         [i];
    70           }
    71         if (_param._have_bht and _param._have_pht)
    72         delete  in_BRANCH_COMPLETE_BHT_HISTORY         [i];
    73         delete out_BRANCH_COMPLETE_ACK                 [i];
    74         delete  in_BRANCH_COMPLETE_ADDRESS             [i];
    75       }
    7643    if (_param._have_bht)
    7744      {
    78     delete in_BRANCH_COMPLETE_BHT_ACK    ;
    79     delete out_BRANCH_COMPLETE_BHT_ADDRESS;
     45    delete [] in_BRANCH_COMPLETE_BHT_ACK    ;
     46    delete [] out_BRANCH_COMPLETE_BHT_ADDRESS;
    8047      }
    8148    if (_param._have_pht)
    8249      {
    83     delete in_BRANCH_COMPLETE_PHT_ACK    ;
    84     delete out_BRANCH_COMPLETE_PHT_ADDRESS;
     50    delete [] in_BRANCH_COMPLETE_PHT_ACK    ;
     51    delete [] out_BRANCH_COMPLETE_PHT_ADDRESS;
    8552      }
    8653    if (_param._have_bht and _param._have_pht)
    87     delete in_BRANCH_COMPLETE_BHT_HISTORY;
    88     delete out_BRANCH_COMPLETE_ACK        ;
    89     delete in_BRANCH_COMPLETE_ADDRESS    ;
     54    delete [] in_BRANCH_COMPLETE_BHT_HISTORY;
     55    delete [] out_BRANCH_COMPLETE_ACK        ;
     56    delete [] in_BRANCH_COMPLETE_ADDRESS    ;
    9057
    9158    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     59    delete _component;
    9260
    9361    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"deallocation","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl.cpp

    r2 r42  
    2222  {
    2323    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl","Begin");
    24     Vhdl vhdl (_name);
     24   
     25    Vhdl * vhdl = new Vhdl (_name);
    2526
    26     vhdl.set_library_work (_name + "_Pack");
     27    vhdl->set_library_work (_name + "_Pack");
    2728
    2829    vhdl_port        (vhdl);
     
    3031    vhdl_body        (vhdl);
    3132
    32     vhdl.generate_file();
     33    vhdl->generate_file();
     34
     35    delete vhdl;
     36
    3337    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl","End");
    3438
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_body.cpp

    r2 r42  
    1818
    1919
    20   void Two_Level_Branch_Predictor_Glue::vhdl_body (Vhdl & vhdl)
     20  void Two_Level_Branch_Predictor_Glue::vhdl_body (Vhdl * & vhdl)
    2121  {
    2222    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_body","Begin");
    2323
    24     vhdl.set_body ("-- ack output");
     24    vhdl->set_body ("-- ack output");
    2525    for (uint32_t i=0; i<_param._nb_prediction; i++)
    2626      {
     
    2828
    2929        if (_param._have_bht)
    30           bht_ack = "in_PREDICT_BHT_ACK_"+toString(i);
     30          bht_ack = "in_PREDICT_"+toString(i)+"_BHT_ACK";
    3131        else
    3232          bht_ack = "'1'";
    3333
    3434        if (_param._have_pht)
    35           pht_ack = "in_PREDICT_PHT_ACK_"+toString(i);
     35          pht_ack = "in_PREDICT_"+toString(i)+"_PHT_ACK";
    3636        else
    3737          pht_ack = "'1'";
    3838
    39         vhdl.set_body ("out_PREDICT_ACK_"+toString(i)+"         <= "+bht_ack+" and "+pht_ack+";");
     39        vhdl->set_body ("out_PREDICT_"+toString(i)+"_ACK         <= "+bht_ack+" and "+pht_ack+";");
    4040      }
    4141
     
    4545
    4646        if (_param._have_bht)
    47           bht_ack = "in_BRANCH_COMPLETE_BHT_ACK_"+toString(i);
     47          bht_ack = "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK";
    4848        else
    4949          bht_ack = "'1'";
    5050
    5151        if (_param._have_pht)
    52           pht_ack = "in_BRANCH_COMPLETE_PHT_ACK_"+toString(i);
     52          pht_ack = "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK";
    5353        else
    5454          pht_ack = "'1'";
    5555
    56         vhdl.set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= "+bht_ack+" and "+pht_ack+";");
     56        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_ACK <= "+bht_ack+" and "+pht_ack+";");
    5757      }
    5858   
    59     vhdl.set_body ("");
    60     vhdl.set_body ("-- address output");
     59    vhdl->set_body ("");
     60    vhdl->set_body ("-- address output");
    6161
    6262    for (uint32_t i=0; i<_param._nb_prediction; i++)
     
    6464        // The address is higher than the address size of bht
    6565        if (_param._have_bht)
    66           vhdl.set_body ("out_PREDICT_BHT_ADDRESS_"+toString(i)+" <= in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._bht_size_address)+";");
     66          vhdl->set_body ("out_PREDICT_"+toString(i)+"_BHT_ADDRESS <= in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._bht_size_address)+";");
    6767
    6868        if (_param._have_pht)
     
    9393                  {
    9494                    min = _param._pht_size_address_shift;
    95                     vhdl.set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+std_logic_range(min) + " <=  in_PREDICT_BHT_HISTORY_"+toString(i)+std_logic_range(min)+";");
     95                    vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(min) + " <=  in_PREDICT_"+toString(i)+"_BHT_HISTORY"+std_logic_range(min)+";");
    9696                  }
    9797
     
    9999                  {
    100100                    max = _param._bht_size_history;
    101                     vhdl.set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1,max) + " <=  in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
     101                    vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(_param._pht_size_address-1,max) + " <=  in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
    102102                  }
    103103               
    104104                // intersection
    105105                if (_param._pht_size_address_share > 0)
    106                   vhdl.set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+std_logic_range(max-1,min) + " <=  in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_PREDICT_BHT_HISTORY_"+toString(i)+std_logic_range(max-1,min)+";");
     106                  vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(max-1,min) + " <=  in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_PREDICT_"+toString(i)+"_BHT_HISTORY"+std_logic_range(max-1,min)+";");
    107107              }
    108108            else
    109               vhdl.set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+" <=  in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address)+";");
     109              vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS <=  in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address)+";");
    110110          }
    111111      }
     
    115115        // The address is higher than the address size of bht
    116116        if (_param._have_bht)
    117           vhdl.set_body ("out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i)+" <= in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._bht_size_address)+";");
     117          vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS <= in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._bht_size_address)+";");
    118118
    119119        if (_param._have_pht)
     
    129129                  {
    130130                    min = _param._pht_size_address_shift;
    131                     vhdl.set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+std_logic_range(min) + " <=  in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+std_logic_range(min)+";");
     131                    vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(min) + " <=  in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"+std_logic_range(min)+";");
    132132                  }
    133133
     
    135135                  {
    136136                    max = _param._bht_size_history;
    137                     vhdl.set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1,max) + " <=  in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
     137                    vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(_param._pht_size_address-1,max) + " <=  in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
    138138                  }
    139139               
    140140                // intersection
    141141                if (_param._pht_size_address_share > 0)
    142                   vhdl.set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+std_logic_range(max-1,min) + " <=  in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+std_logic_range(max-1,min)+";");
     142                  vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(max-1,min) + " <=  in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"+std_logic_range(max-1,min)+";");
    143143              }
    144144            else
    145               vhdl.set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+" <=  in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address)+";");
     145              vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS <=  in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address)+";");
    146146          }
    147147      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_declaration.cpp

    r2 r42  
    1818
    1919
    20   void Two_Level_Branch_Predictor_Glue::vhdl_declaration (Vhdl & vhdl)
     20  void Two_Level_Branch_Predictor_Glue::vhdl_declaration (Vhdl * & vhdl)
    2121  {
    2222    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_declaration","Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_port.cpp

    r3 r42  
    1818
    1919
    20   void Two_Level_Branch_Predictor_Glue::vhdl_port (Vhdl & vhdl)
     20  void Two_Level_Branch_Predictor_Glue::vhdl_port (Vhdl * & vhdl)
    2121  {
    2222    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_port","Begin");
    2323
    24     for (uint32_t i=0; i<_param._nb_prediction; i++)
    25       {
    26         if (_param._have_bht)
    27           {
    28         vhdl.set_port (" in_PREDICT_BHT_ACK_"    +toString(i), IN, 1);
    29         vhdl.set_port ("out_PREDICT_BHT_ADDRESS_"+toString(i),OUT,_param._bht_size_address);
    30           }
    31         if (_param._have_bht and _param._have_pht)
    32         vhdl.set_port (" in_PREDICT_BHT_HISTORY_"+toString(i), IN,_param._bht_size_history);
    33         if (_param._have_pht)
    34           {
    35         vhdl.set_port (" in_PREDICT_PHT_ACK_"    +toString(i), IN, 1);
    36         vhdl.set_port ("out_PREDICT_PHT_ADDRESS_"+toString(i),OUT,_param._pht_size_address);
    37           }
    38        
    39         vhdl.set_port ("out_PREDICT_ACK_"        +toString(i),OUT, 1);
    40         vhdl.set_port (" in_PREDICT_ADDRESS_"    +toString(i), IN,_param._size_address);
    41       }
    42 
    43     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    44       {
    45         if (_param._have_bht)
    46           {
    47         vhdl.set_port (" in_BRANCH_COMPLETE_BHT_ACK_"    +toString(i), IN, 1);
    48         vhdl.set_port ("out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i),OUT,_param._bht_size_address);
    49           }
    50         if (_param._have_bht and _param._have_pht)
    51         vhdl.set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,_param._bht_size_history);
    52         if (_param._have_pht)
    53           {
    54         vhdl.set_port (" in_BRANCH_COMPLETE_PHT_ACK_"    +toString(i), IN, 1);
    55         vhdl.set_port ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i),OUT,_param._pht_size_address);
    56           }
    57         vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"        +toString(i),OUT, 1);
    58         vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"    +toString(i), IN,_param._size_address);
    59       }
     24    _interfaces->set_port(vhdl);
    6025
    6126    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_port","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_transition.cpp

    r2 r42  
    2222    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_transition","Begin");
    2323
    24 #ifndef SYSTEMCASS_SPECIFIC
    25     sc_cycle(0);
    26 #endif   
     24    sc_start(0);
    2725
    28     // In order with file Two_Level_Branch_Predictor_Glue_vhdl_testbench_port.cpp
    29     // Warning : if a output depend of a subcomponent, take directly the port of subcomponent
    30     // (because we have no control on the ordonnancer's policy)
    31 
    32 //     _vhdl_testbench->add_input (PORT_READ( in_NRESET));
    33     for (uint32_t i=0; i<_param._nb_prediction; i++)
    34       {
    35         if (_param._have_bht)
    36           {
    37         _vhdl_testbench->add_input  (PORT_READ( in_PREDICT_BHT_ACK      [i]));
    38         _vhdl_testbench->add_output (PORT_READ(out_PREDICT_BHT_ADDRESS  [i]));
    39           }
    40         if (_param._have_bht and _param._have_pht)
    41         _vhdl_testbench->add_input  (PORT_READ( in_PREDICT_BHT_HISTORY  [i]));
    42         if (_param._have_pht)
    43           {
    44         _vhdl_testbench->add_input  (PORT_READ( in_PREDICT_PHT_ACK      [i]));
    45         _vhdl_testbench->add_output (PORT_READ(out_PREDICT_PHT_ADDRESS  [i]));
    46           }
    47         _vhdl_testbench->add_output (PORT_READ(out_PREDICT_ACK          [i]));
    48         _vhdl_testbench->add_input  (PORT_READ( in_PREDICT_ADDRESS      [i]));
    49       }
    50 
    51     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    52       {
    53         if (_param._have_bht)
    54           {
    55         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_BHT_ACK      [i]));
    56         _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_BHT_ADDRESS  [i]));
    57           }
    58         if (_param._have_bht and _param._have_pht)
    59         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_BHT_HISTORY  [i]));
    60         if (_param._have_pht)
    61           {
    62         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_PHT_ACK      [i]));
    63         _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_PHT_ADDRESS  [i]));
    64           }
    65         _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_ACK          [i]));
    66         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_ADDRESS      [i]));
    67       }
    68     // add_test :
    69     //  - True  : the cycle must be compare with the output of systemC
    70     //  - False : no test
    71     _vhdl_testbench->add_test(true);
    72 
    73     _vhdl_testbench->new_cycle (); // always at the end
     26    _interfaces->testbench();
    7427
    7528    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_transition","End");
Note: See TracChangeset for help on using the changeset viewer.