source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h @ 67

Last change on this file since 67 was 67, checked in by rosiere, 17 years ago

Ajout d'un nouveau composant : fifo generic (un port lecture et un port ecriture).

File size: 7.0 KB
Line 
1#ifdef VHDL
2
3#ifndef morpheo_behavioural_Vhdl_h
4#define morpheo_behavioural_Vhdl_h
5
6/*
7 * $Id$
8 *
9 * [ Description ]
10 *
11 */
12
13#include <stdint.h>
14#include <iostream>
15#include <list>
16#include "Behavioural/include/Environnement.h"
17#include "Behavioural/include/Direction.h"
18#include "Common/include/ToString.h"
19#include "Common/include/Debug.h"
20#include "Common/include/ErrorMorpheo.h"
21
22using namespace std;
23
24namespace morpheo              {
25namespace behavioural          {
26
27  string std_logic        (uint32_t size);
28  string std_logic_conv   (uint32_t size, string   value);
29  string std_logic_conv   (uint32_t size, uint32_t value);
30  string std_logic_range  (uint32_t size, uint32_t max , uint32_t min  );
31  string std_logic_range  (uint32_t max , uint32_t min  );
32  string std_logic_range  (uint32_t size);
33  string std_logic_others (uint32_t size, uint32_t cst  );
34
35  class Vhdl
36  {
37    // -----[ fields ]----------------------------------------------------
38  private   : const string     _name                         ;
39
40  private   : list<string>     _list_library_work            ;
41  private   : list<string>     _list_signal                  ;
42  private   : list<string>     _list_type                    ;
43  private   : list<string>     _list_alias                   ;
44  private   : list<string>     _list_port                    ;
45  private   : list<string>     _list_body                    ;
46   
47    // -----[ methods ]---------------------------------------------------
48  public    :                  Vhdl                        (string name);
49  public    :                  ~Vhdl                       ();
50                                                           
51  public    : void             generate_file               (void);
52  public    : void             generate_file               (bool generate_package,
53                                                            bool generate_model  );
54
55  private   : void             generate_file_package       (void);
56  private   : void             generate_file_model         (void);
57 
58  private   : string           get_package                 (uint32_t    depth                 ,
59                                                            string      filename              ,
60                                                            string      package_name          ,
61                                                            string      entity_name           );
62  private   : string           get_model                   (uint32_t    depth                 ,
63                                                            string      filename              ,
64                                                            string      entity_name           ,
65                                                            string      architecture_name     );
66  private   : string           get_header                  (uint32_t    depth                 ,
67                                                            string      filename              );
68  private   : string           get_entity                  (uint32_t    depth                 ,
69                                                            string      name                  );
70  private   : string           get_architecture            (uint32_t    depth                 , 
71                                                            string      name                  ,
72                                                            string      entity_name           );
73  private   : string           get_component               (uint32_t    depth                 ,
74                                                            string      name                  );
75
76  private   : string           get_port                    (uint32_t    depth                 );
77  public    : void             set_port                    (string      name                  ,
78                                                            direction_t direction             ,
79                                                            string      type                  );
80  public    : void             set_port                    (string      name                  ,
81                                                            direction_t direction             ,
82                                                            uint32_t    size                  );
83  private   : string           get_signal                  (uint32_t    depth                 );
84  public    : void             set_signal                  (string      name                  ,
85                                                            string      type                  );
86  public    : void             set_signal                  (string      name                  ,
87                                                            uint32_t    signal                );
88  public    : void             set_signal                  (string      name                  ,
89                                                            string      type                  ,
90                                                            string      init                  );
91  public    : void             set_signal                  (string      name                  ,
92                                                            uint32_t    size                  ,
93                                                            string      init                  );
94  public    : void             set_signal                  (string      name                  ,
95                                                            uint32_t    size                  ,
96                                                            uint32_t    init                  );
97  public    : void             set_constant                (string      name                  ,
98                                                            string      type                  ,
99                                                            string      init                  );
100  public    : void             set_constant                (string      name                  ,
101                                                            uint32_t    size                  ,
102                                                            string      init                  );
103  public    : void             set_constant                (string      name                  ,
104                                                            uint32_t    size                  ,
105                                                            uint32_t    init                  );
106
107  private   : string           get_type                    (uint32_t    depth                 );
108  public    : void             set_type                    (string      name                  ,
109                                                            string      type                  );
110  private   : string           get_alias                   (uint32_t    depth                 );
111  public    : void             set_alias                   (string      name1                 ,
112                                                            string      type1                 ,
113                                                            string      name2                 ,
114                                                            string      range2                );
115
116  public    : string           get_list                    (list<string> liste                ,
117                                                            uint32_t     depth                ,
118                                                            string       separator            ,
119                                                            bool         last_separator       );
120  public    : void             set_list                    (list<string> & liste              ,
121                                                            string         text               );
122
123  private   : string           get_body                    (uint32_t       depth              );
124  public    : void             set_body                    (string         text               );
125
126  public    : void             set_body_component          (string         name_instance      ,
127                                                            string         name_component     ,
128                                                            list<string>   list_port_map      );
129  public    : void             set_body_component_port_map (list<string> & list_port_map      ,
130                                                            string         name_port          ,
131                                                            uint32_t       size_port          ,
132                                                            string         name_signal        ,
133                                                            uint32_t       size_signal        );
134
135  private   : string           get_library_ieee            (uint32_t    depth                 );
136  private   : string           get_library_work            (uint32_t    depth                 );
137  public    : void             set_library_work            (string      package_name          );
138
139  private   : string           direction_toString          (direction_t direction);
140  };
141
142}; // end namespace behavioural         
143}; // end namespace morpheo             
144
145#endif
146#endif
Note: See TracBrowser for help on using the repository browser.