Ignore:
Timestamp:
Aug 17, 2007, 6:00:56 PM (17 years ago)
Author:
rosiere
Message:

Changement dans le répertoire "New_Component" afin que les composants nouvellement crées peuvent compiler

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/include/test.h

    r2 r50  
    1313#include <string>
    1414#include <iostream>
     15#include <sys/time.h>
    1516
    1617#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
     
    2324
    2425void test    (string name,
    25               morpheo::behavioural::@NAMESPACE_USE::Parameters param);
     26              morpheo::behavioural::@NAMESPACE_USE::Parameters * param);
     27
     28class Time
     29{
     30private : timeval time_begin;
     31// private : timeval time_end;
     32 
     33public  : Time ()
     34  {
     35    gettimeofday(&time_begin     ,NULL);
     36  };
     37
     38public  : ~Time ()
     39  {
     40    cout << *this;
     41  };
     42
     43public  : friend ostream& operator<< (ostream& output_stream,
     44                                      const Time & x)
     45  {
     46    timeval time_end;
     47   
     48    gettimeofday(&time_end       ,NULL);
     49   
     50    uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time());
     51
     52    double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec);
     53   
     54    output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << endl;
     55
     56    return output_stream;
     57  }
     58};
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/main.cpp

    r15 r50  
    4040  try
    4141    {
    42       morpheo::behavioural::@NAMESPACE_USE::Parameters param (//size_data,
    43                                                               //nb_port 
    44                                                              );
     42      morpheo::behavioural::@NAMESPACE_USE::Parameters * param = new morpheo::behavioural::@NAMESPACE_USE::Parameters
     43        (//size_data,
     44         //nb_port 
     45        );
    4546     
    46       cout << param.print(1);
     47      cout << param->print(1);
    4748     
    4849      test (name,param);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/test.cpp

    r44 r50  
    77 */
    88
    9 #define NB_ITERATION 1
    10 
    11 #define LABEL(str) do {cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; _@COMPONENT->vhdl_testbench_label(str);} while (0)
    12 
    139#include "Behavioural/@DIRECTORY/SelfTest/include/test.h"
    1410#include "Common/include/Test.h"
    1511
     12#define NB_ITERATION  1
     13#define CYCLE_MAX     (128*NB_ITERATION)
     14
     15#define LABEL(str)                                                                       \
     16{                                                                                        \
     17  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; \
     18} while(0)
     19
     20#define SC_START(cycle)                                        \
     21do                                                             \
     22{                                                              \
     23  if (static_cast<uint32_t>(sc_simulation_time()) > CYCLE_MAX) \
     24    {                                                          \
     25      TEST_KO("Maximal cycles Reached");                       \
     26    }                                                          \
     27  sc_start(cycle);                                             \
     28} while(0)
     29
    1630void test (string name,
    17            morpheo::behavioural::@NAMESPACE_USE::Parameters _param)
     31           morpheo::behavioural::@NAMESPACE_USE::Parameters * _param)
    1832{
    1933  cout << "<" << name << "> : Simulation SystemC" << endl;
     
    2337                                             morpheo::behavioural::Parameters_Statistics(5,50),
    2438#endif
    25                                              _param);
     39                                             *_param);
    2640 
    2741#ifdef SYSTEMC
     
    4862
    4963  cout << "<" << name << "> Start Simulation ............" << endl;
     64  Time * _time = new Time();
    5065
    5166  /********************************************************
     
    6075  srand(seed);
    6176
    62   sc_start(0);
     77  SC_START(0);
    6378  LABEL("Initialisation");
    6479
     
    6984      LABEL("Iteration "+toString(iteration));
    7085
    71       sc_start(1);
     86      SC_START(1);
    7287    }
    7388
     
    7691   ********************************************************/
    7792
     93  TEST_OK ("End of Simulation");
     94  delete _time;
    7895  cout << "<" << name << "> ............ Stop Simulation" << endl;
    7996
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.h

    r44 r50  
    100100#if VHDL                                       
    101101  public  : void     vhdl                      (void);
    102   private : void     vhdl_declaration          (Vhdl & vhdl);
    103   private : void     vhdl_body                 (Vhdl & vhdl);
     102  private : void     vhdl_declaration          (Vhdl * & vhdl);
     103  private : void     vhdl_body                 (Vhdl * & vhdl);
    104104#endif                                         
    105105                                               
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_allocation.cpp

    r42 r50  
    2222
    2323    Entity * entity = _component->set_entity (_name       
     24                                              ,"@COMPONENT"
    2425#ifdef POSITION
    25                                               ,"@COMPONENT"
    2626                                              ,COMBINATORY
    2727#endif
     
    4040                                                         );
    4141
    42      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO);
    43      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1);
    44 
     42     in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
     43     in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
    4544
    4645    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     
    5049#endif
    5150
    52     Log_printf(FUNC,@COMPONENT,"allocation","End");
     51    log_printf(FUNC,@COMPONENT,"allocation","End");
    5352  };
    5453
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl.cpp

    r42 r50  
    1818    log_printf(FUNC,@COMPONENT,"vhdl","Begin");
    1919
    20     Vhdl vhdl (_name);
     20    Vhdl * vhdl = new Vhdl (_name);
    2121
    2222    _interfaces->set_port(vhdl);
     
    2626    vhdl_body        (vhdl);
    2727
    28     vhdl.generate_file();
     28    vhdl->generate_file();
    2929
    3030    delete vhdl;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_body.cpp

    r2 r50  
    1313@NAMESPACE_BEGIN
    1414
    15   void @COMPONENT::vhdl_body (Vhdl & vhdl)
     15  void @COMPONENT::vhdl_body (Vhdl * & vhdl)
    1616  {
    1717    log_printf(FUNC,@COMPONENT,"vhdl_body","Begin");
    18     vhdl.set_body ("");
     18    vhdl->set_body ("");
    1919    log_printf(FUNC,@COMPONENT,"vhdl_body","End");
    2020  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_declaration.cpp

    r2 r50  
    1313@NAMESPACE_BEGIN
    1414
    15   void @COMPONENT::vhdl_declaration (Vhdl & vhdl)
     15  void @COMPONENT::vhdl_declaration (Vhdl * & vhdl)
    1616  {
    1717    log_printf(FUNC,@COMPONENT,"vhdl_declaration","Begin");
Note: See TracChangeset for help on using the changeset viewer.