Ignore:
Timestamp:
May 31, 2007, 11:22:29 PM (17 years ago)
Author:
rosiere
Message:

Interface et vhdl_testbench : l'appel aux fonction add_input et add_ouput est maintenant réalisé par la classe Interface (et autre).

2 remarques :

  • tester avec des sous composants (en particulier les sorties d'un est directement relié au sortie d'un autre)
  • Signal_testbench.cpp -> l'optimisé (par exemple pointeur de fonction afin d'éviter le test et le switch)
File:
1 edited

Legend:

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

    r31 r38  
    99 */
    1010
     11#ifdef SYSTEMC
     12#include "systemc.h"
     13#endif
     14
    1115#include <stdint.h>
    1216#include <iostream>
     17
     18#ifdef VHDL_TESTBENCH
     19#include "Behavioural/include/Vhdl_Testbench.h"
     20#endif
     21
    1322#include "Behavioural/include/Direction.h"
    1423#include "Behavioural/include/XML.h"
     24#include "Include/ErrorMorpheo.h"
    1525#include "Include/ToString.h"
    1626#include "Include/Debug.h"
     
    2030namespace morpheo              {
    2131namespace behavioural          {
     32
     33  typedef enum {UNKNOW                     ,
     34                BOOL                       ,
     35                UINT8_T                    ,
     36                UINT16_T                   ,
     37                UINT32_T                   ,
     38                UINT64_T                   } type_info_t;
    2239
    2340  typedef enum {PORT_VHDL_YES_TESTBENCH_YES,
     
    3653  private   : const presence_port_t _presence_port;
    3754
     55#ifdef VHDL_TESTBENCH
     56  private   : void *                _signal       ;
     57  private   : type_info_t           _type_info    ;
     58#endif
     59
    3860    // -----[ methods ]---------------------------------------------------
    3961  public    :                   Signal          (string          name          ,
     
    4365  public    :                   Signal          (const Signal &);
    4466  public    :                   ~Signal         ();
     67
     68#ifdef VHDL_TESTBENCH
     69  public    : void              testbench       (Vhdl_Testbench * & vhdl_testbench);
     70
     71  public    : template <typename T>
     72              void              alloc           (void * port)
     73    {
     74      if (_type_info != UNKNOW)
     75        throw (ErrorMorpheo ("Signal \""+_name+"\" : already allocate."));
     76
     77      _signal    = port;
     78
     79      if (typeid(T) == typeid(bool    ))
     80        _type_info = BOOL;
     81      else
     82      if (typeid(T) == typeid(uint8_t ))
     83        _type_info = UINT8_T;
     84      else
     85      if (typeid(T) == typeid(uint16_t))
     86        _type_info = UINT16_T;
     87      else
     88      if (typeid(T) == typeid(uint32_t))
     89        _type_info = UINT32_T;
     90      else
     91      if (typeid(T) == typeid(uint64_t))
     92        _type_info = UINT64_T;
     93      else
     94        _type_info = UNKNOW;
     95    }
     96#endif
    4597
    4698  public    : XML               toXML           (void);
Note: See TracChangeset for help on using the changeset viewer.