Changeset 29


Ignore:
Timestamp:
May 23, 2007, 6:17:08 PM (17 years ago)
Author:
rosiere
Message:

Changement de classes de gestions des Interfaces.

-> simplification pour les déclarations de ports, application pour le composant Select_Priority_Fixed.
-> !!! essayer de supprimer la redondance dans les fichierx xxx_vhdl_testbench_transition.cpp

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural
Files:
22 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/configuration.cfg

    r15 r29  
    11Select_Priority_Fixed
    2 2       16      *2      # nb_entity
    3 0       1       +1      # encoding_one_hot
     216      16      *2      # nb_entity
     30       0       +1      # encoding_one_hot
    441       1       +1      # encoding_compact
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h

    r15 r29  
    1919#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Parameters.h"
    2020#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h"
     21#include "Behavioural/include/Interfaces.h"
     22
    2123#ifdef STATISTICS
    2224#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Statistics.h"
     
    5961  private   : Vhdl_Testbench                 * _vhdl_testbench;
    6062#endif
     63
     64  private   : Interfaces                     * interfaces;
    6165
    6266#ifdef SYSTEMC
     
    113117#if VHDL                                       
    114118  public  : void     vhdl                      (void);
    115   private : void     vhdl_port                 (Vhdl & vhdl);
    116   private : void     vhdl_declaration          (Vhdl & vhdl);
    117   private : void     vhdl_body                 (Vhdl & vhdl);
     119  private : void     vhdl_port                 (Vhdl * & vhdl);
     120  private : void     vhdl_declaration          (Vhdl * & vhdl);
     121  private : void     vhdl_body                 (Vhdl * & vhdl);
    118122#endif                                         
    119123                                               
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp

    r15 r29  
    3232    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin");
    3333
     34#ifdef SYSTEMC
     35    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation");
     36
     37    allocation ();
     38#endif
     39
     40#ifdef POSITION
     41    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Position");
     42   
     43   
     44#endif
     45
    3446#ifdef STATISTICS
    3547    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
     
    4860    //  -> clock's signals
    4961    _vhdl_testbench = new Vhdl_Testbench (_name);
    50 //     _vhdl_testbench->set_clock    ("in_CLOCK",false);
    5162#endif
    5263
     
    5869#endif
    5970
    60 #ifdef VHDL_TESTBENCH
    61     _vhdl_testbench->set_clock    ("in_CLOCK",true);
    62 #endif
    63 
    6471#ifdef SYSTEMC
    65     log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation");
    66 
    67     allocation ();
    68 
    6972#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    7073    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition");
     
    98101   
    99102#endif   
    100 
    101103#endif
    102104    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp

    r15 r29  
    1515namespace select_priority_fixed {
    1616
    17 
    1817  void Select_Priority_Fixed::allocation (void)
    1918  {
     
    2221    log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin");
    2322
    24      in_CLOCK        = new SC_CLOCK           ("in_CLOCK ");
    25      in_NRESET       = new SC_IN (Tcontrol_t) ("in_NRESET");
     23    interfaces = new Interfaces;
     24
     25    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     26    Interface interface_ ("", IN, WEST);
     27   
     28    in_CLOCK        = interface_.set_signal_clk              ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO);
     29    in_NRESET       = interface_.set_signal_in  <Tcontrol_t> ("nreset",1);
    2630
    2731     in_VAL          = new SC_IN (Tcontrol_t)           * [_param._nb_entity];
     
    3135    for (uint32_t i=0; i<_param._nb_entity; i++)
    3236      {
    33         rename = " in_VAL_"+toString(i);
    34          in_VAL [i]      = new SC_IN (Tcontrol_t) (rename.c_str());
    35 
     37         in_VAL [i]    = interface_.set_signal_in  <Tcontrol_t> ("val_"+toString(i),1);
    3638        if (_param._encoding_one_hot)
    37           {
    38         rename = "out_ACK_"+toString(i);
    39         out_ACK [i]      = new SC_OUT(Tcontrol_t) (rename.c_str());
    40           }
     39        out_ACK [i]    = interface_.set_signal_out <Tcontrol_t> ("ack_"+toString(i),1);
    4140      }
    4241
    4342    if (_param._encoding_compact)
    4443      {
    45         out_ENTITY_ACK   = new SC_OUT(Tcontrol_t)           ("out_entity_ack");
    46         out_ENTITY       = new SC_OUT(Tentity_t)            ("out_entity");
     44        out_ENTITY     = interface_.set_signal_out <Tentity_t > ("entity"    , _param._size_entity);
     45        out_ENTITY_ACK = interface_.set_signal_out <Tcontrol_t> ("entity_ack", 1);
    4746      }
     47
    4848    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    4949
     
    5454}; // end namespace select
    5555}; // end namespace generic
    56 
    5756}; // end namespace behavioural
    5857}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_deallocation.cpp

    r15 r29  
    4040    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    4141
     42    delete interfaces;
     43
    4244    log_printf(FUNC,Select_Priority_Fixed,"deallocation","End");
    4345  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl.cpp

    r15 r29  
    2020  {
    2121    log_printf(FUNC,Select_Priority_Fixed,"vhdl","Begin");
    22     Vhdl vhdl (_name);
    2322
    24     vhdl.set_library_work (_name + "_Pack");
     23    Vhdl * vhdl = new Vhdl (_name);
     24
     25    vhdl->set_library_work (_name + "_Pack");
    2526
    2627    vhdl_port        (vhdl);
     
    2829    vhdl_body        (vhdl);
    2930
    30     vhdl.generate_file();
     31    vhdl->generate_file();
    3132    log_printf(FUNC,Select_Priority_Fixed,"vhdl","End");
    3233
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_body.cpp

    r15 r29  
    1616
    1717
    18   void Select_Priority_Fixed::vhdl_body (Vhdl & vhdl)
     18  void Select_Priority_Fixed::vhdl_body (Vhdl * & vhdl)
    1919  {
    2020    log_printf(FUNC,Select_Priority_Fixed,"vhdl_body","Begin");
    21     vhdl.set_body ("");
     21    vhdl->set_body ("");
    2222
    23     vhdl.set_body("internal_entity <=");
     23    vhdl->set_body("internal_entity <=");
    2424    for (uint32_t i=0; i<_param._nb_entity; i++)
    2525      {
    26         vhdl.set_body("\t"+std_logic_conv(_param._size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else");
     26        vhdl->set_body("\t"+std_logic_conv(_param._size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else");
    2727      }
    28     vhdl.set_body("\t"+std_logic_conv(_param._size_entity+1,1<<_param._size_entity)+";");
    29     vhdl.set_body ("");
     28    vhdl->set_body("\t"+std_logic_conv(_param._size_entity+1,1<<_param._size_entity)+";");
     29    vhdl->set_body ("");
    3030
    3131    if (_param._encoding_one_hot)
    3232      {
    3333        for (uint32_t i=0; i<_param._nb_entity; i++)
    34           vhdl.set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param._size_entity+1)+" = "+std_logic_conv(_param._size_entity+1,i)+" else '0';");
    35         vhdl.set_body ("");
     34          vhdl->set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param._size_entity+1)+" = "+std_logic_conv(_param._size_entity+1,i)+" else '0';");
     35        vhdl->set_body ("");
    3636      }
    3737
    3838    if (_param._encoding_compact)
    3939      {
    40         vhdl.set_body ("out_ENTITY     <=     internal_entity"+std_logic_range(_param._size_entity-1,                  0)+";");
    41         vhdl.set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param._size_entity  ,_param._size_entity)+";");
     40        vhdl->set_body ("out_ENTITY     <=     internal_entity"+std_logic_range(_param._size_entity-1,                  0)+";");
     41        vhdl->set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param._size_entity  ,_param._size_entity)+";");
    4242      }   
    4343   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_declaration.cpp

    r15 r29  
    1616
    1717
    18   void Select_Priority_Fixed::vhdl_declaration (Vhdl & vhdl)
     18  void Select_Priority_Fixed::vhdl_declaration (Vhdl * & vhdl)
    1919  {
    2020    log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","Begin");
    2121
    22     vhdl.set_signal("internal_entity",_param._size_entity+1);
     22    vhdl->set_signal("internal_entity",_param._size_entity+1);
    2323
    2424    log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_port.cpp

    r15 r29  
    99#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.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 
    17 namespace morpheo                    {
     11namespace morpheo {
    1812namespace behavioural {
    1913namespace generic {
     
    2115namespace select_priority_fixed {
    2216
    23 
    24   void Select_Priority_Fixed::vhdl_port (Vhdl & vhdl)
     17  void Select_Priority_Fixed::vhdl_port (Vhdl * & vhdl)
    2518  {
    2619    log_printf(FUNC,Select_Priority_Fixed,"vhdl_port","Begin");
    2720
    28     vhdl.set_port (" in_CLOCK ", IN, 1);
    29     VHDL_SET_PORT (" in_NRESET", IN, 1);
    30        
    31     for (uint32_t i=0; i<_param._nb_entity; i++)
    32       {
    33         VHDL_SET_PORT (" in_VAL_"+toString(i) , IN, 1);
    34         if (_param._encoding_one_hot)
    35         VHDL_SET_PORT ("out_ACK_"+toString(i) ,OUT, 1);
    36       }
    37     if (_param._encoding_compact)
    38       {
    39     VHDL_SET_PORT ("out_ENTITY    ",OUT,_param._size_entity);
    40     VHDL_SET_PORT ("out_ENTITY_ACK",OUT,1);
    41       }
    42     log_printf(FUNC,Select_Priority_Fixed,"vhdl_port","End");
     21#ifdef VHDL
     22    interfaces->set_port(vhdl);
     23#endif
     24#ifdef VHDL_TESTBENCH
     25    interfaces->set_port(_vhdl_testbench);                     
     26   _vhdl_testbench->set_clock    ("in_CLOCK",true);
     27#endif   
     28
     29   log_printf(FUNC,Select_Priority_Fixed,"vhdl_port","End");
    4330  };
    4431
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags

    r23 r29  
    1414
    1515#-----[ Flags ]--------------------------------------------
    16 FLAGS                           =       -DVHDL                  \
     16FLAGS                           =       -DSYSTEMC               \
     17                                        -DVHDL                  \
    1718                                        -DVHDL_TESTBENCH        \
    18                                         -DSYSTEMC               \
    1919                                        -DSTATISTICS            \
    20                                         -DCONFIGURATION         \
     20                                        -DPOSITION              \
     21                                        -DCONFIGURATION         \
    2122                                        -DDEBUG=DEBUG_ALL   
    2223                                       
    2324# Flags :
    2425# DEBUG={level}                 - Print Debug Message
    25 # VHDL                          - To generate a vhdl's    model
    2626# SYSTEMC                       - To generate a systemc's model
    27 # CONFIGURATION                 - To generate a configuration file (it's input of viewer)
     27# VHDL                          - To generate a vhdl's    models
     28# VHDL_TESTBENCH (need SYSTEMC) - In the simulation, generate two testbench's file (input and ouput) to validate the vhdl's model
    2829# STATISTICS     (need SYSTEMC) - In the simulation, generate a statistics's file
    29 # VHDL_TESTBENCH (need SYSTEMC) - In the simulation, generate two testbench's file (input and ouput) to validate the vhdl's model
     30# POSITION                      - To generate a position's files     (it's input of viewer)
     31# CONFIGURATION                 - To generate a configuration's file (it's input of viewer and generator)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h

    r25 r29  
    4444    // -----[ methods ]---------------------------------------------------
    4545  public    :                  Vhdl                        (string name);
    46   public    : virtual          ~Vhdl                       ();
     46  public    :                  ~Vhdl                       ();
    4747                                                           
    4848  public    : void             generate_file               (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h

    r3 r29  
    4040  public   : bool             singleton_end       (void);
    4141  public   : bool             attribut            (string name, string value);
     42  public   : bool             insert_XML          (XML    xml );
    4243
    4344  public   : void             generate_file       (void);
Note: See TracChangeset for help on using the changeset viewer.