Changeset 40 for trunk


Ignore:
Timestamp:
Jun 5, 2007, 11:06:46 PM (17 years ago)
Author:
rosiere
Message:

Interface et Signal, c'est deux classes enregistres la valeurs des signaux à chaque cycle ... étape préparatoire avan le changement de la classe Vhdl_Testbench

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural
Files:
7 added
45 edited

Legend:

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

    r15 r40  
    1919  Select_Priority_Fixed * _Select_Priority_Fixed = new Select_Priority_Fixed (name.c_str(),
    2020#ifdef STATISTICS
    21                                              morpheo::behavioural::Parameters_Statistics(5,50),
     21                                                                              morpheo::behavioural::Parameters_Statistics(5,50),
    2222#endif
    23                                              _param);
     23                                                                              _param);
    2424 
    2525#ifdef SYSTEMC
     
    137137  cout << "<" << name << "> ............ Stop Simulation" << endl;
    138138
    139   delete CLOCK;
    140   delete NRESET;
    141 
    142   for (uint32_t i=0; i<_param._nb_entity; i++)
    143     {
    144       delete VAL [i];
    145       delete ACK [i];
    146     }
    147  
    148   delete VAL       ;
    149   delete ACK       ;
    150   delete ENTITY    ;
    151   delete ENTITY_ACK;
     139  delete    CLOCK;
     140  delete    NRESET;
     141  delete [] VAL       ;
     142  delete [] ACK       ;
     143  delete    ENTITY    ;
     144  delete    ENTITY_ACK;
    152145#endif
    153146
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h

    r31 r40  
    1919#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Parameters.h"
    2020#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h"
     21#ifdef STATISTICS
     22#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Statistics.h"
     23#endif
    2124#ifdef POSITION
    2225#include "Behavioural/include/Position.h"
    2326#else
    2427#include "Behavioural/include/Interfaces.h"
    25 #endif
    26 
    27 #ifdef STATISTICS
    28 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Statistics.h"
    2928#endif
    3029#ifdef VHDL
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Parameters_msg_error.cpp

    r15 r40  
    3131      }
    3232
     33    log_printf(FUNC,Select_Priority_Fixed,"msg_error","End");
     34
    3335    return msg;
    34 
    35     log_printf(FUNC,Select_Priority_Fixed,"msg_error","End");
    3636  };
    3737
     
    3939}; // end namespace select
    4040}; // end namespace generic
    41 
    4241}; // end namespace behavioural
    4342}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp

    r29 r40  
    3838#endif
    3939
    40 #ifdef POSITION
    41     log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Position");
    42    
    43    
    44 #endif
    45 
    4640#ifdef STATISTICS
    4741    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
     
    5650    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Creation of a testbench");
    5751
    58     // Creation of a testbench
    59     //  -> port
    60     //  -> clock's signals
    6152    _vhdl_testbench = new Vhdl_Testbench (_name);
    6253#endif
     
    137128}; // end namespace select
    138129}; // end namespace generic
    139 
    140130}; // end namespace behavioural
    141131}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp

    r31 r40  
    3535    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3636
    37     Interface * interface_ = _interfaces->set_interface(""  ,
    38                                                         IN  ,
    39                                                         WEST,
    40                                                         "...");
     37    Interface_fifo * interface_ = _interfaces->set_interface("", IN  ,WEST, "Generalist interface");
    4138
    4239     in_CLOCK        = interface_->set_signal_clk              ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_deallocation.cpp

    r31 r40  
    2020    log_printf(FUNC,Select_Priority_Fixed,"deallocation","Begin");
    2121
    22     delete in_CLOCK;
    23     delete in_NRESET;
     22    delete     in_CLOCK;
     23    delete     in_NRESET;
    2424
    25     for (uint32_t i=0; i<_param._nb_entity; i++)
    26       {
    27         delete  in_VAL [i];
    28         if (_param._encoding_one_hot)
    29         delete out_ACK [i];
    30       }
     25    delete []  in_VAL;
     26    if (_param._encoding_one_hot)
     27    delete [] out_ACK;
    3128
    32     delete  in_VAL;
    33     if (_param._encoding_one_hot)
    34     delete out_ACK;
    3529    if (_param._encoding_compact)
    3630      {
    37     delete out_ENTITY;
    38     delete out_ENTITY_ACK;
     31    delete    out_ENTITY;
     32    delete    out_ENTITY_ACK;
    3933      }
    4034    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     35
     36    cout << *_interfaces << endl;
    4137
    4238#ifdef POSITION
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_genMealy_entity.cpp

    r15 r40  
    11#ifdef SYSTEMC
    2 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    32/*
    43 * $Id$
     
    6463}; // end namespace morpheo             
    6564#endif
    66 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl.cpp

    r29 r40  
    3030
    3131    vhdl->generate_file();
     32
     33    delete vhdl;
     34
    3235    log_printf(FUNC,Select_Priority_Fixed,"vhdl","End");
    33 
    3436  };
    3537
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_port.cpp

    r31 r40  
    1919    log_printf(FUNC,Select_Priority_Fixed,"vhdl_port","Begin");
    2020
    21 #ifdef VHDL
    2221    _interfaces->set_port(vhdl);
    23 #endif
     22
    2423#ifdef VHDL_TESTBENCH
    2524    _interfaces->set_port(_vhdl_testbench);                     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_testbench_transition.cpp

    r38 r40  
    2323    sc_start(0);
    2424
    25     // In order with file Select_Priority_Fixed_vhdl_testbench_port.cpp
    26     // Warning : if a output depend of a subcomponent, take directly the port of subcomponent
    27     // (because we have no control on the ordonnancer's policy)
    28 
    2925    _interfaces->testbench(_vhdl_testbench);
    3026
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest

    r31 r40  
    9696$(DIR_LOG)/%.exec.log           : $(DIR_CFG_GEN)/%.cfg $(DIR_BIN)/$(EXEC).x
    9797                                @$(ECHO) "Execute            : $*"
    98                                 @$(EXPORT) SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; ./$(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` > $@
     98                                @$(EXPORT) SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; $(VALGRIND) ./$(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@
    9999                                declare -i count=`$(GREP) -ch "Test KO" $@`;            \
    100100                                if $(TEST) $$count -eq 0;                               \
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis

    r19 r40  
    6060$(DIR_LOG)/%.fpga.log           :
    6161                                @$(ECHO) "Synthetis on FPGA  : $*"
    62                                 @$(XILINX_ENV); $(MAKE) -f Makefile.mkf $*.ngc > $@
     62                                @$(XILINX_ENV); $(MAKE) -f Makefile.mkf $*.ngc &> $@
    6363
    6464$(DIR_WORK)                     :
     
    6767
    6868$(DIR_LOG)/%.vhdl_sim.log       : $(DIR_VHDL)/%.vhdl $(DIR_LOG)/%.vhdl.log
    69                                 @$(ECHO) "VHDL's Simulation: $*"
    70                                 @$(MODELTECH_VSIM) "$(DIR_WORK).`$(BASENAME) $* |$(UPPERtoLOWER)`" > $@
     69                                @$(ECHO) "VHDL's Simulation  : $*"
     70                                @$(MODELTECH_VSIM) "$(DIR_WORK).`$(BASENAME) $* |$(UPPERtoLOWER)`" &> $@
    7171                                declare -i count=`$(GREP) -ch "Test KO" $@`;            \
    7272                                if $(TEST) $$count -eq 0;                               \
     
    7777$(DIR_LOG)/%.vhdl.log           : $(DIR_VHDL)/%.vhdl
    7878                                @$(ECHO) "VHDL's Compilation : $*"
    79                                 @$(MODELTECH_VCOM) $< > $@
     79                                @$(MODELTECH_VCOM) $< &> $@
    8080
    8181synthesis_clean                 :
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags

    r38 r40  
    66
    77#-----[ Simulator ]----------------------------------------
    8 SIMULATOR                       = systemcass_deps
     8SIMULATOR                       = systemcass
    99
    1010# 3 simulators :
     
    1717                                        -DVHDL                  \
    1818                                        -DVHDL_TESTBENCH        \
     19                                        -DCONFIGURATION         \
     20                                        -DPOSITION              \
    1921                                        -DSTATISTICS            \
    20                                         -DPOSITION              \
    21                                         -DCONFIGURATION         \
    22                                         -DDEBUG=DEBUG_ALL   
     22                                        -DDEBUG=DEBUG_NONE
    2323
    24                                        
    2524# Flags :
    2625# DEBUG={level}                 - Print Debug Message
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.h

    r15 r40  
    2121#ifdef STATISTICS
    2222#include "Behavioural/@DIRECTORY/include/Statistics.h"
     23#endif
     24#ifdef POSITION
     25#include "Behavioural/include/Position.h"
     26#else
     27#include "Behavioural/include/Interfaces.h"
    2328#endif
    2429#ifdef VHDL
     
    5661  private   : Vhdl_Testbench                 * _vhdl_testbench;
    5762#endif
     63
     64#ifdef POSITION
     65  private   : Position                       * _position;
     66#endif
     67
     68  private   : Interfaces                     * _interfaces;
    5869
    5970#ifdef SYSTEMC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component.cpp

    r15 r40  
    2929    log_printf(FUNC,@COMPONENT,"@COMPONENT","Begin");
    3030
     31#ifdef SYSTEMC
     32    log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation");
     33
     34    allocation ();
     35#endif
     36
    3137#ifdef STATISTICS
    3238    log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation of statistics");
     
    4147    log_printf(INFO,@COMPONENT,"@COMPONENT","Creation of a testbench");
    4248
    43     // Creation of a testbench
    44     //  -> port
    45     //  -> clock's signals
    4649    _vhdl_testbench = new Vhdl_Testbench (_name);
    4750#endif
     
    5457#endif
    5558
    56 #ifdef VHDL_TESTBENCH
    57     // must be invoke after affect of port
    58     _vhdl_testbench->set_clock    ("in_CLOCK",true);
    59 #endif
    60 
    6159#ifdef SYSTEMC
    62     log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation");
    63 
    64     allocation ();
    65 
    6660//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    6761    log_printf(INFO,@COMPONENT,"@COMPONENT","Method - transition");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_allocation.cpp

    r15 r40  
    1919    log_printf(FUNC,@COMPONENT,"allocation","Begin");
    2020
    21 //#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    22     in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
    23 //#endif
    24     in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET");
     21#ifdef POSITION
     22    _position   = new Position ();
     23
     24    Entity * entity = _position->set_entity (_name       ,
     25                                             "@COMPONENT",
     26                                             COMBINATORY );
     27
     28    _interfaces = entity->set_interfaces();
     29#else
     30    _interfaces = new Interfaces();
     31#endif
     32
     33    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     34
     35    Interface * interface_ = _interfaces->set_interface("", IN  ,WEST, "Generalist interface");
     36
     37     in_CLOCK        = interface_->set_signal_clk              ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO);
     38     in_NRESET       = interface_->set_signal_in  <Tcontrol_t> ("nreset",1);
     39
    2540
    2641    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     42
     43#ifdef POSITION
     44    _position->generate_file();
     45#endif
    2746
    2847    log_printf(FUNC,@COMPONENT,"allocation","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_deallocation.cpp

    r15 r40  
    2424    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    2525
     26#ifdef POSITION
     27    delete _position;
     28#else
     29    delete _interfaces;
     30#endif
     31
    2632    log_printf(FUNC,@COMPONENT,"deallocation","End");
    2733  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl.cpp

    r2 r40  
    1717  {
    1818    log_printf(FUNC,@COMPONENT,"vhdl","Begin");
     19
    1920    Vhdl vhdl (_name);
    2021
     
    2627
    2728    vhdl.generate_file();
     29
     30    delete vhdl;
     31
    2832    log_printf(FUNC,@COMPONENT,"vhdl","End");
    29 
    3033  };
    3134
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_port.cpp

    r15 r40  
    99#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
    1010
    11 #ifdef VHDL_TESTBENCH
    12 # define VHDL_SET_PORT(name,direction,size) do {vhdl.set_port (name,direction,size); _vhdl_testbench->set_port (name,direction,size);} while(0)
    13 #else
    14 # define VHDL_SET_PORT(name,direction,size)     vhdl.set_port (name,direction,size)
    15 #endif
    16 
    1711namespace morpheo                    {
    1812namespace behavioural {
     
    2317    log_printf(FUNC,@COMPONENT,"vhdl_port","Begin");
    2418
    25     vhdl.set_port (" in_CLOCK" , IN, 1);
    26     VHDL_SET_PORT (" in_NRESET", IN, 1);
     19    _interfaces->set_port(vhdl);
     20
     21#ifdef VHDL_TESTBENCH
     22    _interfaces->set_port(_vhdl_testbench);                     
     23   _vhdl_testbench->set_clock    ("in_CLOCK",true);
     24#endif   
    2725
    2826    log_printf(FUNC,@COMPONENT,"vhdl_port","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_vhdl_testbench_transition.cpp

    r2 r40  
    2020    sc_start(0);
    2121
    22     // In order with file @COMPONENT_vhdl_testbench_port.cpp
    23     // Warning : if a output depend of a subcomponent, take directly the port of subcomponent
    24     // (because we have no control on the ordonnancer's policy)
    25 
    26     _vhdl_testbench->add_input (PORT_READ( in_NRESET));
     22    _interfaces->testbench(_vhdl_testbench);
    2723   
    2824    // add_test :
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h

    r3 r40  
    1212#include <iostream>
    1313#include "Behavioural/include/XML.h"
     14#include "Behavioural/include/Environnement.h"
    1415#include "Include/ErrorMorpheo.h"
    1516#include "Include/ToString.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environnement.h

    r2 r40  
    66#  error "To have the vhdl's test bench, you must set flags SYSTEMC"
    77#endif
     8
     9#if (defined(VHDL_TESTBENCH) and not defined(VHDL))
     10#  error "To have the vhdl's test bench, you must set flags VHDL"
     11#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h

    r38 r40  
    3939
    4040    // -----[ fields ]----------------------------------------------------
    41   private  : const string          _name         ;
    42   private  : const direction_t     _direction    ;
    43   private  : const localisation_t  _localisation ;
    44   private  :       string          _comment      ;
     41  protected : const string          _name         ;
     42  protected : const direction_t     _direction    ;
     43  protected : const localisation_t  _localisation ;
     44  protected :       string          _comment      ;
    4545
    46   private   : list<Signal *>      * _list_signal  ;
    47 
     46  protected : list<Signal *>      * _list_signal  ;
    4847
    4948#ifdef POSITION
    50   private  :       bool            _is_map       ;
    51   private  :       void          * _entity_map   ; // Entity -> erreur cyclique
    52   private  :       void          * _interface_map; // pour être homogène avec _entity_map
     49  protected :       bool            _is_map       ;
     50  protected :       void          * _entity_map   ; // Entity -> erreur cyclique
     51  protected :       void          * _interface_map; // pour être homogène avec _entity_map
    5352#endif
    5453
     54#ifdef VHDL_TESTBENCH
     55  private   : list<string>        * _list_cycle   ;
     56#endif
     57   
    5558    // -----[ methods ]---------------------------------------------------
    5659  public    :                       Interface            (string         name        ,
     
    6265
    6366  public    : void                  set_comment          (string comment);
    64   private  : string                get_comment          (void          );
     67  protected : string                get_comment          (void          );
    6568
    66   private   : string                get_signal           (void);
     69  protected : string                signal_name          (string      name_interface,
     70                                                          string      name_signal   ,
     71                                                          direction_t direction     );
     72
     73  protected : string                get_signal           (void);
    6774  public    : Signal *              set_signal           (string          name     ,
    6875                                                          direction_t     direction,
     
    135142
    136143#ifdef VHDL_TESTBENCH
     144  public    : void                  testbench_cycle      (void);
    137145  public    : void                  testbench            (Vhdl_Testbench * & vhdl_testbench);
    138146#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h

    r38 r40  
    1212#include <iostream>
    1313#include <list>
    14 #include "Behavioural/include/Interface.h"
     14#include "Behavioural/include/Interface_fifo.h"
    1515#include "Include/ToString.h"
    1616#include "Include/Debug.h"
     
    3030  {
    3131    // -----[ fields ]----------------------------------------------------
    32   private   : list<Interface*>    * _list_interface;
     32  private   : list<Interface_fifo*>    * _list_interface;
    3333
    3434    // -----[ methods ]---------------------------------------------------
     
    3737  public    :                       ~Interfaces           ();
    3838
    39   public    : Interface *           set_interface         (string         name        ,
     39  public    : Interface_fifo *      set_interface         (string         name        ,
    4040                                                           direction_t    direction   ,
    4141                                                           localisation_t localisation);
    42   public    : Interface *           set_interface         (string         name        ,
     42  public    : Interface_fifo *      set_interface         (string         name        ,
    4343                                                           direction_t    direction   ,
    4444                                                           localisation_t localisation,
     
    5353#endif
    5454
    55   public    : Interface  *          find_interface        (string name);
     55  public    : Interface_fifo  *     find_interface        (string name);
    5656
    5757#ifdef VHDL_TESTBENCH
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h

    r38 r40  
    2323#include "Behavioural/include/XML.h"
    2424#include "Include/ErrorMorpheo.h"
     25#include "Include/ToBase2.h"
    2526#include "Include/ToString.h"
    2627#include "Include/Debug.h"
     
    5657  private   : void *                _signal       ;
    5758  private   : type_info_t           _type_info    ;
     59
     60  private   : list<string>        * _list_value   ;
    5861#endif
    5962
     
    6770
    6871#ifdef VHDL_TESTBENCH
     72  public    :template <typename T>
     73             T                  read (void)
     74    {
     75      switch (_direction)
     76        {
     77        case IN  : {return read_in  <T>();}
     78        case OUT : {return read_out <T>();}
     79        default  : throw (ErrorMorpheo ("Signal \""+_name+"\" : direction unknow."));
     80        }
     81    }
     82
     83  public    :template <typename T>
     84             T                  read_in (void)
     85    {
     86      switch (_type_info)
     87        {
     88        case BOOL     : return (static_cast<sc_in  <bool    > *>(_signal)->read());
     89        case UINT8_T  : return (static_cast<sc_in  <uint8_t > *>(_signal)->read());
     90        case UINT16_T : return (static_cast<sc_in  <uint16_t> *>(_signal)->read());
     91        case UINT32_T : return (static_cast<sc_in  <uint32_t> *>(_signal)->read());
     92        case UINT64_T : return (static_cast<sc_in  <uint64_t> *>(_signal)->read());
     93        default       : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow."));
     94        }
     95    }
     96
     97  public    :template <typename T>
     98             T                  read_out(void)
     99    {
     100      switch (_type_info)
     101        {
     102        case BOOL     : return (static_cast<sc_out <bool    > *>(_signal)->read());
     103        case UINT8_T  : return (static_cast<sc_out <uint8_t > *>(_signal)->read());
     104        case UINT16_T : return (static_cast<sc_out <uint16_t> *>(_signal)->read());
     105        case UINT32_T : return (static_cast<sc_out <uint32_t> *>(_signal)->read());
     106        case UINT64_T : return (static_cast<sc_out <uint64_t> *>(_signal)->read());
     107        default       : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow."));
     108        }
     109    }
     110
    69111  public    : void              testbench       (Vhdl_Testbench * & vhdl_testbench);
    70112
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Statistics.h

    r2 r40  
    1313#include <stdint.h>
    1414#include <iostream>
     15#include "Behavioural/include/Environnement.h"
    1516#include "Behavioural/include/Parameters_Statistics.h"
    1617#include "Include/Average.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h

    r29 r40  
    1414#include <iostream>
    1515#include <list>
     16#include "Behavioural/include/Environnement.h"
    1617#include "Behavioural/include/Direction.h"
    1718#include "Include/ToString.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl_Testbench.h

    r2 r40  
    1111 */
    1212
     13#include "Behavioural/include/Environnement.h"
    1314#include "Behavioural/include/Vhdl.h"
    1415#include "Include/ToString.h"
     
    3940    // -----[ fields ]----------------------------------------------------
    4041  private   : const string     _name       ;
     42  private   : const bool       _exhaustive ;
     43
    4144  private   : string           _clock_name ;
    4245  private   : uint32_t         _num_cycle  ;
     
    4851  private   : list<string>     _list_input_cycle;
    4952  private   : list<uint32_t>   _list_input_size ;
     53
    5054  private   : list<string>     _list_output;
    5155  private   : list<string>     _list_output_cycle;
    5256  private   : list<uint32_t>   _list_output_size ;
     57
    5358  private   : list<bool>       _list_test;
    5459  private   : list<string>     _list_port;
     
    6166   
    6267    // -----[ methods ]---------------------------------------------------
    63   public    :                  Vhdl_Testbench              (string   name);
     68  public    :                  Vhdl_Testbench              (string   name,
     69                                                            bool     exhaustive=true);
    6470  public    : virtual          ~Vhdl_Testbench             ();
    6571                                                           
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp

    r38 r40  
    2020    log_printf(FUNC,Behavioural,"Interface","Begin");
    2121
    22     _comment     = "";
    23     _list_signal = new (list<Signal*>);
     22    _comment       = "";
     23    _list_signal   = new (list<Signal*>);
    2424
    2525#ifdef POSITION
    26      _is_map        = false;
    27      _entity_map    = NULL;
    28      _interface_map = NULL;
     26    _is_map        = false;
     27    _entity_map    = NULL;
     28    _interface_map = NULL;
     29#endif
     30
     31#ifdef VHDL_TESTBENCH
     32    _list_cycle    = new list<string>;
    2933#endif
    3034
     
    4549    _interface_map = interface._interface_map;
    4650#endif
     51#ifdef VHDL_TESTBENCH
     52    _list_cycle    = interface._list_cycle;
     53#endif
     54
    4755    log_printf(FUNC,Behavioural,"Interface (copy)","End");
    4856  };
     
    5462    if (_list_signal->empty()== false)
    5563      {
    56         list<Signal*>::iterator i     = _list_signal->begin();
     64        list<Signal*>::iterator i = _list_signal->begin();
    5765
    5866        while (i != _list_signal->end())
     
    6472
    6573    delete _list_signal;
     74
     75#ifdef VHDL_TESTBENCH
     76    delete _list_cycle ;
     77#endif
     78
    6679    log_printf(FUNC,Behavioural,"~Interface","End");
    6780  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_signal.cpp

    r38 r40  
    1515  {
    1616    log_printf(FUNC,Behavioural,"get_signal","Begin");
     17
    1718    uint32_t               depth          = 0;
    1819    string                 separator      = ",\n";
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_print.cpp

    r38 r40  
    1919    output_stream << x.get_comment() << endl;
    2020    output_stream << x.get_signal () << endl;
     21
     22#ifdef VHDL_TESTBENCH
     23    if (x._list_cycle->empty()== false)
     24      {
     25        list<string>::iterator i = x._list_cycle->begin();
     26
     27        while (i != x._list_cycle->end())
     28          {
     29            output_stream << "\n\t" << *i ;
     30            ++i;
     31          }
     32      }
     33#endif
     34
    2135    log_printf(FUNC,Behavioural,"operator<<","End");
    2236    return output_stream;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp

    r38 r40  
    1 #ifdef VHDL
    21/*
    32 * $Id$
     
    1312namespace behavioural          {
    1413
     14#ifdef VHDL
    1515  void Interface::set_port (Vhdl * & vhdl)
    1616  {
     
    3131    log_printf(FUNC,Behavioural,"set_port (Vhdl)","End");
    3232  };
     33#endif
    3334
     35#ifdef VHDL_TESTBENCH
    3436  void Interface::set_port (Vhdl_Testbench * & vhdl_testbench)
    3537  {
     
    5052    log_printf(FUNC,Behavioural,"set_port (Testbench)","End");
    5153  };
    52 
     54#endif
    5355}; // end namespace behavioural         
    5456}; // end namespace morpheo             
    55 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp

    r38 r40  
    66 */
    77
    8 #include "Include/ChangeCase.h"
    98#include "Behavioural/include/Interface.h"
    109
     
    1817  {
    1918    log_printf(FUNC,Behavioural,"set_signal","Begin");
    20     string str_direction =  toString(direction);
    21     string str_interface = _name;
    22     string str_signal    =  name;
    2319
    24     LowerCase(str_direction);   
    25     UpperCase(str_interface);
    26     UpperCase(str_signal   );
    27    
    28     string signame = str_direction;
    29     if (_name != "")
    30       signame += "_"+str_interface;
    31     if (name  != "")
    32       signame += "_"+str_signal;
     20    string signame = signal_name(_name, name, direction);
    3321
    3422    Signal * sig = new Signal (signame      ,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_testbench.cpp

    r38 r40  
    1212namespace morpheo              {
    1313namespace behavioural          {
     14
     15  void Interface::testbench_cycle (void)
     16  {
     17    // note : if defined(VHDL_TESTBENCH) then defined(SYSTEMC)
     18    _list_cycle->push_back(toString(sc_simulation_time()));
     19  }
    1420
    1521  void Interface::testbench (Vhdl_Testbench * & vhdl_testbench)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp

    r38 r40  
    1414  {
    1515    log_printf(FUNC,Behavioural,"Interfaces","Begin");
    16     _list_interface = new list<Interface*>;
     16    _list_interface = new list<Interface_fifo*>;
    1717    log_printf(FUNC,Behavioural,"Interfaces","End");
    1818  };
     
    3131    if (_list_interface->empty()== false)
    3232      {
    33         list<Interface*>::iterator i     = _list_interface->begin();
     33        list<Interface_fifo*>::iterator i     = _list_interface->begin();
    3434
    3535        while (i != _list_interface->end())
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_find_interface.cpp

    r38 r40  
    1111namespace behavioural          {
    1212
    13   Interface * Interfaces::find_interface (string name)
     13  Interface_fifo * Interfaces::find_interface (string name)
    1414  {
    1515    if (_list_interface->empty()== false)
    1616      {
    17         list<Interface*>::iterator i     = _list_interface->begin();
     17        list<Interface_fifo*>::iterator i     = _list_interface->begin();
    1818
    1919        while (i != _list_interface->end())
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_get_interface.cpp

    r38 r40  
    1818    bool                   last_separator = false;
    1919
    20     list<Interface*>::iterator i  = _list_interface->begin();
     20    list<Interface_fifo*>::iterator i  = _list_interface->begin();
    2121    bool                   empty = _list_interface->empty();
    2222
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp

    r38 r40  
    1111namespace behavioural          {
    1212
    13   Interface * Interfaces::set_interface (string         name        ,
     13  Interface_fifo * Interfaces::set_interface (string         name        ,
    1414                                         direction_t    direction   ,
    1515                                         localisation_t localisation)
    1616  {
    17     Interface * interface = new Interface (name, direction, localisation);
     17    Interface_fifo * interface = new Interface_fifo (name, direction, localisation);
    1818   
    1919    _list_interface->push_back (interface);
     
    2222  };
    2323
    24   Interface * Interfaces::set_interface (string         name        ,
     24  Interface_fifo * Interfaces::set_interface (string         name        ,
    2525                                         direction_t    direction   ,
    2626                                         localisation_t localisation,
    2727                                         string         comment     )
    2828  {
    29     Interface * interface = set_interface(name, direction, localisation);
     29    Interface_fifo * interface = set_interface(name, direction, localisation);
    3030   
    3131    interface->set_comment (comment);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp

    r38 r40  
    1 #ifdef VHDL
    21/*
    32 * $Id$
     
    1312namespace behavioural          {
    1413
     14#ifdef VHDL
    1515  void Interfaces::set_port (Vhdl * & vhdl)
    1616  {
    1717    if (not _list_interface->empty())
    1818      {
    19         list<Interface*>::iterator i     = _list_interface->begin();
     19        list<Interface_fifo*>::iterator i     = _list_interface->begin();
    2020       
    2121        while (i != _list_interface->end())
     
    2626      }
    2727  };
     28#endif
    2829
     30
     31#ifdef VHDL_TESTBENCH
    2932  void Interfaces::set_port (Vhdl_Testbench * & vhdl_testbench)
    3033  {
    3134    if (not _list_interface->empty())
    3235      {
    33         list<Interface*>::iterator i     = _list_interface->begin();
     36        list<Interface_fifo*>::iterator i     = _list_interface->begin();
    3437       
    3538        while (i != _list_interface->end())
     
    4043      }
    4144  };
     45#endif
    4246
    4347}; // end namespace behavioural         
    4448}; // end namespace morpheo             
    45 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench.cpp

    r38 r40  
    1919    if (_list_interface->empty()== false)
    2020      {
    21         list<Interface*>::iterator i     = _list_interface->begin();
     21        list<Interface_fifo*>::iterator i     = _list_interface->begin();
    2222
    2323        while (i != _list_interface->end())
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_toXML.cpp

    r38 r40  
    1717    if (_list_interface->empty()== false)
    1818      {
    19         list<Interface*>::iterator i     = _list_interface->begin();
     19        list<Interface_fifo*>::iterator i     = _list_interface->begin();
    2020
    2121        while (i != _list_interface->end())
     
    3636    if (_list_interface->empty()== false)
    3737      {
    38         list<Interface*>::iterator i     = _list_interface->begin();
     38        list<Interface_fifo*>::iterator i     = _list_interface->begin();
    3939
    4040        while (i != _list_interface->end())
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp

    r38 r40  
    2222    log_printf(FUNC,Behavioural,"Signal","Begin");
    2323#ifdef VHDL_TESTBENCH
    24     _signal    = NULL;
    25     _type_info = UNKNOW;
     24    _signal     = NULL;
     25    _type_info  = UNKNOW;
     26    _list_value = new list<string>;
    2627#endif
    2728    log_printf(FUNC,Behavioural,"Signal","End");
     
    3637    log_printf(FUNC,Behavioural,"Signal (copy)","Begin");
    3738#ifdef VHDL_TESTBENCH
    38     _signal    = signal._signal   ;
    39     _type_info = signal._type_info;
     39    _signal     = signal._signal    ;
     40    _type_info  = signal._type_info ;
     41    _list_value = signal._list_value;
    4042#endif
    4143    log_printf(FUNC,Behavioural,"Signal (copy)","End");
     
    4547  {
    4648    log_printf(FUNC,Behavioural,"~Signal","Begin");
     49#ifdef VHDL_TESTBENCH
     50    delete _list_value;
     51#endif
    4752    log_printf(FUNC,Behavioural,"~Signal","End");
    4853  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_print.cpp

    r38 r40  
    99
    1010namespace morpheo              {
    11 
    12  
    13 
    1411namespace behavioural          {
    1512
     
    2219    output_stream << "\t{" << x._size << "}\t"
    2320                  << toString(x._direction)    << "\t"
    24                   << toString(x._presence_port)<< endl;
     21                  << toString(x._presence_port);
     22
     23// #ifdef VHDL_TESTBENCH
     24//     if (x._list_value->empty()== false)
     25//       {
     26//      list<string>::iterator i = x._list_value->begin();
     27
     28//      while (i != x._list_value->end())
     29//        {
     30//          output_stream << "\n\t" << *i ;
     31//          ++i;
     32//        }
     33//       }
     34// #endif
    2535
    2636    log_printf(FUNC,Behavioural,"operator<<","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp

    r38 r40  
    2020        (_presence_port == PORT_VHDL_NO_TESTBENCH_YES))
    2121      {
     22        string str;
     23
    2224        switch (_type_info)
    2325          {
    2426          case BOOL     :
    2527            {
     28              bool value = read <bool> ();
     29
    2630              switch (_direction)
    2731                {
    28                 case IN    : {vhdl_testbench->add_input (static_cast<sc_in  <bool    > *>(_signal)->read()); break; }
    29                 case OUT   : {vhdl_testbench->add_output(static_cast<sc_out <bool    > *>(_signal)->read()); break; }
     32                case IN    : {vhdl_testbench->add_input (value);
     33                              str =             toBase2 (value); break;}
     34                case OUT   : {vhdl_testbench->add_output(value);
     35                              str =             toBase2 (value); break;}
    3036                case INOUT : {break;}
    3137                }
     
    3440          case UINT8_T  :
    3541            {
     42              uint8_t value = read <uint8_t> ();
     43
    3644              switch (_direction)
    3745                {
    38                 case IN    : {vhdl_testbench->add_input (static_cast<sc_in  <uint8_t > *>(_signal)->read()); break; }
    39                 case OUT   : {vhdl_testbench->add_output(static_cast<sc_out <uint8_t > *>(_signal)->read()); break; }
     46                case IN    : {vhdl_testbench->add_input (value);
     47                              str =             toBase2 (value,_size); break;}
     48                case OUT   : {vhdl_testbench->add_output(value);
     49                              str =             toBase2 (value,_size); break;}
    4050                case INOUT : {break;}
    4151                }
     
    4454          case UINT16_T :
    4555            {
     56              uint16_t value = read <uint16_t> ();
     57
    4658              switch (_direction)
    4759                {
    48                 case IN    : {vhdl_testbench->add_input (static_cast<sc_in  <uint16_t> *>(_signal)->read()); break; }
    49                 case OUT   : {vhdl_testbench->add_output(static_cast<sc_out <uint16_t> *>(_signal)->read()); break; }
    50                 case INOUT : {break;}
     60                case IN    : {vhdl_testbench->add_input (value);
     61                              str =             toBase2 (value,_size); break;}
     62                case OUT   : {vhdl_testbench->add_output(value);
     63                              str =             toBase2 (value,_size); break;}
     64                case INOUT : {break;}           
    5165                }
    5266              break;
     
    5468          case UINT32_T :
    5569            {
     70              uint32_t value = read <uint32_t> ();
     71
    5672              switch (_direction)
    5773                {
    58                 case IN    : {vhdl_testbench->add_input (static_cast<sc_in  <uint32_t> *>(_signal)->read()); break; }
    59                 case OUT   : {vhdl_testbench->add_output(static_cast<sc_out <uint32_t> *>(_signal)->read()); break; }
     74                case IN    : {vhdl_testbench->add_input (value);
     75                              str =             toBase2 (value,_size); break;}
     76                case OUT   : {vhdl_testbench->add_output(value);
     77                              str =             toBase2 (value,_size); break;}
    6078                case INOUT : {break;}
    6179                }
     
    6482          case UINT64_T :
    6583            {
     84              uint64_t value = read <uint64_t> ();
     85
    6686              switch (_direction)
    6787                {
    68                 case IN    : {vhdl_testbench->add_input (static_cast<sc_in  <uint64_t> *>(_signal)->read()); break; }
    69                 case OUT   : {vhdl_testbench->add_output(static_cast<sc_out <uint64_t> *>(_signal)->read()); break; }
     88                case IN    : {vhdl_testbench->add_input (value);
     89                              str =             toBase2 (value,_size); break;}
     90                case OUT   : {vhdl_testbench->add_output(value);
     91                              str =             toBase2 (value,_size); break;}
    7092                case INOUT : {break;}
    7193                }
     
    7698          }
    7799
     100        _list_value->push_back(str);
    78101      }
    79102
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench.cpp

    r2 r40  
    1313namespace behavioural          {
    1414
    15   Vhdl_Testbench::Vhdl_Testbench  (string   name       ):
    16     _name        (name       )
     15  Vhdl_Testbench::Vhdl_Testbench  (string   name       ,
     16                                   bool     exhaustive ):
     17    _name        (name       ),
     18    _exhaustive  (exhaustive )
    1719  {
    1820    _vhdl = new Vhdl (_name + "_Testbench");
     
    2628  Vhdl_Testbench::~Vhdl_Testbench ()
    2729  {
     30    delete _vhdl;
    2831  };
    2932 
Note: See TracChangeset for help on using the changeset viewer.