Ignore:
Timestamp:
Apr 14, 2009, 8:39:12 PM (15 years ago)
Author:
rosiere
Message:

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

File:
1 edited

Legend:

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

    r98 r113  
    77 * $Id$
    88 *
    9  * [ Description ]
     9 * [ Description ]
    1010 *
    1111 */
     
    1414#include <iostream>
    1515#include <list>
     16#include <map>
    1617#include "Common/include/Environment.h"
    1718#include "Behavioural/include/Direction.h"
     
    2324  namespace behavioural          {
    2425
     26#define VHDL_EXTENSION ".vhdl"
     27
     28    typedef enum
     29      {
     30        VHDL_SEVERITY_NOTE   ,
     31        VHDL_SEVERITY_WARNING,
     32        VHDL_SEVERITY_ERROR  ,
     33        VHDL_SEVERITY_FAILURE
     34      } vhdl_severity_t;
     35   
    2536    std::string  std_logic        (uint32_t size);
    2637    std::string  std_logic_conv   (uint32_t size, std::string   value);
     
    3748    class Vhdl
    3849    {
    39       // -----[ fields ]----------------------------------------------------
    40     private   : const std::string     _name                         ;
    41 
    42     private   : std::list<std::string>     _list_library_work            ;
    43     private   : std::list<std::string>     _list_signal                  ;
    44     private   : std::list<std::string>     _list_type                    ;
    45     private   : std::list<std::string>     _list_alias                   ;
    46     private   : std::list<std::string>     _list_port                    ;
    47     private   : std::list<std::string>     _list_body                    ;
    48 
    49       // -----[ methods ]---------------------------------------------------
    50     public    :                  Vhdl                        (std::string name);
     50      typedef struct
     51      {
     52        std::list<std::string> _list_signal;
     53        std::list<std::string> _list_type  ;
     54        std::list<std::string> _list_alias ;
     55        std::list<std::string> _list_body  ;
     56        std::list<std::string> _list_debug ;
     57      } vhdl_architecture_t;
     58
     59      // -----[ fields ]----------------------------------------------------
     60    private   : const std::string                         _name;
     61    private   : const std::string                         _id;
     62
     63    private   : std::list<std::string>                    _list_library;
     64      // Entity
     65//  private   : std::string                               _port_clock;
     66    private   : std::list<std::string>                    _list_port;
     67      // Architecture
     68    public    : const std::string                         _name_architecture_default;
     69    private   :       std::string                         _name_architecture;
     70    private   : std::map<std::string,vhdl_architecture_t> _architecture;
     71
     72      // -----[ methods ]---------------------------------------------------
     73    public    :                  Vhdl                        (std::string name,
     74                                                              std::string id="");
    5175    public    :                  ~Vhdl                       ();
    5276
     
    6488    private   : std::string      get_model                   (uint32_t    depth                 ,
    6589                                                              std::string filename              ,
    66                                                               std::string entity_name           ,
    67                                                               std::string architecture_name     );
     90                                                              std::string entity_name           );
    6891    private   : std::string      get_header                  (uint32_t    depth                 ,
    6992                                                              std::string filename              );
    7093    private   : std::string      get_entity                  (uint32_t    depth                 ,
    7194                                                              std::string name                  );
     95    private   : void             test_architecture           (void);
     96    private   : std::string      test_architecture           (std::string name                  );
     97    public    : std::string      set_architecture            (std::string name                  );
    7298    private   : std::string      get_architecture            (uint32_t    depth                 ,
    73                                                               std::string name                  ,
    7499                                                              std::string entity_name           );
     100    private   : std::string      get_configuration           (uint32_t    depth                 ,
     101                                                              std::string entity_name           ,
     102                                                              std::string configuration_name    );
    75103    private   : std::string      get_component               (uint32_t    depth                 ,
    76104                                                              std::string name                  );
     
    83111                                                              direction_t direction             ,
    84112                                                              uint32_t    size                  );
     113//  public    : void             set_port_clock              (std::string name                  );
    85114    private   : std::string      get_signal                  (uint32_t    depth                 );
    86115    public    : void             set_signal                  (std::string name                  ,
     
    136165    public    : void             set_body_component          (std::string  name_instance        ,
    137166                                                              std::string  name_component       ,
     167                                                              std::string  name_architecture    ,
     168                                                              std::string  name_package         ,
    138169                                                              std::list<std::string>   list_port_map);
    139170    public    : void             set_body_component_port_map (std::list<std::string> & list_port_map,
     
    147178                                                              std::string  text                 );
    148179
    149     private   : std::string      get_library_ieee            (uint32_t     depth                );
    150     private   : std::string      get_library_work            (uint32_t     depth                );
     180    public    : void             set_debug                   (std::string  condition            ,
     181                                                              std::string  text                 ,
     182                                                              vhdl_severity_t severity = VHDL_SEVERITY_NOTE);
     183    private   : std::string      get_debug                   (uint32_t     depth                );
     184
     185    private   : std::string      get_library                 (uint32_t     depth                );
     186    private   : std::string      get_library_default         (uint32_t     depth                );
     187    private   : void             set_library_default         (void                              );
     188    public    : void             set_library                 (std::string  library_name         ,
     189                                                              std::string  package_name         ,
     190                                                              std::string  declarative_unit="all");
    151191    public    : void             set_library_work            (std::string  package_name         );
    152192
     
    154194    };
    155195
     196    std::string vhdl_get_id (std::string model_name);
     197
    156198  }; // end namespace behavioural         
     199
     200  template<> inline std::string toString<morpheo::behavioural::vhdl_severity_t>(const morpheo::behavioural::vhdl_severity_t& x)
     201  {
     202    switch (x)
     203      {
     204      case morpheo::behavioural::VHDL_SEVERITY_NOTE    : return "note"   ; break;
     205      case morpheo::behavioural::VHDL_SEVERITY_WARNING : return "warning"; break;
     206      case morpheo::behavioural::VHDL_SEVERITY_ERROR   : return "error"  ; break;
     207      case morpheo::behavioural::VHDL_SEVERITY_FAILURE : return "failure"; break;
     208      default : return ""; break;
     209      }
     210  };
     211
    157212}; // end namespace morpheo             
    158213
Note: See TracChangeset for help on using the changeset viewer.