Changeset 3


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

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

2) Fin du composant "Two_Level_Branch_Predictor"

validation * systemc

  • vhdl
Location:
trunk/IPs/systemC/processor/Morpheo
Files:
3 added
58 edited

Legend:

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

    r2 r3  
    2121    for (uint32_t i=0; i<_param._nb_port; i++)
    2222      {
    23         Tdata_t data = PORT_READ(in_COUNTER_DATA [i]);
     23        Tcontrol_t addsub  = PORT_READ(in_COUNTER_ADDSUB [i]);
     24        Tdata_t    data_in = PORT_READ(in_COUNTER_DATA   [i]);
     25        Tdata_t    data_out= data_in;
     26        log_printf(TRACE,Counter,"genMealy","before : %d %s = %d",data_in,((addsub==1)?"++":"--"),data_out);
    2427
    2528        // Staturate counter
    26         if (PORT_READ(in_COUNTER_ADDSUB [i]) == 1)
     29        if (addsub == 1)
    2730          {
    28             if (data < _param._data_max)
    29               data ++;
     31            if (data_out < _param._data_max)
     32              data_out++;
    3033          }
    3134        else
    3235          {
    33             if (data > 0)
    34               data --;
     36            if (data_out > 0)
     37              data_out--;
    3538          }
    3639
    37         PORT_WRITE(out_COUNTER_DATA[i], data);
     40        log_printf(TRACE,Counter,"genMealy","after   : %d %s = %d",data_in,((addsub==1)?"++":"--"),data_out);
     41   
     42        PORT_WRITE(out_COUNTER_DATA[i], data_out);
    3843      }
    3944
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters_print.cpp

    r2 r3  
    77
    88#include "Behavioural/Generic/Counter/include/Parameters.h"
    9 #include <sstream>
     9#include "Behavioural/include/XML.h"
    1010using namespace std;
    1111
     
    2020    log_printf(FUNC,Counter,"print","Begin");
    2121
    22     string tab = string(depth,'\t');
    23     ostringstream msg;
    24     msg << tab << "<counter>" << endl
    25         << tab << "\t<size_data value=\"" << _size_data << "\" />" << endl
    26         << tab << "\t<nb_port   value=\"" << _nb_port   << "\" />" << endl
    27         << tab << "</counter>" << endl;
     22    XML xml ("counter");
     23
     24    xml.balise_open("counter");
     25    xml.  singleton_begin("size_data");
     26    xml.    attribut("value",toString(_size_data));
     27    xml.  singleton_end();
     28    xml.  singleton_begin("nb_port  ");
     29    xml.    attribut("value",toString(_nb_port));
     30    xml.  singleton_end();
     31    xml.balise_close();
    2832
    2933    log_printf(FUNC,Counter,"print","End");
    3034   
    31     return msg.str();
     35    return xml.get_body(depth);
    3236  };
    3337
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_genMealy_read.cpp

    r2 r3  
    2727        if ( PORT_READ(in_READ_ENABLE[i]) == 1)
    2828          {
    29             log_printf(TRACE,Register_File,"genMealy_read","Read  [%d] : Have transaction, Reg[%d] -> %x",i,PORT_READ(in_READ_ADDRESS[i]),REGISTER_READ(reg_DATA[PORT_READ(in_READ_ADDRESS[i])]));
     29            Taddress_t address = PORT_READ(in_READ_ADDRESS[i]);
     30            Tdata_t    data    = REGISTER_READ(reg_DATA[address]);
     31
     32            log_printf(TRACE,Register_File,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     33
    3034#ifdef STATISTICS
    3135            _stat_nb_read ++;
    3236#endif   
    3337            // Write in registerFile
    34             PORT_WRITE(out_READ_DATA[i],REGISTER_READ(reg_DATA[PORT_READ(in_READ_ADDRESS[i])]));
     38            PORT_WRITE(out_READ_DATA[i],data);
    3539          }
    3640        else
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_transition.cpp

    r2 r3  
    2626        if ( PORT_READ(in_WRITE_ENABLE[i]) == true)
    2727          {
    28             log_printf(TRACE,Register_File,"transition","Write [%d] : Have transaction, Reg[%d] <- %x",i,PORT_READ(in_WRITE_ADDRESS[i]),PORT_READ(in_WRITE_DATA   [i]));
    29            
    3028#ifdef STATISTICS
    3129            _stat_nb_write ++;
     
    3533            Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
    3634           
     35            log_printf(TRACE,Register_File,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     36
    3737            // Write in registerFile
    3838            REGISTER_WRITE(reg_DATA[address],data);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Common

    r2 r3  
    3434TR                              = tr
    3535UPPERtoLOWER                    = $(TR) [:lower:] [:upper:]
     36
    3637#-----[ Compilation ]--------------------------------------
    3738
     
    6162XX_systemcass                   = -rdynamic                             \
    6263                                  -ansi                                 \
    63                                   -Wno-long-long                        \
    64                                   -DCHECK_MULTIWRITING2REGISTER
    65 
    66 #                                  -DNONAME_RENAME
     64                                  -Wno-long-long
    6765
    6866XX_systemcass_deps              = $(XX_systemcass)
    6967
    7068EXEC_PARAMS_systemc             =
    71 EXEC_PARAMS_systemcass          =
    72 EXEC_PARAMS_systemcass_deps     = --p
     69EXEC_PARAMS_systemcass          = --nobanner
     70EXEC_PARAMS_systemcass_deps     = --nobanner --p
    7371
    7472
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest

    r2 r3  
    142142                                        *.vhdl                  \
    143143                                        *.stat                  \
    144                                         .libs                   \
    145                                         code*                   \
     144                                        generated_by_systemcass \
    146145                                        core*
    147146
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis

    r2 r3  
    6464
    6565$(DIR_LOG)/%.vhdl_sim.log       : $(DIR_VHDL)/%.vhdl $(DIR_LOG)/%.vhdl.log
    66                                 @$(ECHO) "VHDL's Simulation  : $*"
     66                                @$(ECHO) "VHDL's Simulation: $*"
    6767                                @$(VSIM) "$(DIR_WORK).`$(BASENAME) $* |$(UPPERtoLOWER)`" > $@
    6868                                declare -i count=`$(GREP) -ch "Test KO" $@`;            \
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.defs

    r2 r3  
    1616#-----[ Flags ]--------------------------------------------
    1717FLAGS                           =       -DSYSTEMC               \
     18                                        -DCONFIGURATION         \
    1819                                        -DSTATISTICS            \
    1920                                        -DVHDL                  \
    20                                         -DVHDL_TESTBENCH        \
    21                                         -DDEBUG=DEBUG_ALL
     21                                        -DVHDL_TESTBENCH
     22#                                       -DDEBUG=DEBUG_TRACE
    2223
    2324# Flags :
     
    2526# VHDL                          - To generate a vhdl's    model
    2627# SYSTEMC                       - To generate a systemc's model
     28# CONFIGURATION                 - To generate a configuration file (it's input of viewer)
    2729# STATISTICS     (need SYSTEMC) - In the simulation, generate a statistics's file
    2830# VHDL_TESTBENCH (need SYSTEMC) - In the simulation, generate two testbench's file (input and ouput) to validate the vhdl's model
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/VERSION

    r2 r3  
    1 v0.3
     1v0.4
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_print.cpp

    r2 r3  
    77
    88#include "Behavioural/@DIRECTORY/include/Parameters.h"
    9 #include <sstream>
     9#include "Behavioural/include/XML.h"
    1010using namespace std;
    1111
     
    1818    log_printf(FUNC,@COMPONENT,"print","Begin");
    1919
    20     string tab = string(depth,'\t');
    21     ostringstream msg;
    22     msg << tab << "<@COMPONENT_LOWER>" << endl
    23         << tab << "</@COMPONENT_LOWER>" << endl;
     20    XML xml ("@COMPONENT_LOWER");
     21
     22    xml.balise_open("@COMPONENT_LOWER");
     23//  xml.  singleton_begin("size_data");
     24//  xml.    attribut("value",toString(_size_data));
     25//  xml.  singleton_end();
     26//  xml.  singleton_begin("nb_port  ");
     27//  xml.    attribut("value",toString(_nb_port));
     28//  xml.  singleton_end();
     29    xml.balise_close();
    2430
    2531    log_printf(FUNC,@COMPONENT,"print","End");
    2632   
    27     return msg.str();
     33    return xml.get_body(depth);
    2834  };
    2935
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/test.cpp

    r2 r3  
    4646   *********************************************************************/
    4747  sc_clock                                 CLOCK ("clock", 1.0, 0.5);
    48   sc_signal<Tcontrol_t>                    PREDICT_VAL             [param._nb_prediction];
    49   sc_signal<Tcontrol_t>                    PREDICT_ACK             [param._nb_prediction];
    50   sc_signal<Taddress_t>                    PREDICT_ADDRESS         [param._nb_prediction];
    51   sc_signal<Thistory_t>                    PREDICT_HISTORY         [param._nb_prediction];
    52                                            
    53   sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL     [param._nb_branch_complete];
    54   sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK     [param._nb_branch_complete];
    55   sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS [param._nb_branch_complete];
    56   sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY [param._nb_branch_complete];
    57   sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_HIT    [param._nb_branch_complete];
     48  sc_signal<Tcontrol_t>                    PREDICT_VAL               [param._nb_prediction];
     49  sc_signal<Tcontrol_t>                    PREDICT_ACK               [param._nb_prediction];
     50  sc_signal<Taddress_t>                    PREDICT_ADDRESS           [param._nb_prediction];
     51  sc_signal<Thistory_t>                    PREDICT_HISTORY           [param._nb_prediction];
     52                                                                    
     53  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL       [param._nb_branch_complete];
     54  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK       [param._nb_branch_complete];
     55  sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS   [param._nb_branch_complete];
     56  sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY   [param._nb_branch_complete];
     57  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_DIRECTION [param._nb_branch_complete];
    5858 
    5959  /********************************************************
     
    7575  for (uint32_t i=0; i<param._nb_branch_complete; i++)
    7676    {
    77       (*(_Branch_History_Table-> in_BRANCH_COMPLETE_VAL     [i]))        (BRANCH_COMPLETE_VAL     [i]);
    78       (*(_Branch_History_Table->out_BRANCH_COMPLETE_ACK     [i]))        (BRANCH_COMPLETE_ACK     [i]);
    79       (*(_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i]))        (BRANCH_COMPLETE_ADDRESS [i]);
    80       (*(_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY [i]))        (BRANCH_COMPLETE_HISTORY [i]);
    81       (*(_Branch_History_Table-> in_BRANCH_COMPLETE_HIT     [i]))        (BRANCH_COMPLETE_HIT    [i]);
     77      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))        (BRANCH_COMPLETE_VAL       [i]);
     78      (*(_Branch_History_Table->out_BRANCH_COMPLETE_ACK       [i]))        (BRANCH_COMPLETE_ACK       [i]);
     79      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))        (BRANCH_COMPLETE_ADDRESS  [i]);
     80      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))        (BRANCH_COMPLETE_HISTORY  [i]);
     81      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))        (BRANCH_COMPLETE_DIRECTION [i]);
    8282    }
    8383
     
    108108  Thistory_t history                  = 0;
    109109  Thistory_t mask                     = gen_mask <Thistory_t> (param._size_shifter);
    110   Tcontrol_t hit                      = 0;
     110  Tcontrol_t direction                = 0;
    111111
    112112  while (address<param._nb_shifter)
    113113    {
    114       BRANCH_COMPLETE_VAL     [0].write(1);
    115       BRANCH_COMPLETE_ADDRESS [0].write(address);
    116       BRANCH_COMPLETE_HISTORY [0].write(0);
    117       BRANCH_COMPLETE_HIT    [0].write(0);
     114      BRANCH_COMPLETE_VAL       [0].write(1);
     115      BRANCH_COMPLETE_ADDRESS   [0].write(address);
     116      BRANCH_COMPLETE_HISTORY   [0].write(0);
     117      BRANCH_COMPLETE_DIRECTION [0].write(0);
    118118
    119119      sc_start(1);
     
    136136      address                  = rand() % param._nb_shifter        ;
    137137      history                  = rand() % (1<<param._size_shifter) ;
    138       hit                      = rand() % 2;
     138      direction                = rand() % 2;
    139139
    140140      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} ["+toString(num_port_branch_complete)+"]" << endl
    141141           << hex
    142            << " - address     : " << address << endl
    143            << " - history old : " << history << endl
    144            << " - hit         : " << hit     << endl;
     142           << " - address     : " << address  << endl
     143           << " - history old : " << history  << endl
     144           << " - direction   : " << direction<< endl;
    145145
    146       BRANCH_COMPLETE_VAL     [num_port_branch_complete].write(1);
    147       BRANCH_COMPLETE_ADDRESS [num_port_branch_complete].write(address);
    148       BRANCH_COMPLETE_HISTORY [num_port_branch_complete].write(history);
    149       BRANCH_COMPLETE_HIT     [num_port_branch_complete].write(hit);
     146      BRANCH_COMPLETE_VAL       [num_port_branch_complete].write(1);
     147      BRANCH_COMPLETE_ADDRESS   [num_port_branch_complete].write(address);
     148      BRANCH_COMPLETE_HISTORY   [num_port_branch_complete].write(history);
     149      BRANCH_COMPLETE_DIRECTION [num_port_branch_complete].write(direction);
    150150
    151151      // Wait Ack
     
    160160      PREDICT_ADDRESS         [num_port_predict        ].write(address);
    161161     
    162       history                  = ((history<<1)&mask)|hit;
     162      history                  = ((history<<1)&mask)|direction;
    163163     
    164164      // Wait Ack
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h

    r2 r3  
    7878  public    : SC_IN (Taddress_t)           **  in_BRANCH_COMPLETE_ADDRESS;
    7979  public    : SC_IN (Thistory_t)           **  in_BRANCH_COMPLETE_HISTORY;
    80   public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_HIT    ;
     80  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_DIRECTION;
    8181
    8282    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     
    8787
    8888    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    89   protected : morpheo::behavioural::generic::shifter::Shifter           * component_Shifter     ;
    90   protected : morpheo::behavioural::generic::registerfile::RegisterFile * component_RegisterFile;
     89  public    : morpheo::behavioural::generic::shifter::Shifter           * component_Shifter     ;
     90  public    : morpheo::behavioural::generic::registerfile::RegisterFile * component_RegisterFile;
    9191
    9292    // -----[ methods ]---------------------------------------------------
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_allocation.cpp

    r2 r3  
    4848        in_BRANCH_COMPLETE_ADDRESS = new SC_IN     (Taddress_t) * [_param._nb_branch_complete];
    4949        in_BRANCH_COMPLETE_HISTORY = new SC_IN     (Thistory_t) * [_param._nb_branch_complete];
    50         in_BRANCH_COMPLETE_HIT     = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
     50        in_BRANCH_COMPLETE_DIRECTION= new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
    5151    signal_BRANCH_COMPLETE_HISTORY = new SC_SIGNAL (Thistory_t) * [_param._nb_branch_complete];
    5252
     
    6565          in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str());
    6666
    67          rename = "in_BRANCH_COMPLETE_HIT["    +toString(i)+"]";
    68           in_BRANCH_COMPLETE_HIT     [i] = new SC_IN (Tcontrol_t) (rename.c_str());
     67         rename = "in_BRANCH_COMPLETE_DIRECTION["    +toString(i)+"]";
     68          in_BRANCH_COMPLETE_DIRECTION[i] = new SC_IN (Tcontrol_t) (rename.c_str());
    6969
    7070         rename = "signal_BRANCH_COMPLETE_HISTORY["+toString(i)+"]";
     
    9393    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    9494      {
    95         (*(component_Shifter-> in_SHIFTER_DATA       [i]))    (*(    in_BRANCH_COMPLETE_HISTORY [i]));
    96         (*(component_Shifter-> in_SHIFTER_CARRY_IN   [i]))    (*(    in_BRANCH_COMPLETE_HIT     [i]));
    97         (*(component_Shifter->out_SHIFTER_DATA       [i]))    (*(signal_BRANCH_COMPLETE_HISTORY [i]));
     95        (*(component_Shifter-> in_SHIFTER_DATA       [i]))    (*(    in_BRANCH_COMPLETE_HISTORY  [i]));
     96        (*(component_Shifter-> in_SHIFTER_CARRY_IN   [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION[i]));
     97        (*(component_Shifter->out_SHIFTER_DATA       [i]))    (*(signal_BRANCH_COMPLETE_HISTORY  [i]));
    9898      }
    9999   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_deallocation.cpp

    r2 r3  
    4040         delete  in_BRANCH_COMPLETE_ADDRESS [i];
    4141         delete  in_BRANCH_COMPLETE_HISTORY [i];
    42          delete  in_BRANCH_COMPLETE_HIT     [i];
     42         delete  in_BRANCH_COMPLETE_DIRECTION[i];
    4343       }
    4444    delete  in_BRANCH_COMPLETE_VAL    ;
     
    4646    delete  in_BRANCH_COMPLETE_ADDRESS;
    4747    delete  in_BRANCH_COMPLETE_HISTORY;
    48     delete  in_BRANCH_COMPLETE_HIT    ;
     48    delete  in_BRANCH_COMPLETE_DIRECTION;
    4949
    5050     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
  • 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

    r2 r3  
    3232      {
    3333        vhdl.set_body_component_port_map (list_port_map," in_SHIFTER_DATA_"+toString(i)+"     ","    in_BRANCH_COMPLETE_HISTORY_"+toString(i));
    34         vhdl.set_body_component_port_map (list_port_map," in_SHIFTER_CARRY_IN_"+toString(i)+" ","    in_BRANCH_COMPLETE_HIT_"+toString(i)    );
     34        vhdl.set_body_component_port_map (list_port_map," in_SHIFTER_CARRY_IN_"+toString(i)+" ","    in_BRANCH_COMPLETE_DIRECTION_"+toString(i)    );
    3535        vhdl.set_body_component_port_map (list_port_map,"out_SHIFTER_DATA_"+toString(i)+"     ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i));
    3636      }
    3737
    3838    vhdl.set_body_component ("component_Shifter",_name+"_Shifter",list_port_map);
    39 
    4039
    4140    list_port_map.clear();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_port.cpp

    r2 r3  
    2424    for (uint32_t i=0; i<_param._nb_prediction; i++)
    2525      {
    26         vhdl.set_port(" in_PREDICT_VAL_"+toString(i)+"             ", IN, 1);
    27         vhdl.set_port("out_PREDICT_ACK_"+toString(i)+"             ",OUT, 1);
    28         vhdl.set_port(" in_PREDICT_ADDRESS_"+toString(i)+"         ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
    29         vhdl.set_port("out_PREDICT_HISTORY_"+toString(i)+"         ",OUT, _param._size_shifter);
     26        vhdl.set_port(" in_PREDICT_VAL_"+toString(i)+"               ", IN, 1);
     27        vhdl.set_port("out_PREDICT_ACK_"+toString(i)+"               ",OUT, 1);
     28        vhdl.set_port(" in_PREDICT_ADDRESS_"+toString(i)+"           ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
     29        vhdl.set_port("out_PREDICT_HISTORY_"+toString(i)+"           ",OUT, _param._size_shifter);
    3030      }
    3131     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    3232       {
    33          vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"    ", IN, 1);
    34          vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"    ",OUT, 1);
    35          vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
    36          vhdl.set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"", IN, _param._size_shifter);
    37          vhdl.set_port (" in_BRANCH_COMPLETE_HIT_"+toString(i)+"    ", IN, 1);
     33         vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ", IN, 1);
     34         vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ",OUT, 1);
     35         vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
     36         vhdl.set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ", IN, _param._size_shifter);
     37         vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"", IN, 1);
    3838       }
    3939  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_signal.cpp

    r2 r3  
    1717namespace branch_history_table {
    1818
    19 
    2019  void Branch_History_Table::vhdl_signal (Vhdl & vhdl)
    2120  {
     
    2928}; // end namespace predictor
    3029}; // end namespace stage_1_ifetch
    31 
    3230}; // end namespace behavioural
    3331}; // end namespace 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_testbench_port.cpp

    r2 r3  
    2121    for (uint32_t i=0; i<_param._nb_prediction; i++)
    2222      {
    23         _vhdl_testbench->set_port (" in_PREDICT_VAL_"+toString(i)+"             ", IN, 1);
    24         _vhdl_testbench->set_port ("out_PREDICT_ACK_"+toString(i)+"             ",OUT, 1);
    25         _vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"+toString(i)+"         ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
    26         _vhdl_testbench->set_port ("out_PREDICT_HISTORY_"+toString(i)+"         ",OUT, _param._size_shifter);
     23        _vhdl_testbench->set_port (" in_PREDICT_VAL_"+toString(i)+"               ", IN, 1);
     24        _vhdl_testbench->set_port ("out_PREDICT_ACK_"+toString(i)+"               ",OUT, 1);
     25        _vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"+toString(i)+"           ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
     26        _vhdl_testbench->set_port ("out_PREDICT_HISTORY_"+toString(i)+"           ",OUT, _param._size_shifter);
    2727      }
    2828
    2929     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    3030       {
    31          _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"    ", IN, 1);
    32          _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"    ",OUT, 1);
    33          _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
    34          _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"", IN, _param._size_shifter);
    35          _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HIT_"+toString(i)+"    ", IN, 1);
     31         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ", IN, 1);
     32         _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ",OUT, 1);
     33         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
     34         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ", IN, _param._size_shifter);
     35         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"", IN, 1);
    3636       }
    3737  };
  • 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

    r2 r3  
    4040         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_ADDRESS [i]));
    4141         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_HISTORY [i]));
    42          _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_HIT     [i]));
     42         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_DIRECTION[i]));
    4343       }
    4444   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp

    r2 r3  
    4343   *********************************************************************/
    4444  sc_clock                                 CLOCK ("clock", 1.0, 0.5);
    45   sc_signal<Tcontrol_t>                    PREDICT_VAL             [param._nb_prediction];
    46   sc_signal<Tcontrol_t>                    PREDICT_ACK             [param._nb_prediction];
    47   sc_signal<Taddress_t>                    PREDICT_ADDRESS         [param._nb_prediction];
    48   sc_signal<Thistory_t>                    PREDICT_HISTORY         [param._nb_prediction];
    49                                            
    50   sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL     [param._nb_branch_complete];
    51   sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK     [param._nb_branch_complete];
    52   sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS [param._nb_branch_complete];
    53   sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY [param._nb_branch_complete];
    54   sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_HIT    [param._nb_branch_complete];
     45  sc_signal<Tcontrol_t>                    PREDICT_VAL               [param._nb_prediction];
     46  sc_signal<Tcontrol_t>                    PREDICT_ACK               [param._nb_prediction];
     47  sc_signal<Taddress_t>                    PREDICT_ADDRESS           [param._nb_prediction];
     48  sc_signal<Thistory_t>                    PREDICT_HISTORY           [param._nb_prediction];
     49                                                                    
     50  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL       [param._nb_branch_complete];
     51  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK       [param._nb_branch_complete];
     52  sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS   [param._nb_branch_complete];
     53  sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY   [param._nb_branch_complete];
     54  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_DIRECTION [param._nb_branch_complete];
    5555 
    5656  /********************************************************
     
    7272  for (uint32_t i=0; i<param._nb_branch_complete; i++)
    7373    {
    74       (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL     [i]))        (BRANCH_COMPLETE_VAL     [i]);
    75       (*(_Pattern_History_Table->out_BRANCH_COMPLETE_ACK     [i]))        (BRANCH_COMPLETE_ACK     [i]);
    76       (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i]))        (BRANCH_COMPLETE_ADDRESS [i]);
    77       (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY [i]))        (BRANCH_COMPLETE_HISTORY [i]);
    78       (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_HIT     [i]))        (BRANCH_COMPLETE_HIT    [i]);
     74      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))        (BRANCH_COMPLETE_VAL       [i]);
     75      (*(_Pattern_History_Table->out_BRANCH_COMPLETE_ACK       [i]))        (BRANCH_COMPLETE_ACK       [i]);
     76      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))        (BRANCH_COMPLETE_ADDRESS  [i]);
     77      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))        (BRANCH_COMPLETE_HISTORY  [i]);
     78      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))        (BRANCH_COMPLETE_DIRECTION [i]);
    7979    }
    8080
     
    105105  Thistory_t history_max              = (1<<param._size_counter)-1;
    106106  Thistory_t history                  = 0;
    107   Tcontrol_t hit                      = 0;
     107  Tcontrol_t direction                = 0;
    108108
    109109  while (address<param._nb_counter)
    110110    {
    111       BRANCH_COMPLETE_VAL     [0].write(1);
    112       BRANCH_COMPLETE_ADDRESS [0].write(address);
    113       BRANCH_COMPLETE_HISTORY [0].write(0);
    114       BRANCH_COMPLETE_HIT    [0].write(0);
     111      BRANCH_COMPLETE_VAL       [0].write(1);
     112      BRANCH_COMPLETE_ADDRESS   [0].write(address);
     113      BRANCH_COMPLETE_HISTORY   [0].write(0);
     114      BRANCH_COMPLETE_DIRECTION [0].write(0);
    115115
    116116      sc_start(1);
     
    133133      address                  = rand() % param._nb_counter        ;
    134134      history                  = rand() % (1<<param._size_counter) ;
    135       hit                      = rand() % 2;
     135      direction                = rand() % 2;
    136136
    137137      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} ["+toString(num_port_branch_complete)+"]" << endl
    138138           << hex
    139            << " - address     : " << address << endl
    140            << " - history old : " << history << endl
    141            << " - hit         : " << hit    << endl;
     139           << " - address     : " << address   << endl
     140           << " - history old : " << history   << endl
     141           << " - direction   : " << direction << endl;
    142142
    143       BRANCH_COMPLETE_VAL     [num_port_branch_complete].write(1);
    144       BRANCH_COMPLETE_ADDRESS [num_port_branch_complete].write(address);
    145       BRANCH_COMPLETE_HISTORY [num_port_branch_complete].write(history);
    146       BRANCH_COMPLETE_HIT     [num_port_branch_complete].write(hit);
     143      BRANCH_COMPLETE_VAL       [num_port_branch_complete].write(1);
     144      BRANCH_COMPLETE_ADDRESS   [num_port_branch_complete].write(address);
     145      BRANCH_COMPLETE_HISTORY   [num_port_branch_complete].write(history);
     146      BRANCH_COMPLETE_DIRECTION [num_port_branch_complete].write(direction);
    147147
    148148      // Wait Ack
     
    157157      PREDICT_ADDRESS         [num_port_predict        ].write(address);
    158158     
    159       history                  = (hit==1)?((history<history_max)?history+1:history):((history>0)?history-1:history);
     159      history                  = (direction==1)?((history<history_max)?history+1:history):((history>0)?history-1:history);
    160160     
    161161      // Wait Ack
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h

    r2 r3  
    8080  public    : SC_IN (Taddress_t)           **  in_BRANCH_COMPLETE_ADDRESS;
    8181  public    : SC_IN (Thistory_t)           **  in_BRANCH_COMPLETE_HISTORY;
    82   public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_HIT    ;
     82  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_DIRECTION;
    8383
    8484    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     
    8989
    9090    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    91   protected : morpheo::behavioural::generic::counter::Counter           * component_Counter     ;
    92   protected : morpheo::behavioural::generic::registerfile::RegisterFile * component_RegisterFile;
     91  public    : morpheo::behavioural::generic::counter::Counter           * component_Counter     ;
     92  public    : morpheo::behavioural::generic::registerfile::RegisterFile * component_RegisterFile;
    9393
    9494    // -----[ methods ]---------------------------------------------------
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_allocation.cpp

    r2 r3  
    4646      }
    4747
    48         in_BRANCH_COMPLETE_VAL     = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
    49        out_BRANCH_COMPLETE_ACK     = new SC_OUT    (Tcontrol_t) * [_param._nb_branch_complete];
    50         in_BRANCH_COMPLETE_ADDRESS = new SC_IN     (Taddress_t) * [_param._nb_branch_complete];
    51         in_BRANCH_COMPLETE_HISTORY = new SC_IN     (Thistory_t) * [_param._nb_branch_complete];
    52         in_BRANCH_COMPLETE_HIT    = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
    53     signal_BRANCH_COMPLETE_HISTORY = new SC_SIGNAL (Thistory_t) * [_param._nb_branch_complete];
     48        in_BRANCH_COMPLETE_VAL       = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
     49       out_BRANCH_COMPLETE_ACK       = new SC_OUT    (Tcontrol_t) * [_param._nb_branch_complete];
     50        in_BRANCH_COMPLETE_ADDRESS   = new SC_IN     (Taddress_t) * [_param._nb_branch_complete];
     51        in_BRANCH_COMPLETE_HISTORY   = new SC_IN     (Thistory_t) * [_param._nb_branch_complete];
     52        in_BRANCH_COMPLETE_DIRECTION = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
     53    signal_BRANCH_COMPLETE_HISTORY   = new SC_SIGNAL (Thistory_t) * [_param._nb_branch_complete];
    5454
    5555    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
     
    6767          in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str());
    6868
    69          rename = "in_BRANCH_COMPLETE_HIT["    +toString(i)+"]";
    70           in_BRANCH_COMPLETE_HIT    [i] = new SC_IN (Tcontrol_t) (rename.c_str());
     69         rename = "in_BRANCH_COMPLETE_DIRECTION["    +toString(i)+"]";
     70          in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str());
    7171
    7272         rename = "signal_BRANCH_COMPLETE_HISTORY["+toString(i)+"]";
     
    9595    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    9696      {
    97         (*(component_Counter-> in_COUNTER_DATA       [i]))    (*(    in_BRANCH_COMPLETE_HISTORY [i]));
    98         (*(component_Counter-> in_COUNTER_ADDSUB     [i]))    (*(    in_BRANCH_COMPLETE_HIT    [i]));
    99         (*(component_Counter->out_COUNTER_DATA       [i]))    (*(signal_BRANCH_COMPLETE_HISTORY [i]));
     97        (*(component_Counter-> in_COUNTER_DATA       [i]))    (*(    in_BRANCH_COMPLETE_HISTORY   [i]));
     98        (*(component_Counter-> in_COUNTER_ADDSUB     [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION [i]));
     99        (*(component_Counter->out_COUNTER_DATA       [i]))    (*(signal_BRANCH_COMPLETE_HISTORY   [i]));
    100100      }
    101101   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_deallocation.cpp

    r2 r3  
    3939     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    4040       {
    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_HIT    [i];
     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];
    4646       }
    4747    delete  in_BRANCH_COMPLETE_VAL    ;
     
    4949    delete  in_BRANCH_COMPLETE_ADDRESS;
    5050    delete  in_BRANCH_COMPLETE_HISTORY;
    51     delete  in_BRANCH_COMPLETE_HIT    ;
     51    delete  in_BRANCH_COMPLETE_DIRECTION;
    5252
    5353     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_body.cpp

    r2 r3  
    3434      {
    3535        vhdl.set_body_component_port_map (list_port_map," in_COUNTER_DATA_"+toString(i)+"     ","    in_BRANCH_COMPLETE_HISTORY_"+toString(i));
    36         vhdl.set_body_component_port_map (list_port_map," in_COUNTER_ADDSUB_"+toString(i)+"   ","    in_BRANCH_COMPLETE_HIT_"+toString(i)    );
     36        vhdl.set_body_component_port_map (list_port_map," in_COUNTER_ADDSUB_"+toString(i)+"   ","    in_BRANCH_COMPLETE_DIRECTION_"+toString(i)    );
    3737        vhdl.set_body_component_port_map (list_port_map,"out_COUNTER_DATA_"+toString(i)+"     ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i));
    3838      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_port.cpp

    r2 r3  
    2626    for (uint32_t i=0; i<_param._nb_prediction; i++)
    2727      {
    28         vhdl.set_port(" in_PREDICT_VAL_"+toString(i)+"             ", IN, 1);
    29         vhdl.set_port("out_PREDICT_ACK_"+toString(i)+"             ",OUT, 1);
    30         vhdl.set_port(" in_PREDICT_ADDRESS_"+toString(i)+"         ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
    31         vhdl.set_port("out_PREDICT_HISTORY_"+toString(i)+"         ",OUT, _param._size_counter);
     28        vhdl.set_port(" in_PREDICT_VAL_"+toString(i)+"               ", IN, 1);
     29        vhdl.set_port("out_PREDICT_ACK_"+toString(i)+"               ",OUT, 1);
     30        vhdl.set_port(" in_PREDICT_ADDRESS_"+toString(i)+"           ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
     31        vhdl.set_port("out_PREDICT_HISTORY_"+toString(i)+"           ",OUT, _param._size_counter);
    3232      }
    3333     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    3434       {
    35          vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"    ", IN, 1);
    36          vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"    ",OUT, 1);
    37          vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
    38          vhdl.set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"", IN, _param._size_counter);
    39          vhdl.set_port (" in_BRANCH_COMPLETE_HIT_"+toString(i)+"    ", IN, 1);
     35         vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ", IN, 1);
     36         vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ",OUT, 1);
     37         vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
     38         vhdl.set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ", IN, _param._size_counter);
     39         vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"", IN, 1);
    4040       }
    4141
  • 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_port.cpp

    r2 r3  
    2424    for (uint32_t i=0; i<_param._nb_prediction; i++)
    2525      {
    26         _vhdl_testbench->set_port (" in_PREDICT_VAL_"+toString(i)+"             ", IN, 1);
    27         _vhdl_testbench->set_port ("out_PREDICT_ACK_"+toString(i)+"             ",OUT, 1);
    28         _vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"+toString(i)+"         ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
    29         _vhdl_testbench->set_port ("out_PREDICT_HISTORY_"+toString(i)+"         ",OUT, _param._size_counter);
    30       }
    31 
    32      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    33        {
    34          _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"    ", IN, 1);
    35          _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"    ",OUT, 1);
    36          _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
    37          _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"", IN, _param._size_counter);
    38          _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HIT_"+toString(i)+"    ", IN, 1);
     26        _vhdl_testbench->set_port (" in_PREDICT_VAL_"+toString(i)+"              ", IN, 1);
     27        _vhdl_testbench->set_port ("out_PREDICT_ACK_"+toString(i)+"              ",OUT, 1);
     28        _vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"+toString(i)+"          ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
     29        _vhdl_testbench->set_port ("out_PREDICT_HISTORY_"+toString(i)+"          ",OUT, _param._size_counter);
     30      }                                                                           
     31                                                                                 
     32     for (uint32_t i=0; i<_param._nb_branch_complete; i++)                       
     33       {                                                                         
     34         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ", IN, 1);
     35         _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ",OUT, 1);
     36         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
     37         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ", IN, _param._size_counter);
     38         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"", IN, 1);
    3939       }
    4040
  • 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

    r2 r3  
    4141     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    4242       {
    43          _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_VAL     [i]));
    44          _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_ACK     [i]));
    45          _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_ADDRESS [i]));
    46          _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_HISTORY [i]));
    47          _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_HIT     [i]));
     43         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_VAL      [i]));
     44         _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_ACK      [i]));
     45         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_ADDRESS  [i]));
     46         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_HISTORY  [i]));
     47         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_DIRECTION[i]));
    4848       }
    49    
    50    
     49       
    5150    // add_test :
    5251    //  - True  : the cycle must be compare with the output of systemC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/Makefile

    r2 r3  
    2626include                         $(DIR_MORPHEO)/Behavioural/Makefile.defs
    2727include                         $(DIR_MORPHEO)/Behavioural/Makefile.Common
     28include                         $(DIR_MORPHEO)/Behavioural/Makefile.Selftest
    2829include                         $(DIR_MORPHEO)/Behavioural/Makefile.Synthesis
    29 include                         $(DIR_MORPHEO)/Behavioural/Makefile.Selftest
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/configuration.cfg

    r2 r3  
    11Two_Level_Branch_Predictor
    221       1       +1      # have_bht           
    3 6       6       +1      # bht_size_shifter   
     36       8       +1      # bht_size_shifter   
    4464      64      *2      # bht_nb_shifter     
    5 1       1       +1      # have_pht           
     50       1       +1      # have_pht           
    664       4       +1      # pht_size_counter   
    7 256     256     +2      # pht_nb_counter     
    8 2       2       +1      # pht_size_address_share
     7256     512     *2      # pht_nb_counter     
     80       2       +1      # pht_size_address_share
    9916      16      +1      # size_address     
    10101       1       +1      # nb_prediction     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/mkf.info

    r2 r3  
     1
     2# Two_Level_Branch_Predictor_0
     3target_dep      all     Two_Level_Branch_Predictor_0.ngc
     4target_dep      Two_Level_Branch_Predictor_0.ngc        Two_Level_Branch_Predictor_0.prj
     5target_dep      Two_Level_Branch_Predictor_0.prj        Two_Level_Branch_Predictor_0_Branch_History_Table_Pack.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table_RegisterFile_Pack.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table_RegisterFile.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table_Shifter_Pack.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table_Shifter.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table.vhdl Two_Level_Branch_Predictor_0_Pack.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_Counter_Pack.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_Counter.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_Pack.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_RegisterFile_Pack.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_RegisterFile.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table.vhdl Two_Level_Branch_Predictor_0_Two_Level_Branch_Predictor_Glue_Pack.vhdl Two_Level_Branch_Predictor_0_Two_Level_Branch_Predictor_Glue.vhdl Two_Level_Branch_Predictor_0.vhdl
     6
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp

    r2 r3  
    77 */
    88
    9 #define NB_ITERATION 1
     9#define NB_ITERATION 512
    1010
    1111#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h"
    1212#include "Include/Test.h"
    13 
     13#include "Include/BitManipulation.h"
    1414void test (string name,
    1515           morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters param)
     
    2828   * Déclarations des signaux
    2929   *********************************************************************/
    30   sc_clock                              *  CLOCK ("clock", 1.0, 0.5);
     30  sc_clock                              *  CLOCK;
    3131
    3232  sc_signal<Tcontrol_t>                 *  PREDICT_VAL                 [param._nb_prediction];
     
    4141  sc_signal<Tbht_history_t>             *  BRANCH_COMPLETE_BHT_HISTORY [param._nb_branch_complete];
    4242  sc_signal<Tpht_history_t>             *  BRANCH_COMPLETE_PHT_HISTORY [param._nb_branch_complete];
    43   sc_signal<Tcontrol_t>                 *  BRANCH_COMPLETE_HIT         [param._nb_branch_complete];
     43  sc_signal<Tcontrol_t>                 *  BRANCH_COMPLETE_DIRECTION   [param._nb_branch_complete];
    4444
    4545  // Rename signal
     
    7575      rename = "BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);
    7676      BRANCH_COMPLETE_PHT_HISTORY [i] = new sc_signal<Tpht_history_t> (rename.c_str());
    77       rename = "BRANCH_COMPLETE_HIT_"        +toString(i);
    78       BRANCH_COMPLETE_HIT         [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
     77      rename = "BRANCH_COMPLETE_DIRECTION_"  +toString(i);
     78      BRANCH_COMPLETE_DIRECTION   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
    7979    }
    8080
     
    8686 
    8787  (*(_Two_Level_Branch_Predictor->in_CLOCK))        (*(CLOCK));
    88 
    89     for (uint32_t i=0; i<param._nb_prediction; i++)
    90       {
    91         (*(_Two_Level_Branch_Predictor-> in_PREDICT_VAL                 [i])) (*(PREDICT_VAL                  [i]));
    92         (*(_Two_Level_Branch_Predictor->out_PREDICT_ACK                 [i])) (*(PREDICT_ACK                  [i]));
    93         (*(_Two_Level_Branch_Predictor-> in_PREDICT_ADDRESS             [i])) (*(PREDICT_ADDRESS              [i]));
    94         if (param._have_bht)                                                                                   
    95         (*(_Two_Level_Branch_Predictor->out_PREDICT_BHT_HISTORY         [i])) (*(PREDICT_BHT_HISTORY          [i]));
    96         if (param._have_pht)                                                                                   
    97         (*(_Two_Level_Branch_Predictor->out_PREDICT_PHT_HISTORY         [i])) (*(PREDICT_PHT_HISTORY          [i]));
    98       }
     88 
     89  for (uint32_t i=0; i<param._nb_prediction; i++)
     90    {
     91      (*(_Two_Level_Branch_Predictor-> in_PREDICT_VAL                 [i])) (*(PREDICT_VAL                  [i]));
     92      (*(_Two_Level_Branch_Predictor->out_PREDICT_ACK                 [i])) (*(PREDICT_ACK                  [i]));
     93      (*(_Two_Level_Branch_Predictor-> in_PREDICT_ADDRESS             [i])) (*(PREDICT_ADDRESS              [i]));
     94      if (param._have_bht)                                                                                     
     95      (*(_Two_Level_Branch_Predictor->out_PREDICT_BHT_HISTORY         [i])) (*(PREDICT_BHT_HISTORY          [i]));
     96      if (param._have_pht)
     97      (*(_Two_Level_Branch_Predictor->out_PREDICT_PHT_HISTORY         [i])) (*(PREDICT_PHT_HISTORY          [i]));
     98    }
    9999
    100100    for (uint32_t i=0; i<param._nb_branch_complete; i++)
     
    105105        if (param._have_bht)                                                                                   
    106106        (*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(BRANCH_COMPLETE_BHT_HISTORY  [i]));
    107         if (param._have_bht)                                                                                   
     107        if (param._have_pht)                                                                                   
    108108        (*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(BRANCH_COMPLETE_PHT_HISTORY  [i]));
    109         (*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_HIT         [i])) (*(BRANCH_COMPLETE_HIT          [i]));
     109        (*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(BRANCH_COMPLETE_DIRECTION    [i]));
    110110      }
    111111
     
    121121
    122122  srand(seed);
     123
     124  const uint32_t   num_port_predict         = rand()%param._nb_prediction;
     125  const uint32_t   num_port_branch_complete = rand()%param._nb_branch_complete;
     126  const Taddress_t address                  = rand()%param._size_address;
     127        Tcontrol_t direction;
    123128
    124129  sc_start(0);
     
    133138
    134139  // Step 1
    135   BRANCH_COMPLETE_VAL          [0]->write(1);
    136   BRANCH_COMPLETE_HIT          [0]->write(0);
     140  BRANCH_COMPLETE_VAL          [num_port_branch_complete]->write(1);
     141  BRANCH_COMPLETE_DIRECTION    [num_port_branch_complete]->write(0);
     142
     143  if (param._have_pht)                                                                                 
     144    {
     145      // Step 1.1 -> pattern_history_table
     146
     147      // Step 1.1.1 compute number of group.
     148      uint32_t size_address_shift=0;
     149
     150      if (param._have_bht)
     151        size_address_shift=param._param_two_level_branch_predictor_glue->_pht_size_address_shift;
     152
     153      uint32_t nb_group        = (1<<size_address_shift);
     154      uint32_t nb_reg_by_group = (1<<(param._pht_size_address-size_address_shift));
     155
     156      _Two_Level_Branch_Predictor->vhdl_testbench_label("Init pht");
     157      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Init pht" << endl;
     158     
     159      BRANCH_COMPLETE_PHT_HISTORY  [num_port_branch_complete]->write(0);
     160
     161      // Step 1.1.2 for all group ...
     162      for (uint32_t i=0; i<nb_group; i++)
     163        {
     164          if (param._have_bht)
     165            BRANCH_COMPLETE_BHT_HISTORY  [num_port_branch_complete]->write(i);
     166
     167          for (uint32_t j=0; j<nb_reg_by_group; j++)
     168            {
     169              BRANCH_COMPLETE_ADDRESS [num_port_branch_complete]->write(j);
     170             
     171              sc_start(1);
     172
     173              // wait ackwolegde
     174              while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
     175                sc_start(1);
     176            }
     177        }
     178    }
    137179
    138180  if (param._have_bht)                                                                                 
    139181    {
    140       BRANCH_COMPLETE_BHT_HISTORY  [0]->write(0);
     182      // Step 1.2 -> branch_history_table
     183      BRANCH_COMPLETE_BHT_HISTORY  [num_port_branch_complete]->write(0);
    141184     
    142185      _Two_Level_Branch_Predictor->vhdl_testbench_label("Init bht");
     
    145188      for (uint32_t i=0; i<param._bht_nb_shifter; i++)
    146189        {
    147           BRANCH_COMPLETE_ADDRESS [0]->write(i);
     190          BRANCH_COMPLETE_ADDRESS [num_port_branch_complete]->write(i);
    148191
    149192          sc_start(1);
     
    151194
    152195      // wait ackwolegde
    153       while (BRANCH_COMPLETE_ACK [0] -> read() == 0)
     196      while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
    154197        sc_start(1);
    155198    }
    156199
    157   if (param._have_pht)                                                                                 
    158     {
    159       BRANCH_COMPLETE_BHT_HISTORY  [0]->write(0);
    160       BRANCH_COMPLETE_PHT_HISTORY  [0]->write(0);
    161      
    162       _Two_Level_Branch_Predictor->vhdl_testbench_label("Init bht");
    163       cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Init bht" << endl;
    164      
    165       for (uint32_t i=0; i<param._bht_nb_shifter; i++)
    166         {
    167           BRANCH_COMPLETE_ADDRESS [0]->write(i);
    168 
    169           sc_start(1);
    170         }
     200  // Step 2
     201  BRANCH_COMPLETE_VAL          [num_port_branch_complete]->write(0);
     202  PREDICT_ADDRESS              [num_port_predict        ]->write(address);
     203  BRANCH_COMPLETE_ADDRESS      [num_port_branch_complete]->write(address);
     204
     205  _Two_Level_Branch_Predictor->vhdl_testbench_label("Loop of Test");
     206  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl
     207       << " * predict_address : " << hex << address << dec << endl;
     208 
     209  // A lot of prediction
     210  Tbht_history_t bht_history = 0;
     211  Tpht_history_t pht_history [1<<param._bht_size_shifter];
     212 
     213  for (uint32_t i=0; i<static_cast<uint32_t>(1<<param._bht_size_shifter); i++)
     214    pht_history [i] = 0;
     215
     216  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
     217    {
     218      _Two_Level_Branch_Predictor->vhdl_testbench_label("Iteration "+toString(iteration));
     219
     220      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Predict          : bht_history " << bht_history << " - pht_history " << pht_history[bht_history] << endl;
     221
     222      // Ask a new prediction
     223      PREDICT_VAL                  [num_port_predict        ]->write(1);
     224
     225      sc_start(1);
    171226
    172227      // wait ackwolegde
    173       while (BRANCH_COMPLETE_ACK [0] -> read() == 0)
     228      while (PREDICT_ACK [num_port_predict] -> read() == 0)
    174229        sc_start(1);
    175     }
    176 
    177 
    178 
    179   // Step 2
    180   _Two_Level_Branch_Predictor->vhdl_testbench_label("Loop of Test");
    181   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
    182 
    183   for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
    184     {
    185       _Two_Level_Branch_Predictor->vhdl_testbench_label("Iteration "+toString(iteration));
     230      PREDICT_ACK                  [num_port_predict        ]->write(0);
     231
     232      sc_start(0);
     233
     234      // Test
     235      if (param._have_bht)
     236      TEST(Tbht_history_t,bht_history             ,PREDICT_BHT_HISTORY[num_port_predict]->read());
     237      if (param._have_pht)
     238      TEST(Tpht_history_t,pht_history[bht_history],PREDICT_PHT_HISTORY[num_port_predict]->read());
     239
     240      // update
     241      direction = ((rand()%2)==1);
     242
     243      BRANCH_COMPLETE_VAL          [num_port_branch_complete]->write(1);
     244      if (param._have_bht)
     245      BRANCH_COMPLETE_BHT_HISTORY  [num_port_branch_complete]->write(bht_history             );
     246
     247
     248      if (param._have_pht)
     249      BRANCH_COMPLETE_PHT_HISTORY  [num_port_branch_complete]->write(pht_history[bht_history]);
     250      BRANCH_COMPLETE_DIRECTION    [num_port_branch_complete]->write(direction);
     251
     252      if (param._have_pht)
     253      if (direction == 0)
     254        {
     255          if (pht_history[bht_history] > 0)
     256            pht_history[bht_history] --;
     257        }
     258      else
     259        {
     260          if (pht_history[bht_history] < (static_cast<Tpht_history_t>(1<<param._pht_size_counter)-1))
     261            pht_history[bht_history] ++;
     262        }
     263
     264      if (param._have_bht)
     265      bht_history              = (((bht_history) << 1) | direction) & gen_mask<Tbht_history_t>(param._bht_size_shifter);
    186266
    187267      sc_start(1);
     268
     269      // wait ackwolegde
     270      while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
     271        sc_start(1);
     272
     273      BRANCH_COMPLETE_VAL          [num_port_branch_complete]->write(0);
    188274    }
    189275
  • 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

    r2 r3  
    4747    _vhdl_testbench = new Vhdl_Testbench (_name);
    4848    vhdl_testbench_port           ();
    49     _vhdl_testbench->set_clock    ("in_CLOCK",true);
     49    _vhdl_testbench->set_clock    ("in_CLOCK",false);
    5050#endif
    5151
  • 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

    r2 r3  
    2626        {
    2727          // Address
    28           Taddress_t address = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
     28          Taddress_t     address = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
    2929          Tbht_history_t history = 0;
    3030         
     
    3434              address = address << _param._pht_size_address_shift;
    3535            }
     36
     37          Taddress_t     pht_address = (history ^ address) & gen_mask<Taddress_t>(_param._pht_size_address);
     38
     39          log_printf(TRACE,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","out_BRANCH_COMPLETE_PHT_ADDRESS [%d]= %.8x xor %.8x<<%d = %.8x",i,history,PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]),_param._pht_size_address_shift, pht_address);
    3640         
    37           PORT_WRITE (out_BRANCH_COMPLETE_PHT_ADDRESS [i], (history xor address) & gen_mask<Taddress_t>(_param._pht_size_address));
     41          PORT_WRITE (out_BRANCH_COMPLETE_PHT_ADDRESS [i], pht_address);
    3842        }
    3943   
  • 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

    r2 r3  
    2626        {
    2727          // Address
    28           Taddress_t address = PORT_READ(in_PREDICT_ADDRESS [i]);
     28          Taddress_t     address = PORT_READ(in_PREDICT_ADDRESS [i]);
     29          Taddress_t bht_address = range<Taddress_t>(_param._size_address, address, _param._bht_size_address);
    2930         
    30           PORT_WRITE (out_PREDICT_BHT_ADDRESS [i], range<Taddress_t>(_param._size_address, address, _param._bht_size_address));
     31          PORT_WRITE (out_PREDICT_BHT_ADDRESS [i], bht_address);
    3132        }
    3233   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_port.cpp

    r2 r3  
    2121  {
    2222    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_port","Begin");
    23 
    24     vhdl.set_port (" in_CLOCK" , IN, 1);
    2523
    2624    for (uint32_t i=0; i<_param._nb_prediction; i++)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h

    r2 r3  
    8484  public    : SC_IN (Tbht_history_t)       **  in_BRANCH_COMPLETE_BHT_HISTORY;
    8585  public    : SC_IN (Tpht_history_t)       **  in_BRANCH_COMPLETE_PHT_HISTORY;
    86   public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_HIT        ;
     86  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_DIRECTION  ;
    8787
    8888    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     
    9393  private   : SC_SIGNAL(Taddress_t)        ** signal_PREDICT_BHT_ADDRESS        ;
    9494  private   : SC_SIGNAL(Taddress_t)        ** signal_PREDICT_PHT_ADDRESS        ;
    95   private   : SC_SIGNAL(Tbht_history_t)    ** signal_PREDICT_BHT_HISTORY        ;
    9695
    9796  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_BHT_ACK    ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp

    r2 r3  
    3232    _pht_size_counter       ((_have_pht == true)?pht_size_counter:0),
    3333    _pht_nb_counter         ((_have_pht == true)?pht_nb_counter  :0),
    34     _pht_size_address_share (pht_size_address_share),
     34    _pht_size_address_share (((_have_bht and _have_pht) == true)?pht_size_address_share:0),
    3535    _size_address           (size_address      ),
    3636    _nb_prediction          (nb_prediction     ),
     
    4141    log_printf(FUNC,Two_Level_Branch_Predictor,"Parameters","Begin");
    4242   
     43    if (_have_bht)
    4344    _param_branch_history_table  = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Parameters (_bht_size_shifter  ,
    4445                                                                                                                                                                       _bht_nb_shifter    ,
    4546                                                                                                                                                                       _nb_prediction     ,
    4647                                                                                                                                                                       _nb_branch_complete);
     48    if (_have_pht)
    4749    _param_pattern_history_table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters (_pht_size_counter  ,
    4850                                                                                                                                                                       _pht_nb_counter    ,
     
    8284    log_printf(FUNC,Two_Level_Branch_Predictor,"Parameters","Begin");
    8385
     86    if (_have_bht)
    8487    _param_branch_history_table  = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Parameters (_bht_size_shifter  ,
    8588                                                                                                                                                                       _bht_nb_shifter    ,
    8689                                                                                                                                                                       _nb_prediction     ,
    8790                                                                                                                                                                       _nb_branch_complete);
     91    if (_have_pht)
    8892    _param_pattern_history_table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters (_pht_size_counter  ,
    8993                                                                                                                                                                       _pht_nb_counter    ,
     
    109113    log_printf(FUNC,Two_Level_Branch_Predictor,"~Parameters","Begin");
    110114
     115    if (_have_bht)
    111116    delete _param_branch_history_table;
     117    if (_have_pht)
    112118    delete _param_pattern_history_table;
    113119    delete _param_two_level_branch_predictor_glue;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_msg_error.cpp

    r2 r3  
    6565      }
    6666
     67//     if ( not _have_bht and (_pht_size_address_share != 0))
     68//     {
     69//      msg += "  - you have no Branch History Table but size_address_share is > 0\n";
     70//      msg += "    * have_bht                        : " + toString(_have_bht              ) + "\n";
     71//      msg += "    * pht_size_address_share          : " + toString(_pht_size_address_share) + "\n";
     72//     }
     73
    6774    return msg;
    6875
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp

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

    r2 r3  
    3535        delete signal_PREDICT_BHT_ACK          [i];
    3636        delete signal_PREDICT_BHT_ADDRESS      [i];
    37         delete signal_PREDICT_BHT_HISTORY      [i];
    3837          }
    3938        if (_param._have_pht)
     
    5655    delete signal_PREDICT_BHT_ACK    ;
    5756    delete signal_PREDICT_BHT_ADDRESS;
    58     delete signal_PREDICT_BHT_HISTORY;
    5957      }
    6058    if (_param._have_pht)
     
    7169        if (_param._have_bht)
    7270        delete  in_BRANCH_COMPLETE_BHT_HISTORY [i];
    73         if (_param._have_bht)
     71        if (_param._have_pht)
    7472        delete  in_BRANCH_COMPLETE_PHT_HISTORY [i];
    75         delete  in_BRANCH_COMPLETE_HIT         [i];
     73        delete  in_BRANCH_COMPLETE_DIRECTION   [i];
    7674        if (_param._have_bht)
    7775          {
     
    9391    if (_param._have_pht)
    9492    delete  in_BRANCH_COMPLETE_PHT_HISTORY;
    95     delete  in_BRANCH_COMPLETE_HIT        ;
     93    delete  in_BRANCH_COMPLETE_DIRECTION  ;
    9694    if (_param._have_bht)
    9795      {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_statistics.cpp

    r2 r3  
    2222    log_printf(FUNC,Two_Level_Branch_Predictor,"statistics","Begin");
    2323
     24    string stat_component_Branch_History_Table  = (_param._have_bht==false)?"":component_Branch_History_Table  ->statistics(depth+1);
     25    string stat_component_Pattern_History_Table = (_param._have_pht==false)?"":component_Pattern_History_Table ->statistics(depth+1);
     26
    2427    string txt = _stat->print(depth,
    25                               component_Branch_History_Table           ->statistics(depth+1) +
    26                               component_Pattern_History_Table          ->statistics(depth+1) +
     28                              stat_component_Branch_History_Table                            +
     29                              stat_component_Pattern_History_Table                          +
    2730                              component_Two_Level_Branch_Predictor_Glue->statistics(depth+1)
    2831                              );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl.cpp

    r2 r3  
    2424
    2525    vhdl.set_library_work (_name + "_Pack");
    26 
     26    if (_param._have_bht)
     27    vhdl.set_library_work (_name + "_Branch_History_Table_Pack");
     28    if (_param._have_pht)
     29    vhdl.set_library_work (_name + "_Pattern_History_Table_Pack");
     30    vhdl.set_library_work (_name + "_Two_Level_Branch_Predictor_Glue_Pack");
     31   
    2732    vhdl_port        (vhdl);
    2833    vhdl_declaration (vhdl);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp

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

    r2 r3  
    2020  {
    2121    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","Begin");
     22
     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      }
    2251    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","End");
    2352  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_port.cpp

    r2 r3  
    1616namespace two_level_branch_predictor {
    1717
    18 
    1918  void Two_Level_Branch_Predictor::vhdl_port (Vhdl & vhdl)
    2019  {
     
    2524    for (uint32_t i=0; i<_param._nb_prediction; i++)
    2625      {
    27         vhdl.set_port (" in_PREDICT_VAL_"        +toString(i), IN, 1);
    28         vhdl.set_port ("out_PREDICT_ACK_"        +toString(i),OUT, 1);
    29         vhdl.set_port (" in_PREDICT_ADDRESS_"    +toString(i), IN,_param._size_address);
     26        vhdl.set_port (" in_PREDICT_VAL_"+toString(i)+"                ", IN, 1);
     27        vhdl.set_port ("out_PREDICT_ACK_"+toString(i)+"                ",OUT, 1);
     28        vhdl.set_port (" in_PREDICT_ADDRESS_"+toString(i)+"            ", IN,_param._size_address);
    3029        if (_param._have_bht)
    31         vhdl.set_port ("out_PREDICT_BHT_HISTORY_"+toString(i),OUT,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
     30        vhdl.set_port ("out_PREDICT_BHT_HISTORY_"+toString(i)+"        ",OUT,_param._bht_size_shifter);
    3231        if (_param._have_pht)
    33         vhdl.set_port ("out_PREDICT_PHT_HISTORY_"+toString(i),OUT,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
     32        vhdl.set_port ("out_PREDICT_PHT_HISTORY_"+toString(i)+"        ",OUT,_param._pht_size_counter);
    3433      }
    3534
    3635    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    3736      {
    38         vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"        +toString(i), IN, 1);
    39         vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"        +toString(i),OUT, 1);
    40         vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"    +toString(i), IN,_param._size_address);
     37        vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"        ", IN, 1);
     38        vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"        ",OUT, 1);
     39        vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"    ", IN,_param._size_address);
    4140        if (_param._have_bht)
    42         vhdl.set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
    43         if (_param._have_bht)
    44         vhdl.set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
    45         vhdl.set_port (" in_BRANCH_COMPLETE_HIT_"        +toString(i), IN, 1);
     41        vhdl.set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+"", IN,_param._bht_size_shifter);
     42        if (_param._have_pht)
     43        vhdl.set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i)+"", IN,_param._pht_size_counter);
     44        vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"  ", IN, 1);
    4645      }
    4746
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_port.cpp

    r2 r3  
    2727        _vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"    +toString(i), IN,_param._size_address);
    2828        if (_param._have_bht)
    29         _vhdl_testbench->set_port ("out_PREDICT_BHT_HISTORY_"+toString(i),OUT,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
     29        _vhdl_testbench->set_port ("out_PREDICT_BHT_HISTORY_"+toString(i),OUT,_param._bht_size_shifter);
    3030        if (_param._have_pht)
    31         _vhdl_testbench->set_port ("out_PREDICT_PHT_HISTORY_"+toString(i),OUT,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
     31        _vhdl_testbench->set_port ("out_PREDICT_PHT_HISTORY_"+toString(i),OUT,_param._pht_size_counter);
    3232      }
    3333
     
    3838        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"    +toString(i), IN,_param._size_address);
    3939        if (_param._have_bht)
    40         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
    41         if (_param._have_bht)
    42         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
    43         _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HIT_"        +toString(i), IN, 1);
     40        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,_param._bht_size_shifter);
     41        if (_param._have_pht)
     42        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i), IN,_param._pht_size_counter);
     43        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_DIRECTION_"  +toString(i), IN, 1);
    4444      }
    4545
  • 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

    r2 r3  
    2929    // (because we have no control on the ordonnancer's policy)
    3030
    31 //     _vhdl_testbench->add_input (PORT_READ( in_NRESET));
    3231    for (uint32_t i=0; i<_param._nb_prediction; i++)
    3332      {
    34         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_VAL                 [i]));
    35         _vhdl_testbench->add_output(PORT_READ(out_PREDICT_ACK                 [i]));
    36         _vhdl_testbench->add_input (PORT_READ( in_PREDICT_ADDRESS             [i]));
     33        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_VAL                          [i]));
     34        _vhdl_testbench->add_output(PORT_READ(component_Two_Level_Branch_Predictor_Glue->
     35                                              out_PREDICT_ACK                          [i]));
     36        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_ADDRESS                      [i]));
    3737        if (_param._have_bht)
    38         _vhdl_testbench->add_output(PORT_READ(out_PREDICT_BHT_HISTORY         [i]));
     38        _vhdl_testbench->add_output(PORT_READ(component_Branch_History_Table           ->
     39                                              component_RegisterFile                   ->
     40                                              out_READ_DATA                            [i]));
    3941        if (_param._have_pht)
    40         _vhdl_testbench->add_output(PORT_READ(out_PREDICT_PHT_HISTORY         [i]));
     42        _vhdl_testbench->add_output(PORT_READ(component_Pattern_History_Table          ->
     43                                              component_RegisterFile                   ->
     44                                              out_READ_DATA                            [i]));
    4145      }
    4246
    4347    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
    4448      {
    45         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_VAL         [i]));
    46         _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_ACK         [i]));
    47         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_ADDRESS     [i]));
     49        _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_VAL                  [i]));
     50        _vhdl_testbench->add_output(PORT_READ(component_Two_Level_Branch_Predictor_Glue->
     51                                              out_BRANCH_COMPLETE_ACK                  [i]));
     52        _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_ADDRESS              [i]));
    4853        if (_param._have_bht)
    49         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_BHT_HISTORY [i]));
    50         if (_param._have_bht)
    51         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PHT_HISTORY [i]));
    52         _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_HIT         [i]));
     54        _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_BHT_HISTORY          [i]));
     55        if (_param._have_pht)
     56        _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PHT_HISTORY          [i]));
     57        _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_DIRECTION            [i]));
    5358      }
    5459   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h

    r2 r3  
    55
    66// Behavioural/Generic/
    7 #define DEBUG_Counter                                     false
     7#define DEBUG_Counter                                     false 
    88#define DEBUG_Group                                       false
    9 #define DEBUG_Register_File                               false
     9#define DEBUG_Register_File                               false 
    1010#define DEBUG_Shifter                                     false
    1111// Behavioural/Generic/Select/
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h

    r2 r3  
    2323  class XML
    2424  {
    25     typedef enum {_none     ,
    26                   _balise   ,
    27                   _singleton,
    28                   _comment  } balise_t;
    29    
    3025    // -----[ fields ]----------------------------------------------------
    31   private  : const string     _filename        ;
     26  private  : const string     _name            ;
    3227  private  : string           _body            ;
    3328  private  : list<string>     _list_balise_name;
    34    
     29
    3530    // -----[ methods ]---------------------------------------------------
    36   public   :                  XML                 (string filename);
    37   public   :                  XML                 (string filename, string encoding);
     31  public   :                  XML                 (string name);
    3832  public   :                  ~XML                (void);
    3933       
     
    4741  public   : bool             attribut            (string name, string value);
    4842
     43  public   : void             generate_file       (void);
     44  public   : void             generate_file       (string encoding);
     45  public   : string           get_body            (void);
     46  public   : string           get_body            (uint32_t depth);
     47
    4948  public   : bool             comment             (string text);
    5049  public   : bool             text                (string text);
     
    5554                                                 
    5655  private  : void             header              (string encoding);
    57                                                  
    58   public   : void             generate_file       (void);
    59   public   : string           get_body            (void);
    6056  };
    6157}; // end namespace behavioural         
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp

    r2 r3  
    1111namespace behavioural          {
    1212
    13   XML::XML  (string filename) :
    14     _filename (filename)
     13  XML::XML  (string name) :
     14    _name (name)
    1515  {
    16     header ("UTF-8");
    17   };
    18 
    19   XML::XML  (string filename,
    20              string encoding) :
    21     _filename (filename)
    22   {
    23     header(encoding);
    2416  };
    2517
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open_end.cpp

    r2 r3  
    1313  bool XML::balise_open_end (void)
    1414  {
    15     _body += ">\n";
     15    _body += " >\n";
    1616
    1717    return true;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp

    r2 r3  
    77
    88#include "Behavioural/include/XML.h"
     9#include <fstream>
     10using namespace std;
    911
    1012namespace morpheo              {
    1113namespace behavioural          {
    1214
     15  void XML::generate_file (string encoding)
     16  {
     17    header (encoding);
     18
     19    string name     = _name;
     20    string filename =  name + ".xml";
     21
     22    cout << "Generate file \""<< filename << "\"" << endl;
     23
     24    ofstream file;
     25    file.open(filename.c_str(),ios::out | ios::trunc);
     26
     27    file << get_body();
     28
     29    file.close();
     30  };
     31
    1332  void XML::generate_file (void)
    1433  {
     34    generate_file("UTF-8");
    1535  };
    1636
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp

    r2 r3  
    1616  };
    1717
     18  string XML::get_body (uint32_t depth)
     19  {
     20    string body       = _body;
     21    string tabulation = indent(depth);
     22
     23    body.insert(0,tabulation);
     24    for (size_t pos=body.find('\n',0); pos<body.length()-1; pos=body.find('\n',++pos))
     25      body.insert(++pos,tabulation);
     26
     27    return body;
     28  };
     29
    1830}; // end namespace behavioural         
    1931}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_header.cpp

    r2 r3  
    1313  void XML::header (string encoding)
    1414  {
    15     _body += "<?xml version=\"1.0\" encoding=\""+encoding+"\"?>\n";
     15    _body = "<?xml version=\"1.0\" encoding=\""+encoding+"\" ?>\n" + _body;
    1616  };
    1717
  • trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Makefile

    r2 r3  
    2929DIR_SCHEMA              = Schema
    3030DIR_SCHEMA_EPS          = Schema_eps
     31DIR_SCHEMA_JPG          = Schema_jpg
    3132DIR_TEX                 = Source
    3233
     
    6970# Commands to generate all documents
    7071FIG2EPS                 = fig2dev -L eps
     72EPS2JPG                 = convert -quality 100
    7173LATEX                   = latex
    7274BIBTEX                  = bibtex
     
    8486#--------------------------------------------------------------------------------
    8587.PHONY                  : all clean view help doc doc_all new delete
    86 .SECONDARY              : $(DVI_FILES) $(PS_FILES) $(PDF_FILES) $(EPS_FILES) $(DIR_SCHEMA_EPS)
     88.SECONDARY              : $(DVI_FILES) $(PS_FILES) $(PDF_FILES) $(EPS_FILES) $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG)
    8789
    8890all                     : help
     
    392394                        @$(MKDIR) $@
    393395
     396$(DIR_SCHEMA_JPG)       :
     397                        @$(ECHO) "Make directory       : $@"
     398                        @$(MKDIR) $@
     399
    394400$(DIR_TEX)              :
    395401                        @$(ECHO) "Make directory       : $@"
    396402                        @$(MKDIR) $@
    397403
    398 $(DIR_SCHEMA_EPS)/%.eps : $(DIR_SCHEMA)/%.eps $(DIR_SCHEMA_EPS)
     404$(DIR_SCHEMA_EPS)/%.eps : $(DIR_SCHEMA)/%.eps $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG)
    399405                        @$(ECHO) "Generate   files     : $*.eps"
    400406                        @$(CP) $(DIR_SCHEMA)/$*.eps $(DIR_SCHEMA_EPS)
    401 
    402 $(DIR_SCHEMA_EPS)/%.eps : $(DIR_SCHEMA)/%.fig $(DIR_SCHEMA_EPS)
     407                        @$(EPS2JPG) $@ $(DIR_SCHEMA_JPG)/$*.jpg
     408
     409$(DIR_SCHEMA_EPS)/%.eps : $(DIR_SCHEMA)/%.fig $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG)
    403410                        @$(ECHO) "Generate   files     : $*.eps"
    404411                        @$(FIG2EPS) $< $@
    405 
    406 $(DIR_SCHEMA_EPS)/%.eps : $(DIR_GRAPH)/%.p    $(DIR_SCHEMA_EPS)
     412                        @$(EPS2JPG) $@ $(DIR_SCHEMA_JPG)/$*.jpg
     413
     414$(DIR_SCHEMA_EPS)/%.eps : $(DIR_GRAPH)/%.p    $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG)
    407415                        @$(ECHO) "Generate   files     : $*.eps"
    408416                        @$(CD) $(DIR_GRAPH); $(GNUPLOT) $*.p
    409 
     417                        @$(EPS2JPG) $@ $(DIR_SCHEMA_JPG)/$*.jpg
    410418
    411419#--------------------------------------------------------------------------------
     
    415423clean                   :
    416424                        @$(ECHO) "Delete     temporary files              "$(PWD)
    417                         @$(RM) $(DIR_SCHEMA_EPS) $(DIR_TEX) $(DIR_PACKAGE)/*.aux
     425                        @$(RM) $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG) $(DIR_TEX) $(DIR_PACKAGE)/*.aux
    418426                        @$(RM) $(DVI_FILES) $(PS_FILES) $(PDF_FILES)
    419427                        @$(MAKE) clean_rec DIR_CLEAN=. 
  • trunk/IPs/systemC/processor/Morpheo/Include/Debug.h

    r2 r3  
    4343        fprintf(stdout,"In file %s, ",__FILE__);                                      \
    4444        fprintf(stdout,"at line %d, ",__LINE__);                                      \
    45         fprintf(stdout,"in function \"%s\" : ",func);                                \
     45        fprintf(stdout,"in function \"%s\" : ",func);                                 \
    4646        fprintf(stdout,str);                                                          \
    4747        fprintf(stdout,"\n");                                                         \
  • trunk/IPs/systemC/processor/Morpheo/Include/ErrorMorpheo.h

    r2 r3  
    2929  };
    3030
     31  class TestMorpheo : public exception
     32  {
     33    // -----[ fields ]----------------------------------------------------
     34  private : string _msg;
     35   
     36    // -----[ methods ]---------------------------------------------------
     37  public  :             TestMorpheo   ()           throw() { _msg = "Test error ...";}
     38  public  :             TestMorpheo   (string msg) throw() { _msg = msg;}
     39  public  :             ~TestMorpheo  (void)       throw() {}
     40  public  : const char* what          ()    const  throw() { return ( _msg.c_str() );}
     41  };
     42
    3143}; // end namespace morpheo             
    3244
  • trunk/IPs/systemC/processor/Morpheo/Include/Test.h

    r2 r3  
    55#include <sstream>
    66#include <stdint.h>
     7#include "Include/ErrorMorpheo.h"
    78using namespace std;
    89
     
    1415void test_ko (T exp1, T exp2, char * file, uint32_t line)
    1516{
    16   cout << "{" << num_test << "} : Test KO" << endl
    17        << " * Localisation"                << endl
    18        << "   - File : " << file           << endl
    19        << "   - Line : " << line           << endl
    20        << " * Expression is different "    << endl
    21        << "   - exp1 : " << exp1           << endl
    22        << "   - exp2 : " << exp2           << endl;
    23 
    24   exit (line);
     17  string msg = ("{"+toString(num_test)+"} : Test KO\n" +
     18                " * Localisation\n"                    +
     19                "   - File : "+file+"\n"               +
     20                "   - Line : "+toString(line)+"\n"     +
     21                " * Expression is different\n"         +
     22                "   - exp1 : "+toString(exp1)+"\n"     +
     23                "   - exp2 : "+toString(exp2)+"\n");
     24 
     25  throw (ErrorMorpheo (msg));
    2526};
    2627
Note: See TracChangeset for help on using the changeset viewer.