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
Files:
18 added
6 deleted
137 edited
7 moved

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/SelfTest/src/test.cpp

    r42 r44  
    1010
    1111#include "Behavioural/Generic/Counter/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/Generic/Counter/include/Counter.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#include "Behavioural/Generic/Counter/include/Parameters.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/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/Generic/Counter/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/Generic/Counter/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/Generic/Counter/src/Counter_vhdl_testbench_transition.cpp

    r42 r44  
    1919    log_printf(FUNC,Counter,"vhdl_testbench_transition","Begin");
    2020
    21     sc_start(0);
     21//     sc_start(0);
    2222
    2323    _interfaces->testbench();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp

    r42 r44  
    88
    99#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/include/test.h"
    10 #include "Include/Test.h"
     10#include "Common/include/Test.h"
    1111
    1212void test (string name,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/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#include <math.h>
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h

    r43 r44  
    1313#endif
    1414
    15 #include "Include/Debug.h"
    16 #include "Include/ToString.h"
     15#include "Common/include/Debug.h"
     16#include "Common/include/ToString.h"
    1717#include <iostream>
    1818using namespace std;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/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/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h

    r15 r44  
    99 */
    1010
    11 #include "Include/Types.h"
     11#include "Common/include/Types.h"
    1212
    1313namespace morpheo                    {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl.cpp

    r43 r44  
    99#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
    1010#include "Behavioural/include/Vhdl.h"
    11 #include "Include/ToString.h"
     11#include "Common/include/ToString.h"
    1212namespace morpheo                    {
    1313namespace behavioural                {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_testbench_transition.cpp

    r41 r44  
    1818  {
    1919    // Evaluation before read the ouput signal
    20     sc_start(0);
    21 
     20   
     21//  sc_start(0);
    2222    _interfaces->testbench();
    2323  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/SelfTest/src/test.cpp

    r23 r44  
    1313
    1414#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/SelfTest/include/test.h"
    15 #include "Include/Test.h"
    16 #include "Include/BitManipulation.h"
     15#include "Common/include/Test.h"
     16#include "Common/include/BitManipulation.h"
    1717
    1818void test (string name,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/include/Parameters.h

    r23 r44  
    99 */
    1010
    11 #include "Include/Debug.h"
    12 #include "Include/FromString.h"
     11#include "Common/include/Debug.h"
     12#include "Common/include/FromString.h"
    1313#include "Behavioural/include/Parameters.h"
    1414#include <math.h>
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/include/RegisterFile_Multi_Banked_Glue.h

    r23 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/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/include/Parameters.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/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/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/include/Types.h

    r15 r44  
    99 */
    1010
    11 #include "Include/Types.h"
     11#include "Common/include/Types.h"
    1212
    1313namespace morpheo                    {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/RegisterFile_Multi_Banked_Glue/src/RegisterFile_Multi_Banked_Glue_vhdl_testbench_transition.cpp

    r15 r44  
    2222
    2323    // Evaluation before read the ouput signal
    24     sc_start(0);
     24//     sc_start(0);
    2525
    2626    // In order with file RegisterFile_Multi_Banked_Glue_vhdl_testbench_port.cpp
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest/src/test.cpp

    r15 r44  
    1010
    1111#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/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/Generic/RegisterFile/RegisterFile_Multi_Banked/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#include <math.h>
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.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#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/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/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h

    r15 r44  
    99 */
    1010
    11 #include "Include/Types.h"
     11#include "Common/include/Types.h"
    1212
    1313namespace morpheo                    {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_testbench_transition.cpp

    r15 r44  
    2121
    2222    // Evaluation before read the ouput signal
    23     sc_start(0);
     23//     sc_start(0);
    2424
    2525    // In order with file RegisterFile_Multi_Banked_vhdl_testbench_port.cpp
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/src/test.cpp

    r41 r44  
    1010
    1111#include "Behavioural/Generic/Select/Select_Priority_Fixed/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/Generic/Select/Select_Priority_Fixed/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#include <math.h>
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.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/Generic/Select/Select_Priority_Fixed/include/Parameters.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/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/Generic/Select/Select_Priority_Fixed/include/Types.h

    r15 r44  
    99 */
    1010
    11 #include "Include/Types.h"
     11#include "Common/include/Types.h"
    1212
    1313namespace morpheo                    {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_testbench_transition.cpp

    r41 r44  
    2121
    2222    // Evaluation before read the ouput signal
    23     sc_start(0);
     23//     sc_start(0);
    2424
    2525    _interfaces->testbench();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/SelfTest/src/test.cpp

    r42 r44  
    88
    99#include "Behavioural/Generic/Shifter/SelfTest/include/test.h"
    10 #include "Include/BitManipulation.h"
    11 #include "Include/Test.h"
     10#include "Common/include/BitManipulation.h"
     11#include "Common/include/Test.h"
    1212
    1313#define NB_ITERATION 64
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Shifter.h

    r43 r44  
    1414
    1515#include <iostream>
    16 #include "Include/ToString.h"
     16#include "Common/include/ToString.h"
    1717
    1818#include "Behavioural/Generic/Shifter/include/Parameters.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/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/Generic/Shifter/src/Shifter_genMealy_shift.cpp

    r2 r44  
    88
    99#include "Behavioural/Generic/Shifter/include/Shifter.h"
    10 #include "Include/BitManipulation.h"
     10#include "Common/include/BitManipulation.h"
    1111#include <bitset>
    1212
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_vhdl_testbench_transition.cpp

    r42 r44  
    1717  void Shifter::vhdl_testbench_transition (void)
    1818  {
    19     sc_start(0);
     19//     sc_start(0);
    2020
    2121    _interfaces->testbench();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/src/test.cpp

    r15 r44  
    88
    99#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/include/test.h"
    10 #include "Include/Test.h"
     10#include "Common/include/Test.h"
    1111
    1212void test (string name,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h

    r15 r44  
    99 */
    1010
    11 #include "Include/Types.h"
     11#include "Common/include/Types.h"
    1212
    1313namespace morpheo {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h

    r43 r44  
    2929
    3030#include <iostream>
    31 #include "Include/ToString.h"
    32 #include "Include/Debug.h"
     31#include "Common/include/ToString.h"
     32#include "Common/include/Debug.h"
    3333
    3434#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Parameters.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_vhdl_testbench_transition.cpp

    r42 r44  
    1919  {
    2020    // Evaluation before read the ouput signal
    21     sc_start(0);
     21//     sc_start(0);
    2222
    2323    _interfaces->testbench();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest

    r43 r44  
    1616#-----[ Variables ]----------------------------------------
    1717CFG_FILE_EXTENSION              = cfg
     18CFG_FILE_DEBUG                  = debug.$(CFG_FILE_EXTENSION)
    1819
    1920OBJECTS                         = $(OBJECTS_COMMON)
     
    4647                                @                                                                                                       \
    4748                                declare -i  CPT=0;                                                                                      \
    48                                 for file in $$($(LS) *.$(CFG_FILE_EXTENSION) ); do                                                      \
     49                                declare     files;                                                                                      \
     50                                                                                                                                        \
     51                                if $(TEST) -f $(CFG_FILE_DEBUG); then                                                                   \
     52                                        files=$(CFG_FILE_DEBUG);                                                                        \
     53                                else                                                                                                    \
     54                                        files=$$($(LS) *.$(CFG_FILE_EXTENSION) );                                                       \
     55                                fi;                                                                                                     \
     56                                                                                                                                        \
     57                                for file in $$files; do                                                                                 \
    4958                                                                                                                                        \
    5059                                        declare     NAME;                                                                               \
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags

    r43 r44  
    1818                                        -DVHDL_TESTBENCH        \
    1919                                        -DVHDL_TESTBENCH_ASSERT \
    20                                         -DDEBUG=DEBUG_ALL
     20                                        -DDEBUG=DEBUG_NONE
    2121
    2222#                                       -DCONFIGURATION         \
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/test.cpp

    r15 r44  
    1212
    1313#include "Behavioural/@DIRECTORY/SelfTest/include/test.h"
    14 #include "Include/Test.h"
     14#include "Common/include/Test.h"
    1515
    1616void test (string name,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.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#include "Behavioural/@DIRECTORY/include/Parameters.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/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/New_Component/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/New_Component/include/Types.h

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

    r41 r44  
    1818
    1919    // Evaluation before read the ouput signal
    20     sc_start(0);
     20//     sc_start(0);
    2121
    2222    _interfaces->testbench();
  • 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");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h

    r42 r44  
    1818//#include "Behavioural/include/Description.h"
    1919#include "Behavioural/include/Entity.h"
    20 #include "Include/ToString.h"
    21 #include "Include/Debug.h"
     20#include "Common/include/ToString.h"
     21#include "Common/include/Debug.h"
    2222
    2323using namespace std;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h

    r40 r44  
    1313#include "Behavioural/include/XML.h"
    1414#include "Behavioural/include/Environnement.h"
    15 #include "Include/ErrorMorpheo.h"
    16 #include "Include/ToString.h"
     15#include "Common/include/ErrorMorpheo.h"
     16#include "Common/include/ToString.h"
    1717using namespace std;
    1818
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h

    r41 r44  
    22#define DEBUG_COMPONENT_H
    33
    4 #define DEBUG_Behavioural                                   false
     4#define DEBUG_Behavioural                                   true
    55#define   DEBUG_Generic                                     false
    66#define     DEBUG_Counter                                   false
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Direction.h

    r42 r44  
    22#define morpheo_behavioural_Direction_h
    33
    4 #include "Include/ToString.h"
     4#include "Common/include/ToString.h"
    55
    66namespace morpheo              {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h

    r42 r44  
    1515#include "Behavioural/include/Interfaces.h"
    1616#include "Behavioural/include/Schema.h"
    17 #include "Include/ErrorMorpheo.h"
    18 #include "Include/ToString.h"
    19 #include "Include/Debug.h"
     17#include "Common/include/ErrorMorpheo.h"
     18#include "Common/include/ToString.h"
     19#include "Common/include/Debug.h"
    2020
    2121using namespace std;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h

    r42 r44  
    2222#include "Behavioural/include/Vhdl.h"
    2323#endif
    24 #include "Include/ToString.h"
    25 #include "Include/ErrorMorpheo.h"
    26 #include "Include/Debug.h"
     24#include "Common/include/ToString.h"
     25#include "Common/include/ErrorMorpheo.h"
     26#include "Common/include/Debug.h"
    2727
    2828using namespace std;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h

    r42 r44  
    1313#include <list>
    1414#include "Behavioural/include/Interface_fifo.h"
    15 #include "Include/ToString.h"
    16 #include "Include/Debug.h"
     15#include "Common/include/ToString.h"
     16#include "Common/include/Debug.h"
    1717#ifdef VHDL
    1818#include "Behavioural/include/Vhdl.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Localisation.h

    r42 r44  
    33#define morpheo_behavioural_Localisation_h
    44
    5 #include "Include/ToString.h"
     5#include "Common/include/ToString.h"
    66
    77namespace morpheo              {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h

    r43 r44  
    1414#include "Behavioural/Constant/Constant_OpenRISC.h"
    1515#include "Behavioural/include/Environnement.h"
    16 #include "Include/ErrorMorpheo.h"
    17 #include "Include/ToString.h"
    18 #include "Include/Debug.h"
     16#include "Common/include/ErrorMorpheo.h"
     17#include "Common/include/ToString.h"
     18#include "Common/include/Debug.h"
    1919
    2020using namespace morpheo::behavioural::constant;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Schema.h

    r31 r44  
    44#define morpheo_behavioural_Schema_h
    55
    6 #include "Include/ToString.h"
     6#include "Common/include/ToString.h"
    77
    88namespace morpheo              {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h

    r42 r44  
    2222#include "Behavioural/include/Direction.h"
    2323#include "Behavioural/include/XML.h"
    24 #include "Include/ErrorMorpheo.h"
    25 #include "Include/ToBase2.h"
    26 #include "Include/ToString.h"
    27 #include "Include/Debug.h"
     24#include "Common/include/ErrorMorpheo.h"
     25#include "Common/include/ToBase2.h"
     26#include "Common/include/ToString.h"
     27#include "Common/include/Debug.h"
    2828
    2929using namespace std;
     
    5858  private   : const presence_port_t _presence_port;
    5959
    60   private   : Signal *              _signal       ;
    61   private   : bool                  _is_allocate  ;
    62   private   : void *                _sc_signal    ;
    63   private   : bool                  _is_map       ;
    64   private   : void *                _sc_signal_map;
     60  private   : Signal *              _connect_to_signal;   // the actual implementaion, this signal link with one signal (but if signal is an output, it can be connect with many signal ...)
     61  private   : Signal *              _connect_from_signal; // producter of signal. If NULL, then producteur is the current entity
     62  private   : bool                  _is_allocate  ; // Have allocate a sc_in or sc_out port
     63  private   : void *                _sc_signal    ; // sc_in or sc_out associated at this signal
     64  private   : bool                  _is_map       ;
     65  private   : void *                _sc_signal_map; // sc_out generated this signal
    6566  private   : type_info_t           _type_info    ;
    6667
     
    7980  public    : string            get_name        (void);
    8081  public    : uint32_t          get_size        (void);
    81   public    : Signal *          get_signal_link (void);
     82  public    : bool              get_is_map      (void);
     83  public    : Signal *          get_connect_to_signal (void);
     84  public    : Signal *          get_connect_from_signal (void);
     85  public    : direction_t       get_direction   (void);
    8286
    8387  public    : bool              presence_vhdl      (void);
    8488  public    : bool              presence_testbench (void);
    8589
    86   public    : void              mapping         (Signal * signal);
    87   public    : void              link            (Signal * signal);
     90//   public    : void              mapping         (Signal * signal);
     91  public    : void              link            (Signal * signal  ,
     92                                                 bool     is_port_component);
    8893
    8994#ifdef SYSTEMC         
     
    127132    }
    128133
     134#undef  FUNCTION
     135#define FUNCTION "Signal::alloc"
    129136  public    : template <typename T>
    130               void              alloc           (void * port)
    131     {
     137              void              alloc           (void * sc_signal)
     138    {
     139      log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     140
    132141      if (_type_info != UNKNOW)
    133142        throw (ErrorMorpheo ("Signal \""+_name+"\" : already allocate."));
    134143
    135       _is_allocate = true;
    136       _sc_signal      = port;
    137       _sc_signal_map  = port;
     144      _is_allocate    = true;
     145      _sc_signal      = sc_signal;
     146      _sc_signal_map  = sc_signal;
     147
     148      log_printf(TRACE,Behavioural,FUNCTION, "Allocation of %s - %.8x", _name.c_str(), (uint32_t)(_sc_signal_map));
    138149
    139150      if (typeid(T) == typeid(bool    ))
     
    153164      else
    154165        _type_info = UNKNOW;
     166
     167      log_printf(FUNC,Behavioural,FUNCTION,"End");
    155168    }
    156169#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Statistics.h

    r40 r44  
    1515#include "Behavioural/include/Environnement.h"
    1616#include "Behavioural/include/Parameters_Statistics.h"
    17 #include "Include/Average.h"
    18 #include "Include/Percent.h"
     17#include "Common/include/Average.h"
     18#include "Common/include/Percent.h"
    1919
    2020using namespace std;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h

    r40 r44  
    1616#include "Behavioural/include/Environnement.h"
    1717#include "Behavioural/include/Direction.h"
    18 #include "Include/ToString.h"
    19 #include "Include/Debug.h"
     18#include "Common/include/ToString.h"
     19#include "Common/include/Debug.h"
    2020
    2121using namespace std;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h

    r43 r44  
    1313#include <math.h>
    1414#include <list>
    15 #include "Include/ToString.h"
    16 #include "Include/Debug.h"
     15#include "Common/include/ToString.h"
     16#include "Common/include/Debug.h"
    1717
    1818using namespace std;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_interface_map.cpp

    r43 r44  
    2727
    2828    if (entity_dest == NULL)
    29       throw (ErrorMorpheo ("Component \""+name_entity+"\", port map with unknow component \""+component_dest+"\"."));
     29      throw (ErrorMorpheo ("<Component::interface_map> Component \""+name_entity+"\", port map with unknow component \""+component_dest+"\"."));
    3030
    3131    bool is_top_level_dest = (name_entity == component_dest);
     
    3434   
    3535    if (interface_dest == NULL)
    36       throw (ErrorMorpheo ("Component \""+name_entity+"\", port map with component \""+component_dest+"\" and a unknow interface \""+port_dest+"\"."));
     36      throw (ErrorMorpheo ("<Component::interface_map> Component \""+name_entity+"\", port map with component \""+component_dest+"\" and a unknow interface \""+port_dest+"\"."));
    3737
    3838    // Second entity
     
    4040
    4141    if (entity_src == NULL)
    42       throw (ErrorMorpheo ("Component \""+name_entity+"\", port map with unknow component \""+component_src+"\"."));
     42      throw (ErrorMorpheo ("<Component::interface_map> Component \""+name_entity+"\", port map with unknow component \""+component_src+"\"."));
    4343
    4444    bool is_top_level_src = (name_entity == component_src);
     
    4747
    4848    if (interface_src == NULL)
    49       throw (ErrorMorpheo ("Component \""+name_entity+"\", port map with component \""+component_src+"\" and a unknow interface \""+port_src+"\"."));
     49      throw (ErrorMorpheo ("<Component::interface_map> Component \""+name_entity+"\", port map with component \""+component_src+"\" and a unknow interface \""+port_src+"\"."));
    5050
    5151    // all is ok - link
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp

    r43 r44  
    4545
    4646    // If all is ok, mapping
    47    
    48     //cout << " - " << entity_src->get_name() << "("<< signal_src->get_name() << ")" << "\t-> " << entity_dest->get_name() << "(" << signal_dest->get_name() << ")" << endl;
     47    log_printf(TRACE,Behavioural,FUNCTION, "Signal \"%s.%s\"\tlink with \"%s.%s\""
     48               ,entity_src ->get_name().c_str()
     49               ,signal_src ->get_name().c_str()
     50               ,entity_dest->get_name().c_str()
     51               ,signal_dest->get_name().c_str());
    4952
    50     signal_src ->link   (signal_dest);
     53    signal_src ->link   (signal_dest, entity_dest == _entity);
    5154    //signal_dest->mapping(signal_src );
    5255   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp

    r43 r44  
    2020    uint32_t             cpt = 0;
    2121    map<Signal *,string> tab;
     22
     23    // buffer all output
     24    {
     25      vhdl->set_body ("------------------------------------------------------");
     26      vhdl->set_body ("-- Output's Buffer");
     27      vhdl->set_body ("------------------------------------------------------");
     28
     29      // for each interface
     30      list<Interface_fifo *>         * list_interface = (_entity)->get_interfaces_list()->get_interface_list();
     31      list<Interface_fifo *>::iterator j              = list_interface->begin();
     32      if (not list_interface->empty())
     33        {
     34          while (j != list_interface->end())
     35            {
     36              // for each signal
     37              list<Signal *>         * list_signal = (*j)->get_signal_list();
     38              list<Signal *>::iterator k           = list_signal->begin();
     39              if (not list_signal->empty())
     40                {
     41                  while (k != list_signal->end())
     42                    {
     43                      Signal * signal = (*k);
     44
     45                      // test if is connect with external interface or with an another component AND if this port is mapped.
     46                      if ( (signal->get_direction() == OUT) and
     47                           (signal->get_connect_from_signal () != NULL) )
     48                        {
     49                          // Create name
     50                          string signal_name = "signal_"+toString(cpt++);
     51                         
     52                          tab [signal                           ] = signal_name;
     53                          tab [signal->get_connect_from_signal()] = signal_name;
     54                         
     55                          // Add a new signal and the affectation
     56                          vhdl->set_signal (signal_name, signal->get_size());
     57                          vhdl->set_body   (signal->get_name()+" <= "+signal_name+";");
     58                        }
     59                      else
     60                        {
     61                          tab [signal                   ] = signal->get_name();
     62                        }
     63                      ++k;
     64                    }
     65                }
     66              ++j;
     67            }
     68        }
     69      vhdl->set_body ("");
     70      vhdl->set_body ("------------------------------------------------------");
     71      vhdl->set_body ("");
     72    }
    2273
    2374    vhdl->set_library_work (_entity->get_name() + "_Pack");
     
    50101                            // test if is connect with external interface or with an another component.
    51102                            Signal * signal_src  = (*k);
     103
    52104                            if (signal_src->presence_vhdl () == true)
    53105                              {
    54                                 Signal * signal_dest = (*k)->get_signal_link();
     106                                Signal * signal_dest = signal_src->get_connect_to_signal();
    55107                                string   name_src    = signal_src->get_name();
    56108                                string   name_dest;
    57109                               
    58                                 if (_entity->find_signal(signal_dest) == false)
    59                                   {
     110//                              // Test if destination signal is a interface port ?
     111//                              if (_entity->find_signal(signal_dest) == false)
     112//                                {
    60113                                    // find if signal is already link
    61                                     map<Signal *,string>::iterator it = tab.find(signal_src);
    62                                     if (tab.find(signal_src) == tab.end())
     114                                    map<Signal *,string>::iterator it = tab.find(signal_dest);
     115                                    if (tab.find(signal_dest) == tab.end())
    63116                                      {
    64117                                        // Create name
     
    72125                                      }
    73126                                    else
    74                                       name_dest = (*it).second;
    75                                   }
    76                                 else
    77                                   name_dest = signal_dest->get_name();
     127                                      {
     128                                        // find !!!!
     129                                        name_dest = (*it).second;
     130                                        tab [signal_src ] = name_dest;
     131                                      }
     132//                                }
     133//                              else
     134//                                {
     135//                                  cout << "Kane à dit : " << signal_dest->get_name() << endl;
     136//                                  // Test if output
     137//                                  if (signal_dest->get_direction() == OUT)
     138//                                    {
     139//                                      // Take buffer's signal
     140//                                      map<Signal *,string>::iterator it = tab.find(signal_dest);
     141//                                      name_dest        = (*it).second;
     142
     143//                                      cout << " * OUT - name : " << name_dest << endl;
     144//                                    }
     145//                                  else
     146//                                    {
     147//                                      name_dest = signal_dest->get_name();
     148//                                      cout << " * IN  - name : " << name_dest << endl;
     149//                                    }                             
     150//                                }
    78151                               
    79152                                vhdl->set_body_component_port_map (list_port_map, name_src, name_dest);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_signal_name.cpp

    r40 r44  
    77
    88#include "Behavioural/include/Interface.h"
    9 #include "Include/ChangeCase.h"
     9#include "Common/include/ChangeCase.h"
    1010
    1111namespace morpheo              {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench_generate_file.cpp

    r42 r44  
    8787    vhdl->set_body("\t\t\t"+counter+" <= "+counter+"+1;");
    8888    vhdl->set_body("");
    89     vhdl->set_body("\t\t\tassert not ("+counter+" = "+toString(cycle)+") report \"Test OK\" severity FAILURE;");
     89    vhdl->set_body("\t\t\tassert not ("+counter+" >= "+toString(cycle)+") report \"Test OK\" severity FAILURE;");
    9090    vhdl->set_body("\t\t\tassert not ("+test_name+" = '0') report \"Test KO\" severity FAILURE;");
    9191
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp

    r42 r44  
    2323    _is_allocate   = false;
    2424    _is_map        = false;
    25     _signal        = NULL;
     25    _connect_from_signal = NULL;
     26    _connect_to_signal   = NULL;
    2627    _sc_signal     = NULL;
    2728    _sc_signal_map = NULL;
     
    4243    _is_allocate= signal._is_allocate;
    4344    _is_map     = signal._is_map    ;
     45    _connect_from_signal = signal._connect_from_signal;
     46    _connect_to_signal   = signal._connect_to_signal;
    4447    _sc_signal     = signal._sc_signal    ;
    4548    _sc_signal_map = signal._sc_signal_map;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_connect_to_signal.cpp

    r43 r44  
    1313
    1414#undef  FUNCTION
    15 #define FUNCTION "Signal::get_signal_link"
    16   Signal * Signal::get_signal_link (void)
     15#define FUNCTION "Signal::get_connect_to_signal"
     16  Signal * Signal::get_connect_to_signal (void)
    1717  {
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    19     Signal * _return = _signal;
     19    Signal * _return = _connect_to_signal;
    2020    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2121
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp

    r43 r44  
    1414#undef  FUNCTION
    1515#define FUNCTION "Signal::link"
    16   void Signal::link (Signal * signal)
     16  void Signal::link (Signal * signal,
     17                     bool     is_port_component)
    1718  {
    1819    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1920
    2021    if (        _is_allocate == false)
    21       throw (ErrorMorpheo ("Signal \""+_name+"\", can't map with signal \""+        get_name()+"\", because it's not already allocate."));
     22      throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+        get_name()+"\", because it's not already allocate."));
    2223    if (signal->_is_allocate == false)
    23       throw (ErrorMorpheo ("Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate."));
     24      throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate."));
     25    if (_is_map == true)
     26      throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal->get_name()+"\", because it's already map."));
    2427   
    25     _signal = signal;
    2628
    27     if ((_direction == IN ) and (signal->_direction == IN ))
    28       switch (_type_info)
    29         {
    30         case BOOL     : {(*(static_cast<sc_in  <bool    > *>(_sc_signal))) (*(static_cast<sc_in  <bool    > *>(signal->_sc_signal))); break;}
    31         case UINT8_T  : {(*(static_cast<sc_in  <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in  <uint8_t > *>(signal->_sc_signal))); break;}
    32         case UINT16_T : {(*(static_cast<sc_in  <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint16_t> *>(signal->_sc_signal))); break;}
    33         case UINT32_T : {(*(static_cast<sc_in  <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint32_t> *>(signal->_sc_signal))); break;}
    34         case UINT64_T : {(*(static_cast<sc_in  <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint64_t> *>(signal->_sc_signal))); break;}
    35         default       : {throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); break;}
    36         }
    37     else
    38       if ((_direction == OUT) and (signal->_direction == OUT))
    39         {
    40           signal->_sc_signal_map = _sc_signal_map;
     29    // List of all case
     30    //
     31    //       dest        src             dest        src
     32    // PORT {IN } ----- {SIG} COMBI
     33    // PORT {OUT} ----- {SIG} COMBI
     34    //
     35    // PORT {IN } --X-- {OUT} COMPONENT {IN } ----- {OUT} COMPONENT
     36    // PORT {IN } ----- {IN } COMPONENT {IN } --X-- {IN } COMPONENT
     37    // PORT {OUT} ----- {OUT} COMPONENT {OUT} --X-- {OUT} COMPONENT
     38    // PORT {OUT} --X-- {IN } COMPONENT {OUT} ----- {IN } COMPONENT
    4139
    42           switch (_type_info)
    43             {
    44             case BOOL     : {(*(static_cast<sc_out <bool    > *>(_sc_signal))) (*(static_cast<sc_out <bool    > *>(signal->_sc_signal))); break;}
    45             case UINT8_T  : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;}
    46             case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;}
    47             case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;}
    48             case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;}
    49             default       : {throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); break;}
    50             }
    51         }
    52       else
    53         if ((_direction == IN ) and (signal->_direction == OUT))
    54           switch (_type_info)
    55             {
    56             case BOOL     : {(*(static_cast<sc_in  <bool    > *>(_sc_signal))) (*(static_cast<sc_out <bool    > *>(signal->_sc_signal))); break;}
    57             case UINT8_T  : {(*(static_cast<sc_in  <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;}
    58             case UINT16_T : {(*(static_cast<sc_in  <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;}
    59             case UINT32_T : {(*(static_cast<sc_in  <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;}
    60             case UINT64_T : {(*(static_cast<sc_in  <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;}
    61             default       : {throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); break;}
    62             }
    63         else
    64           if ((_direction == OUT) and (signal->_direction == IN ))
     40//  log_printf(TRACE,Behavioural,FUNCTION, "Signal \"%s\"\tlink with \"%s\"", _name.c_str(), signal->get_name().c_str());
     41
     42    log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (before) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal->_sc_signal_map));
     43
     44    _connect_to_signal = signal;
     45    signal->_connect_from_signal = this;
     46
     47    if (is_port_component == true)
     48      {
     49        if ((_direction == IN ) and (signal->_direction == IN ))
     50          {
    6551            switch (_type_info)
    6652              {
    67               case BOOL     : {(*(static_cast<sc_out <bool    > *>(_sc_signal))) (*(static_cast<sc_in  <bool    > *>(signal->_sc_signal))); break;}
    68               case UINT8_T  : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in  <uint8_t > *>(signal->_sc_signal))); break;}
    69               case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint16_t> *>(signal->_sc_signal))); break;}
    70               case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint32_t> *>(signal->_sc_signal))); break;}
    71               case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint64_t> *>(signal->_sc_signal))); break;}
    72               default       : {throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); break;}
     53              case BOOL     : {(*(static_cast<sc_in <bool    > *>(_sc_signal))) (*(static_cast<sc_in  <bool    > *>(signal->_sc_signal))); break;}
     54              case UINT8_T  : {(*(static_cast<sc_in <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in  <uint8_t > *>(signal->_sc_signal))); break;}
     55              case UINT16_T : {(*(static_cast<sc_in <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint16_t> *>(signal->_sc_signal))); break;}
     56              case UINT32_T : {(*(static_cast<sc_in <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint32_t> *>(signal->_sc_signal))); break;}
     57              case UINT64_T : {(*(static_cast<sc_in <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint64_t> *>(signal->_sc_signal))); break;}
     58              default       : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;}
    7359              }
    74           else
    75             throw (ErrorMorpheo ("Signal \""+_name+"\" : unsupported direction to link."));
     60          }
     61        else
     62          {
     63            if ((_direction == OUT) and (signal->_direction == OUT))
     64              {
     65                _is_map = true;
     66                signal->_sc_signal_map = _sc_signal_map;
     67               
     68                switch (_type_info)
     69                  {
     70                  case BOOL     : {(*(static_cast<sc_out <bool    > *>(_sc_signal))) (*(static_cast<sc_out <bool    > *>(signal->_sc_signal))); break;}
     71                  case UINT8_T  : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;}
     72                  case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;}
     73                  case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;}
     74                  case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;}
     75                  default       : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;}
     76                  }
     77              }
     78            else
     79              {
     80                throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal->get_name()+"\" : between two components, illegal direction ("+toString(_direction)+" with "+toString(signal->_direction)+")."));
     81              }
     82          }
     83      }
     84    else
     85      {
     86        if ((_direction == IN ) and (signal->_direction == OUT))
     87          {
     88            switch (_type_info)
     89              {
     90              case BOOL     : {(*(static_cast<sc_in  <bool    > *>(_sc_signal))) (*(static_cast<sc_out <bool    > *>(signal->_sc_signal))); break;}
     91              case UINT8_T  : {(*(static_cast<sc_in  <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;}
     92              case UINT16_T : {(*(static_cast<sc_in  <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;}
     93              case UINT32_T : {(*(static_cast<sc_in  <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;}
     94              case UINT64_T : {(*(static_cast<sc_in  <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;}
     95              default       : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;}
     96              }
     97          }
     98        else
     99          {
     100            if ((_direction == OUT) and (signal->_direction == IN ))
     101              {
     102                _is_map = true;
     103                switch (_type_info)
     104                  {
     105                  case BOOL     : {(*(static_cast<sc_out <bool    > *>(_sc_signal))) (*(static_cast<sc_in  <bool    > *>(signal->_sc_signal))); break;}
     106                  case UINT8_T  : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in  <uint8_t > *>(signal->_sc_signal))); break;}
     107                  case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint16_t> *>(signal->_sc_signal))); break;}
     108                  case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint32_t> *>(signal->_sc_signal))); break;}
     109                  case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint64_t> *>(signal->_sc_signal))); break;}
     110                  default       : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;}
     111                  }
     112              }
     113            else
     114              {
     115                throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal->get_name()+"\" : between a interface's port and one component, illegal direction ("+toString(_direction)+" with "+toString(signal->_direction)+")."));
     116              }
     117          }
     118      }
    76119
     120    log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (after ) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal->_sc_signal_map));
    77121    log_printf(FUNC,Behavioural,FUNCTION,"End");
    78122  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_mapping.cpp

    r43 r44  
    1212namespace behavioural          {
    1313
    14 #undef  FUNCTION
    15 #define FUNCTION "Signal::mapping"
    16   void Signal::mapping (Signal * signal)
    17   {
    18     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     14// #undef  FUNCTION
     15// #define FUNCTION "Signal::mapping"
     16//   void Signal::mapping (Signal * signal)
     17//   {
     18//     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1919
    20     if (_is_map == true)
    21       throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal->get_name()+"\", because it's already map."));
     20//     if (_is_map == true)
     21//       throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal->get_name()+"\", because it's already map."));
    2222   
    23     if (signal->_is_allocate == false)
    24       throw (ErrorMorpheo ("<Signal::mapping> Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate."));
     23//     if (signal->_is_allocate == false)
     24//       throw (ErrorMorpheo ("<Signal::mapping> Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate."));
    2525
    26     if (_direction == OUT)
    27       {
    28         // This output is mapped
    29         _is_map     = true;
     26//     if (_direction == OUT)
     27//       {
     28//      // This output is mapped
     29//      _is_map     = true;
    3030
    31         if (signal->_direction == OUT)
    32           _sc_signal_map = signal->_sc_signal_map;
    33       }
     31//      if (signal->_direction == OUT)
     32//        _sc_signal_map = signal->_sc_signal_map;
     33//       }
    3434   
    35     log_printf(FUNC,Behavioural,FUNCTION,"End");
    36   };
     35//     log_printf(FUNC,Behavioural,FUNCTION,"End");
     36//   };
    3737
    3838}; // end namespace behavioural         
  • trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h

    r43 r44  
    4848            }                                                           \
    4949          }                                                             \
    50         fprintf(stdout,"In file %s, ",__FILE__);                        \
    51         fprintf(stdout,"at line %d, ",__LINE__);                        \
     50        fprintf(stdout,"<%s> ",func);                                   \
    5251        if (DEBUG >= DEBUG_FUNC)                                        \
    53           {                                                             \
    54             fprintf(stdout,"in function \"%s\" ",func);                 \
    55           }                                                             \
     52        {                                                               \
     53          fprintf(stdout,"In file %s, ",__FILE__);                      \
     54          fprintf(stdout,"at line %d, ",__LINE__);                      \
     55        }                                                               \
    5656        fprintf(stdout,": ");                                           \
    5757        fprintf(stdout,str);                                            \
  • trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h

    r43 r44  
    55#include <sstream>
    66#include <stdint.h>
    7 #include "Include/ErrorMorpheo.h"
     7#include "Common/include/ErrorMorpheo.h"
    88using namespace std;
    99
     
    4242};
    4343
    44 #define TEST(type,exp1,exp2) do { test<type> (exp1,exp2,__FILE__,__LINE__);} while(0)
     44#define TEST(type,exp1,exp2)            do {                      test<type> (exp1,exp2,__FILE__,__LINE__);} while(0)
     45#define TEST_STR(type,exp1,exp2,str...) do { fprintf(stdout,str); test<type> (exp1,exp2,__FILE__,__LINE__);} while(0)
    4546
    4647#endif
  • trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Documents/document-cache-specification/fr/root.tex

    r42 r44  
    1 \Section{Introduction - Motivation}
    2 Les processeurs haute performance lancent plusieurs instructions, de manières non ordonnées et spéculativement. Un défaut de cache ne doit pas bloquer le processeur. Le cache doit pouvoir accepter des requêtes pendant le traitement d'un MISS. Il s'agit du concept de cache non bloquant.
     1\Section{Introduction}
     2\subSection{Motivations}
     3Les processeurs haute performance lancent plusieurs instructions, de manière non ordonnée et spéculativement. Un défaut de cache ne doit pas bloquer le processeur. Le cache doit être non blouqant, c'est à dire qu'il doit pouvoir accepter des requêtes venant du processeur pendant le traitement d'un MISS.
     4
     5\subSection{Démarche du document}
     6Le document est accès en quatre parties :
     7\begin{itemize}
     8\item Section \ref{overview_partial} : dans un premier temps, nous allons présenter une architecture qui satisfait des requêtes courantes (lectures / écritures, succès / échec) sur des adresses non conflictuelles. Cette première architecture est utilisable dans la majorité des cas.
     9\item Section \ref{problem}          : dans cette section, nous allons analyser des problèmes arrivant lors d'accès à des adresses conflictuelles, et/ou dans un environnement multi contexte. Pour chaque problème, nous proposons des solutions.
     10\item Section \ref{overview_full}    : cette section est la synthèse des deux précedentes. Nous allons modifier l'architecture de départ afin d'apporter des solutions aux problèmes énumérés dans la section \ref{problem}.
     11\item Section \ref{description}      : cette dernière section énumère les structures internes, ainsi que les automates de la solution retenue dans la section \ref{overview_full}.
     12\end{itemize}
    313
    414\subSection{Paramètres nécessaires}
    515\subsubSection{Paramètres interne du cache}
    6 \begin{itemize}
    7 \item Taille du mot
    8 \item Nombre de lignes par mot
    9 \item Nombre de lignes
    10 \item Associativité
    11 \item Nombre d'interface
    12 \item Taille des files internes
    13 \end{itemize}
     16
     17\begin{center}
     18  \begin{tabular}{|ll|ccc|}
     19    \hline
     20    Paramètres                &             &                       Min &                            Max & Pas \\
     21    \hline
     22    Taille du mot             & SIZE\_WORD  &                   32 bits &                        64 bits &  *2 \\
     23    Nombre de lignes par mot  & NB\_WORD    &                     1 mot &                        64 mots &  *2 \\
     24    Nombre de lignes          & NB\_LINE    &                   1 ligne &                    1024 lignes &  *2 \\
     25    Associativité             & ASSOC       & 1 banc de NB\_LINE lignes & NB\_LINE/16 bancs de 16 lignes &  *2 \\
     26    Taille des files internes & SIZE\_QUEUE &                    1 case &                       64 cases &  *2 \\
     27    \hline
     28  \end{tabular}
     29\end{center}
    1430
    1531\subsubSection{Paramètres de l'interface cache / processeur}
    16 \begin{itemize}
    17 \item Nombre de bits composant une donnée
    18 \item Nombre de bits composant une adresse
    19 \item Nombre de bits composant l'identifiant du propriétaire
    20 \item Nombre de bits composant l'identifiant de transaction
    21 \end{itemize}
     32
     33\begin{center}
     34  \begin{tabular}{|ll|ccc|}
     35    \hline
     36    Paramètres                              &             &     Min &     Max & Pas \\
     37    \hline
     38    Taille d'une donnée                     & SIZE\_DATA  & 32 bits & 64 bits &  *2 \\
     39    Taille de l'adresse                     & SIZE\_ADDR  & 32 bits & 64 bits &  *2 \\
     40    Taille de l'identifiant du propriétaire & SIZE\_TRDID &  0 bits &  4 bits &  +1 \\
     41    Taille de l'identifiant de transaction  & SIZE\_PKTID &  0 bits &  4 bits &  +1 \\
     42    \hline
     43  \end{tabular}
     44\end{center}
    2245
    2346\subSection{Spécification}
    2447\begin{itemize}
    25 \item Write through
    26 \item Write no allocate
    27 \item Les requêtes envoyé par le processeur ne garantisse pas le stricte ordre séquentielle du programme.
    28 \item Associatif : 1, N, Totalement
    29 \end{itemize}
    30 
    31 \Section{Vue d'ensemble - Modèle simplifié}
    32 
    33 \printgraphonly{CACHE_overview_save}{.8}
     48\item Write through     (Les données sont à la fois écrite dans le bloc du cache et dans le bloc de la mémoire de niveau inférieur).
     49\item Write no allocate (Les échecs d'écriture n'affectent pas le cache, le bloc n'est modifié que dans le niveau mémoire inférieur).
     50\item Cache associatif  (Le cache est découpé plusieurs banc et une ligne peut être placé dans n'importe quel banc.)
     51\item Non bloquant      (Le cache permet d'avoir plusieurs requêtes en cours de résolution)
     52\item Le modèle de consistance mémoires du processeur est relachés (Nous permettons aux lectures et aux écritures de se lancer et de se terminer de manière non ordonnées.)
     53\end{itemize}
     54
     55\subSection{Hypothèse de travail}
     56
     57Nous allons supposer que le cache sera connecté à un processeur superscalaire d'ordre 4. Que le code exécuté contient 20\% de lectures et 10 \% d'écritures. Nous avons donc en moyenne 1 accès mémoire par cycle.
     58Si nous ciblons un cache ayant au minimum 90\% de réussites, nous obtenons alors les ratios suivants :
     59\begin{itemize}
     60\item 60 \% de lectures qui réussissent.
     61\item 30 \% d'écritures qui réussissent.
     62\item 6,6\% de lectures qui échouent.
     63\item 3,3\% d'écritures qui échouent.
     64\end{itemize}
     65
     66\Section{Vue d'ensemble - Modèle simplifié}\label{overview_partial}
     67
     68\printgraphonly{CACHE_overview_basic}{.8}
    3469
    3570Dans un premier temps, nous allons montrer un modèle qui satisfait les cas de requêtes courantes : read hit, write hit, read miss et write miss, sur des adresses non conflictuelles.
    3671
    37 Afin de réaliser un cache non bloquant, nous avons séparé l'interface des requêtes de l'interface des réponses. Pour cela, 4 automates gèrent les interfaces et la gestion des ressources. La micro-architecture du cache ce décompose comme suit :
     72
     73Afin de réaliser un cache non bloquant, nous avons séparé l'interface des requêtes, de l'interface des réponses. Pour cela, 4 automates gèrent les interfaces et la gestion des ressources. La micro-architecture du cache ce décompose comme suit :
    3874\begin{itemize}
    3975\item Quatre automates :
    4076  \begin{description}
    4177  \item[FSM\_DCACHE\_REQ :] Cet automate gère la consommation des requêtes provenant du cache et, suivant le type d'accès et la réussite de l'accès, l'écriture dans les blocs QUEUE\_REQ et QUEUE\_READ\_HIT
    42   \item[FSM\_DCACHE\_RSP :] L'automate gère la consommation de réponses contenue dans la QUEUE\_RSP et s'occupe d'écrire les lignes chargés dans le cache.
     78  \item[FSM\_DCACHE\_RSP :] L'automate gère la consommation de réponses contenues dans la QUEUE\_RSP et s'occupe d'écrire les lignes chargés dans le cache.
    4379  \item[FSM\_VCI\_REQ    :] L'automate s'occupe de consommer une requête contenue dans la QUEUE\_REQ (si la file n'est pas vide) et la lance sur l'interface VCI\_REQ (si l'interface n'est pas occupée).
    4480  \item[FSM\_VCI\_RSP    :] L'automate s'occupe de consommer des réponses sur l'interface VCI\_RSP (si l'interface n'est pas occupée) et l'écrit dans  la file QUEUE\_RSP (si la file n'est pas pleine).
     
    4783  \begin{description}
    4884  \item[QUEUE\_READ\_HIT :] Cette file d'attente s'occupe de transmettre le plus tôt possible les requêtes de lectures ayant fait un HIT.
    49   \item[QUEUE\_REQ       :] Cette file est utilisée comme tampon d'écriture et de requête de lecture ayant fait un miss. Elle attende leur envoie à la mémoire.
     85  \item[QUEUE\_REQ       :] Cette file est utilisée comme tampon d'écriture et de requête de lecture ayant fait un miss. Elle attend leur envoi à la mémoire.
    5086  \item[QUEUE\_RSP       :] La file est utilisée comme tampon pour les réponses provenant de la mémoire.
    5187  \end{description}
    5288\item Trois blocs mémoires :
    5389  \begin{description}
    54   \item[RAM\_TAG  :] Contient les informations pouvant identifier les adresses contenues dans cette ligne de cache.
    55   \item[RAM\_DATA :] Contient les données de la ligne de cache.
     90  \item[RAM\_TAG  :] Contient les informations pouvant identifier les adresses contenues dans cette ligne de cache. Ce bloc est composé de ASSOC bancs de tailles identiques.
     91  \item[RAM\_DATA :] Contient les données de la ligne de cache. Ce bloc est composé de ASSOC bancs de tailles identiques.
    5692  \item[RAM\_INFO :] Contient les informations relative aux requêtes pendantes.
    5793  \end{description}
     
    6298
    6399\begin{description}
    64 \item[Read - Hit  :] La requête accède en parralèle aux RAM\_TAG et au RAM\_DATA. La donnée lu est écrite dans la RAM\_INFO, alors que le pointeur vers RAM\_INFO est sauvegardé dans la QUEUE\_READ\_HIT. Ensuite la requête attendra d'être sélectionnée par l'automate FSM\_DCACHE\_RSP, puis va lire les informations à partir de la RAM\_INFO et sera acheminée vers le port de réponse.
     100\item[Read - Hit  :] La requête accède en parallèle aux RAM\_TAG et au RAM\_DATA. La donnée lue est écrite dans la RAM\_INFO, alors que le pointeur vers RAM\_INFO est sauvegardé dans le bloc QUEUE\_READ\_HIT. Ensuite la requête attend d'être sélectionnée par l'automate FSM\_DCACHE\_RSP, puis lit les informations à partir de la RAM\_INFO et est acheminée vers le port de réponse.
    65101\item[Read - Miss :] La requête de lecture réalisant un miss, écrit les informations concernant la requête dans la RAM\_INFO. Le pointeur de RAM\_INFO sera écrit dans la QUEUE\_REQ. L'automate FSM\_VCI\_REQ va envoyer la requête sur le réseau VCI. La réponse reviendra par l'intermédiaire de l'automate FSM\_VCI\_RSP qui enregistre la ligne de cache en cours d'arrivée dans un tampon. Dès la réception de la fin de paquet, le tampon est enregistré dans la QUEUE\_RSP. L'identifiant de requête vci sera un index vers RAM\_INFO, c'est pour cela que lorsque l'automate FSM\_DCACHE\_REQ récupère une réponse dans la QUEUE\_RSP, elle peut retrouver les informations de la requêtes dans RAM\_INFO.
    66 \item[Write - Hit  :] Un write hit est équivalent à un read-miss : lors de la requête les informations sont stockées dans la RAM\_INFO (ainsi que la donnée à écrire). Lors de la réponse, (à la différence d'un read-miss, il n'y a pas de retour de ligne) la donnée à écrire va l'être dans le bloc RAM\_DATA.
     102\item[Write - Hit  :] La gestion d'un write hit est équivalent à celle d'un read-miss : lors de la requête les informations sont stockées dans la RAM\_INFO (ainsi que la donnée à écrire). Lors de la réponse, (à la différence d'un read-miss, il n'y a pas de retour de ligne) la donnée à écrire va l'être dans le bloc RAM\_DATA.
    67103\item[Write - Miss :] Un échec d'écriture est équivalent à une réussite d'écriture mais sans mise à jour du cache.
    68104\item[Lock et Prefetch :] Ce cache n'implémentant ces fonctionnalités et étant le dernier niveau de cache avant l'accès à l'interconnect, alors ces requêtes sont traitées comme étant des Read Hit (sans lecture du cache)
     
    76112Nous optons pour la deuxième solution. Ce choix est également motiver pour uniformiser les solutions proposées pour les problèmes de consistances mémoires.
    77113
    78 \Section{Quelques problèmes du modèle simplifié}
     114\Section{Quelques problèmes du modèle simplifié}\label{problem}
    79115Dans cette section, nous allons voir quelques problèmes fonctionnelle du modèle de base et nous allons présenter des solutions.
    80116
     
    179215Le cache est optimisé pour utiliser les propriétés de localité spatiale et temporelle d'un programme. Avec le multi-contexte, le cache va être soumit à plusieurs flot qui ne sont pas dépendant entre eux. Ceci va entraîner des évincements de lignes en faveur d'un contexte, alors que la ligne victime pouvait être utilisée par un autre contexte. De plus, ceci va augmenter le phénomène décrit dans la section "Évincement précoce de ligne" : des écritures non encore finalisées vont voir leur lignes cibles évincées.
    180216
    181 \Section{Vue d'ensemble - Modèle complet}
     217\Section{Vue d'ensemble - Modèle complet}\label{overview_full}
    182218Cette section à pour but de montrer les modifications par rapport au modèle de base.
    183219
     
    215251\end{tabular}
    216252
    217 \Section{Description détaillée}
     253\Section{Description détaillée}\label{description}
    218254
    219255\subSection{Structure interne}
     256
     257Pour chaque composant interne, les interfaces suivent le protocole fifo (le producteur possède une sortie VAL qui indique s'il a une requête valide et le consommateur possède une sortie ACK qui indique s'il peut accepter une transaction. Il y a une transaction si VAL et ACK sont tous les deux à 1 à la fin d'un cycle). L'avantage est qu'il est très facile de faire du contrôle de flux.
     258
    220259Nous allons maintenant détailler les ressources internes du cache non bloquant :
    221260\begin{itemize}
     
    224263  \item[QUEUE\_READ\_HIT :] Cette file d'attente s'occupe de transmettre le plus tôt possible les requêtes de lecture ayant fait un HIT.
    225264    \begin{description}
    226     \item {\it Valid : } Indique si l'entrée correspondante contient une donnée valide
     265    %\item {\it Valid : } Indique si l'entrée correspondante contient une donnée valide
    227266    \item {\it Index : } Index vers une entrée de RAM\_INFO
    228267    \end{description}
     268    \printgraphonly{CACHE_bloc_QUEUE_READ_HIT}{.8}
    229269  \item[QUEUE\_REQ :] Cette file est utilisée comme tampon d'écriture et de requête de lecture ayant fait un miss. Elle attende leur envoie à la mémoire.
    230270    \begin{description}
    231     \item {\it Valid : } Indique si l'entrée correspondante contient une donnée valide
     271    %\item {\it Valid : } Indique si l'entrée correspondante contient une donnée valide
    232272    \item {\it Index : } Index vers une entrée de RAM\_INFO
    233273    \end{description}
     274    \printgraphonly{CACHE_bloc_QUEUE_REQ}{.8}
    234275  \item[QUEUE\_RSP :] La file est utilisée comme tampon pour les réponses provenant de la mémoire.
    235276    \begin{description}
    236     \item {\it Valid :} Indique si l'entrée correspondante contient une donnée valide
     277    %\item {\it Valid :} Indique si l'entrée correspondante contient une donnée valide
    237278    \item {\it Index :} Index vers une entrée de RAM\_INFO
    238279    \item {\it Line :} Contient la donnée retournée par l'interface de réponse
    239280    \item {\it Error :} Indique si l'accès effectué à généré une erreur ou pas.
    240281    \end{description}
     282    \printgraphonly{CACHE_bloc_QUEUE_RSP}{.8}
    241283  \end{description}
    242284\item Trois blocs mémoires :
     
    246288    \item {\it Tag :} Numéro du tag correspondant à la ligne
    247289    \end{description}
     290    \printgraphonly{CACHE_bloc_RAM_TAG}{.8}
    248291  \item[RAM\_DATA :] Contient les données de la ligne de cache
    249292    \begin{description}
    250293    \item {\it Line :} Contient la ligne de cache proprement dite
    251294    \end{description}
     295    \printgraphonly{CACHE_bloc_RAM_DATA}{.8}
    252296  \item[RAM\_LOCK :] Contient les bits de gestions de dépendances
    253297    \begin{description}
     
    256300    \item {\it Lock\_by\_write :} Si le bit est positionné, alors il existe une écriture pendante
    257301    \end{description}
     302    \printgraphonly{CACHE_bloc_RAM_LOCK}{.8}
    258303  \item[RAM\_INFO :] Contient les informations relative au requête pendante. Pour plus de détails voir la section \ref{RAM_INFO}
    259304    \begin{description}
     
    265310    \item {\it Data :} Donnée (en cas d'écriture : DCACHE.REQ\_WDATA, en cas de lecture avec succès : contenu d'un mot de la ligne de cache)
    266311    \end{description}
     312    \printgraphonly{CACHE_bloc_RAM_INFO}{.8}
    267313  \end{description}
    268314\item  Quatre automates :
     
    289335Nous pouvons noter alors que nous pouvons accepter une requête sur le l'interface DCACHE\_REQ si la file de destination n'est pas vide ET s'il y a encore une place de libre dans RAM\_INFO.
    290336
     337%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    291338Dans un premier temps, la taille de RAM\_INFO sera le nombre maximal de requêtes pendantes que le processeur peut admettre soit : \{nombre de contexte\} * \{taille de la load store queue\} (dans ce premier cas, RAM\_INFO n'a pas besoin de contenir le pktid et le trdid de la requête). De plus le nombre de port de lecture sera de 2.
    292339
     
    312359Dans ce cas ajouter une barrière de pipeline va consommer la requête mais le cache va être dans l'imposibilité de l'accepter et va empêcher d'en choisir une autre.
    313360
     361\subSection{Choix de la victime}
     362Pour la sélection des lignes à evincer, nous allons implémenter un algorithme pseudo aléatoire.
     363L'avantage de cet algorithme est de ne pas avoir besoin de sauvegarder un historique des accès.
     364
     365\subSection{RAM mono-port}\label{mono-port}
     366
     367La mémoire la plus dense est de la mémoire mono-port (soit une lecture, soit une écriture par cycle).
     368
     369Comme chaque interface des blocs de RAM ont une interface fifo, elle intègre donc un contrôle de flux. Ceci les rends indépendant du nombre de port intégrer dans chaque bloc mémoire. (Par exemple, un le bloc RAM\_DATA est implémenté avec de la mémoire dual-port, alors les sorties READ\_ACK et WRITE\_ACK seront toujours égals à 1).
     370
     371Néanmoins, nous devons prendre soin à ce que chaque étage du cache ne commande pas deux interfaces d'un même bloc RAM. Or dans la solution retenue, nous avons les blocs RAM\_TAG et RAM\_LOCK qui ont besoin de deux interfaces durant la partie DCACHE\_REQ. Pour cela nous devons réaliser une barrière de pipeline.
     372
     373Le premier étages va réaliser les lectures, alors que le second va mettre à jour ces bancs. Il est à noter qu'il va devoir avoir un bypass car comme la RAM\_LOCK ainsi que le bloc RAM\_TAG n'a pas encore été mis à jour, cette requête peut être suivit par une autre requête qui entre en conflit.
     374
     375Le graphe \ref{CACHE_overview_mono-port} montre les modifications à apporter au cache pour n'avoir qu'un port par étage.
     376
     377\printgraphonly{CACHE_overview_mono-port}{.8}
     378
     379\subSection{Structure du pipeline}
     380
     381Suivant le type d'une requête, le temps de réponse minimal n'est pas le même (On pose N le nombre de cycle aller retour jusqu'a la mémoire et M le temps pour avoir une ligne de cache complète) :
     382\begin{itemize}
     383\item Read - Hit : 2 cycles.
     384\item Read - Miss : 4 + N + M cycles.
     385\item Write : 5 + N cycles.
     386\item Lock et Prefetch : 2 cycles.
     387\item Invalidate et Flush : 2 cycles.
     388\end{itemize}
     389
     390\printgraphonly{CACHE_pipeline}{.8}
     391
     392%\subSection{Signaux de contrôles}
     393%Dans cette section, nous allons voir les fonctions combinatoires permettant de gérer les différents signaux de contrôles
  • trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Makefile

    r42 r44  
    5050PS_FILES                = $(patsubst $(DIR_TEX)/%.tex,%.ps ,$(TEX_FILES))
    5151PDF_FILES               = $(patsubst $(DIR_TEX)/%.tex,%.pdf,$(TEX_FILES))
    52 EPS_FILES               = $(patsubst $(DIR_GRAPH)/%.p,$(DIR_SCHEMA_EPS)/%.eps,$(wildcard $(DIR_GRAPH)/*.p))             \
    53                           $(patsubst $(DIR_SCHEMA)/%.fig,$(DIR_SCHEMA_EPS)/%.eps,$(wildcard $(DIR_SCHEMA)/*.fig))       \
    54                           $(patsubst $(DIR_SCHEMA)/%.eps,$(DIR_SCHEMA_EPS)/%.eps,$(wildcard $(DIR_SCHEMA)/*.eps))
     52PNG_FILES               = $(patsubst $(DIR_GRAPH)/%.p,$(DIR_SCHEMA_PNG)/%.png,$(wildcard $(DIR_GRAPH)/*.p))             \
     53                          $(patsubst $(DIR_SCHEMA)/%.fig,$(DIR_SCHEMA_PNG)/%.png,$(wildcard $(DIR_SCHEMA)/*.fig))       \
     54                          $(patsubst $(DIR_SCHEMA)/%.eps,$(DIR_SCHEMA_PNG)/%.png,$(wildcard $(DIR_SCHEMA)/*.eps))
    5555
    5656#--------------------------------------------------------------------------------
     
    5858#--------------------------------------------------------------------------------
    5959.PHONY                  : all clean view help doc doc_all new delete
    60 .SECONDARY              : $(DVI_FILES) $(PS_FILES) $(PDF_FILES) $(EPS_FILES) $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_PNG)
     60.SECONDARY              : $(DVI_FILES) $(PS_FILES) $(PDF_FILES) $(PNG_FILES) $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_PNG)
     61.PRECIOUS               : %.pdf %.ps %.dvi $(DIR_SCHEMA_PNG)/%.png $(DIR_SCHEMA_EPS)/%.eps
    6162
    6263all                     : help
    6364
    64 doc                     : $(DIR_TEX)  $(EPS_FILES)
     65doc                     : $(DIR_TEX)  $(PNG_FILES)
    6566                        @                                                                                       \
    6667                        for file in $(ALL_FILES); do                                                            \
     
    373374                        @$(MKDIR) $@
    374375
     376$(DIR_SCHEMA_PNG)/%.png : $(DIR_SCHEMA_EPS)/%.eps $(DIR_SCHEMA_PNG)
     377                        @$(ECHO) "Generate   files     : $*.png"
     378#                       @$(EPS2PNG) $< $@
     379
    375380$(DIR_SCHEMA_EPS)/%.eps : $(DIR_SCHEMA)/%.eps $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_PNG)
    376381                        @$(ECHO) "Generate   files     : $*.eps"
    377382                        @$(CP) $(DIR_SCHEMA)/$*.eps $(DIR_SCHEMA_EPS)
    378                         @$(EPS2PNG) $@ $(DIR_SCHEMA_PNG)/$*.png
    379383
    380384$(DIR_SCHEMA_EPS)/%.eps : $(DIR_SCHEMA)/%.fig $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_PNG)
    381385                        @$(ECHO) "Generate   files     : $*.eps"
    382386                        @$(FIG2EPS) $< $@
    383                         @$(EPS2PNG) $@ $(DIR_SCHEMA_PNG)/$*.png
    384387
    385388$(DIR_SCHEMA_EPS)/%.eps : $(DIR_GRAPH)/%.p    $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_PNG)
    386389                        @$(ECHO) "Generate   files     : $*.eps"
    387390                        @$(CD) $(DIR_GRAPH); $(GNUPLOT) $*.p
    388                         @$(EPS2PNG) $@ $(DIR_SCHEMA_PNG)/$*.png
    389391
    390392#--------------------------------------------------------------------------------
  • trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Package/document-cache-specification.sty

    r42 r44  
    1 \def\review{2007/07/02}
     1\def\review{2007/07/11}
    22%\def\review{\number\day/\number\month/\number\year\xspace}
    33
    4 \title{Cache - Specification}
     4\title{Cache de données associatif et non bloquant\\{\it Spécification}}
    55 
    66\author{}
Note: See TracChangeset for help on using the changeset viewer.