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

Last change on this file since 98 was 98, checked in by rosiere, 15 years ago

1) Fix bug (read unit, RAT -> write in R0, SPR desallocation ...)
2) Change VHDL Execute_queue -> use Generic/Queue?
3) Complete document on VHDL generation
4) Add soc test

  • Property svn:keywords set to Id
File size: 9.6 KB
Line 
1#ifdef VHDL
2
3#ifndef morpheo_behavioural_Vhdl_h
4#define morpheo_behavioural_Vhdl_h
5
6/*
7 * $Id: Vhdl.h 98 2008-12-31 10:18:08Z rosiere $
8 *
9 * [ Description ]
10 *
11 */
12
13#include <stdint.h>
14#include <iostream>
15#include <list>
16#include "Common/include/Environment.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
22namespace morpheo              {
23  namespace behavioural          {
24
25    std::string  std_logic        (uint32_t size);
26    std::string  std_logic_conv   (uint32_t size, std::string   value);
27    std::string  std_logic_conv   (uint32_t size, uint32_t value);
28    std::string  std_logic_cst    (uint32_t size, uint32_t value);
29    std::string  std_logic_range  (uint32_t size, uint32_t max , uint32_t min );
30    std::string  std_logic_range  (               uint32_t max , uint32_t min );
31    std::string  std_logic_range  (uint32_t size                              );
32    std::string _std_logic_range  (uint32_t size, uint32_t max , uint32_t min );
33    std::string _std_logic_range  (               uint32_t max , uint32_t min );
34    std::string _std_logic_range  (uint32_t size                              );
35    std::string  std_logic_others (uint32_t size, bool cst);
36
37    class Vhdl
38    {
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);
51    public    :                  ~Vhdl                       ();
52
53    public    : void             generate_file               (void);
54    public    : void             generate_file               (bool generate_package,
55                                                              bool generate_model  );
56
57    private   : void             generate_file_package       (void);
58    private   : void             generate_file_model         (void);
59     
60    private   : std::string      get_package                 (uint32_t    depth                 ,
61                                                              std::string filename              ,
62                                                              std::string package_name          ,
63                                                              std::string entity_name           );
64    private   : std::string      get_model                   (uint32_t    depth                 ,
65                                                              std::string filename              ,
66                                                              std::string entity_name           ,
67                                                              std::string architecture_name     );
68    private   : std::string      get_header                  (uint32_t    depth                 ,
69                                                              std::string filename              );
70    private   : std::string      get_entity                  (uint32_t    depth                 ,
71                                                              std::string name                  );
72    private   : std::string      get_architecture            (uint32_t    depth                 , 
73                                                              std::string name                  ,
74                                                              std::string entity_name           );
75    private   : std::string      get_component               (uint32_t    depth                 ,
76                                                              std::string name                  );
77     
78    private   : std::string      get_port                    (uint32_t    depth                 );
79    public    : void             set_port                    (std::string name                  ,
80                                                              direction_t direction             ,
81                                                              std::string type                  );
82    public    : void             set_port                    (std::string name                  ,
83                                                              direction_t direction             ,
84                                                              uint32_t    size                  );
85    private   : std::string      get_signal                  (uint32_t    depth                 );
86    public    : void             set_signal                  (std::string name                  ,
87                                                              std::string type                  );
88    public    : void             set_signal                  (std::string name                  ,
89                                                              uint32_t    size                  );
90    public    : void             set_signal                  (std::string name                  ,
91                                                              std::string type                  ,
92                                                              std::string init                  );
93    public    : void             set_signal                  (std::string name                  ,
94                                                              uint32_t    size                  ,
95                                                              std::string init                  );
96    public    : void             set_signal                  (std::string name                  ,
97                                                              uint32_t    size                  ,
98                                                              uint32_t    init                  );
99    public    : void             set_constant                (std::string name                  ,
100                                                              std::string type                  ,
101                                                              std::string init                  );
102    public    : void             set_constant                (std::string name                  ,
103                                                              uint32_t    size                  ,
104                                                              std::string init                  );
105    public    : void             set_constant                (std::string name                  ,
106                                                              uint32_t    size                  ,
107                                                              uint32_t    init                  );
108
109    private   : std::string      get_type                    (uint32_t    depth                 );
110    public    : void             set_type                    (std::string name                  ,
111                                                              std::string type                  );
112    private   : std::string      get_alias                   (uint32_t    depth                 );
113    public    : void             set_alias                   (std::string name1                 ,
114                                                              std::string type1                 ,
115                                                              std::string name2                 ,
116                                                              std::string range2                );
117    public    : void             set_alias                   (std::string name1                 ,
118                                                              uint32_t    size1                 ,
119                                                              std::string name2                 ,
120                                                              std::string range2                );
121     
122    public    : std::string      get_list                    (std::list<std::string> liste      ,
123                                                              uint32_t     depth                ,
124                                                              std::string  separator            ,
125                                                              bool         last_separator       );
126    public    : void             set_list                    (std::list<std::string> & liste    ,
127                                                              std::string  text                 );
128
129    private   : std::string      get_body                    (uint32_t     depth                );
130    public    : void             set_body                    (std::string  text                 );
131    public    : void             set_body                    (uint32_t     depth                ,
132                                                              std::string  text                 );
133                                                                                   
134    public    : void             set_body                    (uint32_t     depth                ,
135                                                              Vhdl *       vhdl                 );
136    public    : void             set_body_component          (std::string  name_instance        ,
137                                                              std::string  name_component       ,
138                                                              std::list<std::string>   list_port_map);
139    public    : void             set_body_component_port_map (std::list<std::string> & list_port_map,
140                                                              std::string  name_port            ,
141                                                              uint32_t     size_port            ,
142                                                              std::string  name_signal          ,
143                                                              uint32_t     size_signal          );
144
145    public    : void             set_comment                 (std::string  text                 );
146    public    : void             set_comment                 (uint32_t     depth                ,
147                                                              std::string  text                 );
148
149    private   : std::string      get_library_ieee            (uint32_t     depth                );
150    private   : std::string      get_library_work            (uint32_t     depth                );
151    public    : void             set_library_work            (std::string  package_name         );
152
153    private   : std::string      direction_toString          (direction_t  direction            );
154    };
155
156  }; // end namespace behavioural         
157}; // end namespace morpheo             
158
159#endif
160#endif
Note: See TracBrowser for help on using the repository browser.