Ignore:
Timestamp:
Jul 17, 2007, 4:47:56 PM (17 years ago)
Author:
rosiere
Message:

Modification des classes d'encapsulation des interfaces.
Stable sur tous les composants actuels

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue
Files:
1 added
3 deleted
13 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/config0.cfg

    r43 r44  
    13130       1       +1      # predictor_2_have_pht             
    14144       4       +1      # predictor_2_pht_size_counter     
    15 1       1       +1      # nb_prediction                     
    16 1       1       +1      # nb_branch_complete               
     152       2       +1      # nb_prediction                     
     162       2       +1      # nb_branch_complete               
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp

    r5 r44  
    1010
    1111#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/include/test.h"
    12 #include "Include/Test.h"
     12#include "Common/include/Test.h"
    1313
    1414void test (string name,
     
    2828   *********************************************************************/
    2929  sc_clock                         * CLOCK;
     30  sc_signal<Tcontrol_t>            * NRESET;
    3031
    3132    // Interface Predict
     
    6566
    6667#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    67   CLOCK                                  = new sc_clock ("clock", 1.0, 0.5);
     68  CLOCK                             = new sc_clock ("clock", 1.0, 0.5);
     69  NRESET                            = new sc_signal<Tcontrol_t> ("nreset");
    6870#endif 
    6971
     
    170172#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    171173  (*(_Meta_Predictor_Glue->in_CLOCK))        (*(CLOCK));
     174  (*(_Meta_Predictor_Glue->in_NRESET))        (*(NRESET));
    172175#endif
    173176
     
    252255
    253256  sc_start(0);
    254   _Meta_Predictor_Glue->vhdl_testbench_label("Initialisation");
    255257  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
    256  
     258
     259  NRESET->write(0);
     260  sc_start(5);
     261  NRESET->write(1);
    257262  // No need initialisation
    258263
    259   _Meta_Predictor_Glue->vhdl_testbench_label("Loop of Test");
    260264  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
    261265 
     
    282286//uint32_t shift_6 = shift_5 + _param._predictor_2_pht_size_counter;
    283287
     288  cout << "shift_0 : " << shift_0 << endl;
     289  cout << "shift_1 : " << shift_1 << endl;
     290  cout << "shift_2 : " << shift_2 << endl;
     291  cout << "shift_3 : " << shift_3 << endl;
     292  cout << "shift_4 : " << shift_4 << endl;
     293  cout << "shift_5 : " << shift_5 << endl;
     294
    284295  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
    285296    {
    286       _Meta_Predictor_Glue->vhdl_testbench_label("Iteration "+toString(iteration));
    287297
    288298      for (uint32_t i=0; i<_param._nb_prediction; i++)
     
    365375          BRANCH_COMPLETE_PREDICTOR_2_ACK         [i] ->write (predictor_2_ack);
    366376
    367           branch_complete_predictor_0_bht_history [i] = rand() % (_param._predictor_0_bht_size_shifter+1);
    368           branch_complete_predictor_0_pht_history [i] = rand() % (_param._predictor_0_pht_size_counter+1);
    369           branch_complete_predictor_1_bht_history [i] = rand() % (_param._predictor_1_bht_size_shifter+1);
    370           branch_complete_predictor_1_pht_history [i] = rand() % (_param._predictor_1_pht_size_counter+1);
    371           branch_complete_predictor_2_bht_history [i] = rand() % (_param._predictor_2_bht_size_shifter+1);
    372           branch_complete_predictor_2_pht_history [i] = rand() % (_param._predictor_2_pht_size_counter+1);
     377          branch_complete_predictor_0_bht_history [i] = rand() % (1<<_param._predictor_0_bht_size_shifter);
     378          branch_complete_predictor_0_pht_history [i] = rand() % (1<<_param._predictor_0_pht_size_counter);
     379          branch_complete_predictor_1_bht_history [i] = rand() % (1<<_param._predictor_1_bht_size_shifter);
     380          branch_complete_predictor_1_pht_history [i] = rand() % (1<<_param._predictor_1_pht_size_counter);
     381          branch_complete_predictor_2_bht_history [i] = rand() % (1<<_param._predictor_2_bht_size_shifter);
     382          branch_complete_predictor_2_pht_history [i] = rand() % (1<<_param._predictor_2_pht_size_counter);
    373383               
    374           BRANCH_COMPLETE_HISTORY                 [i]->write((branch_complete_predictor_0_bht_history [i] << shift_0) |
    375                                                              (branch_complete_predictor_0_pht_history [i] << shift_1) |
    376                                                              (branch_complete_predictor_1_bht_history [i] << shift_2) |
    377                                                              (branch_complete_predictor_1_pht_history [i] << shift_3) |
    378                                                              (branch_complete_predictor_2_bht_history [i] << shift_4) |
    379                                                              (branch_complete_predictor_2_pht_history [i] << shift_5) );
     384          Thistory_t history = ((branch_complete_predictor_0_bht_history [i] << shift_0) |
     385                                (branch_complete_predictor_0_pht_history [i] << shift_1) |
     386                                (branch_complete_predictor_1_bht_history [i] << shift_2) |
     387                                (branch_complete_predictor_1_pht_history [i] << shift_3) |
     388                                (branch_complete_predictor_2_bht_history [i] << shift_4) |
     389                                (branch_complete_predictor_2_pht_history [i] << shift_5) );
     390
     391          BRANCH_COMPLETE_HISTORY                 [i]->write (history);
     392
     393          cout << "<test> [" << i << "] : " << endl
     394             << hex
     395             << " *   " << history << endl
     396             << "   - " << branch_complete_predictor_0_bht_history [i] << endl
     397             << "   - " << branch_complete_predictor_0_pht_history [i] << endl
     398             << "   - " << branch_complete_predictor_1_bht_history [i] << endl
     399             << "   - " << branch_complete_predictor_1_pht_history [i] << endl
     400             << "   - " << branch_complete_predictor_2_bht_history [i] << endl
     401             << "   - " << branch_complete_predictor_2_pht_history [i] << endl
     402             << dec;
    380403
    381404          Tcontrol_t direction_0 = ((_param._predictor_0_have_pht)?(branch_complete_predictor_0_pht_history [i] >> (_param._predictor_0_pht_size_counter-1)):(branch_complete_predictor_0_bht_history [i] >> (_param._predictor_0_bht_size_shifter-1)))&1;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h

    r5 r44  
    1414
    1515#include <iostream>
    16 #include "Include/ToString.h"
    17 #include "Include/Debug.h"
     16#include "Common/include/ToString.h"
     17#include "Common/include/Debug.h"
    1818
    1919#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h"
     
    2525#include "Behavioural/include/Vhdl.h"
    2626#endif
    27 #ifdef VHDL_TESTBENCH
    28 #include "Behavioural/include/Vhdl_Testbench.h"
    29 #endif
     27#include "Behavioural/include/Component.h"
    3028
    3129using namespace std;
     
    5755#endif
    5856
    59 #ifdef VHDL_TESTBENCH
    60   private   : Vhdl_Testbench                 * _vhdl_testbench;
    61 #endif
     57  public    : Component                      * _component;
     58  private   : Interfaces                     * _interfaces;
    6259
    6360#ifdef SYSTEMC
     
    6562    // Interface
    6663  public    : SC_CLOCK                      *  in_CLOCK                                  ;
     64  public    : SC_IN (Tcontrol_t)            *  in_NRESET                                 ;
    6765
    6866    // Interface Predict
     
    146144#if VHDL                                       
    147145  public  : void     vhdl                      (void);
    148   private : void     vhdl_port                 (Vhdl & vhdl);
    149   private : void     vhdl_declaration          (Vhdl & vhdl);
    150   private : void     vhdl_body                 (Vhdl & vhdl);
     146  private : void     vhdl_declaration          (Vhdl * & vhdl);
     147  private : void     vhdl_body                 (Vhdl * & vhdl);
    151148#endif                                         
    152                                                
    153149#ifdef VHDL_TESTBENCH                         
    154   private : void     vhdl_testbench_port       (void);
    155150  private : void     vhdl_testbench_transition (void);
    156151#endif
    157   public  : void     vhdl_testbench_label      (string label);
    158152  };
    159153
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h

    r5 r44  
    99 */
    1010
    11 #include "Include/Debug.h"
     11#include "Common/include/Debug.h"
    1212#include "Behavioural/include/Parameters.h"
    1313#include <math.h>
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h

    r4 r44  
    1010 */
    1111
    12 #include "Include/Debug.h"
     12#include "Common/include/Debug.h"
    1313#include "Behavioural/include/Statistics.h"
    1414#include "Behavioural/include/Parameters_Statistics.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Types.h

    r4 r44  
    1010 */
    1111
    12 #include "Include/Types.h"
     12#include "Common/include/Types.h"
    1313
    1414namespace morpheo                    {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue.cpp

    r5 r44  
    3333    log_printf(FUNC,Meta_Predictor_Glue,"Meta_Predictor_Glue","Begin");
    3434
     35    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Allocation");
     36    allocation ();
     37
    3538#ifdef STATISTICS
    3639    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Allocation of statistics");
     
    4245#endif
    4346
    44 #ifdef VHDL_TESTBENCH
    45     // Creation of a testbench
    46     //  -> port
    47     //  -> clock's signals
    48     log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Creation of a testbench");
    49     _vhdl_testbench = new Vhdl_Testbench (_name);
    50     vhdl_testbench_port           ();
    51     _vhdl_testbench->set_clock    ("in_CLOCK",false);
    52 #endif
    53 
    5447#ifdef VHDL
    5548    // generate the vhdl
     
    5952
    6053#ifdef SYSTEMC
    61     log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Allocation");
    62     allocation ();
    63 
    6454#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    6555    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - transition");
     
    259249    log_printf(FUNC,Meta_Predictor_Glue,"~Meta_Predictor_Glue","Begin");
    260250
    261 #ifdef VHDL_TESTBENCH
    262     log_printf(INFO,Meta_Predictor_Glue,"~Meta_Predictor_Glue","Generate Testbench");
    263     // generate the test bench
    264     _vhdl_testbench->generate_file();
    265     delete _vhdl_testbench;
    266 #endif
    267 
    268251#ifdef STATISTICS
    269252    log_printf(INFO,Meta_Predictor_Glue,"~Meta_Predictor_Glue","Generate Statistics");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_allocation.cpp

    r5 r44  
    2323    log_printf(FUNC,Meta_Predictor_Glue,"allocation","Begin");
    2424
    25 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    26     in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
    27 #endif
    28 
    29     // Interface Predict
     25    _component   = new Component ();
     26
     27    Entity * entity = _component->set_entity (_name                 
     28                                             ,"Two_Level_Branch_Predictor_Glue"
     29#ifdef POSITION
     30                                             ,COMBINATORY
     31#endif
     32                                              );
     33   
     34    _interfaces = entity->set_interfaces();
     35
     36    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     37    {
     38      Interface * interface = _interfaces->set_interface(""
     39#ifdef POSITION
     40                                                         , IN 
     41                                                         , SOUTH
     42                                                         , "Generalist interface"
     43#endif
     44                                                         );
     45     
     46      in_CLOCK              = interface->set_signal_clk              ("clock" ,1,CLOCK_VHDL_NO);
     47      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_NO);
     48    }
     49
     50
     51    // ~~~~~[ Interface : "Predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3052
    3153    if (_param._have_meta_predictor)
     
    5678    for (uint32_t i=0; i<_param._nb_prediction; i++)
    5779      {
    58         if (_param._have_meta_predictor)
    59           {
    60         rename = " in_PREDICT_PREDICTOR_0_ACK_"          +toString(i);
    61          in_PREDICT_PREDICTOR_0_ACK                   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
     80        Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
     81#ifdef POSITION
     82                                                                , IN 
     83                                                                , WEST
     84                                                                , "Interface Predict"
     85#endif
     86                                                                );
     87
     88        if (_param._have_meta_predictor)
     89          {
     90         in_PREDICT_PREDICTOR_0_ACK                   [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_0_ack"        , 1);
     91         in_PREDICT_PREDICTOR_1_ACK                   [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_1_ack"        , 1);
     92          }
     93         in_PREDICT_PREDICTOR_2_ACK                   [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_2_ack"        , 1);
    6294       
    63         rename = " in_PREDICT_PREDICTOR_1_ACK_"          +toString(i);
    64          in_PREDICT_PREDICTOR_1_ACK                   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    65           }
    66         rename = " in_PREDICT_PREDICTOR_2_ACK_"          +toString(i);
    67          in_PREDICT_PREDICTOR_2_ACK                   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    68        
    69         rename = "out_PREDICT_ACK_"                    +toString(i);
    70         out_PREDICT_ACK                               [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
     95        out_PREDICT_ACK                               [i] = interface->set_signal_out <Tcontrol_t>     ("ack"                    , 1);
    7196
    7297        if (_param._have_meta_predictor)
    7398          {
    7499        if (_param._predictor_0_have_bht)
    75           {
    76         rename = " in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i);
    77          in_PREDICT_PREDICTOR_0_BHT_HISTORY           [i] = new SC_IN (Tbht_history_t) (rename.c_str());
    78           }
     100         in_PREDICT_PREDICTOR_0_BHT_HISTORY           [i] = interface->set_signal_in  <Tbht_history_t> ("predictor_0_bht_history", _param._predictor_0_bht_size_shifter);
    79101        if (_param._predictor_0_have_pht)
    80           {
    81         rename = " in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i);
    82          in_PREDICT_PREDICTOR_0_PHT_HISTORY           [i] = new SC_IN (Tpht_history_t) (rename.c_str());
    83           }
     102         in_PREDICT_PREDICTOR_0_PHT_HISTORY           [i] = interface->set_signal_in  <Tpht_history_t> ("predictor_0_pht_history", _param._predictor_0_pht_size_counter);
    84103        if (_param._predictor_1_have_bht)
    85           {
    86         rename = " in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i);
    87          in_PREDICT_PREDICTOR_1_BHT_HISTORY           [i] = new SC_IN (Tbht_history_t) (rename.c_str());
    88           }
     104         in_PREDICT_PREDICTOR_1_BHT_HISTORY           [i] = interface->set_signal_in  <Tbht_history_t> ("predictor_1_bht_history", _param._predictor_1_bht_size_shifter);
    89105        if (_param._predictor_1_have_pht)
    90           {
    91         rename = " in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i);
    92          in_PREDICT_PREDICTOR_1_PHT_HISTORY           [i] = new SC_IN (Tpht_history_t) (rename.c_str());
    93           }
     106         in_PREDICT_PREDICTOR_1_PHT_HISTORY           [i] = interface->set_signal_in  <Tpht_history_t> ("predictor_1_pht_history", _param._predictor_1_pht_size_counter);
    94107          }
    95108        if (_param._predictor_2_have_bht)
    96           {
    97         rename = " in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i);
    98          in_PREDICT_PREDICTOR_2_BHT_HISTORY           [i] = new SC_IN (Tbht_history_t) (rename.c_str());
    99           }
     109         in_PREDICT_PREDICTOR_2_BHT_HISTORY           [i] = interface->set_signal_in  <Tbht_history_t> ("predictor_2_bht_history", _param._predictor_2_bht_size_shifter);
    100110        if (_param._predictor_2_have_pht)
    101           {
    102         rename = " in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i);
    103          in_PREDICT_PREDICTOR_2_PHT_HISTORY           [i] = new SC_IN (Tpht_history_t) (rename.c_str());
    104           }
    105         rename = "out_PREDICT_HISTORY_"                +toString(i);
    106         out_PREDICT_HISTORY                           [i] = new SC_OUT(Thistory_t)     (rename.c_str());
    107 
    108         rename = "out_PREDICT_DIRECTION_"              +toString(i);
    109         out_PREDICT_DIRECTION                         [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    110       }
    111 
    112     // Interface Branch_complete
     111         in_PREDICT_PREDICTOR_2_PHT_HISTORY           [i] = interface->set_signal_in  <Tpht_history_t> ("predictor_2_pht_history", _param._predictor_2_pht_size_counter);
     112        out_PREDICT_HISTORY                           [i] = interface->set_signal_out <Thistory_t>     ("history"                , _param._size_history);
     113        out_PREDICT_DIRECTION                         [i] = interface->set_signal_out <Tcontrol_t>     ("direction"              , 1);
     114      }
     115
     116    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    113117   
    114118    if (_param._have_meta_predictor)
     
    145149    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    146150      {
    147         if (_param._have_meta_predictor)
    148           {
    149         rename = " in_BRANCH_COMPLETE_VAL_"                      +toString(i);
    150          in_BRANCH_COMPLETE_VAL                               [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    151        
    152         rename = "out_BRANCH_COMPLETE_PREDICTOR_2_VAL_"          +toString(i);
    153         out_BRANCH_COMPLETE_PREDICTOR_2_VAL                   [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    154 
    155         rename = " in_BRANCH_COMPLETE_PREDICTOR_0_ACK_"          +toString(i);
    156          in_BRANCH_COMPLETE_PREDICTOR_0_ACK                   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    157        
    158         rename = " in_BRANCH_COMPLETE_PREDICTOR_1_ACK_"          +toString(i);
    159          in_BRANCH_COMPLETE_PREDICTOR_1_ACK                   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    160           }
    161         rename = " in_BRANCH_COMPLETE_PREDICTOR_2_ACK_"          +toString(i);
    162          in_BRANCH_COMPLETE_PREDICTOR_2_ACK                   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    163        
    164         rename = "out_BRANCH_COMPLETE_ACK_"                    +toString(i);
    165         out_BRANCH_COMPLETE_ACK                               [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    166 
     151        Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
     152#ifdef POSITION
     153                                                                , IN 
     154                                                                , EAST
     155                                                                , "Interface branch complete"
     156#endif
     157                                                                );
     158
     159        if (_param._have_meta_predictor)
     160          {
     161         in_BRANCH_COMPLETE_VAL                      [i] = interface->set_signal_in  <Tcontrol_t>     ("val"            , 1);
     162        out_BRANCH_COMPLETE_PREDICTOR_2_VAL          [i] = interface->set_signal_out <Tcontrol_t>     ("predictor_2_val", 1);
     163         in_BRANCH_COMPLETE_PREDICTOR_0_ACK          [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_0_ack", 1);
     164         in_BRANCH_COMPLETE_PREDICTOR_1_ACK          [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_1_ack", 1);
     165          }
     166         in_BRANCH_COMPLETE_PREDICTOR_2_ACK          [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_2_ack" , 1);
     167        out_BRANCH_COMPLETE_ACK                      [i] = interface->set_signal_out <Tcontrol_t>     ("ack"             , 1);
    167168        if (_param._have_meta_predictor)
    168169          {
    169170        if (_param._predictor_0_have_bht)
    170           {
    171         rename = "out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i);
    172         out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY           [i] = new SC_OUT(Tbht_history_t) (rename.c_str());
    173           }
     171        out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY  [i] = interface->set_signal_out <Tbht_history_t> ("predictor_0_bht_history" , _param._predictor_0_bht_size_shifter );
    174172        if (_param._predictor_0_have_pht)
    175           {
    176         rename = "out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i);
    177         out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY           [i] = new SC_OUT(Tpht_history_t) (rename.c_str());
    178           }
     173        out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY  [i] = interface->set_signal_out <Tpht_history_t> ("predictor_0_pht_history" , _param._predictor_0_pht_size_counter);
    179174        if (_param._predictor_1_have_bht)
    180           {
    181         rename = "out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i);
    182         out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY           [i] = new SC_OUT(Tbht_history_t) (rename.c_str());
    183           }
     175        out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY  [i] = interface->set_signal_out <Tbht_history_t> ("predictor_1_bht_history" , _param._predictor_1_bht_size_shifter );
    184176        if (_param._predictor_1_have_pht)
    185           {
    186         rename = "out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i);
    187         out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY           [i] = new SC_OUT(Tpht_history_t) (rename.c_str());
    188           }
     177        out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY  [i] = interface->set_signal_out <Tpht_history_t> ("predictor_1_pht_history" , _param._predictor_1_pht_size_counter );
    189178          }
    190179        if (_param._predictor_2_have_bht)
    191           {
    192         rename = "out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i);
    193         out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY           [i] = new SC_OUT(Tbht_history_t) (rename.c_str());
    194           }
     180        out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY  [i] = interface->set_signal_out <Tbht_history_t> ("predictor_2_bht_history" , _param._predictor_2_bht_size_shifter);
    195181        if (_param._predictor_2_have_pht)
    196           {
    197         rename = "out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i);
    198         out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY           [i] = new SC_OUT(Tpht_history_t) (rename.c_str());
    199           }
    200         rename = " in_BRANCH_COMPLETE_HISTORY_"                +toString(i);
    201          in_BRANCH_COMPLETE_HISTORY                           [i] = new SC_IN (Thistory_t)     (rename.c_str());
    202 
    203         if (_param._have_meta_predictor)
    204           {
    205         rename = " in_BRANCH_COMPLETE_DIRECTION_"              +toString(i);
    206          in_BRANCH_COMPLETE_DIRECTION                         [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    207 
    208         rename = "out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"  +toString(i);
    209         out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION             [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
     182        out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY  [i] = interface->set_signal_out <Tpht_history_t> ("predictor_2_pht_history" , _param._predictor_2_pht_size_counter);
     183         in_BRANCH_COMPLETE_HISTORY                  [i] = interface->set_signal_in  <Thistory_t>     ("history"                 , _param._size_history);
     184        if (_param._have_meta_predictor)
     185          {
     186         in_BRANCH_COMPLETE_DIRECTION                [i] = interface->set_signal_in  <Tcontrol_t>     ("direction"             , 1);
     187        out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION    [i] = interface->set_signal_out <Tcontrol_t>     ("predictor_2_direction" , 1);
    210188          }
    211189      }
    212190    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     191
     192#ifdef POSITION
     193    _component->generate_file();
     194#endif
    213195
    214196    log_printf(FUNC,Meta_Predictor_Glue,"allocation","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.cpp

    r5 r44  
    2121    log_printf(FUNC,Meta_Predictor_Glue,"deallocation","Begin");
    2222
    23 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    24     delete in_CLOCK;
    25 #endif
    26 
    27     // Interface Predict
    28     for (uint32_t i=0; i<_param._nb_prediction; i++)
    29       {
    30         if (_param._have_meta_predictor)
    31         {
    32         delete  in_PREDICT_PREDICTOR_0_ACK                   [i];
    33         delete  in_PREDICT_PREDICTOR_1_ACK                   [i];
    34         }
    35         delete  in_PREDICT_PREDICTOR_2_ACK                   [i];
    36         delete out_PREDICT_ACK                               [i];
    37         if (_param._have_meta_predictor)
    38         {
    39         if (_param._predictor_0_have_bht)
    40         delete  in_PREDICT_PREDICTOR_0_BHT_HISTORY           [i];
    41         if (_param._predictor_0_have_pht)
    42         delete  in_PREDICT_PREDICTOR_0_PHT_HISTORY           [i];
    43         if (_param._predictor_1_have_bht)
    44         delete  in_PREDICT_PREDICTOR_1_BHT_HISTORY           [i];
    45         if (_param._predictor_1_have_pht)
    46         delete  in_PREDICT_PREDICTOR_1_PHT_HISTORY           [i];
    47         }
    48         if (_param._predictor_2_have_bht)
    49         delete  in_PREDICT_PREDICTOR_2_BHT_HISTORY           [i];
    50         if (_param._predictor_2_have_pht)
    51         delete  in_PREDICT_PREDICTOR_2_PHT_HISTORY           [i];
    52         delete out_PREDICT_HISTORY                           [i];
    53         delete out_PREDICT_DIRECTION                         [i];
    54       }
     23    delete     in_CLOCK;
     24    delete     in_NRESET;
    5525
    5626    if (_param._have_meta_predictor)
    5727    {
    58     delete in_PREDICT_PREDICTOR_0_ACK;
    59     delete in_PREDICT_PREDICTOR_1_ACK;
     28    delete []  in_PREDICT_PREDICTOR_0_ACK;
     29    delete []  in_PREDICT_PREDICTOR_1_ACK;
    6030    }                             
    61     delete in_PREDICT_PREDICTOR_2_ACK;
    62     delete out_PREDICT_ACK            ;
     31    delete []  in_PREDICT_PREDICTOR_2_ACK;
     32    delete []  out_PREDICT_ACK            ;
    6333    if (_param._have_meta_predictor)
    6434    {
    6535    if (_param._predictor_0_have_bht)
    66     delete in_PREDICT_PREDICTOR_0_BHT_HISTORY;
     36    delete []  in_PREDICT_PREDICTOR_0_BHT_HISTORY;
    6737    if (_param._predictor_0_have_pht)
    68     delete in_PREDICT_PREDICTOR_0_PHT_HISTORY;
     38    delete []  in_PREDICT_PREDICTOR_0_PHT_HISTORY;
    6939    if (_param._predictor_1_have_bht)
    70     delete in_PREDICT_PREDICTOR_1_BHT_HISTORY;
     40    delete []  in_PREDICT_PREDICTOR_1_BHT_HISTORY;
    7141    if (_param._predictor_1_have_pht)
    72     delete in_PREDICT_PREDICTOR_1_PHT_HISTORY ;
     42    delete []  in_PREDICT_PREDICTOR_1_PHT_HISTORY ;
    7343    }
    7444    if (_param._predictor_2_have_bht)
    75     delete in_PREDICT_PREDICTOR_2_BHT_HISTORY ;
     45    delete []  in_PREDICT_PREDICTOR_2_BHT_HISTORY ;
    7646    if (_param._predictor_2_have_pht)
    77     delete  in_PREDICT_PREDICTOR_2_PHT_HISTORY ;
    78     delete out_PREDICT_HISTORY                 ;
    79     delete out_PREDICT_DIRECTION               ;
    80 
    81     // Interface Branch_complete
    82     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    83       {
    84         if (_param._have_meta_predictor)
    85         {
    86         delete  in_BRANCH_COMPLETE_VAL                               [i];
    87         delete out_BRANCH_COMPLETE_PREDICTOR_2_VAL                   [i];
    88 
    89         delete  in_BRANCH_COMPLETE_PREDICTOR_0_ACK                   [i];
    90         delete  in_BRANCH_COMPLETE_PREDICTOR_1_ACK                   [i];
    91         }
    92         delete  in_BRANCH_COMPLETE_PREDICTOR_2_ACK                   [i];
    93         delete out_BRANCH_COMPLETE_ACK                               [i];
    94  
    95         if (_param._have_meta_predictor)
    96         {
    97         if (_param._predictor_0_have_bht)
    98         delete out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY           [i];
    99         if (_param._predictor_0_have_pht)
    100         delete out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY           [i];
    101         if (_param._predictor_1_have_bht)
    102         delete out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY           [i];
    103         if (_param._predictor_1_have_pht)
    104         delete out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY           [i];
    105         }
    106         if (_param._predictor_2_have_bht)
    107         delete out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY           [i];
    108         if (_param._predictor_2_have_pht)
    109         delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY           [i];
    110         delete  in_BRANCH_COMPLETE_HISTORY                           [i];
    111         if (_param._have_meta_predictor)
    112           {
    113         delete  in_BRANCH_COMPLETE_DIRECTION                         [i];
    114         delete out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION             [i];
    115           }
    116       }
     47    delete []   in_PREDICT_PREDICTOR_2_PHT_HISTORY ;
     48    delete []  out_PREDICT_HISTORY                 ;
     49    delete []  out_PREDICT_DIRECTION               ;
    11750
    11851    if (_param._have_meta_predictor)
    11952    {
    120     delete in_BRANCH_COMPLETE_VAL                     ;
    121     delete out_BRANCH_COMPLETE_PREDICTOR_2_VAL         ;
     53    delete []  in_BRANCH_COMPLETE_VAL                     ;
     54    delete []  out_BRANCH_COMPLETE_PREDICTOR_2_VAL         ;
    12255
    123     delete in_BRANCH_COMPLETE_PREDICTOR_0_ACK         ;
    124     delete in_BRANCH_COMPLETE_PREDICTOR_1_ACK         ;
     56    delete []  in_BRANCH_COMPLETE_PREDICTOR_0_ACK         ;
     57    delete []  in_BRANCH_COMPLETE_PREDICTOR_1_ACK         ;
    12558    }                             
    126     delete in_BRANCH_COMPLETE_PREDICTOR_2_ACK         ;
    127     delete out_BRANCH_COMPLETE_ACK                     ;
     59    delete []  in_BRANCH_COMPLETE_PREDICTOR_2_ACK         ;
     60    delete []  out_BRANCH_COMPLETE_ACK                     ;
    12861    if (_param._have_meta_predictor)
    12962    {
    13063    if (_param._predictor_0_have_bht)
    131     delete out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY ;
     64    delete []  out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY ;
    13265    if (_param._predictor_0_have_pht)
    133     delete out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY ;
     66    delete []  out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY ;
    13467    if (_param._predictor_1_have_bht)
    135     delete out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY ;
     68    delete []  out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY ;
    13669    if (_param._predictor_1_have_pht)
    137     delete out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY ;
     70    delete []  out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY ;
    13871    }
    13972    if (_param._predictor_2_have_bht)
    140     delete out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY ;
     73    delete []  out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY ;
    14174    if (_param._predictor_2_have_pht)
    142     delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY ;
    143     delete in_BRANCH_COMPLETE_HISTORY                 ;
     75    delete []  out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY ;
     76    delete []  in_BRANCH_COMPLETE_HISTORY                 ;
    14477    if (_param._have_meta_predictor)
    14578      {
    146     delete in_BRANCH_COMPLETE_DIRECTION               ;
    147     delete out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   ;
     79    delete []  in_BRANCH_COMPLETE_DIRECTION               ;
     80    delete []  out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   ;
    14881      }
    14982    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     83    delete _component;
    15084
    15185    log_printf(FUNC,Meta_Predictor_Glue,"deallocation","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_history.cpp

    r5 r44  
    88
    99#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
    10 #include "Include/BitManipulation.h"
     10#include "Common/include/BitManipulation.h"
    1111
    1212namespace morpheo                    {
     
    2727        if (_param._have_meta_predictor)
    2828          {
    29         if (_param._predictor_0_have_bht)
     29        if (_param._predictor_0_have_bht) 
    3030        PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i], (history >> _param._shift_0) & gen_mask<Tbht_history_t>(_param._predictor_0_bht_size_shifter));
    3131        if (_param._predictor_0_have_pht)
     
    3434
    3535        if (_param._predictor_1_have_bht)
    36           {
    3736        PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i], (history >> _param._shift_2) & gen_mask<Tbht_history_t>(_param._predictor_1_bht_size_shifter));
    38 
    3937        if (_param._predictor_1_have_pht)
    4038        PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i], (history >> _param._shift_3) & gen_mask<Tpht_history_t>(_param._predictor_1_pht_size_counter));
    41           }
    4239
    4340        if (_param._predictor_2_have_bht)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl.cpp

    r4 r44  
    2121  {
    2222    log_printf(FUNC,Meta_Predictor_Glue,"vhdl","Begin");
    23     Vhdl vhdl (_name);
    2423
    25     vhdl.set_library_work (_name + "_Pack");
     24    Vhdl * vhdl = new Vhdl (_name);
    2625
    27     vhdl_port        (vhdl);
     26    _interfaces->set_port     (vhdl);
     27    _component ->vhdl_instance(vhdl);
     28
    2829    vhdl_declaration (vhdl);
    2930    vhdl_body        (vhdl);
    3031
    31     vhdl.generate_file();
     32    vhdl->generate_file();
     33
     34    delete vhdl;
     35
    3236    log_printf(FUNC,Meta_Predictor_Glue,"vhdl","End");
    3337  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_body.cpp

    r5 r44  
    1717
    1818
    19   void Meta_Predictor_Glue::vhdl_body (Vhdl & vhdl)
     19  void Meta_Predictor_Glue::vhdl_body (Vhdl * & vhdl)
    2020  {
    2121    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_body","Begin");
    22     vhdl.set_body ("");
    23     vhdl.set_body (" -- predict");
     22    vhdl->set_body ("");
     23    vhdl->set_body (" -- predict");
    2424   
    2525    for (uint32_t i=0; i<_param._nb_prediction; i++)
    2626      {
    27         string meta_predictor_ack =  (_param._have_meta_predictor==true)?("in_PREDICT_PREDICTOR_0_ACK_"+toString(i)+" and in_PREDICT_PREDICTOR_1_ACK_"+toString(i)):"'1'";
     27        string meta_predictor_ack =  (_param._have_meta_predictor==true)?("in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK and in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK"):"'1'";
    2828
    29         vhdl.set_body ("out_PREDICT_ACK_"+toString(i)+"         <= "+meta_predictor_ack+" and "+"in_PREDICT_PREDICTOR_2_ACK_"+toString(i)+";");
     29        vhdl->set_body ("out_PREDICT_"+toString(i)+"_ACK         <= "+meta_predictor_ack+" and "+"in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK;");
    3030
    3131        uint32_t index=_param._size_history;
     
    3434        if (_param._predictor_2_have_pht)
    3535          {
    36         vhdl.set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+" <= in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i)+";");
     36        vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY;");
    3737        index-= _param._predictor_2_pht_size_counter;
    3838          }
    3939        if (_param._predictor_2_have_bht)
    4040          {
    41         vhdl.set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+" <= in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i)+";");
     41        vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY;");
    4242        index-= _param._predictor_2_bht_size_shifter;
    4343          }
     
    4747        if (_param._predictor_1_have_pht)
    4848          {
    49         vhdl.set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+" <= in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i)+";");
     49        vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY;");
    5050        index-= _param._predictor_1_pht_size_counter;
    5151          }
    5252        if (_param._predictor_1_have_bht)
    5353          {
    54         vhdl.set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+" <= in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i)+";");
     54        vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY;");
    5555        index-= _param._predictor_1_bht_size_shifter;
    5656          }
     
    5858        if (_param._predictor_0_have_pht)
    5959          {
    60         vhdl.set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+" <= in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i)+";");
     60        vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY;");
    6161        index-= _param._predictor_0_pht_size_counter;
    6262          }
    6363        if (_param._predictor_0_have_bht)
    6464          {
    65         vhdl.set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+" <= in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i)+";");
     65        vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY;");
    6666        index-= _param._predictor_0_bht_size_shifter;
    6767          }
     
    6969
    7070        // direction of prediction
    71         vhdl.set_body ("");
     71        vhdl->set_body ("");
    7272        if (_param._have_meta_predictor)
    73           vhdl.set_body ("out_PREDICT_DIRECTION_"+toString(i)+"   <= predict_predictor_0_direction_"+toString(i)+" when predict_predictor_2_direction_"+toString(i)+"='0' else predict_predictor_1_direction_"+toString(i)+";");
     73          vhdl->set_body ("out_PREDICT_"+toString(i)+"_DIRECTION   <= predict_"+toString(i)+"_predictor_0_direction when predict_"+toString(i)+"_predictor_2_direction='0' else predict_"+toString(i)+"_predictor_1_direction;");
    7474        else
    75           vhdl.set_body ("out_PREDICT_DIRECTION_"+toString(i)+"   <= predict_predictor_2_direction_"+toString(i)+";");
     75          vhdl->set_body ("out_PREDICT_"+toString(i)+"_DIRECTION   <= predict_"+toString(i)+"_predictor_2_direction;");
    7676      }
    7777
    7878    // Interface - branch_complete
    7979
    80     vhdl.set_body ("");
    81     vhdl.set_body (" -- branch_complete");
     80    vhdl->set_body ("");
     81    vhdl->set_body (" -- branch_complete");
    8282    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    8383      {
     
    8585        if (_param._have_meta_predictor)
    8686          {
    87         vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i)+"       <= (branch_complete_predictor_0_direction_"+toString(i)+" xor branch_complete_predictor_1_direction_"+toString(i)+") and "+"in_BRANCH_COMPLETE_VAL_"+toString(i)+";");
    88         vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i)+" <= (branch_complete_predictor_0_direction_"+toString(i)+" and not in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+") or (branch_complete_predictor_1_direction_"+toString(i)+" and in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+");");
     87        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL       <= (branch_complete_"+toString(i)+"_predictor_0_direction xor branch_complete_"+toString(i)+"_predictor_1_direction) and "+"in_BRANCH_COMPLETE_"+toString(i)+"_VAL;");
     88        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION <= (branch_complete_"+toString(i)+"_predictor_0_direction and not in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION) or (branch_complete_"+toString(i)+"_predictor_1_direction and in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION);");
    8989          }
    9090
    91         string meta_predictor_ack =  (_param._have_meta_predictor==true)?("in_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i)+" and in_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i)):"'1'";
     91        string meta_predictor_ack =  (_param._have_meta_predictor==true)?("in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK and in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK"):"'1'";
    9292
    93         vhdl.set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"                   <= "+meta_predictor_ack+" and "+"in_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i)+";");
     93        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_ACK                   <= "+meta_predictor_ack+" and "+"in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK;");
    9494
    9595        uint32_t index=_param._size_history;
     
    9797        if (_param._predictor_2_have_pht)
    9898          {
    99         vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+";");
     99        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+";");
    100100        index-= _param._predictor_2_pht_size_counter;
    101101          }
    102102        if (_param._predictor_2_have_bht)
    103103          {
    104         vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+";");
     104        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+";");
    105105        index-= _param._predictor_2_bht_size_shifter;
    106106          }
     
    110110        if (_param._predictor_1_have_pht)
    111111          {
    112         vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+";");
     112        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+";");
    113113        index-= _param._predictor_1_pht_size_counter;
    114114          }
    115115        if (_param._predictor_1_have_bht)
    116116          {
    117         vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+";");
     117        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+";");
    118118        index-= _param._predictor_1_bht_size_shifter;
    119119          }
     
    121121        if (_param._predictor_0_have_pht)
    122122          {
    123         vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+";");
     123        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+";");
    124124        index-= _param._predictor_0_pht_size_counter;
    125125          }
    126126        if (_param._predictor_0_have_bht)
    127127          {
    128         vhdl.set_body ("out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+";");
     128        vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+";");
    129129        index-= _param._predictor_0_bht_size_shifter;
    130130          }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_declaration.cpp

    r5 r44  
    1717
    1818
    19   void Meta_Predictor_Glue::vhdl_declaration (Vhdl & vhdl)
     19  void Meta_Predictor_Glue::vhdl_declaration (Vhdl * & vhdl)
    2020  {
    2121    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_declaration","Begin");
     
    2626          {
    2727        if (_param._predictor_0_have_pht)
    28           vhdl.set_alias ("predict_predictor_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_pht_size_counter-1,_param._predictor_0_pht_size_counter-1));
     28          vhdl->set_alias ("predict_"+toString(i)+"_predictor_0_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY",std_logic_range(_param._predictor_0_pht_size_counter-1,_param._predictor_0_pht_size_counter-1));
    2929        else
    30           vhdl.set_alias ("predict_predictor_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_bht_size_shifter-1,_param._predictor_0_bht_size_shifter-1));
     30          vhdl->set_alias ("predict_"+toString(i)+"_predictor_0_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY",std_logic_range(_param._predictor_0_bht_size_shifter-1,_param._predictor_0_bht_size_shifter-1));
    3131        if (_param._predictor_1_have_pht)
    32           vhdl.set_alias ("predict_predictor_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_pht_size_counter-1,_param._predictor_1_pht_size_counter-1));
     32          vhdl->set_alias ("predict_"+toString(i)+"_predictor_1_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY",std_logic_range(_param._predictor_1_pht_size_counter-1,_param._predictor_1_pht_size_counter-1));
    3333        else
    34           vhdl.set_alias ("predict_predictor_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_bht_size_shifter-1,_param._predictor_1_bht_size_shifter-1));
     34          vhdl->set_alias ("predict_"+toString(i)+"_predictor_1_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY",std_logic_range(_param._predictor_1_bht_size_shifter-1,_param._predictor_1_bht_size_shifter-1));
    3535          }
    3636
    3737        if (_param._predictor_2_have_pht)
    38           vhdl.set_alias ("predict_predictor_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_pht_size_counter-1,_param._predictor_2_pht_size_counter-1));
     38          vhdl->set_alias ("predict_"+toString(i)+"_predictor_2_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY",std_logic_range(_param._predictor_2_pht_size_counter-1,_param._predictor_2_pht_size_counter-1));
    3939        else
    40           vhdl.set_alias ("predict_predictor_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_bht_size_shifter-1,_param._predictor_2_bht_size_shifter-1));
     40          vhdl->set_alias ("predict_"+toString(i)+"_predictor_2_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY",std_logic_range(_param._predictor_2_bht_size_shifter-1,_param._predictor_2_bht_size_shifter-1));
    4141      }
    4242
     
    4646      {
    4747//      if (_param._predictor_2_have_pht)
    48 //      vhdl.set_alias ("branch_complete_predictor_2_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_6-1, _param._shift_6-1));
     48//      vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_2_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_6-1, _param._shift_6-1));
    4949//      else
    50 //      vhdl.set_alias ("branch_complete_predictor_2_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_5-1, _param._shift_5-1));
     50//      vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_2_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_5-1, _param._shift_5-1));
    5151
    5252        if (_param._predictor_1_have_pht)
    53         vhdl.set_alias ("branch_complete_predictor_1_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_4-1, _param._shift_4-1));
     53        vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_1_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_4-1, _param._shift_4-1));
    5454        else
    55         vhdl.set_alias ("branch_complete_predictor_1_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_3-1, _param._shift_3-1));
     55        vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_1_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_3-1, _param._shift_3-1));
    5656
    5757        if (_param._predictor_0_have_pht)
    58         vhdl.set_alias ("branch_complete_predictor_0_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_2-1, _param._shift_2-1));
     58        vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_0_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_2-1, _param._shift_2-1));
    5959        else
    60         vhdl.set_alias ("branch_complete_predictor_0_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_1-1, _param._shift_1-1));
     60        vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_0_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_1-1, _param._shift_1-1));
    6161
    6262      }
    6363      }
    64 
    65 
    6664
    6765    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_declaration","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_transition.cpp

    r5 r44  
    2121    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_transition","Begin");
    2222
    23     // Evaluation before read the ouput signal
    24     sc_start(0);
    25 
    26     // In order with file Meta_Predictor_Glue_vhdl_testbench_port.cpp
    27     // Warning : if a output depend of a subcomponent, take directly the port of subcomponent
    28     // (because we have no control on the ordonnancer's policy)
    29 
    30     for (uint32_t i=0; i<_param._nb_prediction; i++)
    31       {
    32         if (_param._have_meta_predictor)
    33           {
    34         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_0_ACK [i]));
    35         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_1_ACK [i]));
    36           }
    37         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_2_ACK [i]));
    38         _vhdl_testbench->add_output(PORT_READ(out_PREDICT_ACK [i]));
    39 
    40         if (_param._have_meta_predictor)
    41           {
    42         if (_param._predictor_0_have_bht)
    43         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_0_BHT_HISTORY [i]));
    44         if (_param._predictor_0_have_pht)
    45         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_0_PHT_HISTORY [i]));
    46         if (_param._predictor_1_have_bht)
    47         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_1_BHT_HISTORY [i]));
    48         if (_param._predictor_1_have_pht)
    49         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_1_PHT_HISTORY [i]));
    50           }
    51         if (_param._predictor_2_have_bht)
    52         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_2_BHT_HISTORY [i]));
    53         if (_param._predictor_2_have_pht)
    54         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_2_PHT_HISTORY [i]));
    55 
    56         _vhdl_testbench->add_output(PORT_READ(out_PREDICT_HISTORY [i]));
    57         _vhdl_testbench->add_output(PORT_READ(out_PREDICT_DIRECTION [i]));
    58       }
    59 
    60     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    61       {
    62         if (_param._have_meta_predictor)
    63           {
    64         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_VAL             [i]));
    65         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i]));
    66 
    67         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i]));
    68         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i]));
    69           }
    70         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i]));
    71         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_ACK [i]));
    72 
    73         if (_param._have_meta_predictor)
    74           {
    75         if (_param._predictor_0_have_bht)
    76         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]));
    77         if (_param._predictor_0_have_pht)
    78         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i]));
    79         if (_param._predictor_1_have_bht)
    80         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i]));
    81         if (_param._predictor_1_have_pht)
    82         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i]));
    83           }
    84         if (_param._predictor_2_have_bht)
    85         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i]));
    86         if (_param._predictor_2_have_pht)
    87         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]));
    88 
    89         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_HISTORY   [i]));
    90         if (_param._have_meta_predictor)
    91           {
    92         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_DIRECTION [i]));
    93         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i]));
    94           }
    95       }
    96    
    97     // add_test :
    98     //  - True  : the cycle must be compare with the output of systemC
    99     //  - False : no test
    100     _vhdl_testbench->add_test(true);
    101 
    102     _vhdl_testbench->new_cycle (); // always at the end
     23//  sc_start(0);
     24    _interfaces->testbench();
    10325
    10426    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_transition","End");
Note: See TracChangeset for help on using the changeset viewer.