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
Files:
4 added
6 deleted
62 edited
4 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");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/SelfTest/src/test.cpp

    r15 r44  
    1010
    1111#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/SelfTest/include/test.h"
    12 #include "Include/Test.h"
     12#include "Common/include/Test.h"
    1313
    1414void test (string name,
     
    128128
    129129  sc_start(0);
    130   _Meta_Predictor->vhdl_testbench_label("Initialisation");
     130
     131  NRESET->write(0);
     132  sc_start(5);
     133  NRESET->write(1);
     134
    131135  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
    132136
    133 
    134   _Meta_Predictor->vhdl_testbench_label("Loop of Test");
    135137  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
    136138
    137139  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
    138140    {
    139       _Meta_Predictor->vhdl_testbench_label("Iteration "+toString(iteration));
    140141
    141142      sc_start(1);
     
    146147   ********************************************************/
    147148
     149  cout << "Test OK" << endl;
     150
    148151  cout << "<" << name << "> ............ Stop Simulation" << endl;
    149152
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/test.cpp

    r42 r44  
    1010
    1111#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/include/test.h"
    12 #include "Include/BitManipulation.h"
    13 #include "Include/Test.h"
     12#include "Common/include/BitManipulation.h"
     13#include "Common/include/Test.h"
    1414
    1515void test (string name,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h

    r43 r44  
    1313#endif
    1414
    15 #include "Include/ToString.h"
    16 #include "Include/Debug.h"
     15#include "Common/include/ToString.h"
     16#include "Common/include/Debug.h"
    1717
    1818// Internal structure
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h

    r15 r44  
    99 */
    1010
    11 #include "Include/Debug.h"
     11#include "Common/include/Debug.h"
    1212#include "Behavioural/include/Parameters.h"
    1313// Internal structure
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h

    r15 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/Two_Level_Branch_Predictor/Branch_History_Table/include/Types.h

    r2 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/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_body.cpp

    r42 r44  
    2020  void Branch_History_Table::vhdl_body (Vhdl * & vhdl)
    2121  {
    22 //     vhdl->set_body ("-- Output : always at '1'");
    23 //     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    24 //       vhdl->set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';");
    25 //     for (uint32_t i=0; i<_param._nb_prediction     ; i++)
    26 //       vhdl->set_body ("out_PREDICT_ACK_"+toString(i)+"         <= '1';");
    27 //     vhdl->set_body ("");
    28 
    29     list<string> list_port_map;
    30 
    31     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    32       {
    33         vhdl->set_body_component_port_map (list_port_map," in_SHIFTER_"+toString(i)+"_DATA     ","    in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"  );
    34         vhdl->set_body_component_port_map (list_port_map," in_SHIFTER_"+toString(i)+"_CARRY_IN ","    in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
    35         vhdl->set_body_component_port_map (list_port_map,"out_SHIFTER_"+toString(i)+"_DATA     ","signal_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"  );
    36       }
    37 
    38     vhdl->set_body_component ("component_Shifter",_name+"_Shifter",list_port_map);
    39 
    40     list_port_map.clear();
    41     vhdl->set_body_component_port_map (list_port_map,"in_CLOCK","in_CLOCK");
    42     vhdl->set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");
    43 
    44     for (uint32_t i=0; i<_param._nb_prediction; i++)
    45       {
    46         vhdl->set_body_component_port_map (list_port_map," in_READ_"+toString(i)+"_VAL     "," In_PREDICT_"+toString(i)+"_VAL");
    47         vhdl->set_body_component_port_map (list_port_map,"out_READ_"+toString(i)+"_ACK     ","out_PREDICT_"+toString(i)+"_ACK");
    48         vhdl->set_body_component_port_map (list_port_map," in_READ_"+toString(i)+"_ADDRESS "," in_PREDICT_"+toString(i)+"_ADDRESS");
    49         vhdl->set_body_component_port_map (list_port_map,"out_READ_"+toString(i)+"_DATA    ","out_PREDICT_"+toString(i)+"_HISTORY");
    50       }
    51    
    52     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    53       {
    54         vhdl->set_body_component_port_map (list_port_map," in_WRITE_"+toString(i)+"_VAL    ","    in_BRANCH_COMPLETE_"+toString(i)+"_VAL");
    55         vhdl->set_body_component_port_map (list_port_map,"out_WRITE_"+toString(i)+"_ACK    ","   out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
    56         vhdl->set_body_component_port_map (list_port_map," in_WRITE_"+toString(i)+"_ADDRESS","    in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
    57         vhdl->set_body_component_port_map (list_port_map," in_WRITE_"+toString(i)+"_DATA   ","signal_BRANCH_COMPLETE_"+toString(i)+"_HISTORY");
    58       }
    59     vhdl->set_body_component ("component_RegisterFile",_name+"_RegisterFile",list_port_map);
    6022  };
    6123
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_transition.cpp

    r42 r44  
    2020  void Branch_History_Table::vhdl_testbench_transition (void)
    2121  {
    22     sc_start(0);
     22//     sc_start(0);
    2323
    2424    _interfaces->testbench();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/config0.cfg

    r43 r44  
    222       8       *2      # size_counter         
    332       64      *4      # nb_counter       
    4 1       2       +1      # nb_prediction     
    5 1       2       +1      # nb_branch_complete
     41       1       +1      # nb_prediction     
     51       1       +1      # nb_branch_complete
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp

    r42 r44  
    1010
    1111#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/include/test.h"
    12 #include "Include/Test.h"
     12#include "Common/include/Test.h"
    1313
    1414void test (string name,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h

    r15 r44  
    99 */
    1010
    11 #include "Include/Debug.h"
     11#include "Common/include/Debug.h"
    1212#include "Behavioural/include/Parameters.h"
    1313// Internal structure
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h

    r42 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// Internal structure
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h

    r15 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/Two_Level_Branch_Predictor/Pattern_History_Table/include/Types.h

    r2 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/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_transition.cpp

    r42 r44  
    2222    log_printf(FUNC,Pattern_History_Table,"vhdl_testbench_transition","Begin");
    2323
    24     sc_start(0);
     24//     sc_start(0);
    2525
    2626    _interfaces->testbench();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/config0.cfg

    r43 r44  
    11Two_Level_Branch_Predictor
    2 1       1       +1      # have_bht           
    3 8       8       +1      # bht_size_shifter   
     20       1       +1      # have_bht           
     34       4       +1      # bht_size_shifter   
    4432      32      *2      # bht_nb_shifter     
    551       1       +1      # have_pht           
     
    882       2       +1      # pht_size_address_share
    9916      16      +1      # size_address     
    10 2       2       +1      # nb_prediction     
    11 2       2       +1      # nb_branch_complete
     101       2       +1      # nb_prediction     
     111       2       +1      # nb_branch_complete
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp

    r43 r44  
    1010
    1111#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h"
    12 #include "Include/Test.h"
    13 #include "Include/BitManipulation.h"
     12#include "Common/include/Test.h"
     13#include "Common/include/BitManipulation.h"
    1414void test (string name,
    1515           morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters param)
     
    132132  sc_start(0);
    133133
     134  NRESET->write(0);
     135  sc_start(5);
     136  NRESET->write(1);
     137
    134138  for (uint32_t i=0; i<param._nb_prediction; i++)
    135139    PREDICT_VAL                  [i]->write(0);
     
    156160      uint32_t nb_reg_by_group = (1<<(param._pht_size_address-size_address_shift));
    157161
     162//       cout << "pht_size_address           : " << param._pht_size_address << endl;
     163//       cout << "size_address_shift         : " << size_address_shift << endl;
     164//       cout << "nb_group                   : " << nb_group           << endl;
     165//       cout << "nb_reg_by_group            : " << nb_reg_by_group    << endl;
     166
    158167      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Init pht" << endl;
    159168     
     
    168177          for (uint32_t j=0; j<nb_reg_by_group; j++)
    169178            {
     179              cout << "j : " << j << " on " << nb_reg_by_group << endl;
    170180              BRANCH_COMPLETE_ADDRESS [num_port_branch_complete]->write(j);
    171              
     181
    172182              sc_start(1);
    173183
    174184              // wait ackwolegde
    175185              while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
    176                 sc_start(1);
     186                {
     187                  sc_start(1);
     188                }
    177189            }
    178190        }
     
    195207      // wait ackwolegde
    196208      while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
    197         sc_start(1);
     209        {
     210          sc_start(1);
     211        }
    198212    }
    199213
     
    225239      // wait ackwolegde
    226240      while (PREDICT_ACK [num_port_predict] -> read() == 0)
    227         sc_start(1);
     241        {
     242          sc_start(1);
     243        }
    228244      PREDICT_ACK                  [num_port_predict        ]->write(0);
    229245
     
    231247
    232248      // Test
     249      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Predict (Test)   : " << endl;
    233250      if (param._have_bht)
    234       TEST(Tbht_history_t,bht_history             ,PREDICT_BHT_HISTORY[num_port_predict]->read());
     251        {
     252          cout << "\tbht_history " << PREDICT_BHT_HISTORY[num_port_predict]->read() << endl;
     253          TEST(Tbht_history_t,bht_history             ,PREDICT_BHT_HISTORY[num_port_predict]->read());
     254        }
    235255      if (param._have_pht)
    236       TEST(Tpht_history_t,pht_history[bht_history],PREDICT_PHT_HISTORY[num_port_predict]->read());
     256        {
     257          cout << "\tpht_history " << PREDICT_PHT_HISTORY[num_port_predict]->read() << endl;
     258          TEST(Tpht_history_t,pht_history[bht_history],PREDICT_PHT_HISTORY[num_port_predict]->read());
     259        }
    237260
    238261      // update
     
    267290      // wait ackwolegde
    268291      while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
    269         sc_start(1);
    270 
     292        {
     293          sc_start(1);
     294        }
    271295      BRANCH_COMPLETE_VAL          [num_port_branch_complete]->write(0);
    272296    }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/config0.cfg

    r43 r44  
    11Two_Level_Branch_Predictor_Glue
    2 1       1       +1      # have_bht           
     20       1       +1      # have_bht           
    3311      11      +1      # bht_size_history   
    444       4       +1      # bht_size_address   
    5 0       1       +1      # have_pht           
     51       1       +1      # have_pht           
    6613      13      +1      # pht_size_address   
    7 0       2       +1      # pht_size_address_share
     72       2       +1      # pht_size_address_share
    8816      16      +1      # size_address       
    9 1       2       +1      # nb_prediction     
    10 1       2       +1      # nb_branch_complete
     92       2       +1      # nb_prediction     
     102       2       +1      # nb_branch_complete
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/test.cpp

    r42 r44  
    1010
    1111#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/include/test.h"
    12 #include "Include/BitManipulation.h"
    13 #include "Include/Test.h"
     12#include "Common/include/BitManipulation.h"
     13#include "Common/include/Test.h"
    1414
    1515void test (string name,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h

    r2 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/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h

    r2 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/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h

    r43 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/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Types.h

    r2 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/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters_msg_error.cpp

    r2 r44  
    2626    string msg = "";
    2727   
    28     if (_have_pht and (_pht_size_address_share >= _pht_size_address))
     28    if ((_have_bht and _have_pht) and (_pht_size_address_share >= _pht_size_address))
    2929      {
    3030        msg += "  - You can't have higher pht_size_address_share >= pht_size_address\n";
    3131        msg += "    * pht_size_address                : " + toString(_pht_size_address      ) + "\n";
    3232        msg += "    * pht_size_address_share          : " + toString(_pht_size_address_share) + "\n";
     33      }
     34    if ((_have_bht and _have_pht) and (_bht_size_history > _pht_size_address))
     35      {
     36        msg += "  - You can't have higher bht_size_history > pht_size_address\n";
     37        msg += "    * bht_size_history                : " + toString(_bht_size_history      ) + "\n";
     38        msg += "    * pht_size_address                : " + toString(_pht_size_address      ) + "\n";
    3339      }
    3440
  • 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

    r42 r44  
    3434    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Two_Level_Branch_Predictor_Glue","Begin");
    3535
    36 #ifdef SYSTEMC
    3736    allocation ();
    38 #endif
    3937
    4038#ifdef STATISTICS
  • 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_genMealy_branch_complete_ack.cpp

    r2 r44  
    88
    99#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
    10 #include "Include/BitManipulation.h"
     10#include "Common/include/BitManipulation.h"
    1111
    1212namespace morpheo {
  • 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_genMealy_branch_complete_bht_address.cpp

    r2 r44  
    88
    99#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
    10 #include "Include/BitManipulation.h"
     10#include "Common/include/BitManipulation.h"
    1111
    1212namespace morpheo {
  • 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_genMealy_branch_complete_pht_address.cpp

    r3 r44  
    88
    99#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
    10 #include "Include/BitManipulation.h"
     10#include "Common/include/BitManipulation.h"
    1111
    1212namespace morpheo {
  • 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_genMealy_predict_ack.cpp

    r2 r44  
    88
    99#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
    10 #include "Include/BitManipulation.h"
     10#include "Common/include/BitManipulation.h"
    1111
    1212namespace morpheo {
  • 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_genMealy_predict_bht_address.cpp

    r3 r44  
    88
    99#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
    10 #include "Include/BitManipulation.h"
     10#include "Common/include/BitManipulation.h"
    1111
    1212namespace morpheo {
  • 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_genMealy_predict_pht_address.cpp

    r2 r44  
    88
    99#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
    10 #include "Include/BitManipulation.h"
     10#include "Common/include/BitManipulation.h"
    1111
    1212namespace morpheo {
  • 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

    r42 r44  
    2222    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_transition","Begin");
    2323
    24     sc_start(0);
     24//     sc_start(0);
    2525
    2626    _interfaces->testbench();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h

    r2 r44  
    99 */
    1010
    11 #include "Include/Debug.h"
     11#include "Common/include/Debug.h"
    1212#include "Behavioural/include/Parameters.h"
    1313// Internal structure
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h

    r2 r44  
    1010 */
    1111
    12 #include "Include/Debug.h"
     12#include "Common/include/Debug.h"
    1313// Internal structure
    1414#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h

    r43 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// Internal structure
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h

    r2 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/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp

    r43 r44  
    1818  void Two_Level_Branch_Predictor::allocation (void)
    1919  {
    20     string rename;
    21 
    2220    log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","Begin");
    2321
     
    176174    if (_param._have_bht)
    177175      {
    178         cout << "GEU 1" << endl;
    179176#ifdef POSITION
    180177        _component->interface_map (_name+"_Branch_History_Table","",
     
    214211    if (_param._have_pht)
    215212      {
    216         cout << "GEU 2" << endl;
    217213#ifdef POSITION
    218214        _component->interface_map (_name+"_Pattern_History_Table","",
     
    250246
    251247    // =====[ component_Two_Level_Branch_Predictor_Glue - Instanciation ]=
    252     cout << "GEU 3" << endl;
    253248#ifdef POSITION
    254249        _component->interface_map (_name+"_Two_Level_Branch_Predictor_Glue","",
     
    258253        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_NRESET", _name,"in_NRESET");
    259254
    260         cout << "GEU 3.1" << endl;
    261255        for (uint32_t i=0; i<_param._nb_prediction; i++)
    262256          {
    263             cout << "GEU 3.1.1" << endl;
    264257        if (_param._have_bht)
    265258          {
     
    267260        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_BHT_ADDRESS", _name+"_Branch_History_Table" ,  "in_PREDICT_"+toString(i)+"_ADDRESS");
    268261          }
    269         cout << "GEU 3.1.2" << endl;
    270262        if (_param._have_pht)
    271263          {
     
    273265        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_PHT_ADDRESS", _name+"_Pattern_History_Table",  "in_PREDICT_"+toString(i)+"_ADDRESS");
    274266          }
    275         cout << "GEU 3.1.3" << endl;
    276267        if (_param._have_bht and _param._have_pht)
    277         _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name                         ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
    278         cout << "GEU 3.1.4.1" << endl;
     268        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Branch_History_Table" ,"out_PREDICT_"+toString(i)+"_HISTORY");
    279269        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_ACK"         , _name                         ,"out_PREDICT_"+toString(i)+"_ACK");
    280270        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name                         , "in_PREDICT_"+toString(i)+"_ADDRESS");
    281271          }
    282272   
    283         cout << "GEU 3.2" << endl;
    284273    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    285274      {
     
    299288        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name                         , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
    300289      }
    301     cout << "GEU 4" << endl; 
    302290#ifdef POSITION
    303291    _component->generate_file();
     
    306294    log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End");
    307295  };
    308 
    309 
    310 
    311 
    312 
    313 
    314 
    315 //   void Two_Level_Branch_Predictor::allocation (void)
    316 //   {
    317 //     string rename;
    318 
    319 //     log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","Begin");
    320 
    321 //     _component   = new Component ();
    322 
    323 //     Entity * entity = _component->set_entity (_name                 
    324 // #ifdef POSITION
    325 //                                           ,"Two_Level_Branch_Predictor"
    326 //                                           ,MIXTE
    327 // #endif
    328 //                                            );
    329    
    330 //     _interfaces = entity->set_interfaces();
    331 
    332 //     // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    333 //     {
    334 //       Interface * interface = _interfaces->set_interface(""
    335 // #ifdef POSITION
    336 //                                                       , IN 
    337 //                                                       , SOUTH
    338 //                                                       , "Generalist interface"
    339 // #endif
    340 //                                                       );
    341      
    342 //       in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
    343 //       in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
    344 //     }
    345    
    346 //     // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    347 
    348 //      in_PREDICT_VAL                 = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
    349 //     out_PREDICT_ACK                 = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
    350 //      in_PREDICT_ADDRESS             = new SC_IN (Taddress_t)     * [_param._nb_prediction     ];
    351 //     if (_param._have_bht)
    352 //     out_PREDICT_BHT_HISTORY         = new SC_OUT(Tbht_history_t) * [_param._nb_prediction     ];
    353 //     if (_param._have_pht)
    354 //     out_PREDICT_PHT_HISTORY         = new SC_OUT(Tpht_history_t) * [_param._nb_prediction     ];
    355 // //     if (_param._have_bht)
    356 // //       {
    357 // //     signal_PREDICT_BHT_ACK          = new SC_SIGNAL(Tcontrol_t)     * [_param._nb_prediction];
    358 // //     signal_PREDICT_BHT_ADDRESS      = new SC_SIGNAL(Taddress_t)     * [_param._nb_prediction];
    359 // //       }
    360 // //     if (_param._have_pht)
    361 // //       {
    362 // //     signal_PREDICT_PHT_ACK          = new SC_SIGNAL(Tcontrol_t)     * [_param._nb_prediction];
    363 // //     signal_PREDICT_PHT_ADDRESS      = new SC_SIGNAL(Taddress_t)     * [_param._nb_prediction];
    364 // //       }
    365 
    366 //     for (uint32_t i=0; i<_param._nb_prediction; i++)
    367 //       {
    368 //      rename = "in_PREDICT_VAL_"         +toString(i);
    369 //       in_PREDICT_VAL                 [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    370 
    371 //      rename = "out_PREDICT_ACK_"        +toString(i);
    372 //      out_PREDICT_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    373 
    374 //      rename = "in_PREDICT_ADDRESS_"     +toString(i);
    375 //       in_PREDICT_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
    376 
    377 //      if (_param._have_bht)
    378 //        {
    379 //      rename = "out_PREDICT_BHT_HISTORY_"+toString(i);
    380 //      out_PREDICT_BHT_HISTORY         [i] = new SC_OUT(Tbht_history_t) (rename.c_str());
    381 //        }
    382 
    383 //      if (_param._have_pht)
    384 //        {
    385 //      rename = "out_PREDICT_PHT_HISTORY_"+toString(i);
    386 //      out_PREDICT_PHT_HISTORY         [i] = new SC_OUT(Tpht_history_t) (rename.c_str());
    387 //        }
    388 
    389 // //   if (_param._have_bht)
    390 // //     {
    391 // //   rename = "signal_PREDICT_BHT_ACK_"    +toString(i);
    392 // //   signal_PREDICT_BHT_ACK          [i] = new SC_SIGNAL(Tcontrol_t)     (rename.c_str());
    393 
    394 // //   rename = "signal_PREDICT_BHT_ADDRESS_"+toString(i);
    395 // //   signal_PREDICT_BHT_ADDRESS      [i] = new SC_SIGNAL(Taddress_t)     (rename.c_str());
    396 // //     }
    397 
    398 // //   if (_param._have_pht)
    399 // //     {
    400 // //   rename = "signal_PREDICT_PHT_ACK_"    +toString(i);
    401 // //   signal_PREDICT_PHT_ACK          [i] = new SC_SIGNAL(Tcontrol_t)     (rename.c_str());
    402 
    403 // //   rename = "signal_PREDICT_PHT_ADDRESS_"+toString(i);
    404 // //   signal_PREDICT_PHT_ADDRESS      [i] = new SC_SIGNAL(Taddress_t)     (rename.c_str());
    405 // //     }
    406 //       }
    407 
    408 //      in_BRANCH_COMPLETE_VAL         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
    409 //     out_BRANCH_COMPLETE_ACK         = new SC_OUT(Tcontrol_t)     * [_param._nb_branch_complete];
    410 //      in_BRANCH_COMPLETE_ADDRESS     = new SC_IN (Taddress_t)     * [_param._nb_branch_complete];
    411 //     if (_param._have_bht)
    412 //      in_BRANCH_COMPLETE_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_branch_complete];
    413 //     if (_param._have_pht)
    414 //      in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete];
    415 //      in_BRANCH_COMPLETE_DIRECTION   = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
    416 // //     if (_param._have_bht)
    417 // //       {
    418 // //     signal_BRANCH_COMPLETE_BHT_ACK     = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];
    419 // //     signal_BRANCH_COMPLETE_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete];
    420 // //       }
    421 // //     if (_param._have_pht)
    422 // //       {
    423 // //     signal_BRANCH_COMPLETE_PHT_ACK     = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];
    424 // //     signal_BRANCH_COMPLETE_PHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete];
    425 // //       }
    426 
    427 //     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    428 //       {
    429 //      rename = "in_BRANCH_COMPLETE_VAL_"         +toString(i);
    430 //       in_BRANCH_COMPLETE_VAL         [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    431 
    432 //      rename = "out_BRANCH_COMPLETE_ACK_"        +toString(i);
    433 //      out_BRANCH_COMPLETE_ACK         [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    434 
    435 //      rename = "in_BRANCH_COMPLETE_ADDRESS_"     +toString(i);
    436 //       in_BRANCH_COMPLETE_ADDRESS     [i] = new SC_IN (Taddress_t)     (rename.c_str());
    437 
    438 //      if (_param._have_bht)
    439 //        {
    440 //      rename = "in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i);
    441 //       in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str());
    442 //        }
    443 //      if (_param._have_pht)
    444 //        {
    445 //      rename = "in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);
    446 //       in_BRANCH_COMPLETE_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str());
    447 //        }
    448 //      rename = "in_BRANCH_COMPLETE_DIRECTION_"  +toString(i);
    449 //       in_BRANCH_COMPLETE_DIRECTION   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    450 // //   if (_param._have_bht)
    451 // //     {
    452 // //   rename = "signal_BRANCH_COMPLETE_BHT_ACK_"    +toString(i);
    453 // //   signal_BRANCH_COMPLETE_BHT_ACK     [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    454 
    455 // //   rename = "signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i);
    456 // //   signal_BRANCH_COMPLETE_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str());
    457 // //     }
    458 // //   if (_param._have_pht)
    459 // //     {
    460 // //   rename = "signal_BRANCH_COMPLETE_PHT_ACK_"    +toString(i);
    461 // //   signal_BRANCH_COMPLETE_PHT_ACK     [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    462 
    463 // //   rename = "signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i);
    464 // //   signal_BRANCH_COMPLETE_PHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str());
    465 // //     }
    466 //       }
    467 
    468 //     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    469 //     string name_component;
    470 
    471 //     // =====[ component_Branch_History_Table ]============================   
    472 //     if (_param._have_bht)
    473 //       {
    474 //      name_component = _name+"_Branch_History_Table";
    475 
    476 //      log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
    477        
    478 //      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()               ,
    479 // #ifdef STATISTICS
    480 //                                                                                                                                                                                     _param_statistics                    ,
    481 // #endif
    482 //                                                                                                                                                                                     *(_param._param_branch_history_table));
    483        
    484 //      // Instantiation
    485 //      (*(component_Branch_History_Table->in_CLOCK ))        (*(in_CLOCK ));
    486 //      (*(component_Branch_History_Table->in_NRESET))        (*(in_NRESET));
    487 
    488 //      for (uint32_t i=0; i<_param._nb_prediction; i++)
    489 //        {
    490 //          (*(component_Branch_History_Table-> in_PREDICT_VAL             [i]))    (*(    in_PREDICT_VAL          [i]));
    491 //          (*(component_Branch_History_Table->out_PREDICT_ACK             [i]))    (*(signal_PREDICT_BHT_ACK      [i]));
    492 //          (*(component_Branch_History_Table-> in_PREDICT_ADDRESS         [i]))    (*(signal_PREDICT_BHT_ADDRESS  [i]));
    493 //          (*(component_Branch_History_Table->out_PREDICT_HISTORY         [i]))    (*(   out_PREDICT_BHT_HISTORY  [i]));
    494 //        }
    495        
    496 //      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    497 //        {
    498 //          (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
    499 //          (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK       [i]))    (*(signal_BRANCH_COMPLETE_BHT_ACK     [i]));
    500 //          (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))    (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i]));
    501 //          (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))    (*(    in_BRANCH_COMPLETE_BHT_HISTORY [i]));
    502 //          (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION   [i]));
    503 //        }
    504 //       }
    505 
    506 //     // =====[ component_Pattern_History_Table ]===========================   
    507 //     if (_param._have_pht)
    508 //       {
    509 //      name_component = _name+"_Pattern_History_Table";
    510        
    511 //      log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
    512        
    513 //      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()               ,
    514 // #ifdef STATISTICS
    515 //                                                                                                                                                                                       _param_statistics                    ,
    516 // #endif
    517 //                                                                                                                                                                                       *(_param._param_pattern_history_table));
    518        
    519 //      // Instantiation
    520 //      (*(component_Pattern_History_Table->in_CLOCK))        (*(in_CLOCK));
    521 //      (*(component_Pattern_History_Table->in_NRESET))       (*(in_NRESET));
    522        
    523 //      for (uint32_t i=0; i<_param._nb_prediction; i++)
    524 //        {
    525 //          (*(component_Pattern_History_Table-> in_PREDICT_VAL             [i]))    (*(    in_PREDICT_VAL          [i]));
    526 //          (*(component_Pattern_History_Table->out_PREDICT_ACK             [i]))    (*(signal_PREDICT_PHT_ACK      [i]));
    527 //          (*(component_Pattern_History_Table-> in_PREDICT_ADDRESS         [i]))    (*(signal_PREDICT_PHT_ADDRESS  [i]));
    528 //          (*(component_Pattern_History_Table->out_PREDICT_HISTORY         [i]))    (*(   out_PREDICT_PHT_HISTORY  [i]));
    529 //        }
    530        
    531 //      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    532 //        {
    533 //          (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
    534 //          (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK       [i]))    (*(signal_BRANCH_COMPLETE_PHT_ACK     [i]));
    535 //          (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))    (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i]));
    536 //          (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))    (*(    in_BRANCH_COMPLETE_PHT_HISTORY [i]));
    537 //          (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION   [i]));
    538 //        }
    539 //       }
    540 
    541 //     // =====[ component_Two_Level_Branch_Predictor_Glue ]===========================   
    542 //     name_component = _name+"_Two_Level_Branch_Predictor_Glue";
    543    
    544 //     log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
    545    
    546 //     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()               ,
    547 // #ifdef STATISTICS
    548 //                                                                                                                                                                                                                 _param_statistics                    ,
    549 // #endif
    550 //                                                                                                                                                                                                                 *(_param._param_two_level_branch_predictor_glue));
    551    
    552 //     // Instantiation
    553 // #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    554 //     (*(component_Two_Level_Branch_Predictor_Glue->in_CLOCK))        (*(in_CLOCK));
    555 // #endif       
    556 //     for (uint32_t i=0; i<_param._nb_prediction; i++)
    557 //       {
    558 //      if (_param._have_bht)
    559 //        {
    560 //          (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_ACK             [i])) (*(signal_PREDICT_BHT_ACK              [i]));
    561 //          (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_BHT_ADDRESS         [i])) (*(signal_PREDICT_BHT_ADDRESS          [i]));
    562 //        }                                                                                                                                                                       
    563 //      if (_param._have_pht)                                                                                                                     
    564 //        {                                                                                                                                                                       
    565 //          (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_PHT_ACK             [i])) (*(signal_PREDICT_PHT_ACK              [i]));
    566 //          (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_PHT_ADDRESS         [i])) (*(signal_PREDICT_PHT_ADDRESS          [i]));
    567 //        }                                                                                                                                                                       
    568 //      if (_param._have_bht and _param._have_pht)                                                                                       
    569 //        {                                                                                                                                                                       
    570 //          (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY         [i])) (*(   out_PREDICT_BHT_HISTORY          [i]));
    571 //        }                                                                                                                                                                       
    572 //      (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK                 [i])) (*(   out_PREDICT_ACK                  [i]));
    573 //      (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS              [i]));
    574 //       }
    575    
    576 //     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    577 //       {
    578 //      if (_param._have_bht)
    579 //        {
    580 //          (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_ACK     [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK      [i]));
    581 //          (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS  [i]));
    582 //        }                                                                                                                                                       
    583 //      if (_param._have_pht)                                                                                                     
    584 //        {                                                                                                                                                       
    585 //          (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_PHT_ACK     [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK      [i]));
    586 //          (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS  [i]));
    587 //        }                                                                                                                                                       
    588 //      if (_param._have_bht and _param._have_pht)                                                                               
    589 //        {                                                                                                                                                       
    590 //          (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(    in_BRANCH_COMPLETE_BHT_HISTORY  [i]));
    591 //        }                                                                                                                                                       
    592 //      (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK         [i])) (*(   out_BRANCH_COMPLETE_ACK          [i]));
    593 //      (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS      [i]));
    594 //       }
    595  
    596 //     log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End");
    597 //   };
    598296 
    599297}; // end namespace two_level_branch_predictor
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp

    r43 r44  
    2121    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","Begin");
    2222
    23 //     list<string> list_port_map;
    24 
    25 //     if (_param._have_bht)
    26 //       {
    27 //      list_port_map.clear();
    28 
    29 //      vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK ");
    30 //      vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");
    31 
    32 //      for (uint32_t i=0; i<_param._nb_prediction; i++)
    33 //        {
    34 //          vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+"              ","    in_PREDICT_VAL_"+toString(i));
    35 //          vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"              ","signal_PREDICT_BHT_ACK_"+toString(i));
    36 //          vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+"          ","signal_PREDICT_BHT_ADDRESS_"+toString(i));
    37 //          vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_HISTORY_"+toString(i)+"          ","signal_PREDICT_BHT_HISTORY_"+toString(i));
    38 //        }
    39        
    40 //      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    41 //        {
    42 //          vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ","    in_BRANCH_COMPLETE_VAL_"+toString(i));
    43 //          vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ","signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i));
    44 //          vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ","signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i));
    45 //          vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ","    in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i));
    46 //          vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"","    in_BRANCH_COMPLETE_DIRECTION_"+toString(i));
    47 //        }
    48        
    49 //      vhdl.set_body_component ("component_Branch_History_Table",_name+"_Branch_History_Table",list_port_map);
    50 //       }
    51 
    52 //     if (_param._have_pht)
    53 //       {
    54 //      list_port_map.clear();
    55 
    56 //      vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK ");
    57 //      vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");
    58 
    59 //      for (uint32_t i=0; i<_param._nb_prediction; i++)
    60 //        {
    61 //          vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+"              ","    in_PREDICT_VAL_"+toString(i));
    62 //          vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"              ","signal_PREDICT_PHT_ACK_"+toString(i));
    63 //          vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+"          ","signal_PREDICT_PHT_ADDRESS_"+toString(i));
    64 //          vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_HISTORY_"+toString(i)+"          ","   out_PREDICT_PHT_HISTORY_"+toString(i));
    65 //        }
    66        
    67 //      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    68 //        {
    69 //          vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ","    in_BRANCH_COMPLETE_VAL_"+toString(i));
    70 //          vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ","signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i));
    71 //          vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ","signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i));
    72 //          vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ","    in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i));
    73 //          vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"","    in_BRANCH_COMPLETE_DIRECTION_"+toString(i));
    74 //        }
    75        
    76 //      vhdl.set_body_component ("component_Pattern_History_Table",_name+"_Pattern_History_Table",list_port_map);
    77 //       }
    78 
    79 //     list_port_map.clear();
    80    
    81 //     for (uint32_t i=0; i<_param._nb_prediction; i++)
    82 //       {
    83 //      if (_param._have_bht)
    84 //        {
    85 //      vhdl.set_body_component_port_map (list_port_map," in_PREDICT_BHT_ACK_"+toString(i)+"            ","signal_PREDICT_BHT_ACK_"+toString(i));
    86 //      vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_BHT_ADDRESS_"+toString(i)+"        ","signal_PREDICT_BHT_ADDRESS_"+toString(i));
    87 //        }                                                                                                                                                                       
    88 //      if (_param._have_pht)                                                                                                                     
    89 //        {                                                                                                                                                                       
    90 //      vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PHT_ACK_"+toString(i)+"            ","signal_PREDICT_PHT_ACK_"+toString(i));
    91 //      vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_PHT_ADDRESS_"+toString(i)+"        ","signal_PREDICT_PHT_ADDRESS_"+toString(i));
    92 //        }                                                                                                                                                                       
    93 //      if (_param._have_bht and _param._have_pht)                                                                                       
    94 //        {                                                                                                                                                                       
    95 //      vhdl.set_body_component_port_map (list_port_map," in_PREDICT_BHT_HISTORY_"+toString(i)+"        ","signal_PREDICT_BHT_HISTORY_"+toString(i));
    96 //        }                                                                                                                                                                       
    97 //      vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"                ","   out_PREDICT_ACK_"+toString(i));
    98 //      vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+"            ","    in_PREDICT_ADDRESS_"+toString(i));
    99 //       }
    100    
    101 //     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    102 //       {
    103 //      if (_param._have_bht)
    104 //        {
    105 //      vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_ACK_"+toString(i)+"    ","signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i));
    106 //      vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i)+"","signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i));
    107 //        }                                                                                                                                                       
    108 //      if (_param._have_pht)
    109 //        {
    110 //      vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PHT_ACK_"+toString(i)+"    ","signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i));
    111 //      vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+"","signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i));
    112 //        }                                                                                                                                                       
    113 //      if (_param._have_bht and _param._have_pht)
    114 //        {
    115 //         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+"","    in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i));
    116 //        }                                                                                                                                                       
    117 //      vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"        ","   out_BRANCH_COMPLETE_ACK_"+toString(i));
    118 //      vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"    ","    in_BRANCH_COMPLETE_ADDRESS_"+toString(i));
    119 //       }
    120 
    121 //     vhdl.set_body_component ("component_Two_Level_Branch_Predictor_Glue",_name+"_Two_Level_Branch_Predictor_Glue",list_port_map);
    122 
    123 //     if (_param._have_bht)
    124 //       for (uint32_t i=0; i<_param._nb_prediction; i++)
    125 //      vhdl.set_body("out_PREDICT_BHT_HISTORY_"+toString(i)+" <= signal_PREDICT_BHT_HISTORY_"+toString(i)+";");
    12623   
    12724    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_declaration.cpp

    r42 r44  
    2121    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","Begin");
    2222
    23     for (uint32_t i=0; i<_param._nb_prediction; i++)
    24       {
    25         if (_param._have_bht)
    26           {
    27         vhdl->set_signal  ("signal_PREDICT_BHT_ACK_"+toString(i), 1);
    28         vhdl->set_signal  ("signal_PREDICT_BHT_ADDRESS_"+toString(i), _param._bht_size_address);
    29         vhdl->set_signal  ("signal_PREDICT_BHT_HISTORY_"+toString(i), _param._bht_size_shifter);
    30           }
    31         if (_param._have_pht)
    32           {
    33         vhdl->set_signal  ("signal_PREDICT_PHT_ACK_"+toString(i), 1);
    34         vhdl->set_signal  ("signal_PREDICT_PHT_ADDRESS_"+toString(i), _param._pht_size_address);
    35           }
    36       }
    37 
    38     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    39       {
    40         if (_param._have_bht)
    41           {
    42         vhdl->set_signal  ("signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i), 1);
    43         vhdl->set_signal  ("signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i), _param._bht_size_address);
    44           }
    45         if (_param._have_pht)
    46           {
    47         vhdl->set_signal  ("signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i), 1);
    48         vhdl->set_signal  ("signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i), _param._pht_size_address);
    49           }
    50       }
    5123    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","End");
    5224  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_transition.cpp

    r42 r44  
    2121    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_transition","Begin");
    2222
    23     sc_start(0);
     23//     sc_start(0);
    2424
    2525    _interfaces->testbench();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h

    r15 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// Internal structure
     
    2929#include "Behavioural/include/Vhdl.h"
    3030#endif
    31 #ifdef VHDL_TESTBENCH
    32 #include "Behavioural/include/Vhdl_Testbench.h"
    33 #endif
     31#include "Behavioural/include/Component.h"
    3432
    3533using namespace std;
     
    6058#endif
    6159
    62 #ifdef VHDL_TESTBENCH
    63   private   : Vhdl_Testbench                 * _vhdl_testbench;
    64 #endif
     60  public    : Component                      * _component;
     61  private   : Interfaces                     * _interfaces;
    6562
    6663#ifdef SYSTEMC
     
    155152#if VHDL                                       
    156153  public  : void     vhdl                      (void);
    157   private : void     vhdl_port                 (Vhdl & vhdl);
    158   private : void     vhdl_declaration          (Vhdl & vhdl);
    159   private : void     vhdl_body                 (Vhdl & vhdl);
     154  private : void     vhdl_declaration          (Vhdl * & vhdl);
     155  private : void     vhdl_body                 (Vhdl * & vhdl);
    160156#endif                                         
    161                                                
    162157#ifdef VHDL_TESTBENCH                         
    163   private : void     vhdl_testbench_port       (void);
    164158  private : void     vhdl_testbench_transition (void);
    165159#endif
    166   public  : void     vhdl_testbench_label      (string label);
    167160  };
    168161
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/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 "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Statistics.h

    r5 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/include/Types.h

    r5 r44  
    99 */
    1010
    11 #include "Include/Types.h"
     11#include "Common/include/Types.h"
    1212
    1313namespace morpheo {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/src/Meta_Predictor.cpp

    r5 r44  
    3232    log_printf(FUNC,Meta_Predictor,"Meta_Predictor","Begin");
    3333
     34#ifdef SYSTEMC
     35    allocation ();
     36#endif
     37
    3438#ifdef STATISTICS
    3539    // Allocation of statistics
     
    3741                            param_statistics          ,
    3842                            param);
    39 #endif
    40 
    41 #ifdef VHDL_TESTBENCH
    42     // Creation of a testbench
    43     //  -> port
    44     //  -> clock's signals
    45     _vhdl_testbench = new Vhdl_Testbench (_name);
    46     vhdl_testbench_port           ();
    47     _vhdl_testbench->set_clock    ("in_CLOCK",true);
    4843#endif
    4944
     
    5449
    5550#ifdef SYSTEMC
    56     allocation ();
    57 
    5851#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    5952    SC_METHOD (transition);
     
    7366  {
    7467    log_printf(FUNC,Meta_Predictor,"~Meta_Predictor","Begin");
    75 
    76 #ifdef VHDL_TESTBENCH
    77     // generate the test bench
    78     _vhdl_testbench->generate_file();
    79     delete _vhdl_testbench;
    80 #endif
    8168
    8269#ifdef STATISTICS
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/src/Meta_Predictor_allocation.cpp

    r15 r44  
    1818  void Meta_Predictor::allocation (void)
    1919  {
    20     string rename;
    21 
    2220    log_printf(FUNC,Meta_Predictor,"allocation","Begin");
    2321
    24     in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
    25     in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET");
     22    _component   = new Component ();
     23
     24    Entity * entity = _component->set_entity (_name                 
     25                                             ,"Meta_Predictor"
     26#ifdef POSITION
     27                                             ,MIXTE
     28#endif
     29                                              );
     30   
     31    _interfaces = entity->set_interfaces();
     32
     33    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     34    {
     35      Interface * interface = _interfaces->set_interface(""
     36#ifdef POSITION
     37                                                         , IN 
     38                                                         , SOUTH
     39                                                         , "Generalist interface"
     40#endif
     41                                                         );
     42     
     43      in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
     44      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
     45    }
     46
     47    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2648
    2749     in_PREDICT_VAL                 = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
     
    3355    for (uint32_t i=0; i<_param._nb_prediction; i++)
    3456      {
    35         rename = "in_PREDICT_VAL_"         +toString(i);
    36          in_PREDICT_VAL                 [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    37 
    38         rename = "out_PREDICT_ACK_"        +toString(i);
    39         out_PREDICT_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    40 
    41         rename = "in_PREDICT_ADDRESS_"     +toString(i);
    42          in_PREDICT_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
    43 
    44         rename = "out_PREDICT_HISTORY_"    +toString(i);
    45         out_PREDICT_HISTORY             [i] = new SC_OUT(Thistory_t)     (rename.c_str());
    46 
    47         rename = "out_PREDICT_DIRECTION_"  +toString(i);
    48         out_PREDICT_DIRECTION           [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    49       }
     57        Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
     58#ifdef POSITION
     59                                                                , IN 
     60                                                                , WEST
     61                                                                , "Interface Predict"
     62#endif
     63                                                                );
     64
     65         in_PREDICT_VAL                 [i] = interface->set_signal_valack_in        ("val"      , VAL);
     66        out_PREDICT_ACK                 [i] = interface->set_signal_valack_out       ("ack"      , ACK);
     67         in_PREDICT_ADDRESS             [i] = interface->set_signal_in  <Taddress_t> ("address"  , _param._size_address);
     68        out_PREDICT_HISTORY             [i] = interface->set_signal_out <Thistory_t> ("history"  , _param._size_history);
     69        out_PREDICT_DIRECTION           [i] = interface->set_signal_out <Tcontrol_t> ("direction", 1);
     70      }
     71
     72    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    5073
    5174     in_BRANCH_COMPLETE_VAL         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
     
    5780    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    5881      {
    59         rename = "in_BRANCH_COMPLETE_VAL_"         +toString(i);
    60          in_BRANCH_COMPLETE_VAL         [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    61 
    62         rename = "out_BRANCH_COMPLETE_ACK_"        +toString(i);
    63         out_BRANCH_COMPLETE_ACK         [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
    64 
    65         rename = "in_BRANCH_COMPLETE_ADDRESS_"     +toString(i);
    66          in_BRANCH_COMPLETE_ADDRESS     [i] = new SC_IN (Taddress_t)     (rename.c_str());
    67 
    68         rename = "in_BRANCH_COMPLETE_HISTORY_"     +toString(i);
    69          in_BRANCH_COMPLETE_HISTORY     [i] = new SC_IN (Thistory_t)     (rename.c_str());
    70 
    71         rename = "in_BRANCH_COMPLETE_DIRECTION_"   +toString(i);
    72          in_BRANCH_COMPLETE_DIRECTION   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
    73       }
    74 
    75     // ~~~~~[ Signal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    76 
    77     if (_param._have_meta_predictor)
    78       {
    79     signal_PREDICT_PREDICTOR_0_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
    80     signal_PREDICT_PREDICTOR_1_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
    81       }
    82     signal_PREDICT_PREDICTOR_2_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
    83 
    84     if (_param._have_meta_predictor)
    85       {                                                                                                               
    86     if (_param._predictor_0_have_bht)
    87     signal_PREDICT_PREDICTOR_0_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
    88     if (_param._predictor_0_have_pht)
    89     signal_PREDICT_PREDICTOR_0_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
    90     if (_param._predictor_0_have_bht)
    91     signal_PREDICT_PREDICTOR_1_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
    92     if (_param._predictor_1_have_pht)
    93     signal_PREDICT_PREDICTOR_1_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
    94       }                                                                                                               
    95     if (_param._predictor_2_have_bht)
    96     signal_PREDICT_PREDICTOR_2_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
    97     if (_param._predictor_2_have_pht)
    98     signal_PREDICT_PREDICTOR_2_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
    99 
    100     for (uint32_t i=0; i<_param._nb_prediction; i++)
    101       {
    102         if (_param._have_meta_predictor)
    103           {                                                                                                                   
    104         rename = "signal_PREDICT_PREDICTOR_0_ACK_"+toString(i);
    105         signal_PREDICT_PREDICTOR_0_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    106         rename = "signal_PREDICT_PREDICTOR_1_ACK_"+toString(i);
    107         signal_PREDICT_PREDICTOR_1_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    108           }
    109         rename = "signal_PREDICT_PREDICTOR_2_ACK_"+toString(i);
    110         signal_PREDICT_PREDICTOR_2_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    111 
    112         if (_param._have_meta_predictor)
    113           {                                                                                                                   
    114         if (_param._predictor_0_have_bht)
    115           {
    116         rename = "signal_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i);
    117         signal_PREDICT_PREDICTOR_0_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
    118           }
    119         if (_param._predictor_0_have_pht)
    120           {
    121         rename = "signal_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i);
    122         signal_PREDICT_PREDICTOR_0_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
    123           }
    124         if (_param._predictor_1_have_bht)
    125           {
    126         rename = "signal_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i);
    127         signal_PREDICT_PREDICTOR_1_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
    128           }
    129         if (_param._predictor_1_have_pht)
    130           {
    131         rename = "signal_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i);
    132         signal_PREDICT_PREDICTOR_1_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
    133           }
    134           }
    135         if (_param._predictor_2_have_bht)
    136           {
    137         rename = "signal_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i);
    138         signal_PREDICT_PREDICTOR_2_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
    139           }
    140         if (_param._predictor_2_have_pht)
    141           {
    142         rename = "signal_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i);
    143         signal_PREDICT_PREDICTOR_2_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
    144           }
    145       }
    146     if (_param._have_meta_predictor)
    147       {
    148     signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
    149     signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
    150     signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
    151     signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
    152       }
    153     signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
    154 
    155     if (_param._have_meta_predictor)
    156       {                                                                                                               
    157     if (_param._predictor_0_have_bht)
    158     signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
    159     if (_param._predictor_0_have_pht)
    160     signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
    161     if (_param._predictor_0_have_bht)
    162     signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
    163     if (_param._predictor_1_have_pht)
    164     signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
    165       }                                                                                                               
    166     if (_param._predictor_2_have_bht)
    167     signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
    168     if (_param._predictor_2_have_pht)
    169     signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
    170 
    171     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    172       {
    173         if (_param._have_meta_predictor)
    174           {                                                                                                                   
    175         rename = "signal_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i);
    176         signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    177         rename = "signal_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i);
    178         signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    179         rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i);
    180         signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    181         rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i);
    182         signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    183           }
    184         rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i);
    185         signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
    186 
    187         if (_param._have_meta_predictor)
    188           {                                                                                                                   
    189         if (_param._predictor_0_have_bht)
    190           {
    191         rename = "signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i);
    192         signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
    193           }
    194         if (_param._predictor_0_have_pht)
    195           {
    196         rename = "signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i);
    197         signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
    198           }
    199         if (_param._predictor_1_have_bht)
    200           {
    201         rename = "signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i);
    202         signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
    203           }
    204         if (_param._predictor_1_have_pht)
    205           {
    206         rename = "signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i);
    207         signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
    208           }
    209           }
    210         if (_param._predictor_2_have_bht)
    211           {
    212         rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i);
    213         signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
    214           }
    215         if (_param._predictor_2_have_pht)
    216           {
    217         rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i);
    218         signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
    219           }
     82        Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
     83#ifdef POSITION
     84                                                                , IN 
     85                                                                , EAST
     86                                                                , "Interface branch complete"
     87#endif
     88                                                                );
     89
     90         in_BRANCH_COMPLETE_VAL         [i] = interface->set_signal_valack_in        ("val"        , VAL);                 
     91        out_BRANCH_COMPLETE_ACK         [i] = interface->set_signal_valack_out       ("ack"        , ACK);                 
     92         in_BRANCH_COMPLETE_ADDRESS     [i] = interface->set_signal_in  <Taddress_t> ("address"    , _param._size_address);
     93         in_BRANCH_COMPLETE_HISTORY     [i] = interface->set_signal_in  <Thistory_t> ("history"    , _param._size_history);
     94         in_BRANCH_COMPLETE_DIRECTION   [i] = interface->set_signal_in  <Tcontrol_t> ("direction"  , 1);
    22095      }
    22196
     
    231106    component_Meta_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue (name_component.c_str()               ,
    232107#ifdef STATISTICS       
    233                                                                                                                                                      _param_statistics                    ,
    234 #endif
    235                                                                                                                                                      *(_param._param_meta_predictor_glue));
    236    
    237     // Instantiation
    238 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    239     (*(component_Meta_Predictor_Glue->in_CLOCK ))        (*(in_CLOCK ));
    240 #endif
    241    
    242         // Interface Predict
     108                                                                                                                                                   _param_statistics                    ,
     109#endif
     110                                                                                                                                                   *(_param._param_meta_predictor_glue));
     111   
     112   
     113    _component->set_component (component_Meta_Predictor_Glue->_component
     114#ifdef POSITION
     115                               , 75
     116                               , 25
     117                               , 10
     118                               , 10
     119#endif
     120                               );
     121   
     122
     123    // =====[ component_Two_Level_Branch_Predictor_2 ]====================   
     124
     125    name_component = _name+"_Two_Level_Branch_Predictor_2";
     126   
     127    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
     128   
     129    component_Two_Level_Branch_Predictor_2 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
     130#ifdef STATISTICS       
     131                                                                                                                                                                           _param_statistics                    ,
     132#endif
     133                                                                                                                                                                           *(_param._param_two_level_branch_predictor_2));
     134   
     135
     136    _component->set_component (component_Two_Level_Branch_Predictor_2->_component
     137#ifdef POSITION
     138                               , 75
     139                               , 25
     140                               , 10
     141                               , 10
     142#endif
     143                               );
     144   
     145
     146
     147    if (_param._have_meta_predictor)
     148      {
     149    // =====[ component_Two_Level_Branch_Predictor_1 ]====================   
     150
     151    name_component = _name+"_Two_Level_Branch_Predictor_1";
     152   
     153    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
     154   
     155    component_Two_Level_Branch_Predictor_1 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
     156#ifdef STATISTICS       
     157                                                                                                                                                                           _param_statistics                    ,
     158#endif
     159                                                                                                                                                                           *(_param._param_two_level_branch_predictor_1));
     160
     161    _component->set_component (component_Two_Level_Branch_Predictor_1->_component
     162#ifdef POSITION
     163                               , 75
     164                               , 25
     165                               , 10
     166                               , 10
     167#endif
     168                               );
     169
     170    // =====[ component_Two_Level_Branch_Predictor_0 ]====================   
     171
     172    name_component = _name+"_Two_Level_Branch_Predictor_0";
     173   
     174    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
     175   
     176    component_Two_Level_Branch_Predictor_0 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
     177#ifdef STATISTICS       
     178                                                                                                                                                                           _param_statistics                    ,
     179#endif
     180                                                                                                                                                                           *(_param._param_two_level_branch_predictor_0));
     181   
     182    _component->set_component (component_Two_Level_Branch_Predictor_0->_component
     183#ifdef POSITION
     184                               , 75
     185                               , 25
     186                               , 10
     187                               , 10
     188#endif
     189                               );
     190     
     191      }
     192
     193    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     194
     195    // =====[ component_Meta_Predictor_Glue - Instanciation ]=============
     196
     197    name_component = _name+"_Meta_Predictor_Glue";
     198
     199    cout << "Instance : " << name_component << endl;
     200
     201#ifdef POSITION
     202    _component->interface_map ("Meta_Predictor_Glue","",
     203                               _name                ,"");
     204#endif
     205   
     206    _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
     207    _component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
     208   
     209    // Interface Predict
    243210    for (uint32_t i=0; i<_param._nb_prediction; i++)
    244211      {
     212#ifdef POSITION
     213        _component->interface_map ("Meta_Predictor_Glue","predict_"+toString(i),
     214                                   _name                ,"predict_"+toString(i));
     215#endif
     216       
    245217        if (_param._have_meta_predictor)
    246218          {
    247         (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_0_ACK                 [i]));
    248         (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_1_ACK                 [i]));
    249           }                                                                                                                   
    250         (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_2_ACK                 [i]));
    251         (*(component_Meta_Predictor_Glue->out_PREDICT_ACK                             [i])) (*(   out_PREDICT_ACK                             [i]));
     219        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK"        , _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_ACK");
     220        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK"        , _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_ACK");
     221          }
     222        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK"        , _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_ACK");
     223        _component->port_map(name_component, "out_PREDICT_"+toString(i)+"_ACK"                    , _name , "out_PREDICT_"+toString(i)+"_ACK");
    252224        if (_param._have_meta_predictor)
    253           {                                                                                                                  
     225          {                                                                                                  
    254226        if (_param._predictor_0_have_bht)
    255         (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_0_BHT_HISTORY         [i]));
     227        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
    256228        if (_param._predictor_0_have_pht)
    257         (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_0_PHT_HISTORY         [i]));
     229        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
    258230        if (_param._predictor_1_have_bht)
    259         (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_1_BHT_HISTORY         [i]));
     231        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
    260232        if (_param._predictor_1_have_pht)
    261         (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_1_PHT_HISTORY         [i]));
    262           }                                                                                                                  
     233        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
     234          }                                                                                                  
    263235        if (_param._predictor_2_have_bht)
    264         (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_2_BHT_HISTORY         [i]));
     236        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
    265237        if (_param._predictor_2_have_pht)
    266         (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_2_PHT_HISTORY         [i]));
    267         (*(component_Meta_Predictor_Glue->out_PREDICT_HISTORY                         [i])) (*(   out_PREDICT_HISTORY                         [i]));
    268         (*(component_Meta_Predictor_Glue->out_PREDICT_DIRECTION                       [i])) (*(   out_PREDICT_DIRECTION                       [i]));
    269       }
    270 
    271     // Interface Branch_complete
    272    
     238        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
     239        _component->port_map(name_component, "out_PREDICT_"+toString(i)+"_HISTORY"                , _name , "out_PREDICT_"+toString(i)+"_HISTORY");
     240        _component->port_map(name_component, "out_PREDICT_"+toString(i)+"_DIRECTION"              , _name , "out_PREDICT_"+toString(i)+"_DIRECTION");
     241      }
     242
    273243    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    274244      {
     245#ifdef POSITION
     246        _component->interface_map ("Meta_Predictor_Glue","branch_complete_"+toString(i),
     247                                   _name                ,"branch_complete_"+toString(i));
     248#endif
     249
    275250        if (_param._have_meta_predictor)
    276251          {
    277         (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_VAL                     [i])) (*(    in_BRANCH_COMPLETE_VAL                     [i]));
    278         (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i]));
    279 
    280         (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i]));
    281         (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i]));
     252        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL");
     253        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL"         , _name+"_Two_Level_Branch_Predictor_2",  "in_BRANCH_COMPLETE_"+toString(i)+"_VAL");
     254
     255        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK"         , _name+"_Two_Level_Branch_Predictor_0", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
     256        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK"         , _name+"_Two_Level_Branch_Predictor_1", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
    282257          }                                     
    283         (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i]));
    284         (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_ACK                     [i])) (*(   out_BRANCH_COMPLETE_ACK                     [i]));
     258        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK"         , _name+"_Two_Level_Branch_Predictor_2", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
     259        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_ACK"                     , _name ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
    285260                                               
    286261        if (_param._have_meta_predictor)       
    287262          {                                     
    288263        if (_param._predictor_0_have_bht)
    289         (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]));
     264        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_0",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" );
    290265        if (_param._predictor_0_have_pht)
    291         (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i]));
     266        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_0",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" );
    292267        if (_param._predictor_1_have_bht)
    293         (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i]));
     268        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_1",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" );
    294269        if (_param._predictor_1_have_pht)
    295         (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i]));
     270        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_1",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" );
    296271          }                                     
    297272        if (_param._predictor_2_have_bht)
    298         (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i]));
     273        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_2",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" );
    299274        if (_param._predictor_2_have_pht)
    300         (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]));
    301         (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_HISTORY                 [i])) (*(    in_BRANCH_COMPLETE_HISTORY                 [i]));
     275        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_2",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" );
     276        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"                 , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY");
    302277        if (_param._have_meta_predictor)       
    303278          {
    304         (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_DIRECTION               [i])) (*(    in_BRANCH_COMPLETE_DIRECTION               [i]));
    305         (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i]));
     279        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
     280        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION"   , _name+"_Two_Level_Branch_Predictor_2" , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
    306281          }
    307282      }
    308283
    309     // =====[ component_Two_Level_Branch_Predictor_2 ]====================   
    310 
     284    // =====[ component_Two_Level_Branch_Predictor_2 - Instanciation ]====
    311285    name_component = _name+"_Two_Level_Branch_Predictor_2";
    312    
    313     log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
    314    
    315     component_Two_Level_Branch_Predictor_2 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
    316 #ifdef STATISTICS       
    317                                                                                                                                                                            _param_statistics                    ,
    318 #endif
    319                                                                                                                                                                            *(_param._param_two_level_branch_predictor_2));
    320      
    321     // Instantiation
    322     (*(component_Two_Level_Branch_Predictor_2->in_CLOCK ))        (*(in_CLOCK ));
    323     (*(component_Two_Level_Branch_Predictor_2->in_NRESET))        (*(in_NRESET));
    324    
     286
     287    cout << "Instance : " << name_component << endl;
     288
     289#ifdef POSITION
     290        _component->interface_map ("Two_Level_Branch_Predictor_2","",
     291                                   _name         ,"");
     292#endif
     293       
     294        _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
     295        _component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
     296
    325297    for (uint32_t i=0; i<_param._nb_prediction; i++)
    326298      {
    327         (*(component_Two_Level_Branch_Predictor_2-> in_PREDICT_VAL                 [i])) (*(    in_PREDICT_VAL                             [i]));
    328         (*(component_Two_Level_Branch_Predictor_2->out_PREDICT_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_2_ACK                 [i]));
    329         (*(component_Two_Level_Branch_Predictor_2-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS                         [i]));
    330         if (_param._predictor_2_have_bht)                                                                                     
    331         (*(component_Two_Level_Branch_Predictor_2->out_PREDICT_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_2_BHT_HISTORY         [i]));
     299#ifdef POSITION
     300        _component->interface_map ("Two_Level_Branch_Predictor_2","predict_"+toString(i),
     301                                   _name         ,"predict_"+toString(i));
     302#endif
     303
     304        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL"         , _name, "in_PREDICT_"+toString(i)+"_VAL");
     305        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK");
     306        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
     307        if (_param._predictor_2_have_bht)                                                                             
     308        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY");
    332309        if (_param._predictor_2_have_pht)
    333         (*(component_Two_Level_Branch_Predictor_2->out_PREDICT_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_2_PHT_HISTORY         [i]));
     310        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY");
    334311      }
    335312   
    336313    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    337314      {
     315#ifdef POSITION
     316        _component->interface_map ("Two_Level_Branch_Predictor_2","branch_complete_"+toString(i),
     317                                   _name         ,"branch_complete_"+toString(i));
     318#endif
    338319        if (_param._have_meta_predictor)
    339         (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_VAL         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i]));
     320        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL"         );
    340321        else
    341         (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_VAL         [i])) (*(    in_BRANCH_COMPLETE_VAL                     [i]));
    342         (*(component_Two_Level_Branch_Predictor_2->out_BRANCH_COMPLETE_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i]));
    343         (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS                 [i]));
     322        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     );
     323        _component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK"         );
     324        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"                 );
    344325        if (_param._predictor_2_have_bht)                                                                                       
    345         (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i]));
     326        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY" );
    346327        if (_param._predictor_2_have_pht)                                                                                       
    347         (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]));
     328        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY" );
    348329        if (_param._have_meta_predictor)
    349         (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i]));
     330        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION"   );
    350331        else
    351         (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(    in_BRANCH_COMPLETE_DIRECTION               [i]));       
     332        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               );   
    352333      }
    353334
    354335    if (_param._have_meta_predictor)
    355336      {
    356     // =====[ component_Two_Level_Branch_Predictor_1 ]====================   
     337    // =====[ component_Two_Level_Branch_Predictor_1 - Instanciation ]====
    357338
    358339    name_component = _name+"_Two_Level_Branch_Predictor_1";
    359    
    360     log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
    361    
    362     component_Two_Level_Branch_Predictor_1 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
    363 #ifdef STATISTICS       
    364                                                                                                                                                                            _param_statistics                    ,
    365 #endif
    366                                                                                                                                                                            *(_param._param_two_level_branch_predictor_1));
    367      
    368     // Instantiation
    369     (*(component_Two_Level_Branch_Predictor_1->in_CLOCK ))        (*(in_CLOCK ));
    370     (*(component_Two_Level_Branch_Predictor_1->in_NRESET))        (*(in_NRESET));
    371    
     340
     341    cout << "Instance : " << name_component << endl;
     342
     343#ifdef POSITION
     344        _component->interface_map ("Two_Level_Branch_Predictor_1","",
     345                                   _name         ,"");
     346#endif
     347       
     348        _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
     349        _component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
     350
    372351    for (uint32_t i=0; i<_param._nb_prediction; i++)
    373352      {
    374         (*(component_Two_Level_Branch_Predictor_1-> in_PREDICT_VAL                 [i])) (*(    in_PREDICT_VAL                             [i]));
    375         (*(component_Two_Level_Branch_Predictor_1->out_PREDICT_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_1_ACK                 [i]));
    376         (*(component_Two_Level_Branch_Predictor_1-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS                         [i]));
    377         if (_param._predictor_1_have_bht)                                                                                     
    378         (*(component_Two_Level_Branch_Predictor_1->out_PREDICT_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_1_BHT_HISTORY         [i]));
     353#ifdef POSITION
     354        _component->interface_map ("Two_Level_Branch_Predictor_1","predict_"+toString(i),
     355                                   _name         ,"predict_"+toString(i));
     356#endif
     357
     358        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL"         , _name, "in_PREDICT_"+toString(i)+"_VAL");
     359        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK");
     360        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
     361        if (_param._predictor_1_have_bht)                                                                             
     362        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY");
    379363        if (_param._predictor_1_have_pht)
    380         (*(component_Two_Level_Branch_Predictor_1->out_PREDICT_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_1_PHT_HISTORY         [i]));
     364        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY");
    381365      }
    382366   
    383367    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    384368      {
    385         (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_VAL         [i])) (*(    in_BRANCH_COMPLETE_VAL                     [i]));
    386         (*(component_Two_Level_Branch_Predictor_1->out_BRANCH_COMPLETE_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i]));
    387         (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS                 [i]));
     369#ifdef POSITION
     370        _component->interface_map ("Two_Level_Branch_Predictor_1","branch_complete_"+toString(i),
     371                                   _name         ,"branch_complete_"+toString(i));
     372#endif
     373        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     );
     374        _component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK"         );
     375        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"                 );
    388376        if (_param._predictor_1_have_bht)                                                                                       
    389         (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i]));
     377        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY" );
    390378        if (_param._predictor_1_have_pht)                                                                                       
    391         (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i]));
    392         (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(    in_BRANCH_COMPLETE_DIRECTION               [i]));       
    393       }
    394 
    395     // =====[ component_Two_Level_Branch_Predictor_0 ]====================   
     379        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY" );
     380        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               );   
     381      }
     382    // =====[ component_Two_Level_Branch_Predictor_0 - Instanciation ]====
    396383
    397384    name_component = _name+"_Two_Level_Branch_Predictor_0";
    398    
    399     log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
    400    
    401     component_Two_Level_Branch_Predictor_0 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
    402 #ifdef STATISTICS       
    403                                                                                                                                                                            _param_statistics                    ,
    404 #endif
    405                                                                                                                                                                            *(_param._param_two_level_branch_predictor_0));
    406      
    407     // Instantiation
    408     (*(component_Two_Level_Branch_Predictor_0->in_CLOCK ))        (*(in_CLOCK ));
    409     (*(component_Two_Level_Branch_Predictor_0->in_NRESET))        (*(in_NRESET));
    410    
     385
     386    cout << "Instance : " << name_component << endl;
     387
     388#ifdef POSITION
     389        _component->interface_map ("Two_Level_Branch_Predictor_0","",
     390                                   _name         ,"");
     391#endif
     392       
     393        _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
     394        _component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
     395
    411396    for (uint32_t i=0; i<_param._nb_prediction; i++)
    412397      {
    413         (*(component_Two_Level_Branch_Predictor_0-> in_PREDICT_VAL                 [i])) (*(    in_PREDICT_VAL                             [i]));
    414         (*(component_Two_Level_Branch_Predictor_0->out_PREDICT_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_0_ACK                 [i]));
    415         (*(component_Two_Level_Branch_Predictor_0-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS                         [i]));
    416         if (_param._predictor_0_have_bht)                                                                                     
    417         (*(component_Two_Level_Branch_Predictor_0->out_PREDICT_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_0_BHT_HISTORY         [i]));
     398#ifdef POSITION
     399        _component->interface_map ("Two_Level_Branch_Predictor_0","predict_"+toString(i),
     400                                   _name         ,"predict_"+toString(i));
     401#endif
     402
     403        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL"         , _name, "in_PREDICT_"+toString(i)+"_VAL");
     404        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK");
     405        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
     406        if (_param._predictor_0_have_bht)                                                                             
     407        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY");
    418408        if (_param._predictor_0_have_pht)
    419         (*(component_Two_Level_Branch_Predictor_0->out_PREDICT_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_0_PHT_HISTORY         [i]));
     409        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY");
    420410      }
    421411   
    422412    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    423413      {
    424         (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_VAL         [i])) (*(    in_BRANCH_COMPLETE_VAL                     [i]));
    425         (*(component_Two_Level_Branch_Predictor_0->out_BRANCH_COMPLETE_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i]));
    426         (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS                 [i]));
     414#ifdef POSITION
     415        _component->interface_map ("Two_Level_Branch_Predictor_0","branch_complete_"+toString(i),
     416                                   _name         ,"branch_complete_"+toString(i));
     417#endif
     418        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     );
     419        _component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK"         );
     420        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"                 );
    427421        if (_param._predictor_0_have_bht)                                                                                       
    428         (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]));
     422        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY" );
    429423        if (_param._predictor_0_have_pht)                                                                                       
    430         (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i]));
    431         (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(    in_BRANCH_COMPLETE_DIRECTION               [i]));       
     424        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY" );
     425        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               );   
    432426      }
    433427      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/src/Meta_Predictor_deallocation.cpp

    r15 r44  
    1919    log_printf(FUNC,Meta_Predictor,"deallocation","Begin");
    2020
    21     delete in_CLOCK;
    22     delete in_NRESET;
     21    delete     in_CLOCK;
     22    delete     in_NRESET;
    2323
    24     for (uint32_t i=0; i<_param._nb_prediction; i++)
    25       {
    26         delete  in_PREDICT_VAL                 [i];
    27         delete out_PREDICT_ACK                 [i];
    28         delete  in_PREDICT_ADDRESS             [i];
    29         delete out_PREDICT_HISTORY             [i];
    30         delete out_PREDICT_DIRECTION           [i];
    31       }
     24    delete []  in_PREDICT_VAL        ;
     25    delete [] out_PREDICT_ACK        ;
     26    delete []  in_PREDICT_ADDRESS    ;
     27    delete [] out_PREDICT_HISTORY    ;
     28    delete [] out_PREDICT_DIRECTION  ;
    3229
    33     delete  in_PREDICT_VAL        ;
    34     delete out_PREDICT_ACK        ;
    35     delete  in_PREDICT_ADDRESS    ;
    36     delete out_PREDICT_HISTORY    ;
    37     delete out_PREDICT_DIRECTION  ;
    38 
    39     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    40       {
    41         delete  in_BRANCH_COMPLETE_VAL         [i];
    42         delete out_BRANCH_COMPLETE_ACK         [i];
    43         delete  in_BRANCH_COMPLETE_ADDRESS     [i];
    44         delete  in_BRANCH_COMPLETE_HISTORY     [i];
    45         delete  in_BRANCH_COMPLETE_DIRECTION   [i];
    46       }
    47 
    48     delete  in_BRANCH_COMPLETE_VAL        ;
    49     delete out_BRANCH_COMPLETE_ACK        ;
    50     delete  in_BRANCH_COMPLETE_ADDRESS    ;
    51     delete  in_BRANCH_COMPLETE_HISTORY    ;
    52     delete  in_BRANCH_COMPLETE_DIRECTION  ;
    53 
    54     // ~~~~~[ Signal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    55 
    56     for (uint32_t i=0; i<_param._nb_prediction; i++)
    57       {
    58         if (_param._have_meta_predictor)
    59           {                                                                                                                   
    60         delete signal_PREDICT_PREDICTOR_0_ACK         [i];
    61         delete signal_PREDICT_PREDICTOR_1_ACK         [i];
    62           }
    63         delete signal_PREDICT_PREDICTOR_2_ACK         [i];
    64 
    65         if (_param._have_meta_predictor)
    66           {                                                                                                                   
    67         if (_param._predictor_0_have_bht)
    68         delete signal_PREDICT_PREDICTOR_0_BHT_HISTORY [i];
    69         if (_param._predictor_0_have_pht)
    70         delete signal_PREDICT_PREDICTOR_0_PHT_HISTORY [i];
    71         if (_param._predictor_1_have_bht)
    72         delete signal_PREDICT_PREDICTOR_1_BHT_HISTORY [i];
    73         if (_param._predictor_1_have_pht)
    74         delete signal_PREDICT_PREDICTOR_1_PHT_HISTORY [i];
    75           }
    76         if (_param._predictor_2_have_bht)
    77         delete signal_PREDICT_PREDICTOR_2_BHT_HISTORY [i];
    78         if (_param._predictor_2_have_pht)
    79         delete signal_PREDICT_PREDICTOR_2_PHT_HISTORY [i];
    80       }
    81 
    82     if (_param._have_meta_predictor)
    83       {
    84     delete signal_PREDICT_PREDICTOR_0_ACK         ;
    85     delete signal_PREDICT_PREDICTOR_1_ACK         ;
    86       }
    87     delete signal_PREDICT_PREDICTOR_2_ACK         ;
    88 
    89     if (_param._have_meta_predictor)
    90       {                                                                                                               
    91     if (_param._predictor_0_have_bht)
    92     delete signal_PREDICT_PREDICTOR_0_BHT_HISTORY;
    93     if (_param._predictor_0_have_pht)
    94     delete signal_PREDICT_PREDICTOR_0_PHT_HISTORY;
    95     if (_param._predictor_0_have_bht)
    96     delete signal_PREDICT_PREDICTOR_1_BHT_HISTORY;
    97     if (_param._predictor_1_have_pht)
    98     delete signal_PREDICT_PREDICTOR_1_PHT_HISTORY;
    99       }                                           
    100     if (_param._predictor_2_have_bht)
    101     delete signal_PREDICT_PREDICTOR_2_BHT_HISTORY;
    102     if (_param._predictor_2_have_pht)
    103     delete signal_PREDICT_PREDICTOR_2_PHT_HISTORY;
    104 
    105     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    106       {
    107         if (_param._have_meta_predictor)
    108           {                                                                                                                   
    109         delete signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i];
    110         delete signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i];
    111         delete signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i];
    112         delete signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i];
    113           }
    114         delete signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i];
    115 
    116         if (_param._have_meta_predictor)
    117           {                                                                                                                   
    118         if (_param._predictor_0_have_bht)
    119         delete signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i];
    120         if (_param._predictor_0_have_pht)
    121         delete signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i];
    122         if (_param._predictor_1_have_bht)
    123         delete signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i];
    124         if (_param._predictor_1_have_pht)
    125         delete signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i];
    126           }
    127         if (_param._predictor_2_have_bht)
    128         delete signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i];
    129         if (_param._predictor_2_have_pht)
    130         delete signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i];
    131       }
    132 
    133     if (_param._have_meta_predictor)
    134       {
    135     delete signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         ;
    136     delete signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         ;
    137     delete signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         ;
    138     delete signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   ;
    139       }
    140     delete signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         ;
    141 
    142     if (_param._have_meta_predictor)
    143       {                                                                                                               
    144     if (_param._predictor_0_have_bht)
    145     delete signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY;
    146     if (_param._predictor_0_have_pht)
    147     delete signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY;
    148     if (_param._predictor_0_have_bht)
    149     delete signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY;
    150     if (_param._predictor_1_have_pht)
    151     delete signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY;
    152       }                                           
    153     if (_param._predictor_2_have_bht)
    154     delete signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY;
    155     if (_param._predictor_2_have_pht)
    156     delete signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY;
     30    delete []  in_BRANCH_COMPLETE_VAL        ;
     31    delete [] out_BRANCH_COMPLETE_ACK        ;
     32    delete []  in_BRANCH_COMPLETE_ADDRESS    ;
     33    delete []  in_BRANCH_COMPLETE_HISTORY    ;
     34    delete []  in_BRANCH_COMPLETE_DIRECTION  ;
    15735
    15836    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     
    16543    delete component_Two_Level_Branch_Predictor_2;
    16644    delete component_Meta_Predictor_Glue         ;
    167 
     45    delete _component;
    16846
    16947    log_printf(FUNC,Meta_Predictor,"deallocation","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/src/Meta_Predictor_vhdl.cpp

    r5 r44  
    2020  {
    2121    log_printf(FUNC,Meta_Predictor,"vhdl","Begin");
    22     Vhdl vhdl (_name);
    2322
    24     vhdl.set_library_work (_name + "_Pack");
    25     vhdl.set_library_work (_name + "_Meta_Predictor_Glue_Pack");
    26     if (_param._have_meta_predictor)
    27       {
    28     vhdl.set_library_work (_name + "_Two_Level_Branch_Predictor_0_Pack");
    29     vhdl.set_library_work (_name + "_Two_Level_Branch_Predictor_1_Pack");
    30       }
    31     vhdl.set_library_work (_name + "_Two_Level_Branch_Predictor_2_Pack");
     23    Vhdl * vhdl = new Vhdl (_name);
    3224
    33     vhdl_port        (vhdl);
     25    _interfaces->set_port     (vhdl);
     26    _component ->vhdl_instance(vhdl);
     27
    3428    vhdl_declaration (vhdl);
    3529    vhdl_body        (vhdl);
    3630
    37     vhdl.generate_file();
     31    vhdl->generate_file();
     32
     33    delete vhdl;
     34
    3835    log_printf(FUNC,Meta_Predictor,"vhdl","End");
    3936
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/src/Meta_Predictor_vhdl_body.cpp

    r15 r44  
    1616
    1717
    18   void Meta_Predictor::vhdl_body (Vhdl & vhdl)
     18  void Meta_Predictor::vhdl_body (Vhdl * & vhdl)
    1919  {
    2020    log_printf(FUNC,Meta_Predictor,"vhdl_body","Begin");
    21     vhdl.set_body ("");
    22 
    23     list<string> list_port_map;
    24 
    25     // =====[ component_Meta_Predictor_Glue ]=============================
    26    
    27     list_port_map.clear();
    28     log_printf(INFO,Meta_Predictor,"vhdl_body","Instanciation : component_Meta_Predictor_Glue");
    29    
    30     // Instantiation
    31 
    32     // Interface Predict
    33     for (uint32_t i=0; i<_param._nb_prediction; i++)
    34       {
    35         if (_param._have_meta_predictor)
    36           {
    37         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PREDICTOR_0_ACK_"+toString(i)+"               ", "signal_PREDICT_PREDICTOR_0_ACK_"+toString(i));
    38         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PREDICTOR_1_ACK_"+toString(i)+"               ", "signal_PREDICT_PREDICTOR_1_ACK_"+toString(i));
    39           }                                                                                                                   
    40         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PREDICTOR_2_ACK_"+toString(i)+"               ", "signal_PREDICT_PREDICTOR_2_ACK_"+toString(i));
    41         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"                           ", "   out_PREDICT_ACK_"+toString(i));
    42         if (_param._have_meta_predictor)
    43           {                                                                                                                   
    44         if (_param._predictor_0_have_bht)
    45         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i)+"       ", "signal_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i));
    46         if (_param._predictor_0_have_pht)
    47         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i)+"       ", "signal_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i));
    48         if (_param._predictor_1_have_bht)
    49         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i)+"       ", "signal_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i));
    50         if (_param._predictor_1_have_pht)
    51         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i)+"       ", "signal_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i));
    52           }                                                                                                                   
    53         if (_param._predictor_2_have_bht)
    54         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i)+"       ", "signal_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i));
    55         if (_param._predictor_2_have_pht)
    56         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i)+"       ", "signal_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i));
    57         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_HISTORY_"+toString(i)+"                       ", "   out_PREDICT_HISTORY_"+toString(i));
    58         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_DIRECTION_"+toString(i)+"                     ", "   out_PREDICT_DIRECTION_"+toString(i));
    59       }
    60 
    61     // Interface Branch_complete
    62    
    63     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    64       {
    65         if (_param._have_meta_predictor)
    66           {
    67         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+"                    ", "    in_BRANCH_COMPLETE_VAL_"+toString(i));
    68         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i)+"        ", "signal_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i));
    69 
    70         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i)+"        ", "signal_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i));
    71         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i)+"        ", "signal_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i));
    72           }                                     
    73         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i)+"        ", "signal_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i));
    74         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"                    ", "   out_BRANCH_COMPLETE_ACK_"+toString(i));
    75                                                
    76         if (_param._have_meta_predictor)       
    77           {                                     
    78         if (_param._predictor_0_have_bht)
    79         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i));
    80         if (_param._predictor_0_have_pht)
    81         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i));
    82         if (_param._predictor_1_have_bht)
    83         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i));
    84         if (_param._predictor_1_have_pht)
    85         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i));
    86           }                                     
    87         if (_param._predictor_2_have_bht)
    88         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i));
    89         if (_param._predictor_2_have_pht)
    90         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i));
    91         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"                ", "    in_BRANCH_COMPLETE_HISTORY_"+toString(i));
    92         if (_param._have_meta_predictor)       
    93           {
    94         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"              ", "    in_BRANCH_COMPLETE_DIRECTION_"+toString(i));
    95         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i)+"  ", "signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i));
    96           }
    97       }
    98 
    99     vhdl.set_body_component ("component_Meta_Predictor_Glue",_name+"_Meta_Predictor_Glue",list_port_map);
    100 
    101     // =====[ component_Two_Level_Branch_Predictor_2 ]====================   
    102 
    103     list_port_map.clear();
    104     log_printf(INFO,Meta_Predictor,"vhdl_body","Instanciation : component_Two_Level_Branch_Predictor_2");
    105    
    106     // Instantiation
    107     vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK ");
    108     vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");
    109    
    110     for (uint32_t i=0; i<_param._nb_prediction; i++)
    111       {
    112         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+"                ", "    in_PREDICT_VAL_"+toString(i));
    113         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"                ", "signal_PREDICT_PREDICTOR_2_ACK_"+toString(i));
    114         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+"            ", "    in_PREDICT_ADDRESS_"+toString(i));
    115         if (_param._predictor_2_have_bht)                                                                                     
    116         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_BHT_HISTORY_"+toString(i)+"        ", "signal_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i));
    117         if (_param._predictor_2_have_pht)
    118         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_PHT_HISTORY_"+toString(i)+"        ", "signal_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i));
    119       }
    120    
    121     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    122       {
    123         if (_param._have_meta_predictor)
    124         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+"        ", "signal_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i));
    125         else
    126         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+"        ", "    in_BRANCH_COMPLETE_VAL_"+toString(i));
    127         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"        ", "signal_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i));
    128         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"    ", "    in_BRANCH_COMPLETE_ADDRESS_"+toString(i));
    129         if (_param._predictor_2_have_bht)                                                                                       
    130         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i));
    131         if (_param._predictor_2_have_pht)                                                                                       
    132         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i));
    133         if (_param._have_meta_predictor)
    134         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"  ", "signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i));
    135         else
    136         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"  ", "    in_BRANCH_COMPLETE_DIRECTION_"+toString(i));     
    137       }
    138 
    139     vhdl.set_body_component ("component_Two_Level_Branch_Predictor_2",_name+"_Two_Level_Branch_Predictor_2",list_port_map);
    140 
    141     if (_param._have_meta_predictor)
    142       {
    143     // =====[ component_Two_Level_Branch_Predictor_1 ]====================   
    144 
    145     list_port_map.clear();
    146     log_printf(INFO,Meta_Predictor,"vhdl_body","Instanciation : component_Two_Level_Branch_Predictor_1");
    147    
    148     // Instantiation
    149     vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK ");
    150     vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");
    151    
    152     for (uint32_t i=0; i<_param._nb_prediction; i++)
    153       {
    154         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+"                ", "    in_PREDICT_VAL_"+toString(i));
    155         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"                ", "signal_PREDICT_PREDICTOR_1_ACK_"+toString(i));
    156         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+"            ", "    in_PREDICT_ADDRESS_"+toString(i));
    157         if (_param._predictor_1_have_bht)                                                                                     
    158         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_BHT_HISTORY_"+toString(i)+"        ", "signal_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i));
    159         if (_param._predictor_1_have_pht)
    160         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_PHT_HISTORY_"+toString(i)+"        ", "signal_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i));
    161       }
    162    
    163     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    164       {
    165         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+"        ", "    in_BRANCH_COMPLETE_VAL_"+toString(i));
    166         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"        ", "signal_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i));
    167         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"    ", "    in_BRANCH_COMPLETE_ADDRESS_"+toString(i));
    168         if (_param._predictor_1_have_bht)                                                                                       
    169         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i));
    170         if (_param._predictor_1_have_pht)                                                                                       
    171         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i));
    172         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"  ", "    in_BRANCH_COMPLETE_DIRECTION_"+toString(i));     
    173       }
    174 
    175     vhdl.set_body_component ("component_Two_Level_Branch_Predictor_1",_name+"_Two_Level_Branch_Predictor_1",list_port_map);
    176 
    177     // =====[ component_Two_Level_Branch_Predictor_0 ]====================   
    178 
    179     list_port_map.clear();
    180     log_printf(INFO,Meta_Predictor,"vhdl_body","Instanciation : component_Two_Level_Branch_Predictor_0");
    181    
    182     // Instantiation
    183     vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK ");
    184     vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");
    185    
    186     for (uint32_t i=0; i<_param._nb_prediction; i++)
    187       {
    188         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+"                ", "    in_PREDICT_VAL_"+toString(i));
    189         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"                ", "signal_PREDICT_PREDICTOR_0_ACK_"+toString(i));
    190         vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+"            ", "    in_PREDICT_ADDRESS_"+toString(i));
    191         if (_param._predictor_0_have_bht)                                                                                     
    192         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_BHT_HISTORY_"+toString(i)+"        ", "signal_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i));
    193         if (_param._predictor_0_have_pht)
    194         vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_PHT_HISTORY_"+toString(i)+"        ", "signal_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i));
    195       }
    196    
    197     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    198       {
    199         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+"        ", "    in_BRANCH_COMPLETE_VAL_"+toString(i));
    200         vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"        ", "signal_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i));
    201         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"    ", "    in_BRANCH_COMPLETE_ADDRESS_"+toString(i));
    202         if (_param._predictor_0_have_bht)                                                                                       
    203         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i));
    204         if (_param._predictor_0_have_pht)                                                                                       
    205         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i)+"", "signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i));
    206         vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"  ", "    in_BRANCH_COMPLETE_DIRECTION_"+toString(i));     
    207       }
    208 
    209     vhdl.set_body_component ("component_Two_Level_Branch_Predictor_0",_name+"_Two_Level_Branch_Predictor_0",list_port_map);
    210       }
    21121
    21222    log_printf(FUNC,Meta_Predictor,"vhdl_body","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/src/Meta_Predictor_vhdl_declaration.cpp

    r5 r44  
    1616
    1717
    18   void Meta_Predictor::vhdl_declaration (Vhdl & vhdl)
     18  void Meta_Predictor::vhdl_declaration (Vhdl * & vhdl)
    1919  {
    2020    log_printf(FUNC,Meta_Predictor,"vhdl_declaration","Begin");
    21 
    22     for (uint32_t i=0; i<_param._nb_prediction; i++)
    23       {
    24         if (_param._have_meta_predictor)
    25           {                                                                                                                   
    26         vhdl.set_signal("signal_PREDICT_PREDICTOR_0_ACK_"+toString(i)+"", 1);
    27         vhdl.set_signal("signal_PREDICT_PREDICTOR_1_ACK_"+toString(i)+"", 1);
    28           }
    29         vhdl.set_signal("signal_PREDICT_PREDICTOR_2_ACK_"+toString(i)+"", 1);
    30 
    31         if (_param._have_meta_predictor)
    32           {                                                                                                                   
    33         if (_param._predictor_0_have_bht)
    34         vhdl.set_signal("signal_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i)+"", _param._predictor_0_bht_size_shifter);
    35         if (_param._predictor_0_have_pht)
    36         vhdl.set_signal("signal_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i)+"", _param._predictor_0_pht_size_counter);
    37         if (_param._predictor_1_have_bht)
    38         vhdl.set_signal("signal_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i)+"", _param._predictor_1_bht_size_shifter);
    39         if (_param._predictor_1_have_pht)
    40         vhdl.set_signal("signal_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i)+"", _param._predictor_1_pht_size_counter);
    41           }
    42         if (_param._predictor_2_have_bht)
    43         vhdl.set_signal("signal_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i)+"", _param._predictor_2_bht_size_shifter);
    44         if (_param._predictor_2_have_pht)
    45         vhdl.set_signal("signal_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i)+"", _param._predictor_2_pht_size_counter);
    46       }
    47 
    48     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    49       {
    50         if (_param._have_meta_predictor)
    51           {                                                                                                                   
    52         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i)+"      ", 1);
    53         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i)+"      ", 1);
    54         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i)+"      ", 1);
    55         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i)+"", 1);
    56           }
    57         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i)+"      ", 1);
    58 
    59         if (_param._have_meta_predictor)
    60           {                                                                                                                   
    61         if (_param._predictor_0_have_bht)
    62         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i)+"", _param._predictor_0_bht_size_shifter);
    63         if (_param._predictor_0_have_pht)
    64         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i)+"", _param._predictor_0_pht_size_counter);
    65         if (_param._predictor_1_have_bht)
    66         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i)+"", _param._predictor_1_bht_size_shifter);
    67         if (_param._predictor_1_have_pht)
    68         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i)+"", _param._predictor_1_pht_size_counter);
    69           }
    70         if (_param._predictor_2_have_bht)
    71         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i)+"", _param._predictor_2_bht_size_shifter);
    72         if (_param._predictor_2_have_pht)
    73         vhdl.set_signal("signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i)+"", _param._predictor_2_pht_size_counter);
    74       }
    75 
    7621
    7722    log_printf(FUNC,Meta_Predictor,"vhdl_declaration","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_transition.cpp

    r15 r44  
    2020    log_printf(FUNC,Meta_Predictor,"vhdl_testbench_transition","Begin");
    2121
    22     // Evaluation before read the ouput signal
    23     sc_start(0);
     22//  sc_start(0);
    2423
    25     // In order with file Meta_Predictor_vhdl_testbench_port.cpp
    26     // Warning : if a output depend of a subcomponent, take directly the port of subcomponent
    27     // (because we have no control on the ordonnancer's policy)
    28 
    29     _vhdl_testbench->add_input (PORT_READ( in_NRESET));
    30 
    31     for (uint32_t i=0; i<_param._nb_prediction; i++)
    32       {
    33         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_VAL                          [i]));
    34         _vhdl_testbench->add_output(PORT_READ(out_PREDICT_ACK                          [i]));
    35         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_ADDRESS                      [i]));
    36         _vhdl_testbench->add_output(PORT_READ(out_PREDICT_HISTORY                      [i]));
    37         _vhdl_testbench->add_output(PORT_READ(out_PREDICT_DIRECTION                    [i]));
    38       }
    39 
    40     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    41       {
    42         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_VAL                  [i]));
    43         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_ACK                  [i]));
    44         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_ADDRESS              [i]));
    45         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_HISTORY              [i]));
    46         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_DIRECTION            [i]));
    47       }
    48    
    49     // add_test :
    50     //  - True  : the cycle must be compare with the output of systemC
    51     //  - False : no test
    52     _vhdl_testbench->add_test(true);
    53 
    54     _vhdl_testbench->new_cycle (); // always at the end
     24    _interfaces->testbench();
    5525
    5626    log_printf(FUNC,Meta_Predictor,"vhdl_testbench_transition","End");
Note: See TracChangeset for help on using the changeset viewer.