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/Victim/Victim_Pseudo_LRU
Files:
5 deleted
11 edited
2 moved

Legend:

Unmodified
Added
Removed
  • 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.