1
|
open Mini_vhdl_ast
|
2
|
open Vhdl_ast
|
3
|
open Vhdl_ast_pp
|
4
|
|
5
|
let rec pp_mini_vhdl_component_instantiation_t :
|
6
|
Format.formatter ->
|
7
|
mini_vhdl_component_instantiation_t -> Ppx_deriving_runtime.unit
|
8
|
=
|
9
|
let __4 () = pp_vhdl_assoc_element_t
|
10
|
|
11
|
and __3 () = pp_vhdl_assoc_element_t
|
12
|
|
13
|
and __2 () = pp_vhdl_entity_t
|
14
|
|
15
|
and __1 () = pp_vhdl_architecture_t
|
16
|
|
17
|
and __0 () = pp_vhdl_name_t
|
18
|
in
|
19
|
((let open! Ppx_deriving_runtime in
|
20
|
fun fmt ->
|
21
|
fun x ->
|
22
|
Format.fprintf fmt "@[<v 2>";
|
23
|
((__0 ()) fmt) x.name;
|
24
|
Format.fprintf fmt "__";
|
25
|
((__0 ()) fmt) x.archi.name;
|
26
|
Format.fprintf fmt "__";
|
27
|
((__0 ()) fmt) x.entity.name;
|
28
|
(match x.generic_map with
|
29
|
| [] -> Format.fprintf fmt "";
|
30
|
| _ ->
|
31
|
(Format.fprintf fmt " generic map (@[<v 2>";
|
32
|
((fun x ->
|
33
|
ignore
|
34
|
(List.fold_left
|
35
|
(fun sep ->
|
36
|
fun x ->
|
37
|
if sep then Format.fprintf fmt ",@,";
|
38
|
((__3 ()) fmt) x;
|
39
|
true) false x))) x.generic_map;
|
40
|
Format.fprintf fmt ")@]@;"));
|
41
|
(match x.port_map with
|
42
|
| [] -> Format.fprintf fmt ";";
|
43
|
| _ ->
|
44
|
(Format.fprintf fmt " port map (@[<v 2>";
|
45
|
((fun x ->
|
46
|
ignore
|
47
|
(List.fold_left
|
48
|
(fun sep ->
|
49
|
fun x ->
|
50
|
if sep then Format.fprintf fmt ",@,";
|
51
|
((__4 ()) fmt) x;
|
52
|
true) false x))) x.port_map;
|
53
|
Format.fprintf fmt ")@];"));
|
54
|
Format.fprintf fmt "@]")
|
55
|
[@ocaml.warning "-A"])
|
56
|
|
57
|
and show_mini_vhdl_component_instantiation_t :
|
58
|
mini_vhdl_component_instantiation_t -> Ppx_deriving_runtime.string =
|
59
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_component_instantiation_t x
|
60
|
|
61
|
let rec pp_mini_vhdl_concurrent_stmt_t :
|
62
|
Format.formatter ->
|
63
|
mini_vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit
|
64
|
=
|
65
|
let __3 () = pp_mini_vhdl_component_instantiation_t
|
66
|
|
67
|
and __2 () = pp_vhdl_selected_signal_t
|
68
|
|
69
|
and __1 () = pp_vhdl_process_t
|
70
|
|
71
|
and __0 () = pp_vhdl_conditional_signal_t
|
72
|
in
|
73
|
((let open! Ppx_deriving_runtime in
|
74
|
fun fmt ->
|
75
|
function
|
76
|
| SigAssign a0 ->
|
77
|
((__0 ()) fmt) a0;
|
78
|
| Process a0 ->
|
79
|
((__1 ()) fmt) a0;
|
80
|
| SelectedSig a0 ->
|
81
|
((__2 ()) fmt) a0;
|
82
|
| ComponentInst a0 ->
|
83
|
((__3 ()) fmt) a0;
|
84
|
)
|
85
|
[@ocaml.warning "-A"])
|
86
|
|
87
|
and show_mini_vhdl_concurrent_stmt_t :
|
88
|
mini_vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.string =
|
89
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_concurrent_stmt_t x
|
90
|
|
91
|
let rec pp_mini_vhdl_component_t :
|
92
|
Format.formatter -> mini_vhdl_component_t -> Ppx_deriving_runtime.unit =
|
93
|
let __6 () = pp_mini_vhdl_concurrent_stmt_t
|
94
|
|
95
|
and __5 () = pp_vhdl_definition_t
|
96
|
|
97
|
and __4 () = pp_vhdl_declaration_t
|
98
|
|
99
|
and __3 () = pp_vhdl_load_t
|
100
|
|
101
|
and __2 () = pp_vhdl_port_t
|
102
|
|
103
|
and __1 () = pp_vhdl_port_t
|
104
|
|
105
|
and __0 () = pp_vhdl_name_t
|
106
|
in
|
107
|
((let open! Ppx_deriving_runtime in
|
108
|
fun fmt ->
|
109
|
fun x ->
|
110
|
Format.fprintf fmt "@[<v 2>component ";
|
111
|
(match x.names with
|
112
|
| [] -> ()
|
113
|
| _ ->
|
114
|
((fun x ->
|
115
|
ignore
|
116
|
(List.fold_left
|
117
|
(fun sep ->
|
118
|
fun x ->
|
119
|
if sep then Format.fprintf fmt "__";
|
120
|
((__0 ()) fmt) x;
|
121
|
true) false x))) x.names);
|
122
|
Format.fprintf fmt " is";
|
123
|
(match x.generics with
|
124
|
| [] -> ()
|
125
|
| _ ->
|
126
|
Format.fprintf fmt "@;generics (@[";
|
127
|
((fun x ->
|
128
|
ignore
|
129
|
(List.fold_left
|
130
|
(fun sep ->
|
131
|
fun x ->
|
132
|
if sep then Format.fprintf fmt ",@ ";
|
133
|
((__1 ()) fmt) x;
|
134
|
true) false x))) x.generics;
|
135
|
Format.fprintf fmt "@]);");
|
136
|
(match x.ports with
|
137
|
| [] -> ()
|
138
|
| _ ->
|
139
|
Format.fprintf fmt "@;ports (@[";
|
140
|
((fun x ->
|
141
|
ignore
|
142
|
(List.fold_left
|
143
|
(fun sep ->
|
144
|
fun x ->
|
145
|
if sep then Format.fprintf fmt ",@ ";
|
146
|
((__2 ()) fmt) x;
|
147
|
true) false x))) x.ports;
|
148
|
Format.fprintf fmt "@]);");
|
149
|
(match x.contexts with
|
150
|
| [] -> ()
|
151
|
| _ ->
|
152
|
Format.fprintf fmt "@;";
|
153
|
((fun x ->
|
154
|
ignore
|
155
|
(List.fold_left
|
156
|
(fun sep ->
|
157
|
fun x ->
|
158
|
if sep then Format.fprintf fmt ";@;";
|
159
|
((__3 ()) fmt) x;
|
160
|
true) false x))) x.contexts);
|
161
|
(match x.declarations with
|
162
|
| [] -> ()
|
163
|
| _ ->
|
164
|
Format.fprintf fmt "@;";
|
165
|
((fun x ->
|
166
|
ignore
|
167
|
(List.fold_left
|
168
|
(fun sep ->
|
169
|
fun x ->
|
170
|
if sep then Format.fprintf fmt "@;";
|
171
|
((__4 ()) fmt) x;
|
172
|
Format.fprintf fmt ";";
|
173
|
true) false x))) x.declarations);
|
174
|
(match x.definitions with
|
175
|
| [] -> ()
|
176
|
| _ ->
|
177
|
Format.fprintf fmt "@;";
|
178
|
((fun x ->
|
179
|
ignore
|
180
|
(List.fold_left
|
181
|
(fun sep ->
|
182
|
fun x ->
|
183
|
if sep then Format.fprintf fmt "@;";
|
184
|
((__5 ()) fmt) x;
|
185
|
Format.fprintf fmt ";";
|
186
|
true) false x))) x.definitions);
|
187
|
Format.fprintf fmt "@]@;@[<v 2>begin";
|
188
|
(match x.body with
|
189
|
| [] -> ()
|
190
|
| _ ->
|
191
|
Format.fprintf fmt "@;";
|
192
|
((fun x ->
|
193
|
ignore
|
194
|
(List.fold_left
|
195
|
(fun sep ->
|
196
|
fun x ->
|
197
|
if sep then Format.fprintf fmt "@;";
|
198
|
((__6 ()) fmt) x;
|
199
|
true) false x))) x.body);
|
200
|
Format.fprintf fmt "@]@;end;")
|
201
|
[@ocaml.warning "-A"])
|
202
|
|
203
|
and show_mini_vhdl_component_t :
|
204
|
mini_vhdl_component_t -> Ppx_deriving_runtime.string =
|
205
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_component_t x
|
206
|
|
207
|
let rec pp_mini_vhdl_design_file_t :
|
208
|
Format.formatter -> mini_vhdl_design_file_t -> Ppx_deriving_runtime.unit =
|
209
|
let __1 () = pp_vhdl_package_t
|
210
|
|
211
|
and __0 () = pp_mini_vhdl_component_t
|
212
|
in
|
213
|
((let open! Ppx_deriving_runtime in
|
214
|
fun fmt ->
|
215
|
fun x ->
|
216
|
Format.fprintf fmt "@[<v>";
|
217
|
((fun x ->
|
218
|
ignore
|
219
|
(List.fold_left
|
220
|
(fun sep ->
|
221
|
fun x ->
|
222
|
if sep then Format.fprintf fmt "@;";
|
223
|
Format.fprintf fmt "package ";
|
224
|
((__1 ()) fmt) x;
|
225
|
true) false x))) x.packages;
|
226
|
(match x.components with
|
227
|
| [] -> ()
|
228
|
| _ ->
|
229
|
Format.fprintf fmt "@;";
|
230
|
((fun x ->
|
231
|
ignore
|
232
|
(List.fold_left
|
233
|
(fun sep ->
|
234
|
fun x ->
|
235
|
if sep then Format.fprintf fmt "@;";
|
236
|
((__0 ()) fmt) x;
|
237
|
true) false x))) x.components);
|
238
|
Format.fprintf fmt "@]")
|
239
|
[@ocaml.warning "-A"])
|
240
|
|
241
|
and show_mini_vhdl_design_file_t :
|
242
|
mini_vhdl_design_file_t -> Ppx_deriving_runtime.string =
|
243
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_design_file_t x
|