1
|
open Vhdl_ast
|
2
|
|
3
|
let rec (pp_vhdl_cst_val_t :
|
4
|
Format.formatter -> vhdl_cst_val_t -> Ppx_deriving_runtime.unit)
|
5
|
=
|
6
|
((let open! Ppx_deriving_runtime in
|
7
|
fun fmt ->
|
8
|
function
|
9
|
| CstInt a0 ->
|
10
|
(Format.fprintf fmt "%d") a0;
|
11
|
| CstStdLogic a0 ->
|
12
|
(Format.fprintf fmt "%S") a0;
|
13
|
| CstLiteral a0 ->
|
14
|
(Format.fprintf fmt "%s") a0;)
|
15
|
[@ocaml.warning "-A"])
|
16
|
|
17
|
and show_vhdl_cst_val_t : vhdl_cst_val_t -> Ppx_deriving_runtime.string =
|
18
|
fun x -> Format.asprintf "%a" pp_vhdl_cst_val_t x
|
19
|
|
20
|
let rec pp_vhdl_type_t :
|
21
|
Format.formatter -> vhdl_type_t -> Ppx_deriving_runtime.unit =
|
22
|
let __4 () = pp_vhdl_name_t
|
23
|
|
24
|
and __3 () = pp_vhdl_element_declaration_t
|
25
|
|
26
|
and __2 () = pp_vhdl_subtype_indication_t
|
27
|
|
28
|
and __1 () = pp_vhdl_constraint_t
|
29
|
|
30
|
and __0 () = pp_vhdl_name_t
|
31
|
in
|
32
|
((let open! Ppx_deriving_runtime in
|
33
|
fun fmt ->
|
34
|
function
|
35
|
| Base a0 ->
|
36
|
(Format.fprintf fmt "%s") a0;
|
37
|
| Range (a0,a1,a2) ->
|
38
|
((
|
39
|
(Format.fprintf fmt "%d") a1);
|
40
|
((function
|
41
|
| None -> Format.pp_print_string fmt ""
|
42
|
| Some x ->
|
43
|
(Format.fprintf fmt "%s") x;
|
44
|
)) a0;
|
45
|
(Format.fprintf fmt "%d") a2);
|
46
|
| Bit_vector (a0,a1) ->
|
47
|
(Format.fprintf fmt "array (%d,%d) of bit") a0 a1;
|
48
|
| Array
|
49
|
{ indexes = aindexes; const = aconst; definition = adefinition }
|
50
|
->
|
51
|
Format.fprintf fmt "array";
|
52
|
(match aindexes with
|
53
|
| [] -> Format.fprintf fmt "";
|
54
|
| _ ->
|
55
|
Format.fprintf fmt "(@[<v>";
|
56
|
((fun x ->
|
57
|
ignore
|
58
|
(List.fold_left
|
59
|
(fun sep ->
|
60
|
fun x ->
|
61
|
if sep then Format.fprintf fmt ",@ ";
|
62
|
((__0 ()) fmt) x;
|
63
|
Format.fprintf fmt " range <>";
|
64
|
true) false x)) aindexes);
|
65
|
Format.fprintf fmt ")@]");
|
66
|
(function
|
67
|
| None -> Format.pp_print_string fmt ""
|
68
|
| Some x ->
|
69
|
((__1 ()) fmt) x) aconst;
|
70
|
Format.fprintf fmt " of ";
|
71
|
((__2 ()) fmt) adefinition;
|
72
|
| Record a0 ->
|
73
|
Format.fprintf fmt "@[<v 2>record@;";
|
74
|
(fun x ->
|
75
|
ignore
|
76
|
(List.fold_left
|
77
|
(fun sep ->
|
78
|
fun x ->
|
79
|
if sep then ();
|
80
|
((__3 ()) fmt) x;
|
81
|
Format.fprintf fmt ";@;";
|
82
|
true) false x);
|
83
|
Format.fprintf fmt "@]end record") a0;
|
84
|
| Enumerated a0 ->
|
85
|
(Format.fprintf fmt "(";
|
86
|
((fun x ->
|
87
|
ignore
|
88
|
(List.fold_left
|
89
|
(fun sep ->
|
90
|
fun x ->
|
91
|
if sep then Format.fprintf fmt ",@ ";
|
92
|
((__4 ()) fmt) x;
|
93
|
true) false x))) a0;
|
94
|
Format.fprintf fmt ")");
|
95
|
| Void -> Format.pp_print_string fmt "")
|
96
|
[@ocaml.warning "-A"])
|
97
|
|
98
|
and show_vhdl_type_t : vhdl_type_t -> Ppx_deriving_runtime.string =
|
99
|
fun x -> Format.asprintf "%a" pp_vhdl_type_t x
|
100
|
|
101
|
and pp_vhdl_element_declaration_t :
|
102
|
Format.formatter -> vhdl_element_declaration_t -> Ppx_deriving_runtime.unit
|
103
|
=
|
104
|
let __1 () = pp_vhdl_subtype_indication_t
|
105
|
|
106
|
and __0 () = pp_vhdl_name_t
|
107
|
in
|
108
|
((let open! Ppx_deriving_runtime in
|
109
|
fun fmt ->
|
110
|
fun x ->
|
111
|
(fun x ->
|
112
|
ignore
|
113
|
(List.fold_left
|
114
|
(fun sep ->
|
115
|
fun x ->
|
116
|
if sep then Format.fprintf fmt ", ";
|
117
|
((__0 ()) fmt) x;
|
118
|
true) false x)) x.names;
|
119
|
Format.fprintf fmt ": ";
|
120
|
((__1 ()) fmt) x.definition)
|
121
|
[@ocaml.warning "-A"])
|
122
|
|
123
|
and show_vhdl_element_declaration_t :
|
124
|
vhdl_element_declaration_t -> Ppx_deriving_runtime.string =
|
125
|
fun x -> Format.asprintf "%a" pp_vhdl_element_declaration_t x
|
126
|
|
127
|
and pp_vhdl_subtype_indication_t :
|
128
|
Format.formatter -> vhdl_subtype_indication_t -> Ppx_deriving_runtime.unit
|
129
|
=
|
130
|
let __2 () = pp_vhdl_constraint_t
|
131
|
|
132
|
and __1 () = pp_vhdl_name_t
|
133
|
|
134
|
and __0 () = pp_vhdl_name_t
|
135
|
in
|
136
|
((let open! Ppx_deriving_runtime in
|
137
|
fun fmt ->
|
138
|
fun x ->
|
139
|
((__0 ()) fmt) x.name;
|
140
|
((__1 ()) fmt) x.functionName;
|
141
|
(match x.const with
|
142
|
| NoConstraint -> Format.fprintf fmt "";
|
143
|
| _ -> Format.fprintf fmt " ";
|
144
|
((__2 ()) fmt) x.const))
|
145
|
[@ocaml.warning "-A"])
|
146
|
|
147
|
and show_vhdl_subtype_indication_t :
|
148
|
vhdl_subtype_indication_t -> Ppx_deriving_runtime.string =
|
149
|
fun x -> Format.asprintf "%a" pp_vhdl_subtype_indication_t x
|
150
|
|
151
|
and pp_vhdl_discrete_range_t :
|
152
|
Format.formatter -> vhdl_discrete_range_t -> Ppx_deriving_runtime.unit =
|
153
|
let __3 () = pp_vhdl_expr_t
|
154
|
|
155
|
and __2 () = pp_vhdl_expr_t
|
156
|
|
157
|
and __1 () = pp_vhdl_name_t
|
158
|
|
159
|
and __0 () = pp_vhdl_subtype_indication_t
|
160
|
in
|
161
|
((let open! Ppx_deriving_runtime in
|
162
|
fun fmt ->
|
163
|
function
|
164
|
| SubDiscreteRange a0 ->
|
165
|
((__0 ()) fmt) a0;
|
166
|
| NamedRange a0 ->
|
167
|
((__1 ()) fmt) a0;
|
168
|
| DirectedRange { direction = adirection; from = afrom; _to = a_to }
|
169
|
->
|
170
|
((__2 ()) fmt) afrom;
|
171
|
(Format.fprintf fmt " %s ") adirection;
|
172
|
((__3 ()) fmt) a_to;
|
173
|
)
|
174
|
[@ocaml.warning "-A"])
|
175
|
|
176
|
and show_vhdl_discrete_range_t :
|
177
|
vhdl_discrete_range_t -> Ppx_deriving_runtime.string =
|
178
|
fun x -> Format.asprintf "%a" pp_vhdl_discrete_range_t x
|
179
|
|
180
|
(* TODO Adapt for: ArrayConstraint, RecordConstraint *)
|
181
|
and pp_vhdl_constraint_t :
|
182
|
Format.formatter -> vhdl_constraint_t -> Ppx_deriving_runtime.unit =
|
183
|
let __4 () = pp_vhdl_constraint_t
|
184
|
|
185
|
and __3 () = pp_vhdl_discrete_range_t
|
186
|
|
187
|
and __2 () = pp_vhdl_discrete_range_t
|
188
|
|
189
|
and __1 () = pp_vhdl_discrete_range_t
|
190
|
|
191
|
and __0 () = pp_vhdl_name_t
|
192
|
in
|
193
|
((let open! Ppx_deriving_runtime in
|
194
|
fun fmt ->
|
195
|
function
|
196
|
| RefConstraint { ref_name = aref_name } ->
|
197
|
(Format.fprintf fmt "(";
|
198
|
((__0 ()) fmt) aref_name;
|
199
|
Format.fprintf fmt ")");
|
200
|
| RangeConstraint { range = arange } ->
|
201
|
(Format.fprintf fmt "(";
|
202
|
((__1 ()) fmt) arange;
|
203
|
Format.fprintf fmt ")");
|
204
|
| IndexConstraint { ranges = aranges } ->
|
205
|
Format.fprintf fmt "(";
|
206
|
((fun x ->
|
207
|
ignore
|
208
|
(List.fold_left
|
209
|
(fun sep ->
|
210
|
fun x ->
|
211
|
if sep then Format.fprintf fmt ", ";
|
212
|
((__2 ()) fmt) x;
|
213
|
true) false x))) aranges;
|
214
|
Format.fprintf fmt ")";
|
215
|
| ArrayConstraint { ranges = aranges; sub = asub } ->
|
216
|
(Format.fprintf fmt "@[<2>ArrayConstraint {@,";
|
217
|
((Format.fprintf fmt "@[%s =@ " "ranges";
|
218
|
((fun x ->
|
219
|
Format.fprintf fmt "@[<2>[";
|
220
|
ignore
|
221
|
(List.fold_left
|
222
|
(fun sep ->
|
223
|
fun x ->
|
224
|
if sep then Format.fprintf fmt ";@ ";
|
225
|
((__3 ()) fmt) x;
|
226
|
true) false x);
|
227
|
Format.fprintf fmt "@,]@]")) aranges;
|
228
|
Format.fprintf fmt "@]");
|
229
|
Format.fprintf fmt ";@ ";
|
230
|
Format.fprintf fmt "@[%s =@ " "sub";
|
231
|
((__4 ()) fmt) asub;
|
232
|
Format.fprintf fmt "@]");
|
233
|
Format.fprintf fmt "@]}")
|
234
|
| RecordConstraint -> Format.pp_print_string fmt ""
|
235
|
| NoConstraint -> Format.pp_print_string fmt "")
|
236
|
[@ocaml.warning "-A"])
|
237
|
|
238
|
and show_vhdl_constraint_t : vhdl_constraint_t -> Ppx_deriving_runtime.string
|
239
|
= fun x -> Format.asprintf "%a" pp_vhdl_constraint_t x
|
240
|
|
241
|
and pp_vhdl_definition_t :
|
242
|
Format.formatter -> vhdl_definition_t -> Ppx_deriving_runtime.unit =
|
243
|
let __3 () = pp_vhdl_subtype_indication_t
|
244
|
|
245
|
and __2 () = pp_vhdl_name_t
|
246
|
|
247
|
and __1 () = pp_vhdl_type_t
|
248
|
|
249
|
and __0 () = pp_vhdl_name_t
|
250
|
in
|
251
|
((let open! Ppx_deriving_runtime in
|
252
|
fun fmt ->
|
253
|
function
|
254
|
| Type { name = aname; definition = adefinition } ->
|
255
|
Format.fprintf fmt "type ";
|
256
|
((__0 ()) fmt) aname;
|
257
|
Format.fprintf fmt " is ";
|
258
|
((__1 ()) fmt) adefinition;
|
259
|
| Subtype { name = aname; typ = atyp } ->
|
260
|
Format.fprintf fmt "subtype ";
|
261
|
((__2 ()) fmt) aname;
|
262
|
Format.fprintf fmt " is ";
|
263
|
((__3 ()) fmt) atyp;
|
264
|
)
|
265
|
[@ocaml.warning "-A"])
|
266
|
|
267
|
and show_vhdl_definition_t : vhdl_definition_t -> Ppx_deriving_runtime.string
|
268
|
= fun x -> Format.asprintf "%a" pp_vhdl_definition_t x
|
269
|
|
270
|
(* TODO adapt for Op (more than 2 operand), Time, Sig, suffixMod *)
|
271
|
and pp_vhdl_expr_t :
|
272
|
Format.formatter -> vhdl_expr_t -> Ppx_deriving_runtime.unit =
|
273
|
let __11 () = pp_vhdl_expr_t
|
274
|
|
275
|
and __10 () = pp_vhdl_element_assoc_t
|
276
|
|
277
|
and __9 () = pp_vhdl_name_t
|
278
|
|
279
|
and __8 () = pp_vhdl_element_assoc_t
|
280
|
|
281
|
and __7 () = pp_vhdl_suffix_selection_t
|
282
|
|
283
|
and __6 () = pp_vhdl_expr_t
|
284
|
|
285
|
and __5 () = pp_vhdl_signal_attributes_t
|
286
|
|
287
|
and __4 () = pp_vhdl_name_t
|
288
|
|
289
|
and __3 () = pp_vhdl_expr_t
|
290
|
|
291
|
and __2 () = pp_vhdl_name_t
|
292
|
|
293
|
and __1 () = pp_vhdl_cst_val_t
|
294
|
|
295
|
and __0 () = pp_vhdl_name_t
|
296
|
in
|
297
|
((let open! Ppx_deriving_runtime in
|
298
|
fun fmt ->
|
299
|
function
|
300
|
| Call a0 ->
|
301
|
((__0 ()) fmt) a0;
|
302
|
| Cst { value = avalue; unit_name = aunit_name } ->
|
303
|
((__1 ()) fmt) avalue;
|
304
|
(function
|
305
|
| None -> Format.pp_print_string fmt ""
|
306
|
| Some x ->
|
307
|
Format.fprintf fmt " ";
|
308
|
((__2 ()) fmt) x) aunit_name;
|
309
|
| Op { id = aid; args = aargs } ->
|
310
|
(match aargs with
|
311
|
| [] -> (Format.fprintf fmt "%s") aid;
|
312
|
| hd::[] ->
|
313
|
(Format.fprintf fmt "%s") aid;
|
314
|
((__3 ()) fmt) hd
|
315
|
| hd::(hd2::[]) ->
|
316
|
Format.fprintf fmt "(";
|
317
|
((__3 ()) fmt) hd;
|
318
|
(Format.fprintf fmt " %s ") aid;
|
319
|
((__3 ()) fmt) hd2;
|
320
|
Format.fprintf fmt ")"
|
321
|
| _ ->
|
322
|
(Format.fprintf fmt "@[<2>Op {@,";
|
323
|
((Format.fprintf fmt "@[%s =@ " "id";
|
324
|
(Format.fprintf fmt "%S") aid;
|
325
|
Format.fprintf fmt "@]");
|
326
|
Format.fprintf fmt ";@ ";
|
327
|
Format.fprintf fmt "@[%s =@ " "args";
|
328
|
((fun x ->
|
329
|
Format.fprintf fmt "@[<2>[";
|
330
|
ignore
|
331
|
(List.fold_left
|
332
|
(fun sep ->
|
333
|
fun x ->
|
334
|
if sep then Format.fprintf fmt ";@ ";
|
335
|
((__3 ()) fmt) x;
|
336
|
true) false x);
|
337
|
Format.fprintf fmt "@,]@]")) aargs;
|
338
|
Format.fprintf fmt "@]");
|
339
|
Format.fprintf fmt "@]}"))
|
340
|
| IsNull -> Format.pp_print_string fmt ""
|
341
|
| Time { value = avalue; phy_unit = aphy_unit } ->
|
342
|
(Format.fprintf fmt "@[<2>Time {@,";
|
343
|
((Format.fprintf fmt "@[%s =@ " "value";
|
344
|
(Format.fprintf fmt "%d") avalue;
|
345
|
Format.fprintf fmt "@]");
|
346
|
Format.fprintf fmt ";@ ";
|
347
|
Format.fprintf fmt "@[%s =@ " "phy_unit";
|
348
|
(Format.fprintf fmt "%S") aphy_unit;
|
349
|
Format.fprintf fmt "@]");
|
350
|
Format.fprintf fmt "@]}")
|
351
|
| Sig { name = aname; att = aatt } ->
|
352
|
(Format.fprintf fmt "--@[<2>Sig {@,";
|
353
|
((Format.fprintf fmt "@[%s =@ " "name";
|
354
|
((__4 ()) fmt) aname;
|
355
|
Format.fprintf fmt "@]");
|
356
|
Format.fprintf fmt ";@ ";
|
357
|
Format.fprintf fmt "@[%s =@ " "att";
|
358
|
((function
|
359
|
| None -> Format.pp_print_string fmt "None"
|
360
|
| Some x ->
|
361
|
(Format.pp_print_string fmt "(Some ";
|
362
|
((__5 ()) fmt) x;
|
363
|
Format.pp_print_string fmt ")"))) aatt;
|
364
|
Format.fprintf fmt "@]");
|
365
|
Format.fprintf fmt "@]}")
|
366
|
| SuffixMod { expr = aexpr; selection = aselection } ->
|
367
|
(Format.fprintf fmt "--@[<2>SuffixMod {@,";
|
368
|
((Format.fprintf fmt "@[%s =@ " "expr";
|
369
|
((__6 ()) fmt) aexpr;
|
370
|
Format.fprintf fmt "@]");
|
371
|
Format.fprintf fmt ";@ ";
|
372
|
Format.fprintf fmt "@[%s =@ " "selection";
|
373
|
((__7 ()) fmt) aselection;
|
374
|
Format.fprintf fmt "@]");
|
375
|
Format.fprintf fmt "@]}")
|
376
|
| Aggregate { elems = aelems } ->
|
377
|
(match aelems with
|
378
|
| [] -> Format.fprintf fmt "";
|
379
|
| _ ->
|
380
|
(Format.fprintf fmt "(@[";
|
381
|
((fun x ->
|
382
|
ignore
|
383
|
(List.fold_left
|
384
|
(fun sep ->
|
385
|
fun x ->
|
386
|
if sep then Format.fprintf fmt ", ";
|
387
|
((__8 ()) fmt) x;
|
388
|
true) false x))) aelems;
|
389
|
Format.fprintf fmt ")@]");)
|
390
|
| QualifiedExpression
|
391
|
{ type_mark = atype_mark; aggregate = aaggregate;
|
392
|
expression = aexpression }
|
393
|
->
|
394
|
((__9 ()) fmt) atype_mark;
|
395
|
Format.fprintf fmt "'";
|
396
|
(match aaggregate with
|
397
|
| [] -> Format.fprintf fmt "";
|
398
|
| _ ->
|
399
|
Format.fprintf fmt "(@[<v>";
|
400
|
((fun x ->
|
401
|
ignore
|
402
|
(List.fold_left
|
403
|
(fun sep ->
|
404
|
fun x ->
|
405
|
if sep then Format.fprintf fmt ",@ ";
|
406
|
((__10 ()) fmt) x;
|
407
|
true) false x))) aaggregate;
|
408
|
Format.fprintf fmt ")@]");
|
409
|
(match aexpression with
|
410
|
| None -> Format.pp_print_string fmt ""
|
411
|
| Some x ->
|
412
|
Format.fprintf fmt "(@[<v>";
|
413
|
((__11 ()) fmt) x;
|
414
|
Format.fprintf fmt ")@]");
|
415
|
| Others -> Format.pp_print_string fmt "others")
|
416
|
[@ocaml.warning "-A"])
|
417
|
|
418
|
and show_vhdl_expr_t : vhdl_expr_t -> Ppx_deriving_runtime.string =
|
419
|
fun x -> Format.asprintf "%a" pp_vhdl_expr_t x
|
420
|
|
421
|
and pp_vhdl_name_t :
|
422
|
Format.formatter -> vhdl_name_t -> Ppx_deriving_runtime.unit =
|
423
|
let __9 () = pp_vhdl_assoc_element_t
|
424
|
|
425
|
and __8 () = pp_vhdl_name_t
|
426
|
|
427
|
and __7 () = pp_vhdl_expr_t
|
428
|
|
429
|
and __6 () = pp_vhdl_name_t
|
430
|
|
431
|
and __5 () = pp_vhdl_name_t
|
432
|
|
433
|
and __4 () = pp_vhdl_discrete_range_t
|
434
|
|
435
|
and __3 () = pp_vhdl_name_t
|
436
|
|
437
|
and __2 () = pp_vhdl_expr_t
|
438
|
|
439
|
and __1 () = pp_vhdl_name_t
|
440
|
|
441
|
and __0 () = pp_vhdl_name_t
|
442
|
in
|
443
|
((let open! Ppx_deriving_runtime in
|
444
|
fun fmt ->
|
445
|
function
|
446
|
| Simple a0 ->
|
447
|
(Format.fprintf fmt "%s") a0;
|
448
|
| Identifier a0 ->
|
449
|
(Format.fprintf fmt "%s") a0;
|
450
|
| Selected a0 ->
|
451
|
((fun x ->
|
452
|
ignore
|
453
|
(List.fold_left
|
454
|
(fun sep ->
|
455
|
fun x ->
|
456
|
if sep then Format.fprintf fmt ".";
|
457
|
((__0 ()) fmt) x;
|
458
|
true) false x);) a0;)
|
459
|
| Index { id = aid; exprs = aexprs } ->
|
460
|
((__1 ()) fmt) aid;
|
461
|
Format.fprintf fmt "(";
|
462
|
(fun x ->
|
463
|
ignore
|
464
|
(List.fold_left
|
465
|
(fun sep ->
|
466
|
fun x ->
|
467
|
if sep then Format.fprintf fmt ",@ ";
|
468
|
((__2 ()) fmt) x;
|
469
|
true
|
470
|
) false x);
|
471
|
) aexprs;
|
472
|
Format.fprintf fmt ")";
|
473
|
| Slice { id = aid; range = arange } ->
|
474
|
((__3 ()) fmt) aid;
|
475
|
Format.fprintf fmt "(";
|
476
|
((__4 ()) fmt) arange;
|
477
|
Format.fprintf fmt ")";
|
478
|
| Attribute { id = aid; designator = adesignator; expr = aexpr } ->
|
479
|
((__5 ()) fmt) aid;
|
480
|
Format.fprintf fmt "\'";
|
481
|
((__6 ()) fmt) adesignator;
|
482
|
(match aexpr with
|
483
|
| IsNull -> Format.fprintf fmt "";
|
484
|
| _ ->
|
485
|
Format.fprintf fmt "(";
|
486
|
((__7 ()) fmt) aexpr;
|
487
|
Format.fprintf fmt ")")
|
488
|
| Function { id = aid; assoc_list = aassoc_list } ->
|
489
|
(((__8 ()) fmt) aid;
|
490
|
Format.fprintf fmt "(";
|
491
|
((fun x ->
|
492
|
Format.fprintf fmt "@[";
|
493
|
ignore
|
494
|
(List.fold_left
|
495
|
(fun sep ->
|
496
|
fun x ->
|
497
|
if sep then Format.fprintf fmt ",@ ";
|
498
|
((__9 ()) fmt) x;
|
499
|
true) false x);
|
500
|
Format.fprintf fmt "@]")) aassoc_list;
|
501
|
Format.fprintf fmt ")";)
|
502
|
| NoName -> Format.pp_print_string fmt "")
|
503
|
[@ocaml.warning "-A"])
|
504
|
|
505
|
and show_vhdl_name_t : vhdl_name_t -> Ppx_deriving_runtime.string =
|
506
|
fun x -> Format.asprintf "%a" pp_vhdl_name_t x
|
507
|
|
508
|
and pp_vhdl_assoc_element_t :
|
509
|
Format.formatter -> vhdl_assoc_element_t -> Ppx_deriving_runtime.unit =
|
510
|
let __4 () = pp_vhdl_expr_t
|
511
|
|
512
|
and __3 () = pp_vhdl_name_t
|
513
|
|
514
|
and __2 () = pp_vhdl_name_t
|
515
|
|
516
|
and __1 () = pp_vhdl_name_t
|
517
|
|
518
|
and __0 () = pp_vhdl_name_t
|
519
|
in
|
520
|
((let open! Ppx_deriving_runtime in
|
521
|
fun fmt ->
|
522
|
fun x ->
|
523
|
(match x.formal_name with
|
524
|
| None -> Format.pp_print_string fmt ""
|
525
|
| Some NoName -> Format.pp_print_string fmt ""
|
526
|
| Some a ->
|
527
|
(((__0 ()) fmt) a;
|
528
|
(match x.formal_arg with
|
529
|
| None -> Format.pp_print_string fmt ""
|
530
|
| Some b -> ((__1 ()) fmt) b);
|
531
|
Format.fprintf fmt " => "));
|
532
|
(match x.actual_name with
|
533
|
| None ->
|
534
|
((match x.actual_designator with
|
535
|
| None -> Format.pp_print_string fmt ""
|
536
|
| Some NoName -> Format.pp_print_string fmt ""
|
537
|
| Some b -> ((__3 ()) fmt) b);
|
538
|
(match x.actual_expr with
|
539
|
| None -> Format.pp_print_string fmt ""
|
540
|
| Some IsNull -> Format.pp_print_string fmt ""
|
541
|
| Some c -> ((__4 ()) fmt) c);)
|
542
|
| Some a ->
|
543
|
(((__2 ()) fmt) a;
|
544
|
(match a with
|
545
|
| NoName -> ()
|
546
|
| _ -> Format.fprintf fmt "(");
|
547
|
(match x.actual_designator with
|
548
|
| None -> Format.pp_print_string fmt ""
|
549
|
| Some b -> ((__3 ()) fmt) b);
|
550
|
(match x.actual_expr with
|
551
|
| None -> Format.pp_print_string fmt ""
|
552
|
| Some IsNull -> Format.pp_print_string fmt ""
|
553
|
| Some c -> ((__4 ()) fmt) c);
|
554
|
(match a with
|
555
|
| NoName -> ()
|
556
|
| _ -> Format.fprintf fmt ")")));)
|
557
|
[@ocaml.warning "-A"])
|
558
|
|
559
|
and show_vhdl_assoc_element_t :
|
560
|
vhdl_assoc_element_t -> Ppx_deriving_runtime.string =
|
561
|
fun x -> Format.asprintf "%a" pp_vhdl_assoc_element_t x
|
562
|
|
563
|
and pp_vhdl_element_assoc_t :
|
564
|
Format.formatter -> vhdl_element_assoc_t -> Ppx_deriving_runtime.unit =
|
565
|
let __1 () = pp_vhdl_expr_t
|
566
|
|
567
|
and __0 () = pp_vhdl_expr_t
|
568
|
in
|
569
|
((let open! Ppx_deriving_runtime in
|
570
|
fun fmt ->
|
571
|
fun x ->
|
572
|
(match x.choices with
|
573
|
| [] -> Format.fprintf fmt "";
|
574
|
| _ ->
|
575
|
(((fun x ->
|
576
|
ignore
|
577
|
(List.fold_left
|
578
|
(fun sep ->
|
579
|
fun x ->
|
580
|
if sep then Format.fprintf fmt "|@ ";
|
581
|
((__0 ()) fmt) x;
|
582
|
true) false x))) x.choices;
|
583
|
Format.fprintf fmt " => ";));
|
584
|
((__1 ()) fmt) x.expr)
|
585
|
[@ocaml.warning "-A"])
|
586
|
|
587
|
and show_vhdl_element_assoc_t :
|
588
|
vhdl_element_assoc_t -> Ppx_deriving_runtime.string =
|
589
|
fun x -> Format.asprintf "%a" pp_vhdl_element_assoc_t x
|
590
|
|
591
|
(* TODO *)
|
592
|
and (pp_vhdl_array_attributes_t :
|
593
|
Format.formatter ->
|
594
|
vhdl_array_attributes_t -> Ppx_deriving_runtime.unit)
|
595
|
=
|
596
|
((let open! Ppx_deriving_runtime in
|
597
|
fun fmt ->
|
598
|
function
|
599
|
| AAttInt { id = aid; arg = aarg } ->
|
600
|
(Format.fprintf fmt "@[<2>AAttInt {@,";
|
601
|
((Format.fprintf fmt "@[%s =@ " "id";
|
602
|
(Format.fprintf fmt "%S") aid;
|
603
|
Format.fprintf fmt "@]");
|
604
|
Format.fprintf fmt ";@ ";
|
605
|
Format.fprintf fmt "@[%s =@ " "arg";
|
606
|
(Format.fprintf fmt "%d") aarg;
|
607
|
Format.fprintf fmt "@]");
|
608
|
Format.fprintf fmt "@]}")
|
609
|
| AAttAscending -> Format.pp_print_string fmt "AAttAscending")
|
610
|
[@ocaml.warning "-A"])
|
611
|
|
612
|
and show_vhdl_array_attributes_t :
|
613
|
vhdl_array_attributes_t -> Ppx_deriving_runtime.string =
|
614
|
fun x -> Format.asprintf "%a" pp_vhdl_array_attributes_t x
|
615
|
|
616
|
(* TODO *)
|
617
|
and (pp_vhdl_signal_attributes_t :
|
618
|
Format.formatter ->
|
619
|
vhdl_signal_attributes_t -> Ppx_deriving_runtime.unit)
|
620
|
=
|
621
|
((let open! Ppx_deriving_runtime in
|
622
|
fun fmt ->
|
623
|
function
|
624
|
| SigAtt a0 ->
|
625
|
(Format.fprintf fmt "(@[<2>SigAtt@ ";
|
626
|
(Format.fprintf fmt "%S") a0;
|
627
|
Format.fprintf fmt "@])"))
|
628
|
[@ocaml.warning "-A"])
|
629
|
|
630
|
and show_vhdl_signal_attributes_t :
|
631
|
vhdl_signal_attributes_t -> Ppx_deriving_runtime.string =
|
632
|
fun x -> Format.asprintf "%a" pp_vhdl_signal_attributes_t x
|
633
|
|
634
|
(* TODO *)
|
635
|
and (pp_vhdl_string_attributes_t :
|
636
|
Format.formatter ->
|
637
|
vhdl_string_attributes_t -> Ppx_deriving_runtime.unit)
|
638
|
=
|
639
|
((let open! Ppx_deriving_runtime in
|
640
|
fun fmt ->
|
641
|
function
|
642
|
| StringAtt a0 ->
|
643
|
(Format.fprintf fmt "(@[<2>StringAtt@ ";
|
644
|
(Format.fprintf fmt "%S") a0;
|
645
|
Format.fprintf fmt "@])"))
|
646
|
[@ocaml.warning "-A"])
|
647
|
|
648
|
and show_vhdl_string_attributes_t :
|
649
|
vhdl_string_attributes_t -> Ppx_deriving_runtime.string =
|
650
|
fun x -> Format.asprintf "%a" pp_vhdl_string_attributes_t x
|
651
|
|
652
|
(* TODO *)
|
653
|
and (pp_vhdl_suffix_selection_t :
|
654
|
Format.formatter ->
|
655
|
vhdl_suffix_selection_t -> Ppx_deriving_runtime.unit)
|
656
|
=
|
657
|
((let open! Ppx_deriving_runtime in
|
658
|
fun fmt ->
|
659
|
function
|
660
|
| Idx a0 ->
|
661
|
(Format.fprintf fmt "(@[<2>Idx@ ";
|
662
|
(Format.fprintf fmt "%d") a0;
|
663
|
Format.fprintf fmt "@])")
|
664
|
| SuffixRange (a0,a1) ->
|
665
|
(Format.fprintf fmt "(@[<2>SuffixRange (@,";
|
666
|
((Format.fprintf fmt "%d") a0;
|
667
|
Format.fprintf fmt ",@ ";
|
668
|
(Format.fprintf fmt "%d") a1);
|
669
|
Format.fprintf fmt "@,))@]"))
|
670
|
[@ocaml.warning "-A"])
|
671
|
|
672
|
and show_vhdl_suffix_selection_t :
|
673
|
vhdl_suffix_selection_t -> Ppx_deriving_runtime.string =
|
674
|
fun x -> Format.asprintf "%a" pp_vhdl_suffix_selection_t x
|
675
|
|
676
|
(* TODO *)
|
677
|
let rec pp_vhdl_type_attributes_t
|
678
|
=
|
679
|
((let open! Ppx_deriving_runtime in
|
680
|
fun poly_basetype ->
|
681
|
fun fmt ->
|
682
|
function
|
683
|
| TAttNoArg { id = aid } ->
|
684
|
(Format.fprintf fmt "@[<2>TAttNoArg {@,";
|
685
|
(Format.fprintf fmt "@[%s =@ " "id";
|
686
|
(Format.fprintf fmt "%S") aid;
|
687
|
Format.fprintf fmt "@]");
|
688
|
Format.fprintf fmt "@]}")
|
689
|
| TAttIntArg { id = aid; arg = aarg } ->
|
690
|
(Format.fprintf fmt "@[<2>TAttIntArg {@,";
|
691
|
((Format.fprintf fmt "@[%s =@ " "id";
|
692
|
(Format.fprintf fmt "%S") aid;
|
693
|
Format.fprintf fmt "@]");
|
694
|
Format.fprintf fmt ";@ ";
|
695
|
Format.fprintf fmt "@[%s =@ " "arg";
|
696
|
(Format.fprintf fmt "%d") aarg;
|
697
|
Format.fprintf fmt "@]");
|
698
|
Format.fprintf fmt "@]}")
|
699
|
| TAttValArg { id = aid; arg = aarg } ->
|
700
|
(Format.fprintf fmt "@[<2>TAttValArg {@,";
|
701
|
((Format.fprintf fmt "@[%s =@ " "id";
|
702
|
(Format.fprintf fmt "%S") aid;
|
703
|
Format.fprintf fmt "@]");
|
704
|
Format.fprintf fmt ";@ ";
|
705
|
Format.fprintf fmt "@[%s =@ " "arg";
|
706
|
(poly_basetype fmt) aarg;
|
707
|
Format.fprintf fmt "@]");
|
708
|
Format.fprintf fmt "@]}")
|
709
|
| TAttStringArg { id = aid; arg = aarg } ->
|
710
|
(Format.fprintf fmt "@[<2>TAttStringArg {@,";
|
711
|
((Format.fprintf fmt "@[%s =@ " "id";
|
712
|
(Format.fprintf fmt "%S") aid;
|
713
|
Format.fprintf fmt "@]");
|
714
|
Format.fprintf fmt ";@ ";
|
715
|
Format.fprintf fmt "@[%s =@ " "arg";
|
716
|
(Format.fprintf fmt "%S") aarg;
|
717
|
Format.fprintf fmt "@]");
|
718
|
Format.fprintf fmt "@]}"))
|
719
|
[@ocaml.warning "-A"])
|
720
|
|
721
|
and show_vhdl_type_attributes_t =
|
722
|
fun poly_basetype ->
|
723
|
fun x ->
|
724
|
Format.asprintf "%a" (pp_vhdl_type_attributes_t poly_basetype) x
|
725
|
|
726
|
let rec pp_vhdl_parameter_t :
|
727
|
Format.formatter -> vhdl_parameter_t -> Ppx_deriving_runtime.unit =
|
728
|
let __2 () = pp_vhdl_cst_val_t
|
729
|
|
730
|
and __1 () = pp_vhdl_subtype_indication_t
|
731
|
|
732
|
and __0 () = pp_vhdl_name_t
|
733
|
in
|
734
|
((let open! Ppx_deriving_runtime in
|
735
|
fun fmt ->
|
736
|
fun x ->
|
737
|
((fun x ->
|
738
|
ignore
|
739
|
(List.fold_left
|
740
|
(fun sep ->
|
741
|
fun x ->
|
742
|
if sep then Format.fprintf fmt ", ";
|
743
|
((__0 ()) fmt) x;
|
744
|
true) false x))) x.names;
|
745
|
Format.fprintf fmt ": ";
|
746
|
((fun x ->
|
747
|
ignore
|
748
|
(List.fold_left
|
749
|
(fun sep ->
|
750
|
fun x ->
|
751
|
if sep then Format.fprintf fmt "";
|
752
|
Format.fprintf fmt "%s " x;
|
753
|
true) false x))) x.mode;
|
754
|
((__1 ()) fmt) x.typ;
|
755
|
(match x.init_val with
|
756
|
| None -> Format.pp_print_string fmt ""
|
757
|
| Some x ->
|
758
|
(Format.pp_print_string fmt " := ";
|
759
|
((__2 ()) fmt) x));)
|
760
|
[@ocaml.warning "-A"])
|
761
|
|
762
|
and show_vhdl_parameter_t : vhdl_parameter_t -> Ppx_deriving_runtime.string =
|
763
|
fun x -> Format.asprintf "%a" pp_vhdl_parameter_t x
|
764
|
|
765
|
let rec pp_vhdl_subprogram_spec_t :
|
766
|
Format.formatter -> vhdl_subprogram_spec_t -> Ppx_deriving_runtime.unit =
|
767
|
let __1 () = pp_vhdl_parameter_t
|
768
|
|
769
|
and __0 () = pp_vhdl_name_t
|
770
|
in
|
771
|
((let open! Ppx_deriving_runtime in
|
772
|
fun fmt ->
|
773
|
fun x ->
|
774
|
(match x.subprogram_type with
|
775
|
| "function" ->
|
776
|
if (x.isPure) then
|
777
|
Format.fprintf fmt "pure %s %s" x.subprogram_type x.name
|
778
|
else
|
779
|
Format.fprintf fmt "impure %s %s" x.subprogram_type x.name
|
780
|
| "procedure" ->
|
781
|
Format.fprintf fmt "%s %s" x.subprogram_type x.name);
|
782
|
(match x.parameters with
|
783
|
| [] -> Format.fprintf fmt "";
|
784
|
| _ ->
|
785
|
Format.fprintf fmt "(@[";
|
786
|
((fun x ->
|
787
|
ignore
|
788
|
(List.fold_left
|
789
|
(fun sep ->
|
790
|
fun x ->
|
791
|
if sep then Format.fprintf fmt ";@ ";
|
792
|
((__1 ()) fmt) x;
|
793
|
true) false x))) x.parameters;
|
794
|
Format.fprintf fmt "@])");
|
795
|
(match x.typeMark with
|
796
|
| NoName -> Format.fprintf fmt "";
|
797
|
| _ ->
|
798
|
Format.fprintf fmt "return ";
|
799
|
((__0 ()) fmt) x.typeMark))
|
800
|
[@ocaml.warning "-A"])
|
801
|
|
802
|
and show_vhdl_subprogram_spec_t :
|
803
|
vhdl_subprogram_spec_t -> Ppx_deriving_runtime.string =
|
804
|
fun x -> Format.asprintf "%a" pp_vhdl_subprogram_spec_t x
|
805
|
|
806
|
let rec pp_vhdl_waveform_element_t :
|
807
|
Format.formatter -> vhdl_waveform_element_t -> Ppx_deriving_runtime.unit =
|
808
|
let __1 () = pp_vhdl_expr_t
|
809
|
|
810
|
and __0 () = pp_vhdl_expr_t
|
811
|
in
|
812
|
((let open! Ppx_deriving_runtime in
|
813
|
fun fmt ->
|
814
|
fun x ->
|
815
|
(match x.value with
|
816
|
| None -> Format.fprintf fmt "";
|
817
|
| Some IsNull -> Format.fprintf fmt "null";
|
818
|
| Some v -> ((__0 ()) fmt) v);
|
819
|
(match x.delay with
|
820
|
| None -> Format.fprintf fmt "";
|
821
|
| Some v ->
|
822
|
Format.fprintf fmt " after ";
|
823
|
((__1 ()) fmt) v))
|
824
|
[@ocaml.warning "-A"])
|
825
|
|
826
|
and show_vhdl_waveform_element_t :
|
827
|
vhdl_waveform_element_t -> Ppx_deriving_runtime.string =
|
828
|
fun x -> Format.asprintf "%a" pp_vhdl_waveform_element_t x
|
829
|
|
830
|
let rec pp_vhdl_sequential_stmt_t :
|
831
|
Format.formatter -> vhdl_sequential_stmt_t -> Ppx_deriving_runtime.unit =
|
832
|
let __23 () = pp_vhdl_expr_t
|
833
|
|
834
|
and __22 () = pp_vhdl_name_t
|
835
|
|
836
|
and __21 () = pp_vhdl_name_t
|
837
|
|
838
|
and __20 () = pp_vhdl_assoc_element_t
|
839
|
|
840
|
and __19 () = pp_vhdl_name_t
|
841
|
|
842
|
and __18 () = pp_vhdl_name_t
|
843
|
|
844
|
and __17 () = pp_vhdl_expr_t
|
845
|
|
846
|
and __16 () = pp_vhdl_expr_t
|
847
|
|
848
|
and __15 () = pp_vhdl_expr_t
|
849
|
|
850
|
and __14 () = pp_vhdl_name_t
|
851
|
|
852
|
and __13 () = pp_vhdl_expr_t
|
853
|
|
854
|
and __12 () = pp_vhdl_name_t
|
855
|
|
856
|
and __11 () = pp_vhdl_case_item_t
|
857
|
|
858
|
and __10 () = pp_vhdl_expr_t
|
859
|
|
860
|
and __9 () = pp_vhdl_name_t
|
861
|
|
862
|
and __8 () = pp_vhdl_sequential_stmt_t
|
863
|
|
864
|
and __7 () = pp_vhdl_if_case_t
|
865
|
|
866
|
and __6 () = pp_vhdl_name_t
|
867
|
|
868
|
and __5 () = pp_vhdl_waveform_element_t
|
869
|
|
870
|
and __4 () = pp_vhdl_name_t
|
871
|
|
872
|
and __3 () = pp_vhdl_name_t
|
873
|
|
874
|
and __2 () = pp_vhdl_expr_t
|
875
|
|
876
|
and __1 () = pp_vhdl_name_t
|
877
|
|
878
|
and __0 () = pp_vhdl_name_t
|
879
|
in
|
880
|
((let open! Ppx_deriving_runtime in
|
881
|
fun fmt ->
|
882
|
function
|
883
|
| VarAssign { label = alabel; lhs = alhs; rhs = arhs } ->
|
884
|
(match alabel with
|
885
|
| NoName -> Format.fprintf fmt "";
|
886
|
| _ -> (((__0 ()) fmt) alabel;
|
887
|
Format.fprintf fmt ": ")
|
888
|
);
|
889
|
((__1 ()) fmt) alhs;
|
890
|
Format.fprintf fmt " := ";
|
891
|
((__2 ()) fmt) arhs;
|
892
|
(* TODO: Check
|
893
|
(Format.fprintf fmt "@[<2>VarAssign {@,";
|
894
|
(((Format.fprintf fmt "@[%s =@ " "label";
|
895
|
((__0 ()) fmt) alabel;
|
896
|
Format.fprintf fmt "@]");
|
897
|
Format.fprintf fmt ";@ ";
|
898
|
Format.fprintf fmt "@[%s =@ " "lhs";
|
899
|
((__1 ()) fmt) alhs;
|
900
|
Format.fprintf fmt "@]");
|
901
|
Format.fprintf fmt ";@ ";
|
902
|
Format.fprintf fmt "@[%s =@ " "rhs";
|
903
|
((__2 ()) fmt) arhs;
|
904
|
Format.fprintf fmt "@]");
|
905
|
Format.fprintf fmt "@]}") *)
|
906
|
| SigSeqAssign { label = alabel; lhs = alhs; rhs = arhs } ->
|
907
|
(match alabel with
|
908
|
| NoName -> Format.fprintf fmt "";
|
909
|
| _ -> (((__3 ()) fmt) alabel;
|
910
|
Format.fprintf fmt ":@ ")
|
911
|
);
|
912
|
Format.fprintf fmt "@[<2>";
|
913
|
((__4 ()) fmt) alhs;
|
914
|
Format.fprintf fmt "@ <=@ ";
|
915
|
((fun x ->
|
916
|
Format.fprintf fmt "@[";
|
917
|
ignore
|
918
|
(List.fold_left
|
919
|
(fun sep ->
|
920
|
fun x ->
|
921
|
if sep then Format.fprintf fmt ", ";
|
922
|
((__5 ()) fmt) x;
|
923
|
true) false x);
|
924
|
Format.fprintf fmt "@]@]")) arhs;
|
925
|
| If { label = alabel; if_cases = aif_cases; default = adefault } ->
|
926
|
(match alabel with
|
927
|
| NoName -> Format.fprintf fmt "";
|
928
|
| _ -> (((__6 ()) fmt) alabel;
|
929
|
Format.fprintf fmt ":@ ")
|
930
|
);
|
931
|
Format.fprintf fmt "@[<v>if";
|
932
|
((fun x ->
|
933
|
ignore
|
934
|
(List.fold_left
|
935
|
(fun sep ->
|
936
|
fun x ->
|
937
|
if sep then Format.fprintf fmt "@;elsif";
|
938
|
((__7 ()) fmt) x;
|
939
|
true
|
940
|
) false x);
|
941
|
)) aif_cases;
|
942
|
(match adefault with
|
943
|
| [] -> Format.fprintf fmt "";
|
944
|
| _ -> (Format.fprintf fmt "@;else";
|
945
|
((fun x ->
|
946
|
Format.fprintf fmt "@;<0 2>";
|
947
|
ignore
|
948
|
(List.fold_left
|
949
|
(fun sep ->
|
950
|
fun x ->
|
951
|
if sep then Format.fprintf fmt "";
|
952
|
((__8 ()) fmt) x;
|
953
|
Format.fprintf fmt ";";
|
954
|
true) false x))) adefault));
|
955
|
Format.fprintf fmt "@;end if@]"
|
956
|
| Case { label = alabel; guard = aguard; branches = abranches } ->
|
957
|
(match alabel with
|
958
|
| NoName -> Format.fprintf fmt "";
|
959
|
| _ -> (((__9 ()) fmt) alabel;
|
960
|
Format.fprintf fmt ":@ ")
|
961
|
);
|
962
|
Format.fprintf fmt "@[<v>case ";
|
963
|
((__10 ()) fmt) aguard;
|
964
|
Format.fprintf fmt " is";
|
965
|
((fun x ->
|
966
|
ignore
|
967
|
(List.fold_left
|
968
|
(fun sep ->
|
969
|
fun x ->
|
970
|
if sep then Format.fprintf fmt "";
|
971
|
((__11 ()) fmt) x;
|
972
|
true) false x);)) abranches;
|
973
|
Format.fprintf fmt "@;end case@]";
|
974
|
| Exit
|
975
|
{ label = alabel; loop_label = aloop_label;
|
976
|
condition = acondition }
|
977
|
->
|
978
|
(match alabel with
|
979
|
| NoName -> Format.fprintf fmt "";
|
980
|
| _ -> (((__12 ()) fmt) alabel;
|
981
|
Format.fprintf fmt ":@ ")
|
982
|
);
|
983
|
Format.fprintf fmt "exit";
|
984
|
(match aloop_label with
|
985
|
| None -> Format.pp_print_string fmt ""
|
986
|
| Some x -> (Format.fprintf fmt "@ %s@ ") x);
|
987
|
((function
|
988
|
| None -> Format.pp_print_string fmt ""
|
989
|
| Some x ->
|
990
|
(Format.pp_print_string fmt "when@ ";
|
991
|
((__13 ()) fmt) x;))) acondition;
|
992
|
| Assert
|
993
|
{ label = alabel; cond = acond; report = areport;
|
994
|
severity = aseverity }
|
995
|
->
|
996
|
Format.fprintf fmt "@[<v 2>";
|
997
|
(match alabel with
|
998
|
| NoName -> Format.fprintf fmt "";
|
999
|
| _ -> (((__14 ()) fmt) alabel;
|
1000
|
Format.fprintf fmt ":@ ")
|
1001
|
);
|
1002
|
Format.fprintf fmt "assert ";
|
1003
|
((__15 ()) fmt) acond;
|
1004
|
(match areport with
|
1005
|
| IsNull -> Format.fprintf fmt "";
|
1006
|
| _ ->
|
1007
|
Format.fprintf fmt "@;report ";
|
1008
|
((__16 ()) fmt) areport);
|
1009
|
(match aseverity with
|
1010
|
| IsNull -> Format.fprintf fmt "";
|
1011
|
| _ ->
|
1012
|
Format.fprintf fmt "@;severity ";
|
1013
|
((__17 ()) fmt) aseverity);
|
1014
|
Format.fprintf fmt "@]";
|
1015
|
| ProcedureCall { label = alabel; name = aname; assocs = aassocs } ->
|
1016
|
(match alabel with
|
1017
|
| NoName -> Format.fprintf fmt "";
|
1018
|
| _ -> (((__18 ()) fmt) alabel;
|
1019
|
Format.fprintf fmt ":@ ")
|
1020
|
);
|
1021
|
((__19 ()) fmt) aname;
|
1022
|
(match aassocs with
|
1023
|
| [] -> Format.fprintf fmt "";
|
1024
|
| _ ->
|
1025
|
Format.fprintf fmt "(@[<v>";
|
1026
|
((fun x ->
|
1027
|
ignore
|
1028
|
(List.fold_left
|
1029
|
(fun sep ->
|
1030
|
fun x ->
|
1031
|
if sep then Format.fprintf fmt ",@ ";
|
1032
|
((__20 ()) fmt) x;
|
1033
|
true) false x))) aassocs;
|
1034
|
Format.fprintf fmt "@])");
|
1035
|
| Wait -> Format.pp_print_string fmt "wait"
|
1036
|
| Null { label = alabel } ->
|
1037
|
(match alabel with
|
1038
|
| NoName -> Format.fprintf fmt "";
|
1039
|
| _ -> (((__18 ()) fmt) alabel;
|
1040
|
Format.fprintf fmt ":@ ")
|
1041
|
);
|
1042
|
Format.fprintf fmt "null";
|
1043
|
| Return { label = alabel; expr = aexpr } ->
|
1044
|
(match alabel with
|
1045
|
| None -> ();
|
1046
|
| Some a -> (((__19 ()) fmt) a;
|
1047
|
Format.fprintf fmt ":@ ")
|
1048
|
);
|
1049
|
Format.fprintf fmt "return";
|
1050
|
(match aexpr with
|
1051
|
| None -> ()
|
1052
|
| Some a ->
|
1053
|
((__23 ()) fmt) a);)
|
1054
|
[@ocaml.warning "-A"])
|
1055
|
|
1056
|
and show_vhdl_sequential_stmt_t :
|
1057
|
vhdl_sequential_stmt_t -> Ppx_deriving_runtime.string =
|
1058
|
fun x -> Format.asprintf "%a" pp_vhdl_sequential_stmt_t x
|
1059
|
|
1060
|
and pp_vhdl_if_case_t :
|
1061
|
Format.formatter -> vhdl_if_case_t -> Ppx_deriving_runtime.unit =
|
1062
|
let __1 () = pp_vhdl_sequential_stmt_t
|
1063
|
|
1064
|
and __0 () = pp_vhdl_expr_t
|
1065
|
in
|
1066
|
((let open! Ppx_deriving_runtime in
|
1067
|
fun fmt ->
|
1068
|
fun x ->
|
1069
|
Format.fprintf fmt " (";
|
1070
|
((__0 ()) fmt) x.if_cond;
|
1071
|
Format.fprintf fmt ") then@;<0 2>";
|
1072
|
((fun x ->
|
1073
|
ignore
|
1074
|
(List.fold_left
|
1075
|
(fun sep ->
|
1076
|
fun x ->
|
1077
|
if sep then Format.fprintf fmt "@;<0 2>";
|
1078
|
((__1 ()) fmt) x;
|
1079
|
Format.fprintf fmt ";";
|
1080
|
true) false x);
|
1081
|
)) x.if_block;)
|
1082
|
[@ocaml.warning "-A"])
|
1083
|
|
1084
|
and show_vhdl_if_case_t : vhdl_if_case_t -> Ppx_deriving_runtime.string =
|
1085
|
fun x -> Format.asprintf "%a" pp_vhdl_if_case_t x
|
1086
|
|
1087
|
and pp_vhdl_case_item_t :
|
1088
|
Format.formatter -> vhdl_case_item_t -> Ppx_deriving_runtime.unit =
|
1089
|
let __1 () = pp_vhdl_sequential_stmt_t
|
1090
|
|
1091
|
and __0 () = pp_vhdl_expr_t
|
1092
|
in
|
1093
|
((let open! Ppx_deriving_runtime in
|
1094
|
fun fmt ->
|
1095
|
fun x ->
|
1096
|
Format.fprintf fmt "@;@[<v 2>when ";
|
1097
|
((fun x ->
|
1098
|
ignore
|
1099
|
(List.fold_left
|
1100
|
(fun sep ->
|
1101
|
fun x ->
|
1102
|
if sep then Format.fprintf fmt "@ |@ ";
|
1103
|
((__0 ()) fmt) x;
|
1104
|
true) false x);)) x.when_cond;
|
1105
|
Format.fprintf fmt " => ";
|
1106
|
(fun x ->
|
1107
|
ignore
|
1108
|
(List.fold_left
|
1109
|
(fun sep ->
|
1110
|
fun x ->
|
1111
|
if sep then Format.fprintf fmt "@;";
|
1112
|
((__1 ()) fmt) x;
|
1113
|
Format.fprintf fmt ";";
|
1114
|
true) ((List.length x) > 1) x);) x.when_stmt;
|
1115
|
Format.fprintf fmt "@]")
|
1116
|
[@ocaml.warning "-A"])
|
1117
|
|
1118
|
and show_vhdl_case_item_t : vhdl_case_item_t -> Ppx_deriving_runtime.string =
|
1119
|
fun x -> Format.asprintf "%a" pp_vhdl_case_item_t x
|
1120
|
|
1121
|
let rec (pp_vhdl_port_mode_t :
|
1122
|
Format.formatter -> vhdl_port_mode_t -> Ppx_deriving_runtime.unit)
|
1123
|
=
|
1124
|
((let open! Ppx_deriving_runtime in
|
1125
|
fun fmt ->
|
1126
|
function
|
1127
|
| InPort -> Format.pp_print_string fmt "in"
|
1128
|
| OutPort -> Format.pp_print_string fmt "out"
|
1129
|
| InoutPort -> Format.pp_print_string fmt "inout"
|
1130
|
| BufferPort -> Format.pp_print_string fmt "buffer")
|
1131
|
[@ocaml.warning "-A"])
|
1132
|
|
1133
|
and show_vhdl_port_mode_t : vhdl_port_mode_t -> Ppx_deriving_runtime.string =
|
1134
|
fun x -> Format.asprintf "%a" pp_vhdl_port_mode_t x
|
1135
|
|
1136
|
|
1137
|
let rec pp_vhdl_port_t :
|
1138
|
Format.formatter -> vhdl_port_t -> Ppx_deriving_runtime.unit =
|
1139
|
let __3 () = pp_vhdl_expr_t
|
1140
|
|
1141
|
and __2 () = pp_vhdl_subtype_indication_t
|
1142
|
|
1143
|
and __1 () = pp_vhdl_port_mode_t
|
1144
|
|
1145
|
and __0 () = pp_vhdl_name_t
|
1146
|
in
|
1147
|
((let open! Ppx_deriving_runtime in
|
1148
|
fun fmt ->
|
1149
|
fun x ->
|
1150
|
Format.fprintf fmt "@[";
|
1151
|
((((
|
1152
|
((fun x ->
|
1153
|
Format.fprintf fmt "@[";
|
1154
|
ignore
|
1155
|
(List.fold_left
|
1156
|
(fun sep ->
|
1157
|
fun x ->
|
1158
|
if sep then Format.fprintf fmt ",@ ";
|
1159
|
((__0 ()) fmt) x;
|
1160
|
true) false x);
|
1161
|
Format.fprintf fmt "@,@]")) x.names;
|
1162
|
);
|
1163
|
Format.fprintf fmt ": ";
|
1164
|
((__1 ()) fmt) x.mode;
|
1165
|
);
|
1166
|
Format.fprintf fmt " ";
|
1167
|
((__2 ()) fmt) x.typ;
|
1168
|
);
|
1169
|
(match x.expr with
|
1170
|
| IsNull -> Format.fprintf fmt "";
|
1171
|
| _ -> (Format.fprintf fmt "@[:= ";
|
1172
|
((__3 ()) fmt) x.expr;
|
1173
|
Format.fprintf fmt "@]"));
|
1174
|
Format.fprintf fmt "@]"))
|
1175
|
[@ocaml.warning "-A"])
|
1176
|
|
1177
|
and show_vhdl_port_t : vhdl_port_t -> Ppx_deriving_runtime.string =
|
1178
|
fun x -> Format.asprintf "%a" pp_vhdl_port_t x
|
1179
|
|
1180
|
let rec pp_vhdl_declaration_t :
|
1181
|
Format.formatter -> vhdl_declaration_t -> Ppx_deriving_runtime.unit =
|
1182
|
let __14 () = pp_vhdl_sequential_stmt_t
|
1183
|
|
1184
|
and __13 () = pp_vhdl_declaration_t
|
1185
|
|
1186
|
and __12 () = pp_vhdl_subprogram_spec_t
|
1187
|
|
1188
|
and __11 () = pp_vhdl_port_t
|
1189
|
|
1190
|
and __10 () = pp_vhdl_port_t
|
1191
|
|
1192
|
and __9 () = pp_vhdl_name_t
|
1193
|
|
1194
|
and __8 () = pp_vhdl_expr_t
|
1195
|
|
1196
|
and __7 () = pp_vhdl_subtype_indication_t
|
1197
|
|
1198
|
and __6 () = pp_vhdl_name_t
|
1199
|
|
1200
|
and __5 () = pp_vhdl_expr_t
|
1201
|
|
1202
|
and __4 () = pp_vhdl_subtype_indication_t
|
1203
|
|
1204
|
and __3 () = pp_vhdl_name_t
|
1205
|
|
1206
|
and __2 () = pp_vhdl_expr_t
|
1207
|
|
1208
|
and __1 () = pp_vhdl_subtype_indication_t
|
1209
|
|
1210
|
and __0 () = pp_vhdl_name_t
|
1211
|
in
|
1212
|
((let open! Ppx_deriving_runtime in
|
1213
|
fun fmt ->
|
1214
|
function
|
1215
|
| VarDecl { names = anames; typ = atyp; init_val = ainit_val } ->
|
1216
|
(Format.fprintf fmt "variable ";
|
1217
|
((((fun x ->
|
1218
|
ignore
|
1219
|
(List.fold_left
|
1220
|
(fun sep ->
|
1221
|
fun x ->
|
1222
|
if sep then Format.fprintf fmt ",";
|
1223
|
((__0 ()) fmt) x;
|
1224
|
true) false x);)) anames;
|
1225
|
Format.fprintf fmt " : ";
|
1226
|
((__1 ()) fmt) atyp;
|
1227
|
(match ainit_val with
|
1228
|
| IsNull -> Format.pp_print_string fmt ""
|
1229
|
| _ ->
|
1230
|
(Format.fprintf fmt ":=";
|
1231
|
((__2 ()) fmt) ainit_val;))));)
|
1232
|
| CstDecl { names = anames; typ = atyp; init_val = ainit_val } ->
|
1233
|
(Format.fprintf fmt "constant ";
|
1234
|
((((fun x ->
|
1235
|
ignore
|
1236
|
(List.fold_left
|
1237
|
(fun sep ->
|
1238
|
fun x ->
|
1239
|
if sep then Format.fprintf fmt ",";
|
1240
|
((__3 ()) fmt) x;
|
1241
|
true) false x);)) anames;
|
1242
|
Format.fprintf fmt " : ";
|
1243
|
((__4 ()) fmt) atyp;
|
1244
|
Format.fprintf fmt " := ";
|
1245
|
((__5 ()) fmt) ainit_val)))
|
1246
|
| SigDecl { names = anames; typ = atyp; init_val = ainit_val } ->
|
1247
|
(Format.fprintf fmt "signal ";
|
1248
|
((fun x ->
|
1249
|
ignore
|
1250
|
(List.fold_left
|
1251
|
(fun sep ->
|
1252
|
fun x ->
|
1253
|
if sep then Format.fprintf fmt ",";
|
1254
|
((__6 ()) fmt) x;
|
1255
|
true) false x);
|
1256
|
)) anames;
|
1257
|
Format.fprintf fmt " : ";
|
1258
|
((__7 ()) fmt) atyp;
|
1259
|
(match ainit_val with
|
1260
|
| IsNull -> Format.pp_print_string fmt ""
|
1261
|
| _ ->
|
1262
|
(Format.fprintf fmt ":=";
|
1263
|
((__8 ()) fmt) ainit_val;)))
|
1264
|
| ComponentDecl
|
1265
|
{ name = aname; generics = agenerics; ports = aports } ->
|
1266
|
Format.fprintf fmt "@[<v 2>component ";
|
1267
|
((__9 ()) fmt) aname;
|
1268
|
Format.fprintf fmt " is@;";
|
1269
|
(match agenerics with
|
1270
|
| [] -> ()
|
1271
|
| _ ->
|
1272
|
Format.fprintf fmt "generic (@[<v>";
|
1273
|
((fun x ->
|
1274
|
ignore
|
1275
|
(List.fold_left
|
1276
|
(fun sep ->
|
1277
|
fun x ->
|
1278
|
if sep then Format.fprintf fmt ";@;";
|
1279
|
((__10 ()) fmt) x;
|
1280
|
true) false x))) agenerics;
|
1281
|
Format.fprintf fmt "@]);");
|
1282
|
(match aports with
|
1283
|
| [] -> ()
|
1284
|
| _ ->
|
1285
|
Format.fprintf fmt "port (@[<v>";
|
1286
|
((fun x ->
|
1287
|
ignore
|
1288
|
(List.fold_left
|
1289
|
(fun sep ->
|
1290
|
fun x ->
|
1291
|
if sep then Format.fprintf fmt ";@;";
|
1292
|
((__11 ()) fmt) x;
|
1293
|
true) false x))) aports;
|
1294
|
Format.fprintf fmt "@]);");
|
1295
|
Format.fprintf fmt "@]@;end component";
|
1296
|
| Subprogram
|
1297
|
{ spec = aspec; decl_part = adecl_part; stmts = astmts }
|
1298
|
->
|
1299
|
Format.fprintf fmt "@[<v 2>";
|
1300
|
((__12 ()) fmt) aspec;
|
1301
|
Format.fprintf fmt " is";
|
1302
|
(match adecl_part with
|
1303
|
| [] -> Format.fprintf fmt "";
|
1304
|
| _ ->
|
1305
|
((fun x ->
|
1306
|
ignore
|
1307
|
(List.fold_left
|
1308
|
(fun sep ->
|
1309
|
fun x ->
|
1310
|
if sep then Format.fprintf fmt "";
|
1311
|
Format.fprintf fmt "@;";
|
1312
|
((__13 ()) fmt) x;
|
1313
|
Format.fprintf fmt ";";
|
1314
|
true) false x))) adecl_part);
|
1315
|
Format.fprintf fmt "@]@;";
|
1316
|
Format.fprintf fmt "@[<v 2>begin@;";
|
1317
|
((fun x ->
|
1318
|
ignore
|
1319
|
(List.fold_left
|
1320
|
(fun sep ->
|
1321
|
fun x ->
|
1322
|
if sep then Format.fprintf fmt "@;";
|
1323
|
((__14 ()) fmt) x;
|
1324
|
Format.fprintf fmt ";";
|
1325
|
true) false x))) astmts;
|
1326
|
Format.fprintf fmt "@]@;end";)
|
1327
|
[@ocaml.warning "-A"])
|
1328
|
|
1329
|
and show_vhdl_declaration_t :
|
1330
|
vhdl_declaration_t -> Ppx_deriving_runtime.string =
|
1331
|
fun x -> Format.asprintf "%a" pp_vhdl_declaration_t x
|
1332
|
|
1333
|
let rec pp_vhdl_load_t :
|
1334
|
Format.formatter -> vhdl_load_t -> Ppx_deriving_runtime.unit =
|
1335
|
let __1 () = pp_vhdl_name_t
|
1336
|
|
1337
|
and __0 () = pp_vhdl_name_t
|
1338
|
in
|
1339
|
((let open! Ppx_deriving_runtime in
|
1340
|
fun fmt ->
|
1341
|
function
|
1342
|
| Library a0 ->
|
1343
|
(Format.fprintf fmt "library ";
|
1344
|
((fun x ->
|
1345
|
ignore
|
1346
|
(List.fold_left
|
1347
|
(fun sep ->
|
1348
|
fun x ->
|
1349
|
if sep then Format.fprintf fmt ",";
|
1350
|
((__0 ()) fmt) x;
|
1351
|
true) false x))) a0);
|
1352
|
| Use a0 ->
|
1353
|
(Format.fprintf fmt "use ";
|
1354
|
((fun x ->
|
1355
|
ignore
|
1356
|
(List.fold_left
|
1357
|
(fun sep ->
|
1358
|
fun x ->
|
1359
|
if sep then Format.fprintf fmt ".";
|
1360
|
((__1 ()) fmt) x;
|
1361
|
true) false x))) a0))
|
1362
|
[@ocaml.warning "-A"])
|
1363
|
|
1364
|
and show_vhdl_load_t : vhdl_load_t -> Ppx_deriving_runtime.string =
|
1365
|
fun x -> Format.asprintf "%a" pp_vhdl_load_t x
|
1366
|
|
1367
|
let rec pp_vhdl_declarative_item_t :
|
1368
|
Format.formatter -> vhdl_declarative_item_t -> Ppx_deriving_runtime.unit =
|
1369
|
let __2 () = pp_vhdl_definition_t
|
1370
|
|
1371
|
and __1 () = pp_vhdl_declaration_t
|
1372
|
|
1373
|
and __0 () = pp_vhdl_load_t
|
1374
|
in
|
1375
|
((let open! Ppx_deriving_runtime in
|
1376
|
fun fmt ->
|
1377
|
fun x ->
|
1378
|
(match x.use_clause with
|
1379
|
| None -> Format.fprintf fmt "";
|
1380
|
| Some e -> ((__0 ()) fmt) e);
|
1381
|
(match x.declaration with
|
1382
|
| None -> Format.fprintf fmt "";
|
1383
|
| Some e -> ((__1 ()) fmt) e);
|
1384
|
(match x.definition with
|
1385
|
| None -> Format.fprintf fmt "";
|
1386
|
| Some e -> ((__2 ()) fmt) e);)
|
1387
|
[@ocaml.warning "-A"])
|
1388
|
|
1389
|
and show_vhdl_declarative_item_t :
|
1390
|
vhdl_declarative_item_t -> Ppx_deriving_runtime.string =
|
1391
|
fun x -> Format.asprintf "%a" pp_vhdl_declarative_item_t x
|
1392
|
|
1393
|
let rec pp_vhdl_signal_condition_t :
|
1394
|
Format.formatter -> vhdl_signal_condition_t -> Ppx_deriving_runtime.unit =
|
1395
|
let __1 () = pp_vhdl_expr_t
|
1396
|
|
1397
|
and __0 () = pp_vhdl_waveform_element_t
|
1398
|
in
|
1399
|
((let open! Ppx_deriving_runtime in
|
1400
|
fun fmt ->
|
1401
|
fun x ->
|
1402
|
((fun x ->
|
1403
|
ignore
|
1404
|
(List.fold_left
|
1405
|
(fun sep ->
|
1406
|
fun x ->
|
1407
|
if sep then Format.fprintf fmt ",@,";
|
1408
|
((__0 ()) fmt) x;
|
1409
|
true) false x))) x.expr;
|
1410
|
(match x.cond with
|
1411
|
| None -> Format.fprintf fmt "";
|
1412
|
| Some e -> Format.fprintf fmt " when ";
|
1413
|
((__1 ()) fmt) e);)
|
1414
|
[@ocaml.warning "-A"])
|
1415
|
|
1416
|
and show_vhdl_signal_condition_t :
|
1417
|
vhdl_signal_condition_t -> Ppx_deriving_runtime.string =
|
1418
|
fun x -> Format.asprintf "%a" pp_vhdl_signal_condition_t x
|
1419
|
|
1420
|
let rec pp_vhdl_signal_selection_t :
|
1421
|
Format.formatter -> vhdl_signal_selection_t -> Ppx_deriving_runtime.unit =
|
1422
|
let __1 () = pp_vhdl_expr_t
|
1423
|
|
1424
|
and __0 () = pp_vhdl_waveform_element_t
|
1425
|
in
|
1426
|
((let open! Ppx_deriving_runtime in
|
1427
|
fun fmt ->
|
1428
|
fun x ->
|
1429
|
((fun x ->
|
1430
|
ignore
|
1431
|
(List.fold_left
|
1432
|
(fun sep ->
|
1433
|
fun x ->
|
1434
|
if sep then Format.fprintf fmt "@ ";
|
1435
|
((__0 ()) fmt) x;
|
1436
|
true) false x))) x.expr;
|
1437
|
Format.fprintf fmt " when ";
|
1438
|
((fun x ->
|
1439
|
ignore
|
1440
|
(List.fold_left
|
1441
|
(fun sep ->
|
1442
|
fun x ->
|
1443
|
if sep then Format.fprintf fmt "|@ ";
|
1444
|
((__1 ()) fmt) x;
|
1445
|
true) false x))) x.when_sel)
|
1446
|
[@ocaml.warning "-A"])
|
1447
|
|
1448
|
and show_vhdl_signal_selection_t :
|
1449
|
vhdl_signal_selection_t -> Ppx_deriving_runtime.string =
|
1450
|
fun x -> Format.asprintf "%a" pp_vhdl_signal_selection_t x
|
1451
|
|
1452
|
let rec pp_vhdl_conditional_signal_t :
|
1453
|
Format.formatter -> vhdl_conditional_signal_t -> Ppx_deriving_runtime.unit
|
1454
|
=
|
1455
|
let __3 () = pp_vhdl_expr_t
|
1456
|
|
1457
|
and __2 () = pp_vhdl_signal_condition_t
|
1458
|
|
1459
|
and __1 () = pp_vhdl_name_t
|
1460
|
|
1461
|
and __0 () = pp_vhdl_name_t
|
1462
|
in
|
1463
|
((let open! Ppx_deriving_runtime in
|
1464
|
fun fmt ->
|
1465
|
fun x ->
|
1466
|
(match x.label with
|
1467
|
| NoName -> Format.fprintf fmt "";
|
1468
|
| _ -> (((__0 ()) fmt) x.label;
|
1469
|
Format.fprintf fmt ":@ ")
|
1470
|
);
|
1471
|
if (x.postponed) then Format.fprintf fmt "postponed@ ";
|
1472
|
((__1 ()) fmt) x.lhs;
|
1473
|
Format.fprintf fmt " <= ";
|
1474
|
(match x.delay with
|
1475
|
| IsNull -> Format.fprintf fmt "";
|
1476
|
| _ -> ((__3 ()) fmt) x.delay;
|
1477
|
Format.fprintf fmt " ");
|
1478
|
((fun x ->
|
1479
|
Format.fprintf fmt "@[";
|
1480
|
ignore
|
1481
|
(List.fold_left
|
1482
|
(fun sep ->
|
1483
|
fun x ->
|
1484
|
if sep then Format.fprintf fmt " else ";
|
1485
|
((__2 ()) fmt) x;
|
1486
|
true) false x);
|
1487
|
Format.fprintf fmt "@]")) x.rhs;
|
1488
|
Format.fprintf fmt ";")
|
1489
|
[@ocaml.warning "-A"])
|
1490
|
|
1491
|
and show_vhdl_conditional_signal_t :
|
1492
|
vhdl_conditional_signal_t -> Ppx_deriving_runtime.string =
|
1493
|
fun x -> Format.asprintf "%a" pp_vhdl_conditional_signal_t x
|
1494
|
|
1495
|
let rec pp_vhdl_process_t :
|
1496
|
Format.formatter -> vhdl_process_t -> Ppx_deriving_runtime.unit =
|
1497
|
let __3 () = pp_vhdl_sequential_stmt_t
|
1498
|
|
1499
|
and __2 () = pp_vhdl_name_t
|
1500
|
|
1501
|
and __1 () = pp_vhdl_declarative_item_t
|
1502
|
|
1503
|
and __0 () = pp_vhdl_name_t
|
1504
|
in
|
1505
|
((let open! Ppx_deriving_runtime in
|
1506
|
fun fmt ->
|
1507
|
fun x ->
|
1508
|
Format.fprintf fmt "@[<v 2>";
|
1509
|
(match x.id with
|
1510
|
| NoName -> Format.fprintf fmt "";
|
1511
|
| _ ->
|
1512
|
((__0 ()) fmt) x.id;
|
1513
|
Format.fprintf fmt ": ");
|
1514
|
Format.fprintf fmt "process ";
|
1515
|
(match x.active_sigs with
|
1516
|
| [] -> Format.fprintf fmt "";
|
1517
|
| _ -> Format.fprintf fmt "(";
|
1518
|
((fun x ->
|
1519
|
ignore
|
1520
|
(List.fold_left
|
1521
|
(fun sep ->
|
1522
|
fun x ->
|
1523
|
if sep then Format.fprintf fmt ",";
|
1524
|
((__2 ()) fmt) x;
|
1525
|
true) false x))) x.active_sigs;
|
1526
|
Format.fprintf fmt ")");
|
1527
|
Format.fprintf fmt " is";
|
1528
|
(match x.declarations with
|
1529
|
| [] -> Format.fprintf fmt "";
|
1530
|
| _ ->
|
1531
|
(Format.fprintf fmt "@;";
|
1532
|
((fun x ->
|
1533
|
ignore
|
1534
|
(List.fold_left
|
1535
|
(fun sep ->
|
1536
|
fun x ->
|
1537
|
if sep then Format.fprintf fmt "@;";
|
1538
|
((__1 ()) fmt) x;
|
1539
|
Format.fprintf fmt ";";
|
1540
|
true) false x))) x.declarations));
|
1541
|
Format.fprintf fmt "@]@;@[<v 2>begin@;";
|
1542
|
((fun x ->
|
1543
|
ignore
|
1544
|
(List.fold_left
|
1545
|
(fun sep ->
|
1546
|
fun x ->
|
1547
|
if sep then Format.fprintf fmt "@;";
|
1548
|
((__3 ()) fmt) x;
|
1549
|
Format.fprintf fmt ";";
|
1550
|
true) false x);)) x.body;
|
1551
|
Format.fprintf fmt "@]@;end process;@;")
|
1552
|
[@ocaml.warning "-A"])
|
1553
|
|
1554
|
and show_vhdl_process_t : vhdl_process_t -> Ppx_deriving_runtime.string =
|
1555
|
fun x -> Format.asprintf "%a" pp_vhdl_process_t x
|
1556
|
|
1557
|
let rec pp_vhdl_selected_signal_t :
|
1558
|
Format.formatter -> vhdl_selected_signal_t -> Ppx_deriving_runtime.unit =
|
1559
|
let __4 () = pp_vhdl_expr_t
|
1560
|
|
1561
|
and __3 () = pp_vhdl_signal_selection_t
|
1562
|
|
1563
|
and __2 () = pp_vhdl_expr_t
|
1564
|
|
1565
|
and __1 () = pp_vhdl_name_t
|
1566
|
|
1567
|
and __0 () = pp_vhdl_name_t
|
1568
|
in
|
1569
|
((let open! Ppx_deriving_runtime in
|
1570
|
fun fmt ->
|
1571
|
fun x ->
|
1572
|
Format.fprintf fmt "@[<v 2>";
|
1573
|
(match x.label with
|
1574
|
| NoName -> Format.fprintf fmt "";
|
1575
|
| _ -> (((__0 ()) fmt) x.label;
|
1576
|
Format.fprintf fmt ":@ ")
|
1577
|
);
|
1578
|
Format.fprintf fmt "with ";
|
1579
|
((__2 ()) fmt) x.sel;
|
1580
|
Format.fprintf fmt " select@;";
|
1581
|
((__1 ()) fmt) x.lhs;
|
1582
|
Format.fprintf fmt " <= ";
|
1583
|
((function
|
1584
|
| None -> Format.pp_print_string fmt ""
|
1585
|
| Some x ->
|
1586
|
((__4 ()) fmt) x)) x.delay;
|
1587
|
((fun x ->
|
1588
|
ignore
|
1589
|
(List.fold_left
|
1590
|
(fun sep ->
|
1591
|
fun x ->
|
1592
|
if sep then Format.fprintf fmt ",@ ";
|
1593
|
((__3 ()) fmt) x;
|
1594
|
true) false x))) x.branches;
|
1595
|
Format.fprintf fmt ";@]";)
|
1596
|
[@ocaml.warning "-A"])
|
1597
|
|
1598
|
and show_vhdl_selected_signal_t :
|
1599
|
vhdl_selected_signal_t -> Ppx_deriving_runtime.string =
|
1600
|
fun x -> Format.asprintf "%a" pp_vhdl_selected_signal_t x
|
1601
|
|
1602
|
let rec pp_vhdl_component_instantiation_t :
|
1603
|
Format.formatter ->
|
1604
|
vhdl_component_instantiation_t -> Ppx_deriving_runtime.unit
|
1605
|
=
|
1606
|
let __4 () = pp_vhdl_assoc_element_t
|
1607
|
|
1608
|
and __3 () = pp_vhdl_assoc_element_t
|
1609
|
|
1610
|
and __2 () = pp_vhdl_name_t
|
1611
|
|
1612
|
and __1 () = pp_vhdl_name_t
|
1613
|
|
1614
|
and __0 () = pp_vhdl_name_t
|
1615
|
in
|
1616
|
((let open! Ppx_deriving_runtime in
|
1617
|
fun fmt ->
|
1618
|
fun x ->
|
1619
|
Format.fprintf fmt "@[<v 2>";
|
1620
|
((__0 ()) fmt) x.name;
|
1621
|
Format.fprintf fmt " : ";
|
1622
|
Format.fprintf fmt "%s " x.inst_unit_type;
|
1623
|
((__1 ()) fmt) x.inst_unit;
|
1624
|
((function
|
1625
|
| None -> Format.pp_print_string fmt ""
|
1626
|
| Some x ->
|
1627
|
(Format.fprintf fmt "(";
|
1628
|
((__2 ()) fmt) x;
|
1629
|
Format.fprintf fmt ")@;"))) x.archi_name;
|
1630
|
(match x.generic_map with
|
1631
|
| [] -> Format.fprintf fmt "";
|
1632
|
| _ ->
|
1633
|
(Format.fprintf fmt " generic map (@[<v 2>";
|
1634
|
((fun x ->
|
1635
|
ignore
|
1636
|
(List.fold_left
|
1637
|
(fun sep ->
|
1638
|
fun x ->
|
1639
|
if sep then Format.fprintf fmt ",@,";
|
1640
|
((__3 ()) fmt) x;
|
1641
|
true) false x))) x.generic_map;
|
1642
|
Format.fprintf fmt ")@]@;"));
|
1643
|
(match x.port_map with
|
1644
|
| [] -> Format.fprintf fmt ";";
|
1645
|
| _ ->
|
1646
|
(Format.fprintf fmt " port map (@[<v 2>";
|
1647
|
((fun x ->
|
1648
|
ignore
|
1649
|
(List.fold_left
|
1650
|
(fun sep ->
|
1651
|
fun x ->
|
1652
|
if sep then Format.fprintf fmt ",@,";
|
1653
|
((__4 ()) fmt) x;
|
1654
|
true) false x))) x.port_map;
|
1655
|
Format.fprintf fmt ")@];"));
|
1656
|
Format.fprintf fmt "@]")
|
1657
|
[@ocaml.warning "-A"])
|
1658
|
|
1659
|
and show_vhdl_component_instantiation_t :
|
1660
|
vhdl_component_instantiation_t -> Ppx_deriving_runtime.string =
|
1661
|
fun x -> Format.asprintf "%a" pp_vhdl_component_instantiation_t x
|
1662
|
|
1663
|
let rec pp_vhdl_concurrent_stmt_t :
|
1664
|
Format.formatter -> vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit =
|
1665
|
let __3 () = pp_vhdl_component_instantiation_t
|
1666
|
|
1667
|
and __2 () = pp_vhdl_selected_signal_t
|
1668
|
|
1669
|
and __1 () = pp_vhdl_process_t
|
1670
|
|
1671
|
and __0 () = pp_vhdl_conditional_signal_t
|
1672
|
in
|
1673
|
((let open! Ppx_deriving_runtime in
|
1674
|
fun fmt ->
|
1675
|
function
|
1676
|
| SigAssign a0 ->
|
1677
|
((__0 ()) fmt) a0;
|
1678
|
| Process a0 ->
|
1679
|
((__1 ()) fmt) a0;
|
1680
|
| SelectedSig a0 ->
|
1681
|
((__2 ()) fmt) a0;
|
1682
|
| ComponentInst a0 ->
|
1683
|
((__3 ()) fmt) a0;
|
1684
|
)
|
1685
|
[@ocaml.warning "-A"])
|
1686
|
|
1687
|
and show_vhdl_concurrent_stmt_t :
|
1688
|
vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.string =
|
1689
|
fun x -> Format.asprintf "%a" pp_vhdl_concurrent_stmt_t x
|
1690
|
|
1691
|
let rec pp_vhdl_entity_t :
|
1692
|
Format.formatter -> vhdl_entity_t -> Ppx_deriving_runtime.unit =
|
1693
|
let __4 () = pp_vhdl_concurrent_stmt_t
|
1694
|
|
1695
|
and __3 () = pp_vhdl_declarative_item_t
|
1696
|
|
1697
|
and __2 () = pp_vhdl_port_t
|
1698
|
|
1699
|
and __1 () = pp_vhdl_port_t
|
1700
|
|
1701
|
and __0 () = pp_vhdl_name_t
|
1702
|
in
|
1703
|
((let open! Ppx_deriving_runtime in
|
1704
|
fun fmt ->
|
1705
|
fun x ->
|
1706
|
((__0 ()) fmt) x.name;
|
1707
|
Format.fprintf fmt " is@;";
|
1708
|
(match x.generics with
|
1709
|
| [] -> Format.fprintf fmt "";
|
1710
|
| _ ->
|
1711
|
Format.fprintf fmt "generic (@[<v>";
|
1712
|
((fun x ->
|
1713
|
ignore
|
1714
|
(List.fold_left
|
1715
|
(fun sep ->
|
1716
|
fun x ->
|
1717
|
if sep then Format.fprintf fmt ";@;";
|
1718
|
((__1 ()) fmt) x;
|
1719
|
true) false x))) x.generics;
|
1720
|
Format.fprintf fmt "@]);");
|
1721
|
(match x.ports with
|
1722
|
| [] -> Format.fprintf fmt "";
|
1723
|
| _ ->
|
1724
|
Format.fprintf fmt "port (@[<v>";
|
1725
|
((fun x ->
|
1726
|
ignore
|
1727
|
(List.fold_left
|
1728
|
(fun sep ->
|
1729
|
fun x ->
|
1730
|
if sep then Format.fprintf fmt ";@;";
|
1731
|
((__2 ()) fmt) x;
|
1732
|
true) false x))) x.ports;
|
1733
|
Format.fprintf fmt "@]);");
|
1734
|
(match x.declaration with
|
1735
|
| [] -> Format.fprintf fmt "";
|
1736
|
| _ ->
|
1737
|
Format.fprintf fmt "@;";
|
1738
|
((fun x ->
|
1739
|
ignore
|
1740
|
(List.fold_left
|
1741
|
(fun sep ->
|
1742
|
fun x ->
|
1743
|
if sep then Format.fprintf fmt ";@;";
|
1744
|
((__3 ()) fmt) x;
|
1745
|
true) false x))) x.declaration;
|
1746
|
Format.fprintf fmt ";");
|
1747
|
(match x.stmts with
|
1748
|
| [] -> Format.fprintf fmt "";
|
1749
|
| _ ->
|
1750
|
Format.fprintf fmt "@;@[<v 2>begin@;";
|
1751
|
((fun x ->
|
1752
|
ignore
|
1753
|
(List.fold_left
|
1754
|
(fun sep ->
|
1755
|
fun x ->
|
1756
|
if sep then Format.fprintf fmt ";@;";
|
1757
|
((__4 ()) fmt) x;
|
1758
|
true) false x))) x.stmts;
|
1759
|
Format.fprintf fmt ";@]");)
|
1760
|
[@ocaml.warning "-A"])
|
1761
|
|
1762
|
and show_vhdl_entity_t : vhdl_entity_t -> Ppx_deriving_runtime.string =
|
1763
|
fun x -> Format.asprintf "%a" pp_vhdl_entity_t x
|
1764
|
|
1765
|
let rec pp_vhdl_package_t :
|
1766
|
Format.formatter -> vhdl_package_t -> Ppx_deriving_runtime.unit =
|
1767
|
let __3 () = pp_vhdl_load_t
|
1768
|
|
1769
|
and __2 () = pp_vhdl_declaration_t
|
1770
|
|
1771
|
and __1 () = pp_vhdl_definition_t
|
1772
|
|
1773
|
and __0 () = pp_vhdl_name_t
|
1774
|
in
|
1775
|
((let open! Ppx_deriving_runtime in
|
1776
|
fun fmt ->
|
1777
|
fun x ->
|
1778
|
((__0 ()) fmt) x.name;
|
1779
|
Format.fprintf fmt " is";
|
1780
|
((fun x ->
|
1781
|
ignore
|
1782
|
(List.fold_left
|
1783
|
(fun sep ->
|
1784
|
fun x ->
|
1785
|
Format.fprintf fmt "@;";
|
1786
|
if sep then Format.fprintf fmt "";
|
1787
|
((__1 ()) fmt) x;
|
1788
|
Format.fprintf fmt ";";
|
1789
|
true) false x))) x.shared_defs;
|
1790
|
((fun x ->
|
1791
|
ignore
|
1792
|
(List.fold_left
|
1793
|
(fun sep ->
|
1794
|
fun x ->
|
1795
|
Format.fprintf fmt "@;";
|
1796
|
if sep then Format.fprintf fmt "";
|
1797
|
((__2 ()) fmt) x;
|
1798
|
Format.fprintf fmt ";";
|
1799
|
true) false x))) x.shared_decls;
|
1800
|
((fun x ->
|
1801
|
ignore
|
1802
|
(List.fold_left
|
1803
|
(fun sep ->
|
1804
|
fun x ->
|
1805
|
Format.fprintf fmt "@;";
|
1806
|
if sep then Format.fprintf fmt "";
|
1807
|
((__3 ()) fmt) x;
|
1808
|
Format.fprintf fmt ";";
|
1809
|
true) false x))) x.shared_uses;)
|
1810
|
[@ocaml.warning "-A"])
|
1811
|
|
1812
|
and show_vhdl_package_t : vhdl_package_t -> Ppx_deriving_runtime.string =
|
1813
|
fun x -> Format.asprintf "%a" pp_vhdl_package_t x
|
1814
|
|
1815
|
let rec pp_vhdl_architecture_t :
|
1816
|
Format.formatter -> vhdl_architecture_t -> Ppx_deriving_runtime.unit =
|
1817
|
let __3 () = pp_vhdl_concurrent_stmt_t
|
1818
|
|
1819
|
and __2 () = pp_vhdl_declarative_item_t
|
1820
|
|
1821
|
and __1 () = pp_vhdl_name_t
|
1822
|
|
1823
|
and __0 () = pp_vhdl_name_t
|
1824
|
in
|
1825
|
((let open! Ppx_deriving_runtime in
|
1826
|
fun fmt ->
|
1827
|
fun x ->
|
1828
|
((__0 ()) fmt) x.name;
|
1829
|
Format.fprintf fmt " of ";
|
1830
|
((__1 ()) fmt) x.entity;
|
1831
|
Format.fprintf fmt " is@;";
|
1832
|
((fun x ->
|
1833
|
ignore
|
1834
|
(List.fold_left
|
1835
|
(fun sep ->
|
1836
|
fun x ->
|
1837
|
if sep then Format.fprintf fmt "@;";
|
1838
|
((__2 ()) fmt) x;
|
1839
|
Format.fprintf fmt ";";
|
1840
|
true) false x))) x.declarations;
|
1841
|
Format.fprintf fmt "@;";
|
1842
|
Format.fprintf fmt "@[<v 2>begin@;";
|
1843
|
(match x.body with
|
1844
|
| [] -> Format.fprintf fmt "";
|
1845
|
| _ ->
|
1846
|
((fun x ->
|
1847
|
ignore
|
1848
|
(List.fold_left
|
1849
|
(fun sep ->
|
1850
|
fun x ->
|
1851
|
if sep then Format.fprintf fmt "@;";
|
1852
|
((__3 ()) fmt) x;
|
1853
|
true) false x))) x.body);
|
1854
|
Format.fprintf fmt "@]@;")
|
1855
|
[@ocaml.warning "-A"])
|
1856
|
|
1857
|
and show_vhdl_architecture_t :
|
1858
|
vhdl_architecture_t -> Ppx_deriving_runtime.string =
|
1859
|
fun x -> Format.asprintf "%a" pp_vhdl_architecture_t x
|
1860
|
|
1861
|
|
1862
|
let rec (pp_vhdl_configuration_t :
|
1863
|
Format.formatter ->
|
1864
|
vhdl_configuration_t -> Ppx_deriving_runtime.unit)
|
1865
|
=
|
1866
|
((let open! Ppx_deriving_runtime in
|
1867
|
fun fmt -> fun () -> Format.pp_print_string fmt "()")
|
1868
|
[@ocaml.warning "-A"])
|
1869
|
|
1870
|
and show_vhdl_configuration_t :
|
1871
|
vhdl_configuration_t -> Ppx_deriving_runtime.string =
|
1872
|
fun x -> Format.asprintf "%a" pp_vhdl_configuration_t x
|
1873
|
|
1874
|
|
1875
|
let rec pp_vhdl_library_unit_t :
|
1876
|
Format.formatter -> vhdl_library_unit_t -> Ppx_deriving_runtime.unit =
|
1877
|
let __3 () = pp_vhdl_configuration_t
|
1878
|
|
1879
|
and __2 () = pp_vhdl_architecture_t
|
1880
|
|
1881
|
and __1 () = pp_vhdl_entity_t
|
1882
|
|
1883
|
and __0 () = pp_vhdl_package_t
|
1884
|
in
|
1885
|
((let open! Ppx_deriving_runtime in
|
1886
|
fun fmt ->
|
1887
|
function
|
1888
|
| Package a0 ->
|
1889
|
(Format.fprintf fmt "@[<v 2>package ";
|
1890
|
((__0 ()) fmt) a0;
|
1891
|
Format.fprintf fmt "@.end;@]")
|
1892
|
| Entities a0 ->
|
1893
|
(Format.fprintf fmt "@[<v 2>entity ";
|
1894
|
((__1 ()) fmt) a0;
|
1895
|
Format.fprintf fmt "@.end;@]")
|
1896
|
| Architecture a0 ->
|
1897
|
(Format.fprintf fmt "@[<v 2>architecture ";
|
1898
|
((__2 ()) fmt) a0;
|
1899
|
Format.fprintf fmt "@.end;@]")
|
1900
|
| Configuration a0 ->
|
1901
|
(Format.fprintf fmt "@[<v 2>configuration ";
|
1902
|
((__3 ()) fmt) a0;
|
1903
|
Format.fprintf fmt "@.end;@]"))
|
1904
|
[@ocaml.warning "-A"])
|
1905
|
|
1906
|
and show_vhdl_library_unit_t :
|
1907
|
vhdl_library_unit_t -> Ppx_deriving_runtime.string =
|
1908
|
fun x -> Format.asprintf "%a" pp_vhdl_library_unit_t x
|
1909
|
|
1910
|
let rec pp_vhdl_design_unit_t :
|
1911
|
Format.formatter -> vhdl_design_unit_t -> Ppx_deriving_runtime.unit =
|
1912
|
let __1 () = pp_vhdl_library_unit_t
|
1913
|
|
1914
|
and __0 () = pp_vhdl_load_t
|
1915
|
in
|
1916
|
((let open! Ppx_deriving_runtime in
|
1917
|
fun fmt ->
|
1918
|
fun x ->
|
1919
|
(match x.contexts with
|
1920
|
| [] -> Format.fprintf fmt "";
|
1921
|
| _ ->
|
1922
|
((fun x ->
|
1923
|
ignore
|
1924
|
(List.fold_left
|
1925
|
(fun sep ->
|
1926
|
fun x ->
|
1927
|
if sep then Format.fprintf fmt "@.";
|
1928
|
((__0 ()) fmt) x;
|
1929
|
Format.fprintf fmt ";";
|
1930
|
true) false x);
|
1931
|
)) x.contexts;
|
1932
|
Format.fprintf fmt "@.";);
|
1933
|
((__1 ()) fmt) x.library;)
|
1934
|
[@ocaml.warning "-A"])
|
1935
|
|
1936
|
and show_vhdl_design_unit_t :
|
1937
|
vhdl_design_unit_t -> Ppx_deriving_runtime.string =
|
1938
|
fun x -> Format.asprintf "%a" pp_vhdl_design_unit_t x
|
1939
|
|
1940
|
let rec pp_vhdl_design_file_t :
|
1941
|
Format.formatter -> vhdl_design_file_t -> Ppx_deriving_runtime.unit =
|
1942
|
let __0 () = pp_vhdl_design_unit_t in
|
1943
|
((let open! Ppx_deriving_runtime in
|
1944
|
fun fmt ->
|
1945
|
fun x ->
|
1946
|
((fun x ->
|
1947
|
ignore
|
1948
|
(List.fold_left
|
1949
|
(fun sep ->
|
1950
|
fun x ->
|
1951
|
if sep then Format.fprintf fmt "@.";
|
1952
|
((__0 ()) fmt) x;
|
1953
|
true) false x);
|
1954
|
)) x.design_units)
|
1955
|
[@ocaml.warning "-A"])
|
1956
|
|
1957
|
and show_vhdl_design_file_t :
|
1958
|
vhdl_design_file_t -> Ppx_deriving_runtime.string =
|
1959
|
fun x -> Format.asprintf "%a" pp_vhdl_design_file_t x
|
1960
|
|
1961
|
let rec pp_vhdl_file_t :
|
1962
|
Format.formatter -> vhdl_file_t -> Ppx_deriving_runtime.unit =
|
1963
|
let __0 () = pp_vhdl_design_file_t in
|
1964
|
((let open! Ppx_deriving_runtime in
|
1965
|
fun fmt ->
|
1966
|
fun x ->
|
1967
|
((__0 ()) fmt) x.design_file;
|
1968
|
)
|
1969
|
[@ocaml.warning "-A"])
|
1970
|
|
1971
|
and show_vhdl_file_t : vhdl_file_t -> Ppx_deriving_runtime.string =
|
1972
|
fun x -> Format.asprintf "%a" pp_vhdl_file_t x
|
1973
|
|