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

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

register_unit : systemc et VHDL ok

File size: 6.9 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 max , uint32_t min  );
31  string std_logic_range  (uint32_t size);
32  string std_logic_others (uint32_t size, uint32_t cst  );
33
34  class Vhdl
35  {
36    // -----[ fields ]----------------------------------------------------
37  private   : const string     _name                         ;
38
39  private   : list<string>     _list_library_work            ;
40  private   : list<string>     _list_signal                  ;
41  private   : list<string>     _list_type                    ;
42  private   : list<string>     _list_alias                   ;
43  private   : list<string>     _list_port                    ;
44  private   : list<string>     _list_body                    ;
45   
46    // -----[ methods ]---------------------------------------------------
47  public    :                  Vhdl                        (string name);
48  public    :                  ~Vhdl                       ();
49                                                           
50  public    : void             generate_file               (void);
51  public    : void             generate_file               (bool generate_package,
52                                                            bool generate_model  );
53
54  private   : void             generate_file_package       (void);
55  private   : void             generate_file_model         (void);
56 
57  private   : string           get_package                 (uint32_t    depth                 ,
58                                                            string      filename              ,
59                                                            string      package_name          ,
60                                                            string      entity_name           );
61  private   : string           get_model                   (uint32_t    depth                 ,
62                                                            string      filename              ,
63                                                            string      entity_name           ,
64                                                            string      architecture_name     );
65  private   : string           get_header                  (uint32_t    depth                 ,
66                                                            string      filename              );
67  private   : string           get_entity                  (uint32_t    depth                 ,
68                                                            string      name                  );
69  private   : string           get_architecture            (uint32_t    depth                 , 
70                                                            string      name                  ,
71                                                            string      entity_name           );
72  private   : string           get_component               (uint32_t    depth                 ,
73                                                            string      name                  );
74
75  private   : string           get_port                    (uint32_t    depth                 );
76  public    : void             set_port                    (string      name                  ,
77                                                            direction_t direction             ,
78                                                            string      type                  );
79  public    : void             set_port                    (string      name                  ,
80                                                            direction_t direction             ,
81                                                            uint32_t    size                  );
82  private   : string           get_signal                  (uint32_t    depth                 );
83  public    : void             set_signal                  (string      name                  ,
84                                                            string      type                  );
85  public    : void             set_signal                  (string      name                  ,
86                                                            uint32_t    signal                );
87  public    : void             set_signal                  (string      name                  ,
88                                                            string      type                  ,
89                                                            string      init                  );
90  public    : void             set_signal                  (string      name                  ,
91                                                            uint32_t    size                  ,
92                                                            string      init                  );
93  public    : void             set_signal                  (string      name                  ,
94                                                            uint32_t    size                  ,
95                                                            uint32_t    init                  );
96  public    : void             set_constant                (string      name                  ,
97                                                            string      type                  ,
98                                                            string      init                  );
99  public    : void             set_constant                (string      name                  ,
100                                                            uint32_t    size                  ,
101                                                            string      init                  );
102  public    : void             set_constant                (string      name                  ,
103                                                            uint32_t    size                  ,
104                                                            uint32_t    init                  );
105
106  private   : string           get_type                    (uint32_t    depth                 );
107  public    : void             set_type                    (string      name                  ,
108                                                            string      type                  );
109  private   : string           get_alias                   (uint32_t    depth                 );
110  public    : void             set_alias                   (string      name1                 ,
111                                                            string      type1                 ,
112                                                            string      name2                 ,
113                                                            string      range2                );
114
115  public    : string           get_list                    (list<string> liste                ,
116                                                            uint32_t     depth                ,
117                                                            string       separator            ,
118                                                            bool         last_separator       );
119  public    : void             set_list                    (list<string> & liste              ,
120                                                            string         text               );
121
122  private   : string           get_body                    (uint32_t       depth              );
123  public    : void             set_body                    (string         text               );
124
125  public    : void             set_body_component          (string         name_instance      ,
126                                                            string         name_component     ,
127                                                            list<string>   list_port_map      );
128  public    : void             set_body_component_port_map (list<string> & list_port_map      ,
129                                                            string         name_port          ,
130                                                            uint32_t       size_port          ,
131                                                            string         name_signal        ,
132                                                            uint32_t       size_signal        );
133
134  private   : string           get_library_ieee            (uint32_t    depth                 );
135  private   : string           get_library_work            (uint32_t    depth                 );
136  public    : void             set_library_work            (string      package_name          );
137
138  private   : string           direction_toString          (direction_t direction);
139  };
140
141}; // end namespace behavioural         
142}; // end namespace morpheo             
143
144#endif
145#endif
Note: See TracBrowser for help on using the repository browser.