Ignore:
Timestamp:
Jan 31, 2008, 6:46:41 PM (16 years ago)
Author:
rosiere
Message:

Update all component (except front_end) to :

  • new statistics model
  • no namespace std
Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
Files:
1 added
36 deleted
72 edited
9 moved

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Counter.h

    r71 r75  
    2727#include "Behavioural/include/Component.h"
    2828
    29 using namespace std;
    30 
    3129namespace morpheo {
    3230namespace behavioural {
     
    4139    // -----[ fields ]----------------------------------------------------
    4240    // Parameters
    43   protected : const string     _name;
     41  protected : const std::string     _name;
    4442
    4543  protected : const Parameters _param;
    4644
    4745#ifdef STATISTICS
    48   private   : Stat                           * _stat;
     46  public    : Stat                           * _stat;
    4947#endif
    5048
     
    7573  public  :          Counter              (sc_module_name                              name,
    7674#else                                         
    77   public  :          Counter              (string                                      name,
     75  public  :          Counter              (std::string                                 name,
    7876#endif                                         
    7977#ifdef STATISTICS
     
    9694#ifdef STATISTICS
    9795  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
    98   public  : string   statistics_print          (uint32_t depth);
    9996#endif
    10097                                               
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Parameters.h

    r44 r75  
    3232  public : ~Parameters () ;
    3333
    34   public : string msg_error (void);
    35 
    36   public :        string   print      (uint32_t depth);
    37   public : friend ostream& operator<< (ostream& output_stream,
    38                                        morpheo::behavioural::generic::counter::Parameters & x);
     34  public :        std::string   msg_error  (void);
     35  public :        std::string   print      (uint32_t depth);
     36  public : friend std::ostream& operator<< (std::ostream& output_stream,
     37                                            morpheo::behavioural::generic::counter::Parameters & x);
    3938  };
    4039
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_allocation.cpp

    r42 r75  
    1717  void Counter::allocation (void)
    1818  {
    19     string rename;
    20 
    2119    log_printf(FUNC,Counter,"allocation","Begin");
    2220
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_declaration.cpp

    r71 r75  
    2020    log_printf(FUNC,Counter,FUNCTION,"Begin");
    2121
    22     _stat = new Stat (static_cast<string>(_name),
     22    _stat = new Stat (static_cast<std::string>(_name),
    2323                      "Counter",
    2424                      param_statistics);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_vhdl_body.cpp

    r42 r75  
    2121    for (uint32_t i=0; i<_param._nb_port; i++)
    2222      {
    23         string counter_inc, counter_dec;
     23        std::string counter_inc, counter_dec;
    2424
    2525        if (_param._size_data > 1)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters_msg_error.cpp

    r2 r75  
    99#include "Behavioural/Generic/Counter/include/Types.h"
    1010#include <sstream>
    11 using namespace std;
    1211
    1312namespace morpheo                    {
     
    1716
    1817
    19   string Parameters::msg_error(void)
     18  std::string Parameters::msg_error(void)
    2019  {
    2120    log_printf(FUNC,Counter,"msg_error","Begin");
    2221
    23     string msg = "";
     22    std::string msg = "";
    2423
    2524    if (_size_data < 1)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters_print.cpp

    r3 r75  
    88#include "Behavioural/Generic/Counter/include/Parameters.h"
    99#include "Behavioural/include/XML.h"
    10 using namespace std;
    1110
    1211namespace morpheo                    {
     
    1615
    1716
    18   string Parameters::print (uint32_t depth)
     17  std::string Parameters::print (uint32_t depth)
    1918  {
    2019    log_printf(FUNC,Counter,"print","Begin");
     
    3635  };
    3736
    38   ostream& operator<< (ostream& output_stream ,
    39                        morpheo::behavioural::generic::counter::Parameters & x)
     37  std::ostream& operator<< (std::ostream& output_stream ,
     38                            morpheo::behavioural::generic::counter::Parameters & x)
    4039  {
    4140    output_stream << x.print(0);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Parameters.h

    r67 r75  
    3232  public : ~Parameters () ;
    3333
    34   public : string msg_error (void);
     34  public :        std::string   msg_error (void);
    3535
    36   public :        string   print      (uint32_t depth);
    37   public : friend ostream& operator<< (ostream& output_stream,
    38                                        morpheo::behavioural::generic::queue::Parameters & x);
     36  public :        std::string   print      (uint32_t depth);
     37  public : friend std::ostream& operator<< (std::ostream& output_stream,
     38                                            morpheo::behavioural::generic::queue::Parameters & x);
    3939  };
    4040
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Queue.h

    r67 r75  
    2222#include "Behavioural/Generic/Queue/include/Parameters.h"
    2323#ifdef STATISTICS
    24 #include "Behavioural/Generic/Queue/include/Statistics.h"
     24#include "Behavioural/include/Stat.h"
    2525#endif
    2626#include "Behavioural/include/Component.h"
     
    2929#endif
    3030#include "Behavioural/include/Usage.h"
    31 
    32 using namespace std;
    33 using namespace morpheo::behavioural::generic::queue_control;
    3431
    3532namespace morpheo {
     
    4643    // -----[ fields ]----------------------------------------------------
    4744    // Parameters
    48   protected : const string       _name;
     45  protected : const std::string       _name;
    4946  protected : const Parameters * _param;
    5047  private   : const Tusage_t     _usage;
     
    5552
    5653#ifdef STATISTICS
    57   private   : Statistics                     * _stat;
     54  public    : Stat                           * _stat;
    5855#endif
    5956
     
    9996   sc_module_name                                name,
    10097#else                                         
    101    string                                        name,
     98   std::string                                   name,
    10299#endif                                         
    103100#ifdef STATISTICS
     
    116113  public  : void     genMoore                  (void);
    117114#endif                                         
     115
    118116#ifdef STATISTICS
    119   public  : string   statistics                (uint32_t depth);
     117  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
    120118#endif
    121119                                               
     
    125123  private : void     vhdl_body                 (Vhdl * & vhdl);
    126124#endif                                         
    127                                                
    128 #ifdef VHDL_TESTBENCH                         
    129   private : void     vhdl_testbench_transition (void);
     125
     126#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     127  private : void     end_cycle                (void);
    130128#endif
    131129  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Parameters_msg_error.cpp

    r67 r75  
    99#include "Behavioural/Generic/Queue/include/Parameters.h"
    1010#include <sstream>
    11 using namespace std;
    12 
    1311namespace morpheo                    {
    1412namespace behavioural {
     
    1917#undef  FUNCTION
    2018#define FUNCTION "Queue::msg_error"
    21   string Parameters::msg_error(void)
     19  std::string Parameters::msg_error(void)
    2220  {
    2321    log_printf(FUNC,Queue,FUNCTION,"Begin");
    2422
    25     string msg = "";
     23    std::string msg = "";
    2624
    2725    return msg;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Parameters_print.cpp

    r67 r75  
    88#include "Behavioural/Generic/Queue/include/Parameters.h"
    99#include "Behavioural/include/XML.h"
    10 using namespace std;
    1110
    1211namespace morpheo                    {
     
    1817#undef  FUNCTION
    1918#define FUNCTION "Queue::print"
    20   string Parameters::print (uint32_t depth)
     19  std::string Parameters::print (uint32_t depth)
    2120  {
    2221    log_printf(FUNC,Queue,FUNCTION,"Begin");
     
    3635#undef  FUNCTION
    3736#define FUNCTION "Queue::operator<<"
    38   ostream& operator<< (ostream& output_stream ,
    39                        morpheo::behavioural::generic::queue::Parameters & x)
     37  std::ostream& operator<< (std::ostream& output_stream ,
     38                            morpheo::behavioural::generic::queue::Parameters & x)
    4039  {
    4140    log_printf(FUNC,Queue,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue.cpp

    r68 r75  
    3232    ,_param            (param)
    3333    ,_usage            (usage)
    34 // #ifdef STATISTICS
    35 //                            ,_param_statistics (param_statistics)
    36 // #endif
    3734  {
    3835    log_printf(FUNC,Queue,FUNCTION,"Begin");
     
    4643        log_printf(INFO,Queue,FUNCTION,"Allocation of statistics");
    4744       
    48         // Allocation of statistics
    49         _stat = new Statistics (static_cast<string>(_name),
    50                                 param_statistics          ,
    51                                 param);
     45        statistics_declaration(param_statistics);
    5246      }
    5347#endif
     
    10296        log_printf(INFO,Queue,FUNCTION,"Generate Statistics file");
    10397       
    104         _stat->generate_file(statistics(0));
    10598        delete _stat;
    10699      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_allocation.cpp

    r68 r75  
    1919  void Queue::allocation (void)
    2020  {
    21     string rename;
    22 
    2321    log_printf(FUNC,Queue,FUNCTION,"Begin");
    2422
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_statistics_declaration.cpp

    r67 r75  
    1414namespace queue {
    1515
    16 
    1716#undef  FUNCTION
    18 #define FUNCTION "Queue::statistics"
    19   string Queue::statistics (uint32_t depth)
     17#define FUNCTION "Queue::statistics_declaration"
     18  void Queue::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
    2019  {
    2120    log_printf(FUNC,Queue,FUNCTION,"Begin");
    2221
    23     string txt = _stat->print(depth);
     22    _stat = new Stat (static_cast<std::string>(_name),
     23                      "Queue",
     24                      param_statistics);
    2425   
    2526    log_printf(FUNC,Queue,FUNCTION,"End");
    26 
    27     return txt;
    2827  };
    2928
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_transition.cpp

    r67 r75  
    5353      }
    5454
    55 #ifdef STATISTICS
    56     _stat->add();
    57 #endif   
    58 
    59 #ifdef VHDL_TESTBENCH
    60     vhdl_testbench_transition ();
     55#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     56    end_cycle ();
    6157#endif
    6258
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/include/Queue_Control.h

    r56 r75  
    1616#include "Common/include/Debug.h"
    1717
    18 using namespace std;
    19 
    2018namespace morpheo {
    2119namespace behavioural {
     
    2725  private : const uint32_t     _nb_elt_max;
    2826  private : uint32_t           _nb_elt;
    29   private : vector<uint32_t> * _tab;
     27  private : std::vector<uint32_t> * _tab;
    3028   
    3129  public  :          Queue_Control  (uint32_t nb_elt_max);
     
    4543   
    4644  public : uint32_t operator[] (uint32_t);
    47   public : ostream& operator<< (ostream& output_stream);
     45  public : std::ostream& operator<< (std::ostream& output_stream);
    4846  };
    4947 
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/src/Queue_Control.cpp

    r56 r75  
    1313    log_printf(FUNC,Queue_Control,FUNCTION,"Begin");
    1414       
    15     _tab = new vector<uint32_t>;
     15    _tab = new std::vector<uint32_t>;
    1616
    1717    log_printf(FUNC,Queue_Control,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/src/Queue_Control_operator.cpp

    r56 r75  
    88#undef  FUNCTION
    99#define FUNCTION "Queue_Control::operator<<"
    10   ostream& Queue_Control::operator<< (ostream& output_stream)
     10  std::ostream& Queue_Control::operator<< (std::ostream& output_stream)
    1111  {
    1212    log_printf(FUNC,Queue_Control,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h

    r62 r75  
    3737  public : ~Parameters () ;
    3838
    39   public : string msg_error (void);
    40 
    41   public :        string   print      (uint32_t depth);
    42   public : friend ostream& operator<< (ostream& output_stream,
    43                                        morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters & x);
     39  public :        std::string   msg_error  (void);
     40  public :        std::string   print      (uint32_t depth);
     41  public : friend std::ostream& operator<< (std::ostream& output_stream,
     42                                            morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters & x);
    4443  };
    4544
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h

    r71 r75  
    1616#include "Common/include/ToString.h"
    1717#include <iostream>
    18 using namespace std;
    1918
    2019#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h"
     
    2827#endif
    2928#include "Behavioural/include/Usage.h"
    30 
    31 using namespace std;
    3229
    3330namespace morpheo                    {
     
    4643    // -----[ fields ]----------------------------------------------------
    4744    // Parameters
    48   protected : const string       _name;
     45  protected : const std::string       _name;
    4946  protected : const Parameters * _param;
    5047  private   : const Tusage_t     _usage;
    5148
    5249#ifdef STATISTICS
    53   private   : Stat                           * _stat;
     50  public    : Stat                           * _stat;
    5451   
    5552  private   : counter_t                      * _stat_nb_read;
     
    106103   sc_module_name                              name
    107104#else                                         
    108    string                                      name
     105   std::string                                      name
    109106#endif                                         
    110107#ifdef STATISTICS
     
    128125#ifdef STATISTICS
    129126  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
    130   public  : string   statistics_print          (uint32_t depth);
    131127#endif                                         
    132128
     
    137133#endif                                         
    138134                                               
     135#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    139136  private : void     end_cycle                 (void);
    140 
     137#endif
    141138  };
    142139
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters_msg_error.cpp

    r62 r75  
    1010#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h"
    1111#include <sstream>
    12 using namespace std;
    1312
    1413namespace morpheo                    {
     
    1817namespace registerfile_monolithic    {
    1918
    20   string Parameters::msg_error(void)
     19  std::string Parameters::msg_error(void)
    2120  {
    22     string msg = "";
     21    std::string msg = "";
    2322
    2423    if ((8*sizeof(Tdata_t)) < _size_word)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters_print.cpp

    r55 r75  
    88#include <stdint.h>
    99#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h"
    10 #include <sstream>
    11 using namespace std;
     10#include "Behavioural/include/XML.h"
    1211
    1312namespace morpheo                    {
     
    1716namespace registerfile_monolithic    {
    1817
    19   string Parameters::print (uint32_t depth)
     18  std::string Parameters::print (uint32_t depth)
    2019  {
    21     string tab = string(depth,'\t');
    22     ostringstream msg;
    23     msg << tab << "<registerfile_monolithic>" << endl
    24         << tab << "\t<nb_port_read       value=\"" << _nb_port_read       << "\" />" << endl
    25         << tab << "\t<nb_port_write      value=\"" << _nb_port_write      << "\" />" << endl
    26         << tab << "\t<nb_port_read_write value=\"" << _nb_port_read_write << "\" />" << endl
    27         << tab << "\t<nb_word            value=\"" << _nb_word            << "\" />" << endl
    28         << tab << "\t<size_word          value=\"" << _size_word          << "\" />" << endl
    29         << tab << "</registerfile_monolithic>" << endl;
    30    
    31     return msg.str();
     20    XML xml ("registerfile_monolithic");
     21
     22    xml.balise_open("registerfile_monolithic");
     23    xml.singleton_begin("nb_port_read      "); xml.attribut("value",toString(_nb_port_read      )); xml.singleton_end();
     24    xml.singleton_begin("nb_port_write     "); xml.attribut("value",toString(_nb_port_write     )); xml.singleton_end();
     25    xml.singleton_begin("nb_port_read_write"); xml.attribut("value",toString(_nb_port_read_write)); xml.singleton_end();
     26    xml.singleton_begin("nb_word           "); xml.attribut("value",toString(_nb_word           )); xml.singleton_end();
     27    xml.singleton_begin("size_word         "); xml.attribut("value",toString(_size_word         )); xml.singleton_end();
     28    xml.balise_close();
     29
     30    return xml.get_body(depth);
    3231  };
    3332
    34   ostream& operator<< (ostream& output_stream ,
    35                        morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters & x)
     33  std::ostream& operator<< (std::ostream& output_stream ,
     34                            morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters & x)
    3635  {
    3736    output_stream << x.print(0);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp

    r71 r75  
    1919   sc_module_name name,
    2020#else
    21    string name        ,
     21   std::string name        ,
    2222#endif
    2323#ifdef STATISTICS
     
    3737
    3838#ifdef STATISTICS
    39     statistics_declaration(param_statistics);
     39    if (_usage & USE_STATISTICS)
     40      statistics_declaration(param_statistics);
    4041#endif
    4142
     
    102103#ifdef STATISTICS
    103104    if (_usage & USE_STATISTICS)
    104       {
    105         delete _stat;
    106       }
     105      delete _stat;
    107106#endif
    108107
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp

    r62 r75  
    124124    for (uint32_t i=0; i<_param->_nb_word; i++)
    125125      {
    126         string rename = "reg_DATA["  + toString(i) + "]";
     126        std::string rename = "reg_DATA["  + toString(i) + "]";
    127127        reg_DATA [i]  = new SC_REGISTER (Tdata_t) (rename.c_str());
    128128      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_end_cycle.cpp

    r71 r75  
     1#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    12/*
    23 * $Id$
     
    3738}; // end namespace behavioural         
    3839}; // end namespace morpheo             
     40#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_declaration.cpp

    r71 r75  
    1717  void RegisterFile_Monolithic::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
    1818  {
    19     _stat = new Stat (static_cast<string>(_name),
     19    _stat = new Stat (static_cast<std::string>(_name),
    2020                      "RegisterFile_Monolithic",
    2121                      param_statistics);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp

    r71 r75  
    7979#endif   
    8080
     81#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    8182    end_cycle();
    82 
     83#endif
    8384    log_printf(FUNC,RegisterFile,"transition","End");
    8485  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp

    r62 r75  
    3838    for (uint32_t i = 0; i < _param->_nb_port_read; i++)
    3939      {
    40         string str_address;
     40        std::string str_address;
    4141        if (_param->_have_port_address)
    4242          str_address = "conv_integer(in_READ_"+toString(i)+"_ADDRESS)";
     
    4848    for (uint32_t i = 0; i < _param->_nb_port_read_write; i++)
    4949      {
    50         string str_address;
     50        std::string str_address;
    5151        if (_param->_have_port_address)
    5252          str_address = "conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)";
     
    6868    for (uint32_t i = 0; i < _param->_nb_port_write; i++)
    6969      {
    70         string str_address;
     70        std::string str_address;
    7171        if (_param->_have_port_address)
    7272          str_address = "conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)";
     
    8080    for (uint32_t i = 0; i < _param->_nb_port_read_write; i++)
    8181      {
    82         string str_address;
     82        std::string str_address;
    8383        if (_param->_have_port_address)
    8484          str_address = "conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)";
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h

    r62 r75  
    1010
    1111#include "Common/include/Debug.h"
    12 #include "Common/include/FromString.h"
    1312#include "Behavioural/include/Parameters.h"
    1413#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h"
     
    1615
    1716namespace morpheo {
    18   typedef enum {PARTIAL_CROSSBAR,
    19                 FULL_CROSSBAR   } Tcrossbar_t;
    20 
    21   template<> inline Tcrossbar_t fromString<Tcrossbar_t> (const std::string& x)
    22   {
    23     if ( (x.compare("0")                == 0) or
    24          (x.compare("PARTIAL_CROSSBAR") == 0))
    25       return PARTIAL_CROSSBAR;
    26     if ( (x.compare("1")                == 0) or
    27          (x.compare("FULL_CROSSBAR"   ) == 0))
    28       return FULL_CROSSBAR;
    29 
    30     throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\""));
    31   };
    32  
    33   template<> inline std::string toString<Tcrossbar_t>   (const Tcrossbar_t& x)
    34   {
    35     ostringstream out;
    36 
    37     if (x == PARTIAL_CROSSBAR)
    38       out << "PARTIAL_CROSSBAR";
    39     if (x == FULL_CROSSBAR)
    40       out << "FULL_CROSSBAR";
    41 
    42     return out.str();
    43   };
    44 
    4517namespace behavioural {
    4618namespace generic {
     
    9264  public : ~Parameters () ;
    9365
    94   public : string msg_error (void);
    95 
    96   public :        string   print      (uint32_t depth);
    97   public : friend ostream& operator<< (ostream& output_stream,
    98                                        morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters & x);
     66  public :        std::string   msg_error  (void);
     67  public :        std::string   print      (uint32_t depth);
     68  public : friend std::ostream& operator<< (std::ostream& output_stream,
     69                                            morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters & x);
    9970  };
    10071
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h

    r57 r75  
    2020#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h"
    2121#ifdef STATISTICS
    22 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Statistics.h"
     22#include "Behavioural/include/Stat.h"
    2323#endif
    2424#include "Behavioural/include/Component.h"
     
    2626#include "Behavioural/include/Vhdl.h"
    2727#endif
    28 
    29 using namespace std;
    3028
    3129namespace morpheo {
     
    4341    // -----[ fields ]----------------------------------------------------
    4442    // Parameters
    45   protected : const string       _name;
     43  protected : const std::string       _name;
    4644
    4745  protected : const Parameters * _param;
    48 //#ifdef STATISTICS
    49 //  protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
    50 //#endif
    5146
    5247#ifdef STATISTICS
    53   private   : Statistics                     * _stat;
     48  public    : Stat                           * _stat;
    5449#endif
    5550
     
    10095                                              sc_module_name                                name,
    10196#else                                         
    102                                               string                                        name,
     97                                              std::string                                   name,
    10398#endif                                         
    10499#ifdef STATISTICS
     
    113108  private : void     deallocation              (void);
    114109                                               
    115 //#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    116 
    117110  private : Taddress_t address_bank                 (Taddress_t address);
    118111  private : Taddress_t address_num_reg              (Taddress_t address);
     
    129122  public  : void     partial_crossbar_genMealy_read (void);
    130123  public  : void     partial_crossbar_genMealy_write(void);
    131 
    132 //#endif
    133124#endif                                         
    134 #ifdef STATISTICS
    135   public  : string   statistics                (uint32_t depth);
    136 #endif
    137125                                               
    138126#if VHDL                                       
     
    142130#endif                                         
    143131                                               
    144 #ifdef VHDL_TESTBENCH                         
    145   private : void     vhdl_testbench_transition (void);
     132#ifdef STATISTICS
     133  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
     134#endif
     135#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     136  private : void     end_cycle                 (void);
    146137#endif
    147138  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h

    r57 r75  
    1010
    1111#include "Behavioural/include/Types.h"
    12 
     12#include "Common/include/ToString.h"
     13#include "Common/include/FromString.h"
    1314namespace morpheo                    {
    1415namespace behavioural {
     
    2324}; // end namespace registerfile
    2425}; // end namespace generic
     26}; // end namespace behavioural
    2527
    26 }; // end namespace behavioural
     28  typedef enum {PARTIAL_CROSSBAR,
     29                FULL_CROSSBAR   } Tcrossbar_t;
     30
     31  template<> inline Tcrossbar_t fromString<Tcrossbar_t> (const std::string& x)
     32  {
     33    if ( (x.compare("0")                == 0) or
     34         (x.compare("PARTIAL_CROSSBAR") == 0))
     35      return PARTIAL_CROSSBAR;
     36    if ( (x.compare("1")                == 0) or
     37         (x.compare("FULL_CROSSBAR"   ) == 0))
     38      return FULL_CROSSBAR;
     39
     40    throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\""));
     41  };
     42 
     43  template<> inline std::string toString<Tcrossbar_t>   (const Tcrossbar_t& x)
     44  {
     45    std::ostringstream out;
     46
     47    if (x == PARTIAL_CROSSBAR)
     48      out << "PARTIAL_CROSSBAR";
     49    if (x == FULL_CROSSBAR)
     50      out << "FULL_CROSSBAR";
     51
     52    return out.str();
     53  };
     54
     55
    2756}; // end namespace morpheo             
    2857
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/Parameters_msg_error.cpp

    r53 r75  
    77
    88#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h"
    9 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h"
    10 #include <sstream>
    11 using namespace std;
    129
    1310namespace morpheo                    {
     
    1815
    1916
    20   string Parameters::msg_error(void)
     17  std::string Parameters::msg_error(void)
    2118  {
    2219    log_printf(FUNC,RegisterFile_Multi_Banked,"msg_error","Begin");
    2320
    24     string msg = "";
     21    std::string msg = "";
    2522
    2623    if (_nb_port_read < _nb_port_read_by_bank)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/Parameters_print.cpp

    r53 r75  
    88#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h"
    99#include "Behavioural/include/XML.h"
    10 using namespace std;
    1110
    1211namespace morpheo                    {
     
    1716
    1817
    19   string Parameters::print (uint32_t depth)
     18  std::string Parameters::print (uint32_t depth)
    2019  {
    2120    log_printf(FUNC,RegisterFile_Multi_Banked,"print","Begin");
     
    4645  };
    4746
    48   ostream& operator<< (ostream& output_stream ,
    49                        morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters & x)
     47  std::ostream& operator<< (std::ostream& output_stream ,
     48                            morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters & x)
    5049  {
    5150    output_stream << x.print(0);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked.cpp

    r67 r75  
    2626                              _name              (name)
    2727                              ,_param            (param)
    28 // #ifdef STATISTICS
    29 //                            ,_param_statistics (param_statistics)
    30 // #endif
    3128  {
    3229    log_printf(FUNC,RegisterFile_Multi_Banked,"RegisterFile_Multi_Banked","Begin");
     
    4239
    4340    // Allocation of statistics
    44     _stat = new Statistics (static_cast<string>(_name),
    45                             param_statistics          ,
    46                             param);
     41    statistics_declaration(param_statistics);
    4742#endif
    4843
     
    142137#ifdef STATISTICS
    143138    log_printf(INFO,RegisterFile_Multi_Banked,"~RegisterFile_Multi_Banked","Generate Statistics file");
    144 
    145     _stat->generate_file(statistics(0));
    146139   
    147140    delete _stat;
     
    160153}; // end namespace registerfile
    161154}; // end namespace generic
    162 
    163155}; // end namespace behavioural
    164156}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_allocation.cpp

    r62 r75  
    1818  void RegisterFile_Multi_Banked::allocation (void)
    1919  {
    20     string rename;
    21 
    2220    log_printf(FUNC,RegisterFile_Multi_Banked,"allocation","Begin");
    2321
     
    2725                                              ,"RegisterFile_Multi_Banked"
    2826#ifdef POSITION
    29                                               ,Register
     27                                              ,REGISTER
    3028#endif
    3129                                              );
     
    106104        for (uint32_t j=0; j<_param->_nb_word; j++)
    107105          {
    108             string rename = "reg_DATA_"  + toString(i) + "_"  + toString(j);
     106            std::string rename = "reg_DATA_"  + toString(i) + "_"  + toString(j);
    109107            reg_DATA [i][j]  = new SC_REGISTER (Tdata_t) (rename.c_str());
    110108          }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_end_cycle.cpp

    r59 r75  
    1 #ifdef VHDL_TESTBENCH
     1#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     2
    23/*
    34 * $Id$
     
    1516namespace registerfile_multi_banked {
    1617
     18#undef  FUNCTION
     19#define FUNCTION "RegisterFile_Multi_Banked::end_cycle"
     20void RegisterFile_Multi_Banked::end_cycle ()
     21  {
     22    log_printf(FUNC,RegisterFile_Multi_Banked,FUNCTION,"Begin");
    1723
    18   void RegisterFile_Multi_Banked::vhdl_testbench_transition ()
    19   {
    20     log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl_testbench_transition","Begin");
     24#ifdef STATISTICS
     25    _stat->end_cycle();
     26#endif   
    2127
     28#ifdef VHDL_TESTBENCH
    2229    // Evaluation before read the ouput signal
    23 //     sc_start(0);
     30//  sc_start(0);
     31    _interfaces->testbench();
     32#endif
    2433
    25     _interfaces->testbench();
    26 
    27     log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl_testbench_transition","End");
     34    log_printf(FUNC,RegisterFile_Multi_Banked,FUNCTION,"End");
    2835  };
    2936
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_statistics_declaration.cpp

    r59 r75  
    1515namespace registerfile_multi_banked {
    1616
     17#undef  FUNCTION
     18#define FUNCTION "RegisterFile_Multi_Banked::statistics_declaration"
     19  void RegisterFile_Multi_Banked::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
     20  {
     21    log_printf(FUNC,RegisterFile_Multi_Banked,FUNCTION,"Begin");
    1722
    18   string RegisterFile_Multi_Banked::statistics (uint32_t depth)
    19   {
    20     log_printf(FUNC,RegisterFile_Multi_Banked,"statistics","Begin");
    21 
    22     string txt = _stat->print(depth);
     23    _stat = new Stat (static_cast<std::string>(_name),
     24                      "RegisterFile_Multi_Banked",
     25                      param_statistics);
    2326   
    24     log_printf(FUNC,RegisterFile_Multi_Banked,"statistics","End");
    25 
    26     return txt;
     27    log_printf(FUNC,RegisterFile_Multi_Banked,FUNCTION,"End");
    2728  };
    2829
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_transition.cpp

    r57 r75  
    3535      }
    3636
    37 #ifdef STATISTICS
    38     _stat->add();
    39 #endif   
    40 
    41 #ifdef VHDL_TESTBENCH
    42     vhdl_testbench_transition ();
     37#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     38    end_cycle();
    4339#endif
    4440
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl.cpp

    r57 r75  
    3939       ,_param->_size_word);
    4040   
    41     string bank_name = _name + "_bank";
     41    std::string bank_name = _name + "_bank";
    4242    bank = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic
    4343      (bank_name.c_str()
     
    106106                         (nb_select_port_4 != nb_select_port_1) );
    107107
    108     string select_name1;
    109     string select_name2;
    110     string select_name3;
    111     string select_name4;
     108    std::string select_name1;
     109    std::string select_name2;
     110    std::string select_name3;
     111    std::string select_name4;
    112112   
    113113    if (have_select1)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_body.cpp

    r62 r75  
    8585              {
    8686                uint32_t num_port  = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_read_by_bank*k+j);
    87                 string   separator = ((k==0)?" ":",");
    88                 string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
     87                std::string   separator = ((k==0)?" ":",");
     88                std::string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
    8989
    9090                vhdl->set_body("\t"+separator+" in_VAL_"+toString(k)+"     \t=>\tinternal_READ_"+toString(i)+"_"+toString(num_port)+index+"_VAL");
     
    104104              {
    105105                uint32_t num_port  = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_write_by_bank*k+j);
    106                 string   separator = ((k==0)?" ":",");
    107                 string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
     106                std::string   separator = ((k==0)?" ":",");
     107                std::string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
    108108               
    109109                vhdl->set_body("\t"+separator+" in_VAL_"+toString(k)+"     \t=>\tinternal_WRITE_"+toString(i)+"_"+toString(num_port)+index+"_VAL");
     
    130130              {
    131131                uint32_t num_port  = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_read_by_bank*k+j);
    132                 string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
     132                std::string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
    133133                vhdl->set_body("\tor internal_SELECT_READ_"+toString(i)+"_"+toString(num_port)+index+"_VAL");
    134134              }
     
    143143              {
    144144                uint32_t num_port  = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_write_by_bank*k+j);
    145                 string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
     145                std::string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
    146146
    147147                vhdl->set_body("\tor internal_SELECT_WRITE_"+toString(i)+"_"+toString(num_port)+index+"_VAL");
     
    168168              {
    169169                uint32_t num_port  = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_read_by_bank*k+j);
    170                 string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
     170                std::string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
    171171                               
    172172                vhdl->set_body("\tin_READ_"+toString(num_port)+"_ADDRESS"+std_logic_range(_param->_size_address_by_bank)+"  when internal_SELECT_READ_"+toString(i)+"_"+toString(num_port)+index+"_VAL ='1' else");
     
    183183              {
    184184                uint32_t num_port  = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_write_by_bank*k+j);
    185                 string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
     185                std::string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
    186186
    187187                vhdl->set_body("\tin_WRITE_"+toString(num_port)+"_ADDRESS"+std_logic_range(_param->_size_address_by_bank)+" when internal_SELECT_WRITE_"+toString(i)+"_"+toString(num_port)+index+"_VAL='1' else");
     
    207207              {
    208208                uint32_t num_port  = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_write_by_bank*k+j);
    209                 string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
     209                std::string   index     = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";
    210210                vhdl->set_body("\tin_WRITE_"+toString(num_port)+"_DATA when internal_SELECT_WRITE_"+toString(i)+"_"+toString(num_port)+index+"_VAL='1' else");
    211211              }
     
    225225        for (uint32_t j=0; j<_param->_nb_port_read; j ++)
    226226          {
    227             string str_address;
     227            std::string str_address;
    228228
    229229            if (_param->_have_bank_port_address == true)
     
    236236        for (uint32_t j=0; j<_param->_nb_port_write; j ++)
    237237          {
    238             string str_address;
     238            std::string str_address;
    239239
    240240            if (_param->_have_port_address == true)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/include/Parameters.h

    r62 r75  
    4343  public : ~Parameters () ;
    4444
    45   public : string msg_error (void);
    46 
    47   public :        string   print      (uint32_t depth);
    48   public : friend ostream& operator<< (ostream& output_stream,
     45  public :        std::string   msg_error  (void);
     46  public :        std::string   print      (uint32_t depth);
     47  public : friend std::ostream& operator<< (std::ostream& output_stream,
    4948                                       morpheo::behavioural::generic::registerfile::Parameters & x);
    5049  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/include/RegisterFile.h

    r62 r75  
    2323#include "Behavioural/Generic/RegisterFile/include/Types.h"
    2424#ifdef STATISTICS
    25 #include "Behavioural/Generic/RegisterFile/include/Statistics.h"
     25#include "Behavioural/include/Stat.h"
    2626#endif
    2727#include "Behavioural/include/Component.h"
     
    2929#include "Behavioural/include/Vhdl.h"
    3030#endif
    31 
    32 using namespace std;
    3331
    3432namespace morpheo {
     
    4543    // -----[ fields ]----------------------------------------------------
    4644    // Parameters
    47   protected : const string       _name;
     45  protected : const std::string       _name;
    4846
    4947  protected : const Parameters * _param;
     48
    5049#ifdef STATISTICS
    51   protected : morpheo::behavioural::Parameters_Statistics * _param_statistics;
     50  public    : Stat                           * _stat;
    5251#endif
    5352
     
    8988  public  :          RegisterFile              (
    9089#ifdef SYSTEMC
    91                                               sc_module_name                              name,
     90                                                sc_module_name                              name,
    9291#else                                         
    93                                               string                                      name,
     92                                                std::string                                      name,
    9493#endif                                         
    9594#ifdef STATISTICS
    96                                               morpheo::behavioural::Parameters_Statistics * param_statistics,
     95                                                morpheo::behavioural::Parameters_Statistics * param_statistics,
    9796#endif
    98                                               Parameters                                  * param );
    99                                               
     97                                                Parameters                                  * param );
     98   
    10099  public  :          ~RegisterFile             (void);
    101100                                               
    102101#ifdef SYSTEMC                                 
    103   private : void     allocation                (void);
     102  private : void     allocation                (
     103#ifdef STATISTICS
     104                                                morpheo::behavioural::Parameters_Statistics * param_statistics
     105#else
     106                                                void
     107#endif
     108                                                );
    104109  private : void     deallocation              (void);
    105110#endif                                         
    106 
    107 #ifdef STATISTICS
    108   public  : string   statistics                (uint32_t depth);
    109 #endif
    110111  };
    111112
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/Parameters_msg_error.cpp

    r53 r75  
    99#include "Behavioural/Generic/RegisterFile/include/Types.h"
    1010#include <sstream>
    11 using namespace std;
    1211
    1312namespace morpheo                    {
     
    1716
    1817
    19   string Parameters::msg_error(void)
     18  std::string Parameters::msg_error(void)
    2019  {
    2120    log_printf(FUNC,RegisterFile,"msg_error","Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/Parameters_print.cpp

    r53 r75  
    88#include "Behavioural/Generic/RegisterFile/include/Parameters.h"
    99#include "Behavioural/include/XML.h"
    10 using namespace std;
    1110
    1211namespace morpheo                    {
     
    1615
    1716
    18   string Parameters::print (uint32_t depth)
     17  std::string Parameters::print (uint32_t depth)
    1918  {
    2019    log_printf(FUNC,RegisterFile,"print","Begin");
    2120
    22     string _return;
     21    std::string _return;
    2322
    2423    if (_instance == instance_RegisterFile_Monolithic)
     
    3231  };
    3332
    34   ostream& operator<< (ostream& output_stream ,
    35                        morpheo::behavioural::generic::registerfile::Parameters & x)
     33  std::ostream& operator<< (std::ostream& output_stream ,
     34                            morpheo::behavioural::generic::registerfile::Parameters & x)
    3635  {
    37     if (x._instance == instance_RegisterFile_Monolithic)
    38       output_stream << x._param_registerfile_monolithic  ->print(0);
    39     else
    40       output_stream << x._param_registerfile_multi_banked->print(0);
     36    output_stream << x.print(0);
    4137   
    4238    return output_stream;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile.cpp

    r62 r75  
    2525                              _name              (name)
    2626                              ,_param            (param)
    27 #ifdef STATISTICS
    28                               ,_param_statistics (param_statistics)
    29 #endif
    3027  {
    3128    log_printf(FUNC,RegisterFile,"RegisterFile","Begin");
     
    3431    log_printf(INFO,RegisterFile,"RegisterFile","Allocation");
    3532
    36     allocation ();
     33    allocation (
     34# ifdef STATISTICS
     35                param_statistics
     36# endif
     37                );
     38#endif
     39
     40#ifdef STATISTICS
     41    if (_param->_instance == instance_RegisterFile_Monolithic)
     42      _stat = component_RegisterFile_Monolithic  ->_stat;
     43    else
     44      _stat = component_RegisterFile_Multi_Banked->_stat;
    3745#endif
    3846
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_allocation.cpp

    r62 r75  
    1515
    1616
    17   void RegisterFile::allocation (void)
     17  void RegisterFile::allocation (
     18#ifdef STATISTICS
     19                                 morpheo::behavioural::Parameters_Statistics * param_statistics
     20#else
     21                                 void
     22#endif
     23                                 )
    1824  {
    19     string rename;
     25    std::string rename;
    2026
    2127    log_printf(FUNC,RegisterFile,"allocation","Begin");
     
    7884        component_RegisterFile_Monolithic  = new morpheo::behavioural::generic::registerfile::registerfile_monolithic  ::RegisterFile_Monolithic  ::RegisterFile_Monolithic   (_name.c_str()
    7985#ifdef STATISTICS
    80                                                                                                                                                                                ,_param_statistics
     86                                                                                                                                                                               ,param_statistics
    8187#endif
    8288                                                                                                                                                                               ,_param->_param_registerfile_monolithic
     
    8995        component_RegisterFile_Multi_Banked = new morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::RegisterFile_Multi_Banked (_name.c_str()
    9096#ifdef STATISTICS
    91                                                                                                                                                                                 ,_param_statistics
     97                                                                                                                                                                                ,param_statistics
    9298#endif
    9399                                                                                                                                                                                ,_param->_param_registerfile_multi_banked
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Parameters.h

    r44 r75  
    3434  public : ~Parameters () ;
    3535
    36   public : string msg_error (void);
    37 
    38   public :        string   print      (uint32_t depth);
    39   public : friend ostream& operator<< (ostream& output_stream,
    40                                        morpheo::behavioural::generic::select::select_priority_fixed::Parameters & x);
     36  public :        std::string   msg_error  (void);
     37  public :        std::string   print      (uint32_t depth);
     38  public : friend std::ostream& operator<< (std::ostream& output_stream,
     39                                            morpheo::behavioural::generic::select::select_priority_fixed::Parameters & x);
    4140  };
    4241
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h

    r57 r75  
    2020#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h"
    2121#ifdef STATISTICS
    22 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Statistics.h"
     22#include "Behavioural/include/Stat.h"
    2323#endif
    2424#include "Behavioural/include/Component.h"
     
    2727#endif
    2828#include "Behavioural/include/Usage.h"
    29 
    30 using namespace std;
    3129
    3230namespace morpheo {
     
    4442    // -----[ fields ]----------------------------------------------------
    4543    // Parameters
    46   protected : const string     _name;
     44  protected : const std::string     _name;
    4745  protected : const Parameters * _param;
    4846  private   : const Tusage_t     _usage;
     
    5250
    5351#ifdef STATISTICS
    54   private   : Statistics                     * _stat;
     52  public    : Stat                           * _stat;
    5553#endif
    5654
     
    8785   sc_module_name                              name,
    8886#else                                         
    89    string                                      name,
     87   std::string                                 name,
    9088#endif                                         
    9189#ifdef STATISTICS
     
    10199  private : void     deallocation              (void);
    102100                                               
    103 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     101# if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    104102  public  : void     transition                (void);
    105 #endif
     103# endif
    106104  public  : void     genMealy_entity           (void);
    107105#endif                                         
    108 #ifdef STATISTICS
    109   public  : string   statistics                (uint32_t depth);
    110 #endif
    111106                                               
    112107#if VHDL                                       
     
    116111#endif                                         
    117112                                               
    118 #ifdef VHDL_TESTBENCH                         
    119   private : void     vhdl_testbench_transition (void);
     113#ifdef STATISTICS
     114  public  : void        statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
     115#endif
     116#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     117  private : void        end_cycle                 (void);
    120118#endif
    121119  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Parameters_msg_error.cpp

    r40 r75  
    99#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h"
    1010#include <sstream>
    11 using namespace std;
    1211
    1312namespace morpheo                    {
     
    1817
    1918
    20   string Parameters::msg_error(void)
     19  std::string Parameters::msg_error(void)
    2120  {
    2221    log_printf(FUNC,Select_Priority_Fixed,"msg_error","Begin");
    2322
    24     string msg = "";
     23    std::string msg = "";
    2524
    2625    if ((_encoding_one_hot or _encoding_compact) == false)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Parameters_print.cpp

    r15 r75  
    88#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Parameters.h"
    99#include "Behavioural/include/XML.h"
    10 using namespace std;
    1110
    1211namespace morpheo                    {
     
    1615namespace select_priority_fixed {
    1716
    18   string Parameters::print (uint32_t depth)
     17  std::string Parameters::print (uint32_t depth)
    1918  {
    2019    log_printf(FUNC,Select_Priority_Fixed,"print","Begin");
     
    3332  };
    3433
    35   ostream& operator<< (ostream& output_stream ,
    36                        morpheo::behavioural::generic::select::select_priority_fixed::Parameters & x)
     34  std::ostream& operator<< (std::ostream& output_stream ,
     35                            morpheo::behavioural::generic::select::select_priority_fixed::Parameters & x)
    3736  {
    3837    output_stream << x.print(0);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp

    r68 r75  
    3030    _param            (param),
    3131    _usage            (usage)
    32 // #ifdef STATISTICS
    33 //                            ,_param_statistics (param_statistics)
    34 // #endif
    3532  {
    3633    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin");
     
    4441        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
    4542       
    46         // Allocation of statistics
    47         _stat = new Statistics (static_cast<string>(_name),
    48                                 param_statistics          ,
    49                                 param);
     43        statistics_declaration(param_statistics);
    5044      }
    5145#endif
     
    106100        log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
    107101       
    108         _stat->generate_file(statistics(0));
    109102        delete _stat;
    110103      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_end_cycle.cpp

    r59 r75  
    1 #ifdef VHDL_TESTBENCH
     1#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    22/*
    33 * $Id$
     
    1515namespace select_priority_fixed {
    1616
     17#undef  FUNCTION
     18#define FUNCTION "Select_Priority_Fixed::end_cycle"
     19void Select_Priority_Fixed::end_cycle ()
     20  {
     21    log_printf(FUNC,Select_Priority_Fixed,FUNCTION,"Begin");
    1722
    18   void Select_Priority_Fixed::vhdl_testbench_transition ()
    19   {
    20     log_printf(FUNC,Select_Priority_Fixed,"vhdl_testbench_transition","Begin");
     23#ifdef STATISTICS
     24    _stat->end_cycle();
     25#endif   
    2126
     27#ifdef VHDL_TESTBENCH
    2228    // Evaluation before read the ouput signal
    23 //     sc_start(0);
     29//  sc_start(0);
     30    _interfaces->testbench();
     31#endif
    2432
    25     _interfaces->testbench();
    26 
    27     log_printf(FUNC,Select_Priority_Fixed,"vhdl_testbench_transition","End");
     33    log_printf(FUNC,Select_Priority_Fixed,FUNCTION,"End");
    2834  };
    2935
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_statistics_declaration.cpp

    r59 r75  
    1515namespace select_priority_fixed {
    1616
     17#undef  FUNCTION
     18#define FUNCTION "Select_Priority_Fixed::statistics_declaration"
     19  void Select_Priority_Fixed::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
     20  {
     21    log_printf(FUNC,Select_Priority_Fixed,FUNCTION,"Begin");
    1722
    18   string Select_Priority_Fixed::statistics (uint32_t depth)
    19   {
    20     log_printf(FUNC,Select_Priority_Fixed,"statistics","Begin");
    21 
    22     string txt = _stat->print(depth);
     23    _stat = new Stat (static_cast<std::string>(_name),
     24                      "Select_Priority_Fixed",
     25                      param_statistics);
    2326   
    24     log_printf(FUNC,Select_Priority_Fixed,"statistics","End");
    25 
    26     return txt;
     27    log_printf(FUNC,Select_Priority_Fixed,FUNCTION,"End");
    2728  };
    2829
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_transition.cpp

    r15 r75  
    2121    log_printf(FUNC,Select_Priority_Fixed,"transition","Begin");
    2222
    23 #ifdef STATISTICS
    24     _stat->add();
    25 #endif   
    26 
    27 #ifdef VHDL_TESTBENCH
    28     vhdl_testbench_transition ();
     23#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     24    end_cycle();
    2925#endif
    3026
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_body.cpp

    r59 r75  
    3838    if (_param->_encoding_compact)
    3939      {
    40         string range = ((_param->_size_entity-1)==0)?"(0)":std_logic_range(_param->_size_entity-1,0);
     40        std::string range = ((_param->_size_entity-1)==0)?"(0)":std_logic_range(_param->_size_entity-1,0);
    4141
    4242        vhdl->set_body ("out_ENTITY     <=     internal_entity"+range+";");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/SelfTest/include/test.h

    r2 r75  
    2020using namespace morpheo::behavioural;
    2121using namespace morpheo::behavioural::generic;
    22 
    2322using namespace morpheo::behavioural::generic::shifter;
    2423
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/SelfTest/src/test.cpp

    r44 r75  
    3333      exit (EXIT_FAILURE);
    3434    }
     35
     36#ifdef STATISTICS
     37  morpheo::behavioural::Parameters_Statistics * param_stat = new morpheo::behavioural::Parameters_Statistics(5,50);
     38#endif
    3539  Shifter * _Shifter = new Shifter (name.c_str(),
    3640#ifdef STATISTICS
    37                                              morpheo::behavioural::Parameters_Statistics(5,50),
    38 #endif
    39                                              param);
     41                                    param_stat,
     42#endif
     43                                    param);
    4044 
    4145#ifdef SYSTEMC
     
    4852  sc_signal <Tshift_t    >                 SHIFTER_SHIFT     [param._nb_port];
    4953  sc_signal <Tdirection_t>                 SHIFTER_DIRECTION [param._nb_port];
    50   sc_signal <Ttype_t     >                 SHIFTER_TYPE      [param._nb_port];
     54  sc_signal <morpheo::behavioural::generic::shifter::Ttype_t     >                 SHIFTER_TYPE      [param._nb_port];
    5155  sc_signal <Tcarry_t    >                 SHIFTER_CARRY     [param._nb_port];
    5256  sc_signal <Tcontrol_t  >                 SHIFTER_CARRY_IN  [param._nb_port];
     
    96100
    97101  Tdirection_t   direction       ;
    98   Ttype_t        type            ;
     102  morpheo::behavioural::generic::shifter::Ttype_t        type            ;
    99103  Tcarry_t       carry           ;
    100104  const Tdata_t  data_max        = (1<<param._size_data);
     
    271275                       << hex
    272276                       << data_in[i] << op
    273                        << dec
     277                       << std::dec
    274278                       << shift      << " = "
    275                        << hex
     279                       << std::hex
    276280                       << SHIFTER_DATA_OUT [i].read()
    277281                       << " - completion : "
    278282                       << data_completion [i]
    279                        << dec ;
     283                       << std::dec ;
    280284                 
    281285                  TEST(Tdata_t,SHIFTER_DATA_OUT [i].read(),data_out[i]);
     
    298302
    299303  delete _Shifter;
     304
     305#ifdef STATISTICS
     306  delete param_stat;
     307#endif
    300308}
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Parameters.h

    r2 r75  
    4848  public : const bool        _have_direction_right         ;
    4949
    50     string toString_rotate    (rotate_t x)
    51     {
    52       switch (x)
    53         {
    54         case without_rotate            : return "without_rotate" ;
    55         case internal_rotate           : return "internal_rotate";
    56         case external_rotate           : return "external_rotate";     
    57         default                        : return "";
    58         }
    59     };
    60    
    61     string toString_direction (direction_t x)
    62     {
    63       switch (x)
    64         {
    65         case internal_right_shift      : return "internal_right_shift";
    66         case internal_left_shift       : return "internal_left_shift" ;
    67         case external_direction        : return "external_direction"  ;
    68         default                        : return "";
    69         }
    70     };
    71    
    72     string toString_carry (carry_t x)
    73     {
    74       switch (x)
    75         {
    76         case internal_logic            : return "internal_logic"       ;
    77         case internal_arithmetic       : return "internal_arithmetic"  ;
    78         case external_carry            : return "external_carry"       ;
    79         case external_completion       : return "external_completion"  ;
    80         default                        : return "";
    81         }
    82     };
    83    
    8450    //-----[ methods ]-----------------------------------------------------------
    8551  public : Parameters  (uint32_t    size_data           ,
     
    9359  public : ~Parameters () ;
    9460
    95   public : string msg_error (void);
    96 
    97   public :        string   print      (uint32_t depth);
    98   public : friend ostream& operator<< (ostream& output_stream,
    99                                        morpheo::behavioural::generic::shifter::Parameters & x);
     61  public :        std::string   msg_error  (void);
     62  public :        std::string   print      (uint32_t depth);
     63  public : friend std::ostream& operator<< (std::ostream& output_stream,
     64                                            morpheo::behavioural::generic::shifter::Parameters & x);
    10065  };
    10166
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Shifter.h

    r44 r75  
    1919#include "Behavioural/Generic/Shifter/include/Types.h"
    2020#ifdef STATISTICS
    21 #include "Behavioural/Generic/Shifter/include/Statistics.h"
     21#include "Behavioural/include/Stat.h"
    2222#endif
    2323#ifdef VHDL
     
    2525#endif
    2626#include "Behavioural/include/Component.h"
    27 
    28 using namespace std;
    2927
    3028namespace morpheo                    {
     
    4139    // -----[ fields ]----------------------------------------------------
    4240    // Parameters
    43   protected : const string     _name;
     41  protected : const std::string     _name;
    4442
    4543  protected : const Parameters _param;
    4644#ifdef STATISTICS
    47   private   : Statistics                     * _stat;
     45  public    : Stat                           * _stat;
    4846#endif
    4947
     
    7977  public  :          Shifter              (
    8078#ifdef SYSTEMC
    81                                            sc_module_name                              name,
     79                                           sc_module_name                                name,
    8280#else                                         
    83                                            string                                      name,
     81                                           std::string                                   name,
    8482#endif                                         
    8583#ifdef STATISTICS
    86                                            morpheo::behavioural::Parameters_Statistics param_statistics,
     84                                           morpheo::behavioural::Parameters_Statistics * param_statistics,
    8785#endif
    88                                            Parameters                                  param );
     86                                           Parameters                                    param );
    8987   
    9088  public  :          Shifter              (Parameters param );
     
    106104  private : void     vhdl_body                 (Vhdl * & vhdl);
    107105#endif                                         
     106
    108107#ifdef STATISTICS
    109   public  : string   statistics                (uint32_t depth);
     108  public  : void        statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
    110109#endif
    111                                                
    112 #ifdef VHDL_TESTBENCH                         
    113   private : void     vhdl_testbench_transition (void);
     110#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     111  private : void        end_cycle                 (void);
    114112#endif
    115 
    116113  };
    117114
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Types.h

    r44 r75  
    1 #ifdef SYSTEMC
    21#ifndef morpheo_behavioural_generic_shifter_Type_h
    32#define morpheo_behavioural_generic_shifter_Type_h
     
    109 */
    1110
    12 #include "Common/include/Types.h"
     11#include "Behavioural/include/Types.h"
     12#include "Common/include/ToString.h"
    1313
    1414namespace morpheo {
     
    4949}; // end namespace generic
    5050}; // end namespace behavioural
     51
     52  template<> inline std::string toString<morpheo::behavioural::generic::shifter::rotate_t>(const morpheo::behavioural::generic::shifter::rotate_t& x)
     53    {
     54      switch (x)
     55        {
     56        case morpheo::behavioural::generic::shifter::without_rotate            : return "without_rotate" ;
     57        case morpheo::behavioural::generic::shifter::internal_rotate           : return "internal_rotate";
     58        case morpheo::behavioural::generic::shifter::external_rotate           : return "external_rotate";     
     59        default                        : return "";
     60        }
     61    };
     62 
     63  template<> inline std::string toString<morpheo::behavioural::generic::shifter::direction_t>(const morpheo::behavioural::generic::shifter::direction_t& x)
     64  {
     65    switch (x)
     66      {
     67      case morpheo::behavioural::generic::shifter::internal_right_shift      : return "internal_right_shift";
     68      case morpheo::behavioural::generic::shifter::internal_left_shift       : return "internal_left_shift" ;
     69      case morpheo::behavioural::generic::shifter::external_direction        : return "external_direction"  ;
     70      default                        : return "";
     71      }
     72  };
     73 
     74  template<> inline std::string toString<morpheo::behavioural::generic::shifter::carry_t>(const morpheo::behavioural::generic::shifter::carry_t& x)
     75  {
     76    switch (x)
     77      {
     78      case morpheo::behavioural::generic::shifter::internal_logic            : return "internal_logic"       ;
     79      case morpheo::behavioural::generic::shifter::internal_arithmetic       : return "internal_arithmetic"  ;
     80      case morpheo::behavioural::generic::shifter::external_carry            : return "external_carry"       ;
     81      case morpheo::behavioural::generic::shifter::external_completion       : return "external_completion"  ;
     82      default                        : return "";
     83      }
     84  };
     85   
     86
    5187}; // end namespace morpheo             
    5288
    5389#endif
    54 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Parameters_msg_error.cpp

    r2 r75  
    99#include "Behavioural/Generic/Shifter/include/Types.h"
    1010#include <sstream>
    11 using namespace std;
    1211
    1312namespace morpheo {
     
    1615namespace shifter {
    1716
    18   string Parameters::msg_error(void)
     17  std::string Parameters::msg_error(void)
    1918  {
    20     string msg = "";
     19    std::string msg = "";
    2120
    2221    if (_size_data < 2)
     
    4241      {
    4342        msg += "  - Incompatible parameters : internal_rotate have never carry (must be set at \"internal_logic\"\n";
    44         msg += "    * rotate                          : " + toString_rotate(_rotate) + "\n";
    45         msg += "    * carry                           : " + toString_carry (_carry ) + "\n";
     43        msg += "    * rotate                          : " + toString(_rotate) + "\n";
     44        msg += "    * carry                           : " + toString(_carry ) + "\n";
    4645      }   
    4746
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Parameters_print.cpp

    r2 r75  
    77
    88#include "Behavioural/Generic/Shifter/include/Parameters.h"
    9 #include <sstream>
    10 using namespace std;
     9#include "Behavioural/include/XML.h"
    1110
    1211namespace morpheo                    {
     
    1615
    1716
    18   string Parameters::print (uint32_t depth)
     17  std::string Parameters::print (uint32_t depth)
    1918  {
    20     string tab = string(depth,'\t');
    21     ostringstream msg;
    22     msg << tab << "<shifter>" << endl
    23         << tab << "\t<size_data   value=\"" << _size_data   << "\" />" << endl
    24         << tab << "\t<nb_port     value=\"" << _nb_port     << "\" />" << endl
    25         << tab << "\t<shift_value value=\"" << _shift_value << "\" />" << endl
    26         << tab << "\t<rotate      value=\"" << toString_rotate    (_rotate   ) << "\" />" << endl
    27         << tab << "\t<direction   value=\"" << toString_direction (_direction) << "\" />" << endl
    28         << tab << "\t<carry       value=\"" << toString_carry     (_carry    ) << "\" />" << endl
    29         << tab << "\t<!-- port_completion is type bool : " << toString(_type_completion_bool) << " -->" << endl
    30         << tab << "</shifter>" << endl;
     19    XML xml ("shifter");
     20
     21    xml.balise_open("shifter");
     22    xml.singleton_begin("size_data  "); xml.attribut("value",toString(_size_data  )); xml.singleton_end();
     23    xml.singleton_begin("nb_port    "); xml.attribut("value",toString(_nb_port    )); xml.singleton_end();
     24    xml.singleton_begin("shift_value"); xml.attribut("value",toString(_shift_value)); xml.singleton_end();
     25    xml.singleton_begin("rotate     "); xml.attribut("value",toString(_rotate     )); xml.singleton_end();
     26    xml.singleton_begin("direction  "); xml.attribut("value",toString(_direction  )); xml.singleton_end();
     27    xml.singleton_begin("carry      "); xml.attribut("value",toString(_carry      )); xml.singleton_end();
    3128   
    32     return msg.str();
     29    return xml.get_body(depth);
    3330  };
    3431
    35   ostream& operator<< (ostream& output_stream ,
    36                        morpheo::behavioural::generic::shifter::Parameters & x)
     32  std::ostream& operator<< (std::ostream& output_stream ,
     33                            morpheo::behavioural::generic::shifter::Parameters & x)
    3734  {
    3835    output_stream << x.print(0);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter.cpp

    r66 r75  
    2020#endif
    2121#ifdef STATISTICS
    22                     ,morpheo::behavioural::Parameters_Statistics             param_statistics
     22                    ,morpheo::behavioural::Parameters_Statistics * param_statistics
    2323#endif
    2424                    ,morpheo::behavioural::generic::shifter::Parameters param ):
     
    3232#ifdef STATISTICS
    3333    // Allocation of statistics
    34     _stat = new Statistics (static_cast<string>(_name),
    35                             param_statistics          ,
    36                             param);
     34    statistics_declaration(param_statistics);
    3735#endif
    3836
     
    10199
    102100#ifdef STATISTICS
    103     _stat->generate_file(statistics(0));
    104    
    105101    delete _stat;
    106102#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_end_cycle.cpp

    r59 r75  
    1 #ifdef VHDL_TESTBENCH
     1#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    22/*
    33 * $Id$
     
    1414namespace shifter {
    1515
     16#undef  FUNCTION
     17#define FUNCTION "Shifter::end_cycle"
     18void Shifter::end_cycle ()
     19  {
     20    log_printf(FUNC,Shifter,FUNCTION,"Begin");
    1621
    17   void Shifter::vhdl_testbench_transition (void)
    18   {
    19 //     sc_start(0);
     22#ifdef STATISTICS
     23    _stat->end_cycle();
     24#endif   
    2025
     26#ifdef VHDL_TESTBENCH
     27    // Evaluation before read the ouput signal
     28//  sc_start(0);
    2129    _interfaces->testbench();
     30#endif
     31
     32    log_printf(FUNC,Shifter,FUNCTION,"End");
    2233  };
     34
    2335
    2436}; // end namespace shifter
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_genMealy_shift.cpp

    r44 r75  
    1111#include <bitset>
    1212
    13 using namespace std;
    1413namespace morpheo {
    1514namespace behavioural {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_statistics_declaration.cpp

    r59 r75  
    1414namespace shifter {
    1515
     16#undef  FUNCTION
     17#define FUNCTION "Shifter::statistics_declaration"
     18  void Shifter::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
     19  {
     20    log_printf(FUNC,Shifter,FUNCTION,"Begin");
    1621
    17   string Shifter::statistics (uint32_t depth)
    18   {
    19     return _stat->print(depth);
     22    _stat = new Stat (static_cast<std::string>(_name),
     23                      "Shifter",
     24                      param_statistics);
     25   
     26    log_printf(FUNC,Shifter,FUNCTION,"End");
    2027  };
    2128
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_transition.cpp

    r42 r75  
    1818  void Shifter::transition (void)
    1919  {
    20 #ifdef STATISTICS
    21     _stat->add();
    22 #endif   
    23 
    24 #ifdef VHDL_TESTBENCH
    25     vhdl_testbench_transition ();
     20#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     21    end_cycle ();
    2622#endif
    2723  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_vhdl_body.cpp

    r42 r75  
    5050        for (uint32_t i=0; i<_param._nb_port; i++)
    5151          {
    52             string print_shifter_completion;
     52            std::string print_shifter_completion;
    5353           
    5454            if (_param._type_completion_bool == true)
     
    8383      {
    8484        vhdl->set_body ("out_SHIFTER_"+toString(i)+"_DATA       <=");
    85         string print_else = "    ";
     85        std::string print_else = "    ";
    8686
    8787        //-----[ Shift arithmetic Left ]---------------------------------------
     
    8989          {
    9090            bool   have_when  = false;
    91             string print_when = "";
    92             string print_and  = "";
     91            std::string print_when = "";
     92            std::string print_and  = "";
    9393           
    9494            if (_param._direction   == external_direction)
     
    120120          {
    121121            bool   have_when  = false;
    122             string print_when = "";
    123             string print_and  = "";
     122            std::string print_when = "";
     123            std::string print_and  = "";
    124124           
    125125            if (_param._direction   == external_direction)
     
    151151          {
    152152            bool   have_when  = false;
    153             string print_when = "";
    154             string print_and  = "";
     153            std::string print_when = "";
     154            std::string print_and  = "";
    155155           
    156156            if (_param._direction   == external_direction)
     
    175175              print_when = "when " + print_when;
    176176
    177             string print_expr_completion;
     177            std::string print_expr_completion;
    178178
    179179            if (_param._size_data_completion == 0)
     
    189189          {
    190190            bool   have_when  = false;
    191             string print_when = "";
    192             string print_and  = "";
     191            std::string print_when = "";
     192            std::string print_and  = "";
    193193           
    194194            if (_param._direction   == external_direction)
     
    213213              print_when = "when " + print_when;
    214214
    215             string print_expr_completion;
     215            std::string print_expr_completion;
    216216
    217217            if (_param._size_data_completion == 0)
     
    227227          {
    228228            bool   have_when  = false;
    229             string print_when = "";
    230             string print_and  = "";
     229            std::string print_when = "";
     230            std::string print_and  = "";
    231231           
    232232            if (_param._direction   == external_direction)
     
    253253          {
    254254            bool   have_when  = false;
    255             string print_when = "";
    256             string print_and  = "";
     255            std::string print_when = "";
     256            std::string print_and  = "";
    257257           
    258258            if (_param._direction   == external_direction)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/Makefile.deps

    r53 r75  
    1313include                         $(DIR_MORPHEO)/Behavioural/Makefile.deps
    1414endif
    15 ifndef Group
    16 include                         $(DIR_MORPHEO)/Behavioural/Generic/Group/Makefile.deps
    17 endif
    1815
    1916#-----[ Library ]------------------------------------------
    2017Victim_Pseudo_LRU_LIBRARY               =       -lVictim_Pseudo_LRU             \
    21                                                 $(Group_LIBRARY)                \
    2218                                                $(Behavioural_LIBRARY) 
    2319
    2420Victim_Pseudo_LRU_DIR_LIBRARY           =       -L$(DIR_MORPHEO)/Behavioural/Generic/Victim/Victim_Pseudo_LRU/lib       \
    25                                                 $(Group_DIR_LIBRARY)                                                    \
    2621                                                $(Behavioural_DIR_LIBRARY)     
    2722
     
    3126                                @\
    3227                                $(MAKE)  Behavioural_library; \
    33                                 $(MAKE)  Group_library; \
    3428                                $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/Victim/Victim_Pseudo_LRU --makefile=Makefile;
    35                                
     29
    3630Victim_Pseudo_LRU_library_clean :
    3731                                @\
    3832                                $(MAKE)  Behavioural_library_clean; \
    39                                 $(MAKE)  Group_library_clean; \
    4033                                $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/Victim/Victim_Pseudo_LRU --makefile=Makefile clean;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/src/test.cpp

    r44 r75  
    3636      exit (EXIT_FAILURE);
    3737    }
     38
     39#ifdef STATISTICS
     40  morpheo::behavioural::Parameters_Statistics * param_stat = new morpheo::behavioural::Parameters_Statistics(5,50);
     41#endif
     42
    3843  Victim_Pseudo_LRU * _Victim_Pseudo_LRU = new Victim_Pseudo_LRU (name.c_str(),
    3944#ifdef STATISTICS
    40                                              morpheo::behavioural::Parameters_Statistics(5,50),
    41 #endif
    42                                              param);
     45                                                                  param_stat,
     46#endif
     47                                                                  param);
    4348 
    4449#ifdef SYSTEMC
     
    207212
    208213  delete _Victim_Pseudo_LRU;
     214
     215#ifdef STATISTICS
     216  delete param_stat;
     217#endif
     218
    209219}
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Parameters.h

    r15 r75  
    3535  public : ~Parameters () ;
    3636
    37   public : string msg_error (void);
    38 
    39   public :        string   print      (uint32_t depth);
    40   public : friend ostream& operator<< (ostream& output_stream,
    41                                        morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters & x);
     37  public :        std::string   msg_error  (void);
     38  public :        std::string   print      (uint32_t depth);
     39  public : friend std::ostream& operator<< (std::ostream& output_stream,
     40                                            morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters & x);
    4241  };
    4342
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h

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

    r44 r75  
    3535#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h"
    3636#ifdef STATISTICS
    37 #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Statistics.h"
     37#include "Behavioural/include/Stat.h"
    3838#endif
    3939#ifdef VHDL
    4040#include "Behavioural/include/Vhdl.h"
    4141#endif
    42 #ifdef POSITION
    4342#include "Behavioural/include/Component.h"
    44 #else
    45 #include "Behavioural/include/Interfaces.h"
    46 #endif
    47 
    48 using namespace std;
    4943
    5044namespace morpheo {
     
    157151    }
    158152
    159   public : string print ()
    160     {
    161       string res = "";
     153  public : std::string print ()
     154    {
     155      std::string res = "";
    162156
    163157      for (int32_t i=static_cast<int32_t>(_size)-1; i>=0; i--)
     
    170164    // -----[ fields ]----------------------------------------------------
    171165    // Parameters
    172   protected : const string     _name;
     166  protected : const std::string     _name;
    173167
    174168  protected : const Parameters _param;
    175169#ifdef STATISTICS
    176   private   : Statistics                     * _stat;
    177 #endif
    178 
    179 #ifdef POSITION
    180   private   : Component                      * _component;
    181 #endif
     170  public    : Stat                           * _stat;
     171#endif
     172
     173  public    : Component                      * _component;
    182174  private   : Interfaces                     * _interfaces;
    183175
     
    215207  public  :          Victim_Pseudo_LRU              (
    216208#ifdef SYSTEMC
    217                                               sc_module_name                              name,
     209                                              sc_module_name                                name,
    218210#else                                         
    219                                               string                                      name,
     211                                              std::string                                   name,
    220212#endif                                         
    221213#ifdef STATISTICS
    222                                               morpheo::behavioural::Parameters_Statistics param_statistics,
    223 #endif
    224                                               Parameters                                  param );
     214                                              morpheo::behavioural::Parameters_Statistics * param_statistics,
     215#endif
     216                                              Parameters                                    param );
    225217                                               
    226218  public  :          Victim_Pseudo_LRU              (Parameters param );
     
    233225  public  : void     transition                (void);
    234226  public  : void     genMealy_access           (void);
    235 #endif                                         
    236 #ifdef STATISTICS
    237   public  : string   statistics                (uint32_t depth);
    238227#endif
    239228                                               
     
    244233#endif                                         
    245234                                               
    246 #ifdef VHDL_TESTBENCH                         
    247   private : void     vhdl_testbench_transition (void);
    248 #endif
    249 
     235#ifdef STATISTICS
     236  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
     237#endif
     238
     239#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     240  private : void     end_cycle                 (void);
     241#endif
    250242  };
    251243
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Parameters_msg_error.cpp

    r15 r75  
    99#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h"
    1010#include <sstream>
    11 using namespace std;
    1211
    1312namespace morpheo {
     
    1716namespace victim_pseudo_lru {
    1817
    19   string Parameters::msg_error(void)
     18  std::string Parameters::msg_error(void)
    2019  {
    21     string msg = "";
     20    std::string msg = "";
    2221
    2322    if (_nb_entity < 2)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Parameters_print.cpp

    r15 r75  
    22 * $Id$
    33 *
    4  * [ Description ]
     4 * [ Description ]
    55 *
    66 */
    77
    88#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Parameters.h"
     9#include "Behavioural/include/XML.h"
    910#include <sstream>
    10 using namespace std;
    1111
    1212namespace morpheo {
     
    1616namespace victim_pseudo_lru {
    1717
    18   string Parameters::print (uint32_t depth)
     18  std::string Parameters::print (uint32_t depth)
    1919  {
    20     string tab = string(depth,'\t');
    21     ostringstream msg;
    22     msg << tab << "<victim_pseudo_lru>" << endl
    23         << tab << "\t<nb_entity  value=\"" << _nb_entity  << "\" />" << endl
    24         << tab << "\t<nb_access  value=\"" << _nb_access  << "\" />" << endl
    25         << tab << "\t<nb_update  value=\"" << _nb_update  << "\" />" << endl
    26         << tab << "\t<size_table value=\"" << _size_table << "\" />" << endl
    27         << tab << "</victim_pseudo_lru>" << endl;
    28    
    29     return msg.str();
     20    XML xml ("victim_pseudo_lru");
     21
     22    xml.balise_open("victim_pseudo_lru");
     23    xml.singleton_begin("nb_entity "); xml.attribut("value",toString(_nb_entity )); xml.singleton_end();
     24    xml.singleton_begin("nb_access "); xml.attribut("value",toString(_nb_access )); xml.singleton_end();
     25    xml.singleton_begin("nb_update "); xml.attribut("value",toString(_nb_update )); xml.singleton_end();
     26    xml.singleton_begin("size_table"); xml.attribut("value",toString(_size_table)); xml.singleton_end();
     27    xml.balise_close();
     28
     29    return xml.get_body(depth);
    3030  };
    3131
    32   ostream& operator<< (ostream& output_stream ,
    33                        morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters & x)
     32  std::ostream& operator<< (std::ostream& output_stream ,
     33                            morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters & x)
    3434  {
    3535    output_stream << x.print(0);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU.cpp

    r66 r75  
    1717  Victim_Pseudo_LRU::Victim_Pseudo_LRU (sc_module_name name,
    1818#else
    19   Victim_Pseudo_LRU::Victim_Pseudo_LRU (string name,
     19  Victim_Pseudo_LRU::Victim_Pseudo_LRU (std::string name,
    2020#endif
    2121#ifdef STATISTICS
    22                           morpheo::behavioural::Parameters_Statistics             param_statistics,
     22                          morpheo::behavioural::Parameters_Statistics * param_statistics,
    2323#endif
    2424                          morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters param ):
     
    3737   
    3838    // Allocation of statistics
    39     _stat = new Statistics (static_cast<string>(_name),
    40                             param_statistics          ,
    41                             param);
     39    statistics_declaration(param_statistics);
    4240#endif
    4341
     
    9391
    9492#ifdef STATISTICS
    95     _stat->generate_file(statistics(0));
    96    
    9793    delete _stat;
    9894#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_allocation.cpp

    r42 r75  
    1717  void Victim_Pseudo_LRU::allocation (void)
    1818  {
    19 #ifdef POSITION
    2019    _component   = new Component ();
    2120
    22     Entity * entity = _component->set_entity (_name                  ,
    23                                              "Select_Priority_Fixed",
    24                                              COMBINATORY            );
     21    Entity * entity = _component->set_entity (_name                 
     22                                              ,"Select_Priority_Fixed"
     23#ifdef POSITION
     24                                              ,COMBINATORY           
     25#endif
     26                                              );
    2527   
    2628    _interfaces = entity->set_interfaces();
    27 #else
    28     _interfaces = new Interfaces();
    29 #endif
    3029
    3130    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3231    {
    33       Interface_fifo * interface = _interfaces->set_interface("", IN  ,WEST, "Generalist interface");
     32      Interface_fifo * interface = _interfaces->set_interface(""
     33#ifdef POSITION
     34                                                              , IN  ,WEST, "Generalist interface"
     35#endif
     36                                                              );
    3437     
    3538      in_CLOCK        = interface->set_signal_clk              ("clock" ,1);
     
    4750      for (uint32_t i=0; i<_param._nb_access; i++)
    4851        {
    49           Interface_fifo * interface = _interfaces->set_interface("access_"+toString(i), IN  ,WEST, "Access");
     52          Interface_fifo * interface = _interfaces->set_interface("access_"+toString(i)
     53#ifdef POSITION
     54                                                                  , IN  ,WEST, "Access"
     55#endif
     56                                                                  );
    5057
    5158           in_ACCESS_VAL     [i] = interface->set_signal_valack_in        ("val"    , VAL);
     
    6976      for (uint32_t i=0; i<_param._nb_update; i++)
    7077        {
    71           Interface_fifo * interface = _interfaces->set_interface("update_"+toString(i), IN  ,EAST, "Update");
     78          Interface_fifo * interface = _interfaces->set_interface("update_"+toString(i)
     79#ifdef POSITION
     80                                                                  , IN  ,EAST, "Update"
     81#endif
     82                                                                  );
    7283
    7384          in_UPDATE_VAL     [i] = interface->set_signal_valack_in        ("val"    , VAL);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_end_cycle.cpp

    r59 r75  
    1 #ifdef VHDL_TESTBENCH
     1#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    22/*
    33 * $Id$
     
    1515namespace victim_pseudo_lru {
    1616
     17#undef  FUNCTION
     18#define FUNCTION "Victim_Pseudo_LRU::end_cycle"
     19void Victim_Pseudo_LRU::end_cycle ()
     20  {
     21    log_printf(FUNC,Victim_Pseudo_LRU,FUNCTION,"Begin");
    1722
    18   void Victim_Pseudo_LRU::vhdl_testbench_transition (void)
    19   {
     23#ifdef STATISTICS
     24    _stat->end_cycle();
     25#endif   
     26
     27#ifdef VHDL_TESTBENCH
    2028    // Evaluation before read the ouput signal
    21 //     sc_start(0);
     29//  sc_start(0);
     30    _interfaces->testbench();
     31#endif
    2232
    23     _interfaces->testbench();
     33    log_printf(FUNC,Victim_Pseudo_LRU,FUNCTION,"End");
    2434  };
    2535
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_statistics_declaration.cpp

    r59 r75  
    1515namespace victim_pseudo_lru {
    1616
    17  
    18   string Victim_Pseudo_LRU::statistics (uint32_t depth)
     17#undef  FUNCTION
     18#define FUNCTION "Victim_Pseudo_LRU::statistics_declaration"
     19  void Victim_Pseudo_LRU::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
    1920  {
    20     return _stat->print(depth);
     21    log_printf(FUNC,Victim_Pseudo_LRU,FUNCTION,"Begin");
     22
     23    _stat = new Stat (static_cast<std::string>(_name),
     24                      "Victim_Pseudo_LRU",
     25                      param_statistics);
     26   
     27    log_printf(FUNC,Victim_Pseudo_LRU,FUNCTION,"End");
    2128  };
    2229
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_transition.cpp

    r42 r75  
    6161      }//end for i
    6262
    63 #ifdef STATISTICS
    64     _stat->add(_stat_nb_access,
    65                _stat_nb_update);
    66 #endif   
    67    
    68 #ifdef VHDL_TESTBENCH
    69     vhdl_testbench_transition ();
     63#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     64    end_cycle ();
    7065#endif
    7166  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_vhdl_body.cpp

    r42 r75  
    4040        // Read the table
    4141       
    42         string access_address;
     42        std::string access_address;
    4343
    4444        if (_param._size_table>1)
     
    5858            for (int32_t k=(1<<j)-1; k<static_cast<int32_t>(_param._nb_entity-1); k+=(1<<(j+1)))
    5959              {
    60                 string cond = "";
     60                std::string cond = "";
    6161               
    6262                // Create the condition
     
    7070                  }
    7171               
    72                 string print_else = (k==(1<<j)-1)?"     ":"else ";
     72                std::string print_else = (k==(1<<j)-1)?"     ":"else ";
    7373
    7474                vhdl->set_body ("\t"+print_else+"access_entry_"+toString(i)+"("+toString(k)+") "+cond);
     
    9393            {
    9494              bool   have_cond = false;
    95               string cond      = "";
     95              std::string cond      = "";
    9696             
    9797              // condition to change the bit
     
    126126            {
    127127              bool   have_cond = false;
    128               string cond      = "";
     128              std::string cond      = "";
    129129             
    130130              // condition to change the bit
     
    144144              if (have_cond == true)
    145145                {
    146                   string update_address;
     146                  std::string update_address;
    147147
    148148                  if (_param._size_table>1)
     
    170170    for (uint32_t i=0; i<_param._nb_access; i++)
    171171      {
    172         string access_address;
     172        std::string access_address;
    173173
    174174        if (_param._size_table>1)
     
    185185    for (uint32_t i=0; i<_param._nb_update; i++)
    186186      {
    187         string update_address;
     187        std::string update_address;
    188188
    189189        if (_param._size_table>1)
Note: See TracChangeset for help on using the changeset viewer.