Ignore:
Timestamp:
Jul 5, 2007, 5:50:19 PM (17 years ago)
Author:
rosiere
Message:

Modification des classes d'encapsulation des interfaces :

  • gère les signaux à écrire dans le vhdl
  • les traces pour le testbench
  • la génération des vhdl structurelles

-> test sur la Pattern History Table

File:
1 edited

Legend:

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

    r41 r42  
    3333  class Interface
    3434  {
    35     friend class Interfaces;
    36 
    3735    // -----[ fields ]----------------------------------------------------
    3836  protected : const string          _name         ;
     37#ifdef POSITION
    3938  protected : const direction_t     _direction    ;
    4039  protected : const localisation_t  _localisation ;
    4140  protected :       string          _comment      ;
     41#endif
    4242
    4343  protected : list<Signal *>      * _list_signal  ;
     
    5454   
    5555    // -----[ methods ]---------------------------------------------------
    56   public    :                       Interface            (string         name        ,
    57                                                           direction_t    direction   ,
    58                                                           localisation_t localisation);
     56  public    :                       Interface            (string         name       
     57#ifdef POSITION
     58                                                          ,direction_t    direction   
     59                                                          ,localisation_t localisation
     60#endif
     61                                                          );
    5962
    6063  public    :                       Interface            (const Interface    & interface);
    6164  public    :                       ~Interface           ();
    6265
     66  public    : string                get_name             ();
     67
     68#ifdef POSITION
    6369  public    : void                  set_comment          (string comment);
    6470  protected : string                get_comment          (void          );
     71#endif
    6572
    6673  protected : string                signal_name          (string      name_interface,
    6774                                                          string      name_signal   ,
    6875                                                          direction_t direction     );
     76
     77  public    : Signal *              find_signal          (string name);
     78  public    : bool                  find_signal          (Signal * signal);
    6979
    7080  protected : string                get_signal           (void);
     
    7383                                                          uint32_t        size     ,
    7484                                                          presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES);
     85  public    : list<Signal *>      * get_signal_list      (void);
    7586
    7687#ifdef SYSTEMC
     
    8596        throw ErrorMorpheo ("Signal \""+name+"\" is a clock, bad presence_port.");
    8697
    87       Signal    * sig    = set_signal (name, IN , size, presence_port);
    88       sc_in_clk * signal = new sc_in_clk (sig->_name.c_str());
     98      Signal    * sig  = set_signal (name, IN , size, presence_port);
     99      sc_in_clk * port = new sc_in_clk (sig->_name.c_str());
     100
     101      sig->alloc<bool> (static_cast<void *>(port));
    89102
    90103      log_printf(FUNC,Behavioural,"set_signal_clk","End");
    91104
    92       return signal;
     105      return port;
    93106    };
    94107
     
    104117        throw ErrorMorpheo ("Signal \""+name+"\" is not a clock, bad presence_port.");
    105118
    106       Signal * sig = set_signal (name, IN , size, presence_port);
     119      Signal    * sig = set_signal (name, IN , size, presence_port);
    107120      sc_in <T> * port = new sc_in <T> (sig->_name.c_str());
    108 #ifdef VHDL_TESTBENCH
     121
    109122      sig->alloc<T> (static_cast<void *>(port));
    110 #endif
    111123
    112124      log_printf(FUNC,Behavioural,"set_signal_in","End");
     
    128140      Signal * sig = set_signal (name, OUT , size, presence_port);
    129141      sc_out <T> * port = new sc_out <T> (sig->_name.c_str());
    130 #ifdef VHDL_TESTBENCH
     142
    131143      sig->alloc<T> (static_cast<void *>(port));
    132 #endif
    133144
    134145      log_printf(FUNC,Behavioural,"set_signal_out","End");
     
    136147      return port;
    137148    };
     149
     150  public    : template <typename T>
     151              sc_signal <T> *       set_signal_internal (string   name,
     152                                                         uint32_t size)
     153    {
     154      log_printf(FUNC,Behavioural,"set_signal_internal","Begin");
     155
     156      Signal * sig = set_signal (name, INTERNAL , size, PORT_VHDL_NO_TESTBENCH_NO);
     157      sc_signal <T> * port = new sc_signal <T> (sig->_name.c_str());
     158
     159      sig->alloc<T> (static_cast<void *>(port));
     160
     161      log_printf(FUNC,Behavioural,"set_signal_internal","End");
     162
     163      return port;
     164    };
     165
    138166#endif
    139167
    140168#ifdef VHDL
    141169  public    : void                  set_port             (Vhdl * & vhdl);
    142 #ifdef VHDL_TESTBENCH
     170#  ifdef VHDL_TESTBENCH
    143171  public    : void                  set_signal           (Vhdl * & vhdl);
    144172  public    : void                  get_signal           (list<string> * & list_signal);
    145 #endif
     173#  endif
    146174#endif
    147175#ifdef VHDL_TESTBENCH
    148176  public    : uint32_t              get_cycle            (void);
    149   public    : string                get_clock            (void);
     177  public    : Signal *              get_clock            (void);
     178  public    : Signal *              get_reset            (void);
    150179
    151180  public    : void                  testbench            (void);
    152181  public    : void                  testbench_cycle      (void);
    153182  public    : void                  testbench_body       (Vhdl           * & vhdl          ,
    154                                                           string             counter_name  );
     183                                                          string             counter_name  ,
     184                                                          string             reset_name    );
    155185  public    : string                testbench_test       (Vhdl           * & vhdl        ,
    156                                                           string             counter_name);
     186                                                          string             counter_name,
     187                                                          string             reset_name);
    157188  public    : string                testbench_test_ok    (Vhdl           * & vhdl        );
    158189  protected : string                testbench_test_name   (Vhdl           * & vhdl);
    159190  protected : string                testbench_test_ok_name(Vhdl           * & vhdl);
    160 
    161 #endif
    162 
    163 #ifdef POSITION
    164   public    : void                  port_map             (void * entity,
     191  protected : string                testbench_test_transaction_name(Vhdl           * & vhdl);
     192#endif
     193
     194#ifdef POSITION
     195  public    : void                  interface_map        (void * entity,
    165196                                                          void * interface);
    166 #endif
    167 
    168197  public    : XML                   toXML                (void);
    169 #ifdef POSITION
    170198  public    : XML                   toXML_mapping        (void);
    171199#endif
Note: See TracChangeset for help on using the changeset viewer.