1
|
open Mini_vhdl_ast
|
2
|
open Vhdl_ast
|
3
|
open Vhdl_ast_pp
|
4
|
|
5
|
let rec pp_mini_vhdl_sequential_stmt_t :
|
6
|
Format.formatter ->
|
7
|
mini_vhdl_sequential_stmt_t -> Ppx_deriving_runtime.unit
|
8
|
=
|
9
|
let __32 () = pp_vhdl_expr_t
|
10
|
|
11
|
and __31 () = pp_vhdl_name_t
|
12
|
|
13
|
and __30 () = pp_vhdl_name_t
|
14
|
|
15
|
and __29 () = pp_vhdl_assoc_element_t
|
16
|
|
17
|
and __28 () = pp_vhdl_name_t
|
18
|
|
19
|
and __27 () = pp_vhdl_name_t
|
20
|
|
21
|
and __26 () = pp_vhdl_expr_t
|
22
|
|
23
|
and __25 () = pp_vhdl_expr_t
|
24
|
|
25
|
and __24 () = pp_vhdl_expr_t
|
26
|
|
27
|
and __23 () = pp_vhdl_name_t
|
28
|
|
29
|
and __22 () = pp_vhdl_expr_t
|
30
|
|
31
|
and __21 () = pp_vhdl_name_t
|
32
|
|
33
|
and __20 () = pp_mini_vhdl_case_item_t
|
34
|
|
35
|
and __19 () = pp_vhdl_expr_t
|
36
|
|
37
|
and __18 () = pp_vhdl_name_t
|
38
|
|
39
|
and __17 () = pp_mini_vhdl_sequential_stmt_t
|
40
|
|
41
|
and __16 () = pp_mini_vhdl_if_case_t
|
42
|
|
43
|
and __15 () = pp_vhdl_name_t
|
44
|
|
45
|
and __14 () = pp_vhdl_expr_t
|
46
|
|
47
|
and __13 () = pp_vhdl_signal_selection_t
|
48
|
|
49
|
and __12 () = pp_vhdl_expr_t
|
50
|
|
51
|
and __11 () = pp_vhdl_name_t
|
52
|
|
53
|
and __10 () = pp_vhdl_name_t
|
54
|
|
55
|
and __9 () = pp_vhdl_expr_t
|
56
|
|
57
|
and __8 () = pp_vhdl_signal_condition_t
|
58
|
|
59
|
and __7 () = pp_vhdl_name_t
|
60
|
|
61
|
and __6 () = pp_vhdl_name_t
|
62
|
|
63
|
and __5 () = pp_vhdl_waveform_element_t
|
64
|
|
65
|
and __4 () = pp_vhdl_name_t
|
66
|
|
67
|
and __3 () = pp_vhdl_name_t
|
68
|
|
69
|
and __2 () = pp_vhdl_expr_t
|
70
|
|
71
|
and __1 () = pp_vhdl_name_t
|
72
|
|
73
|
and __0 () = pp_vhdl_name_t
|
74
|
in
|
75
|
((let open! Ppx_deriving_runtime in
|
76
|
fun fmt ->
|
77
|
function
|
78
|
| VarAssign { label = alabel; lhs = alhs; rhs = arhs } ->
|
79
|
(match alabel with
|
80
|
| None -> Format.fprintf fmt "";
|
81
|
| Some e -> (((__0 ()) fmt) e;
|
82
|
Format.fprintf fmt ": ")
|
83
|
);
|
84
|
((__1 ()) fmt) alhs;
|
85
|
Format.fprintf fmt " := ";
|
86
|
((__2 ()) fmt) arhs;
|
87
|
| SigSeqAssign { label = alabel; lhs = alhs; rhs = arhs } ->
|
88
|
(match alabel with
|
89
|
| None -> Format.fprintf fmt "";
|
90
|
| Some e -> (((__3 ()) fmt) e;
|
91
|
Format.fprintf fmt ":@ ")
|
92
|
);
|
93
|
Format.fprintf fmt "@[<2>";
|
94
|
((__4 ()) fmt) alhs;
|
95
|
Format.fprintf fmt "@ <=@ ";
|
96
|
((fun x ->
|
97
|
Format.fprintf fmt "@[";
|
98
|
ignore
|
99
|
(List.fold_left
|
100
|
(fun sep ->
|
101
|
fun x ->
|
102
|
if sep then Format.fprintf fmt ", ";
|
103
|
((__5 ()) fmt) x;
|
104
|
true) false x);
|
105
|
Format.fprintf fmt "@]@]")) arhs;
|
106
|
| SigCondAssign { label = alabel; lhs = alhs; rhs = arhs; delay = adelay } ->
|
107
|
(match alabel with
|
108
|
| None -> Format.fprintf fmt "";
|
109
|
| Some e -> (((__6 ()) fmt) e;
|
110
|
Format.fprintf fmt ":@ ")
|
111
|
);
|
112
|
Format.fprintf fmt "@[<2>";
|
113
|
((__7 ()) fmt) alhs;
|
114
|
Format.fprintf fmt "@ <=@ ";
|
115
|
(match adelay with
|
116
|
| None -> Format.fprintf fmt "";
|
117
|
| Some e -> ((__9 ()) fmt) e;
|
118
|
Format.fprintf fmt " ");
|
119
|
((fun x ->
|
120
|
Format.fprintf fmt "@[";
|
121
|
ignore
|
122
|
(List.fold_left
|
123
|
(fun sep ->
|
124
|
fun x ->
|
125
|
if sep then Format.fprintf fmt " else ";
|
126
|
((__8 ()) fmt) x;
|
127
|
true) false x);
|
128
|
Format.fprintf fmt "@]@]")) arhs;
|
129
|
| SigSelectAssign
|
130
|
{ label = alabel; lhs = alhs; sel = asel; branches = abranches;
|
131
|
delay = adelay }
|
132
|
->
|
133
|
(match alabel with
|
134
|
| None -> Format.fprintf fmt "";
|
135
|
| Some e -> (((__10 ()) fmt) e;
|
136
|
Format.fprintf fmt ":@ ")
|
137
|
);
|
138
|
Format.fprintf fmt "@[<2>";
|
139
|
Format.fprintf fmt "with ";
|
140
|
((__12 ()) fmt) asel;
|
141
|
Format.fprintf fmt " select@;";
|
142
|
((__11 ()) fmt) alhs;
|
143
|
Format.fprintf fmt " <= ";
|
144
|
((function
|
145
|
| None -> Format.pp_print_string fmt ""
|
146
|
| Some x ->
|
147
|
((__14 ()) fmt) x)) adelay;
|
148
|
((fun x ->
|
149
|
ignore
|
150
|
(List.fold_left
|
151
|
(fun sep ->
|
152
|
fun x ->
|
153
|
if sep then Format.fprintf fmt ",@ ";
|
154
|
((__13 ()) fmt) x;
|
155
|
true) false x))) abranches;
|
156
|
Format.fprintf fmt ";@]"
|
157
|
| If { label = alabel; if_cases = aif_cases; default = adefault } ->
|
158
|
(match alabel with
|
159
|
| None -> Format.fprintf fmt "";
|
160
|
| Some e -> (((__15 ()) fmt) e;
|
161
|
Format.fprintf fmt ":@ ")
|
162
|
);
|
163
|
Format.fprintf fmt "@[<v>if";
|
164
|
((fun x ->
|
165
|
ignore
|
166
|
(List.fold_left
|
167
|
(fun sep ->
|
168
|
fun x ->
|
169
|
if sep then Format.fprintf fmt "@;elsif";
|
170
|
((__16 ()) fmt) x;
|
171
|
true
|
172
|
) false x);
|
173
|
)) aif_cases;
|
174
|
(match adefault with
|
175
|
| [] -> Format.fprintf fmt "";
|
176
|
| _ -> (Format.fprintf fmt "@;else";
|
177
|
((fun x ->
|
178
|
Format.fprintf fmt "@;<0 2>";
|
179
|
ignore
|
180
|
(List.fold_left
|
181
|
(fun sep ->
|
182
|
fun x ->
|
183
|
if sep then Format.fprintf fmt "";
|
184
|
((__17 ()) fmt) x;
|
185
|
Format.fprintf fmt ";";
|
186
|
true) false x))) adefault));
|
187
|
Format.fprintf fmt "@;end if@]"
|
188
|
| Case { label = alabel; guard = aguard; branches = abranches } ->
|
189
|
(match alabel with
|
190
|
| None -> Format.fprintf fmt "";
|
191
|
| Some e -> (((__18 ()) fmt) e;
|
192
|
Format.fprintf fmt ":@ ")
|
193
|
);
|
194
|
Format.fprintf fmt "@[<v>case ";
|
195
|
((__19 ()) fmt) aguard;
|
196
|
Format.fprintf fmt " is";
|
197
|
((fun x ->
|
198
|
ignore
|
199
|
(List.fold_left
|
200
|
(fun sep ->
|
201
|
fun x ->
|
202
|
if sep then Format.fprintf fmt "";
|
203
|
((__20 ()) fmt) x;
|
204
|
true) false x);)) abranches;
|
205
|
Format.fprintf fmt "@;end case@]";
|
206
|
| Exit
|
207
|
{ label = alabel; loop_label = aloop_label;
|
208
|
condition = acondition }
|
209
|
->
|
210
|
(match alabel with
|
211
|
| None -> Format.fprintf fmt "";
|
212
|
| Some e -> (((__21 ()) fmt) e;
|
213
|
Format.fprintf fmt ":@ ")
|
214
|
);
|
215
|
Format.fprintf fmt "exit";
|
216
|
(match aloop_label with
|
217
|
| None -> Format.pp_print_string fmt ""
|
218
|
| Some x -> (Format.fprintf fmt "@ %s@ ") x);
|
219
|
((function
|
220
|
| None -> Format.pp_print_string fmt ""
|
221
|
| Some x ->
|
222
|
(Format.pp_print_string fmt "when@ ";
|
223
|
((__22 ()) fmt) x;))) acondition;
|
224
|
| Assert
|
225
|
{ label = alabel; cond = acond; report = areport;
|
226
|
severity = aseverity }
|
227
|
->
|
228
|
Format.fprintf fmt "@[<v 2>";
|
229
|
(match alabel with
|
230
|
| None -> Format.fprintf fmt "";
|
231
|
| Some e -> (((__23 ()) fmt) e;
|
232
|
Format.fprintf fmt ":@ ")
|
233
|
);
|
234
|
Format.fprintf fmt "assert ";
|
235
|
((__24 ()) fmt) acond;
|
236
|
(match areport with
|
237
|
| IsNull -> Format.fprintf fmt "";
|
238
|
| _ ->
|
239
|
Format.fprintf fmt "@;report ";
|
240
|
((__25 ()) fmt) areport);
|
241
|
(match aseverity with
|
242
|
| IsNull -> Format.fprintf fmt "";
|
243
|
| _ ->
|
244
|
Format.fprintf fmt "@;severity ";
|
245
|
((__26 ()) fmt) aseverity);
|
246
|
Format.fprintf fmt "@]";
|
247
|
| ProcedureCall { label = alabel; name = aname; assocs = aassocs } ->
|
248
|
(match alabel with
|
249
|
| None -> Format.fprintf fmt "";
|
250
|
| Some e -> (((__27 ()) fmt) e;
|
251
|
Format.fprintf fmt ":@ ")
|
252
|
);
|
253
|
((__28 ()) fmt) aname;
|
254
|
(match aassocs with
|
255
|
| [] -> Format.fprintf fmt "";
|
256
|
| _ ->
|
257
|
Format.fprintf fmt "(@[<v>";
|
258
|
((fun x ->
|
259
|
ignore
|
260
|
(List.fold_left
|
261
|
(fun sep ->
|
262
|
fun x ->
|
263
|
if sep then Format.fprintf fmt ",@ ";
|
264
|
((__29 ()) fmt) x;
|
265
|
true) false x))) aassocs;
|
266
|
Format.fprintf fmt "@])");
|
267
|
| Wait -> Format.pp_print_string fmt "wait"
|
268
|
| Null { label = alabel } ->
|
269
|
(match alabel with
|
270
|
| None -> Format.fprintf fmt "";
|
271
|
| Some e -> (((__27 ()) fmt) e;
|
272
|
Format.fprintf fmt ":@ ")
|
273
|
);
|
274
|
Format.fprintf fmt "null";
|
275
|
| Return { label = alabel; expr = aexpr } ->
|
276
|
(match alabel with
|
277
|
| None -> ();
|
278
|
| Some a -> (((__28 ()) fmt) a;
|
279
|
Format.fprintf fmt ":@ ")
|
280
|
);
|
281
|
Format.fprintf fmt "return";
|
282
|
(match aexpr with
|
283
|
| None -> ()
|
284
|
| Some a ->
|
285
|
((__32 ()) fmt) a);)
|
286
|
[@ocaml.warning "-A"])
|
287
|
|
288
|
and show_mini_vhdl_sequential_stmt_t :
|
289
|
mini_vhdl_sequential_stmt_t -> Ppx_deriving_runtime.string =
|
290
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_sequential_stmt_t x
|
291
|
|
292
|
and pp_mini_vhdl_if_case_t :
|
293
|
Format.formatter -> mini_vhdl_if_case_t -> Ppx_deriving_runtime.unit =
|
294
|
let __1 () = pp_mini_vhdl_sequential_stmt_t
|
295
|
|
296
|
and __0 () = pp_vhdl_expr_t
|
297
|
in
|
298
|
((let open! Ppx_deriving_runtime in
|
299
|
fun fmt ->
|
300
|
fun x ->
|
301
|
Format.fprintf fmt "@[<2>{ ";
|
302
|
((Format.fprintf fmt "@[%s =@ " "if_cond";
|
303
|
((__0 ()) fmt) x.if_cond;
|
304
|
Format.fprintf fmt "@]");
|
305
|
Format.fprintf fmt ";@ ";
|
306
|
Format.fprintf fmt "@[%s =@ " "if_block";
|
307
|
((fun x ->
|
308
|
Format.fprintf fmt "@[<2>[";
|
309
|
ignore
|
310
|
(List.fold_left
|
311
|
(fun sep ->
|
312
|
fun x ->
|
313
|
if sep then Format.fprintf fmt ";@ ";
|
314
|
((__1 ()) fmt) x;
|
315
|
true) false x);
|
316
|
Format.fprintf fmt "@,]@]")) x.if_block;
|
317
|
Format.fprintf fmt "@]");
|
318
|
Format.fprintf fmt "@ }@]")
|
319
|
[@ocaml.warning "-A"])
|
320
|
|
321
|
and show_mini_vhdl_if_case_t :
|
322
|
mini_vhdl_if_case_t -> Ppx_deriving_runtime.string =
|
323
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_if_case_t x
|
324
|
|
325
|
and pp_mini_vhdl_case_item_t :
|
326
|
Format.formatter -> mini_vhdl_case_item_t -> Ppx_deriving_runtime.unit =
|
327
|
let __1 () = pp_mini_vhdl_sequential_stmt_t
|
328
|
|
329
|
and __0 () = pp_vhdl_expr_t
|
330
|
in
|
331
|
((let open! Ppx_deriving_runtime in
|
332
|
fun fmt ->
|
333
|
fun x ->
|
334
|
Format.fprintf fmt "@[<2>{ ";
|
335
|
((Format.fprintf fmt "@[%s =@ " "when_cond";
|
336
|
((fun x ->
|
337
|
Format.fprintf fmt "@[<2>[";
|
338
|
ignore
|
339
|
(List.fold_left
|
340
|
(fun sep ->
|
341
|
fun x ->
|
342
|
if sep then Format.fprintf fmt ";@ ";
|
343
|
((__0 ()) fmt) x;
|
344
|
true) false x);
|
345
|
Format.fprintf fmt "@,]@]")) x.when_cond;
|
346
|
Format.fprintf fmt "@]");
|
347
|
Format.fprintf fmt ";@ ";
|
348
|
Format.fprintf fmt "@[%s =@ " "when_stmt";
|
349
|
((fun x ->
|
350
|
Format.fprintf fmt "@[<2>[";
|
351
|
ignore
|
352
|
(List.fold_left
|
353
|
(fun sep ->
|
354
|
fun x ->
|
355
|
if sep then Format.fprintf fmt ";@ ";
|
356
|
((__1 ()) fmt) x;
|
357
|
true) false x);
|
358
|
Format.fprintf fmt "@,]@]")) x.when_stmt;
|
359
|
Format.fprintf fmt "@]");
|
360
|
Format.fprintf fmt "@ }@]")
|
361
|
[@ocaml.warning "-A"])
|
362
|
|
363
|
and show_mini_vhdl_case_item_t :
|
364
|
mini_vhdl_case_item_t -> Ppx_deriving_runtime.string =
|
365
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_case_item_t x
|
366
|
|
367
|
let rec pp_mini_vhdl_declaration_t :
|
368
|
Format.formatter -> mini_vhdl_declaration_t -> Ppx_deriving_runtime.unit =
|
369
|
let __14 () = pp_mini_vhdl_sequential_stmt_t
|
370
|
|
371
|
and __13 () = pp_mini_vhdl_declaration_t
|
372
|
|
373
|
and __12 () = pp_vhdl_subprogram_spec_t
|
374
|
|
375
|
and __11 () = pp_vhdl_port_t
|
376
|
|
377
|
and __10 () = pp_vhdl_port_t
|
378
|
|
379
|
and __9 () = pp_vhdl_name_t
|
380
|
|
381
|
and __8 () = pp_vhdl_expr_t
|
382
|
|
383
|
and __7 () = pp_vhdl_subtype_indication_t
|
384
|
|
385
|
and __6 () = pp_vhdl_name_t
|
386
|
|
387
|
and __5 () = pp_vhdl_expr_t
|
388
|
|
389
|
and __4 () = pp_vhdl_subtype_indication_t
|
390
|
|
391
|
and __3 () = pp_vhdl_name_t
|
392
|
|
393
|
and __2 () = pp_vhdl_expr_t
|
394
|
|
395
|
and __1 () = pp_vhdl_subtype_indication_t
|
396
|
|
397
|
and __0 () = pp_vhdl_name_t
|
398
|
in
|
399
|
((let open! Ppx_deriving_runtime in
|
400
|
fun fmt ->
|
401
|
function
|
402
|
| VarDecl { names = anames; typ = atyp; init_val = ainit_val } ->
|
403
|
(Format.fprintf fmt "variable ";
|
404
|
((((fun x ->
|
405
|
ignore
|
406
|
(List.fold_left
|
407
|
(fun sep ->
|
408
|
fun x ->
|
409
|
if sep then Format.fprintf fmt ",";
|
410
|
((__0 ()) fmt) x;
|
411
|
true) false x);)) anames;
|
412
|
Format.fprintf fmt " : ";
|
413
|
((__1 ()) fmt) atyp;
|
414
|
(match ainit_val with
|
415
|
| IsNull -> Format.pp_print_string fmt ""
|
416
|
| _ ->
|
417
|
(Format.fprintf fmt ":=";
|
418
|
((__2 ()) fmt) ainit_val;))));)
|
419
|
| CstDecl { names = anames; typ = atyp; init_val = ainit_val } ->
|
420
|
(Format.fprintf fmt "constant ";
|
421
|
((((fun x ->
|
422
|
ignore
|
423
|
(List.fold_left
|
424
|
(fun sep ->
|
425
|
fun x ->
|
426
|
if sep then Format.fprintf fmt ",";
|
427
|
((__3 ()) fmt) x;
|
428
|
true) false x);)) anames;
|
429
|
Format.fprintf fmt " : ";
|
430
|
((__4 ()) fmt) atyp;
|
431
|
Format.fprintf fmt " := ";
|
432
|
((__5 ()) fmt) ainit_val)))
|
433
|
| SigDecl { names = anames; typ = atyp; init_val = ainit_val } ->
|
434
|
(Format.fprintf fmt "signal ";
|
435
|
((fun x ->
|
436
|
ignore
|
437
|
(List.fold_left
|
438
|
(fun sep ->
|
439
|
fun x ->
|
440
|
if sep then Format.fprintf fmt ",";
|
441
|
((__6 ()) fmt) x;
|
442
|
true) false x);
|
443
|
)) anames;
|
444
|
Format.fprintf fmt " : ";
|
445
|
((__7 ()) fmt) atyp;
|
446
|
(match ainit_val with
|
447
|
| IsNull -> Format.pp_print_string fmt ""
|
448
|
| _ ->
|
449
|
(Format.fprintf fmt ":=";
|
450
|
((__8 ()) fmt) ainit_val;)))
|
451
|
| ComponentDecl
|
452
|
{ name = aname; generics = agenerics; ports = aports } ->
|
453
|
Format.fprintf fmt "@[<v 2>component ";
|
454
|
((__9 ()) fmt) aname;
|
455
|
Format.fprintf fmt " is@;";
|
456
|
(match agenerics with
|
457
|
| [] -> ()
|
458
|
| _ ->
|
459
|
Format.fprintf fmt "generic (@[<v>";
|
460
|
((fun x ->
|
461
|
ignore
|
462
|
(List.fold_left
|
463
|
(fun sep ->
|
464
|
fun x ->
|
465
|
if sep then Format.fprintf fmt ";@;";
|
466
|
((__10 ()) fmt) x;
|
467
|
true) false x))) agenerics;
|
468
|
Format.fprintf fmt "@]);");
|
469
|
(match aports with
|
470
|
| [] -> ()
|
471
|
| _ ->
|
472
|
Format.fprintf fmt "port (@[<v>";
|
473
|
((fun x ->
|
474
|
ignore
|
475
|
(List.fold_left
|
476
|
(fun sep ->
|
477
|
fun x ->
|
478
|
if sep then Format.fprintf fmt ";@;";
|
479
|
((__11 ()) fmt) x;
|
480
|
true) false x))) aports;
|
481
|
Format.fprintf fmt "@]);");
|
482
|
Format.fprintf fmt "@]@;end component";
|
483
|
| Subprogram
|
484
|
{ spec = aspec; decl_part = adecl_part; stmts = astmts }
|
485
|
->
|
486
|
Format.fprintf fmt "@[<v 2>";
|
487
|
((__12 ()) fmt) aspec;
|
488
|
Format.fprintf fmt " is";
|
489
|
(match adecl_part with
|
490
|
| [] -> Format.fprintf fmt "";
|
491
|
| _ ->
|
492
|
((fun x ->
|
493
|
ignore
|
494
|
(List.fold_left
|
495
|
(fun sep ->
|
496
|
fun x ->
|
497
|
if sep then Format.fprintf fmt "";
|
498
|
Format.fprintf fmt "@;";
|
499
|
((__13 ()) fmt) x;
|
500
|
Format.fprintf fmt ";";
|
501
|
true) false x))) adecl_part);
|
502
|
Format.fprintf fmt "@]@;";
|
503
|
Format.fprintf fmt "@[<v 2>begin@;";
|
504
|
((fun x ->
|
505
|
ignore
|
506
|
(List.fold_left
|
507
|
(fun sep ->
|
508
|
fun x ->
|
509
|
if sep then Format.fprintf fmt "@;";
|
510
|
((__14 ()) fmt) x;
|
511
|
Format.fprintf fmt ";";
|
512
|
true) false x))) astmts;
|
513
|
Format.fprintf fmt "@]@;end";) [@ocaml.warning "-A"])
|
514
|
|
515
|
and show_mini_vhdl_declaration_t :
|
516
|
mini_vhdl_declaration_t -> Ppx_deriving_runtime.string =
|
517
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_declaration_t x
|
518
|
|
519
|
let rec pp_mini_vhdl_declarative_item_t :
|
520
|
Format.formatter ->
|
521
|
mini_vhdl_declarative_item_t -> Ppx_deriving_runtime.unit
|
522
|
=
|
523
|
let __2 () = pp_vhdl_definition_t
|
524
|
|
525
|
and __1 () = pp_mini_vhdl_declaration_t
|
526
|
|
527
|
and __0 () = pp_vhdl_load_t
|
528
|
in
|
529
|
((let open! Ppx_deriving_runtime in
|
530
|
fun fmt ->
|
531
|
fun x ->
|
532
|
Format.fprintf fmt "@[<2>{ ";
|
533
|
(((Format.fprintf fmt "@[%s =@ " "use_clause";
|
534
|
((function
|
535
|
| None -> Format.pp_print_string fmt "None"
|
536
|
| Some x ->
|
537
|
(Format.pp_print_string fmt "(Some ";
|
538
|
((__0 ()) fmt) x;
|
539
|
Format.pp_print_string fmt ")"))) x.use_clause;
|
540
|
Format.fprintf fmt "@]");
|
541
|
Format.fprintf fmt ";@ ";
|
542
|
Format.fprintf fmt "@[%s =@ " "declaration";
|
543
|
((function
|
544
|
| None -> Format.pp_print_string fmt "None"
|
545
|
| Some x ->
|
546
|
(Format.pp_print_string fmt "(Some ";
|
547
|
((__1 ()) fmt) x;
|
548
|
Format.pp_print_string fmt ")"))) x.declaration;
|
549
|
Format.fprintf fmt "@]");
|
550
|
Format.fprintf fmt ";@ ";
|
551
|
Format.fprintf fmt "@[%s =@ " "definition";
|
552
|
((function
|
553
|
| None -> Format.pp_print_string fmt "None"
|
554
|
| Some x ->
|
555
|
(Format.pp_print_string fmt "(Some ";
|
556
|
((__2 ()) fmt) x;
|
557
|
Format.pp_print_string fmt ")"))) x.definition;
|
558
|
Format.fprintf fmt "@]");
|
559
|
Format.fprintf fmt "@ }@]")
|
560
|
[@ocaml.warning "-A"])
|
561
|
|
562
|
and show_mini_vhdl_declarative_item_t :
|
563
|
mini_vhdl_declarative_item_t -> Ppx_deriving_runtime.string =
|
564
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_declarative_item_t x
|
565
|
|
566
|
let rec pp_mini_vhdl_component_instantiation_t :
|
567
|
Format.formatter ->
|
568
|
mini_vhdl_component_instantiation_t -> Ppx_deriving_runtime.unit
|
569
|
=
|
570
|
let __4 () = pp_vhdl_assoc_element_t
|
571
|
|
572
|
and __3 () = pp_vhdl_assoc_element_t
|
573
|
|
574
|
and __2 () = pp_vhdl_entity_t
|
575
|
|
576
|
and __1 () = pp_vhdl_architecture_t
|
577
|
|
578
|
and __0 () = pp_vhdl_name_t
|
579
|
in
|
580
|
((let open! Ppx_deriving_runtime in
|
581
|
fun fmt ->
|
582
|
fun x ->
|
583
|
Format.fprintf fmt "@[<v 2>";
|
584
|
((__0 ()) fmt) x.name;
|
585
|
Format.fprintf fmt "__";
|
586
|
((__0 ()) fmt) x.archi.name;
|
587
|
Format.fprintf fmt "__";
|
588
|
((__0 ()) fmt) x.entity.name;
|
589
|
(match x.generic_map with
|
590
|
| [] -> Format.fprintf fmt "";
|
591
|
| _ ->
|
592
|
(Format.fprintf fmt " generic map (@[<v 2>";
|
593
|
((fun x ->
|
594
|
ignore
|
595
|
(List.fold_left
|
596
|
(fun sep ->
|
597
|
fun x ->
|
598
|
if sep then Format.fprintf fmt ",@,";
|
599
|
((__3 ()) fmt) x;
|
600
|
true) false x))) x.generic_map;
|
601
|
Format.fprintf fmt ")@]@;"));
|
602
|
(match x.port_map with
|
603
|
| [] -> Format.fprintf fmt ";";
|
604
|
| _ ->
|
605
|
(Format.fprintf fmt " port map (@[<v 2>";
|
606
|
((fun x ->
|
607
|
ignore
|
608
|
(List.fold_left
|
609
|
(fun sep ->
|
610
|
fun x ->
|
611
|
if sep then Format.fprintf fmt ",@,";
|
612
|
((__4 ()) fmt) x;
|
613
|
true) false x))) x.port_map;
|
614
|
Format.fprintf fmt ")@];"));
|
615
|
Format.fprintf fmt "@]")
|
616
|
[@ocaml.warning "-A"])
|
617
|
|
618
|
and show_mini_vhdl_component_instantiation_t :
|
619
|
mini_vhdl_component_instantiation_t -> Ppx_deriving_runtime.string =
|
620
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_component_instantiation_t x
|
621
|
|
622
|
let rec pp_mini_vhdl_process_t :
|
623
|
Format.formatter -> mini_vhdl_process_t -> Ppx_deriving_runtime.unit =
|
624
|
let __3 () = pp_mini_vhdl_sequential_stmt_t
|
625
|
|
626
|
and __2 () = pp_vhdl_name_t
|
627
|
|
628
|
and __1 () = pp_mini_vhdl_declarative_item_t
|
629
|
|
630
|
and __0 () = pp_vhdl_name_t
|
631
|
in
|
632
|
((let open! Ppx_deriving_runtime in
|
633
|
fun fmt ->
|
634
|
fun x ->
|
635
|
Format.fprintf fmt "@[<v 2>";
|
636
|
(match x.id with
|
637
|
| NoName -> Format.fprintf fmt "";
|
638
|
| _ ->
|
639
|
((__0 ()) fmt) x.id;
|
640
|
Format.fprintf fmt ": ");
|
641
|
Format.fprintf fmt "process ";
|
642
|
(match x.active_sigs with
|
643
|
| [] -> Format.fprintf fmt "";
|
644
|
| _ -> Format.fprintf fmt "(";
|
645
|
((fun x ->
|
646
|
ignore
|
647
|
(List.fold_left
|
648
|
(fun sep ->
|
649
|
fun x ->
|
650
|
if sep then Format.fprintf fmt ",";
|
651
|
((__2 ()) fmt) x;
|
652
|
true) false x))) x.active_sigs;
|
653
|
Format.fprintf fmt ")");
|
654
|
Format.fprintf fmt " is";
|
655
|
(match x.declarations with
|
656
|
| [] -> Format.fprintf fmt "";
|
657
|
| _ ->
|
658
|
(Format.fprintf fmt "@;";
|
659
|
((fun x ->
|
660
|
ignore
|
661
|
(List.fold_left
|
662
|
(fun sep ->
|
663
|
fun x ->
|
664
|
if sep then Format.fprintf fmt "@;";
|
665
|
((__1 ()) fmt) x;
|
666
|
Format.fprintf fmt ";";
|
667
|
true) false x))) x.declarations));
|
668
|
Format.fprintf fmt "@]@;@[<v 2>begin@;";
|
669
|
((fun x ->
|
670
|
ignore
|
671
|
(List.fold_left
|
672
|
(fun sep ->
|
673
|
fun x ->
|
674
|
if sep then Format.fprintf fmt "@;";
|
675
|
((__3 ()) fmt) x;
|
676
|
Format.fprintf fmt ";";
|
677
|
true) false x);)) x.body;
|
678
|
Format.fprintf fmt "@]@;end process;@;")
|
679
|
[@ocaml.warning "-A"])
|
680
|
|
681
|
and show_mini_vhdl_process_t :
|
682
|
mini_vhdl_process_t -> Ppx_deriving_runtime.string =
|
683
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_process_t x
|
684
|
|
685
|
let rec pp_mini_vhdl_concurrent_stmt_t :
|
686
|
Format.formatter ->
|
687
|
mini_vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit
|
688
|
=
|
689
|
let __1 () = pp_mini_vhdl_component_instantiation_t
|
690
|
|
691
|
and __0 () = pp_mini_vhdl_process_t
|
692
|
in
|
693
|
((let open! Ppx_deriving_runtime in
|
694
|
fun fmt ->
|
695
|
function
|
696
|
| Process a0 ->
|
697
|
((__0 ()) fmt) a0;
|
698
|
| ComponentInst a0 ->
|
699
|
((__1 ()) fmt) a0;
|
700
|
)
|
701
|
[@ocaml.warning "-A"])
|
702
|
|
703
|
and show_mini_vhdl_concurrent_stmt_t :
|
704
|
mini_vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.string =
|
705
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_concurrent_stmt_t x
|
706
|
|
707
|
let rec pp_mini_vhdl_package_t :
|
708
|
Format.formatter -> mini_vhdl_package_t -> Ppx_deriving_runtime.unit =
|
709
|
let __3 () = pp_vhdl_load_t
|
710
|
|
711
|
and __2 () = pp_mini_vhdl_declaration_t
|
712
|
|
713
|
and __1 () = pp_vhdl_definition_t
|
714
|
|
715
|
and __0 () = pp_vhdl_name_t
|
716
|
in
|
717
|
((let open! Ppx_deriving_runtime in
|
718
|
fun fmt ->
|
719
|
fun x ->
|
720
|
Format.fprintf fmt "@[<2>{ ";
|
721
|
((((Format.fprintf fmt "@[%s =@ " "name";
|
722
|
((__0 ()) fmt) x.name;
|
723
|
Format.fprintf fmt "@]");
|
724
|
Format.fprintf fmt ";@ ";
|
725
|
Format.fprintf fmt "@[%s =@ " "shared_defs";
|
726
|
((fun x ->
|
727
|
Format.fprintf fmt "@[<2>[";
|
728
|
ignore
|
729
|
(List.fold_left
|
730
|
(fun sep ->
|
731
|
fun x ->
|
732
|
if sep then Format.fprintf fmt ";@ ";
|
733
|
((__1 ()) fmt) x;
|
734
|
true) false x);
|
735
|
Format.fprintf fmt "@,]@]")) x.shared_defs;
|
736
|
Format.fprintf fmt "@]");
|
737
|
Format.fprintf fmt ";@ ";
|
738
|
Format.fprintf fmt "@[%s =@ " "shared_decls";
|
739
|
((fun x ->
|
740
|
Format.fprintf fmt "@[<2>[";
|
741
|
ignore
|
742
|
(List.fold_left
|
743
|
(fun sep ->
|
744
|
fun x ->
|
745
|
if sep then Format.fprintf fmt ";@ ";
|
746
|
((__2 ()) fmt) x;
|
747
|
true) false x);
|
748
|
Format.fprintf fmt "@,]@]")) x.shared_decls;
|
749
|
Format.fprintf fmt "@]");
|
750
|
Format.fprintf fmt ";@ ";
|
751
|
Format.fprintf fmt "@[%s =@ " "shared_uses";
|
752
|
((fun x ->
|
753
|
Format.fprintf fmt "@[<2>[";
|
754
|
ignore
|
755
|
(List.fold_left
|
756
|
(fun sep ->
|
757
|
fun x ->
|
758
|
if sep then Format.fprintf fmt ";@ ";
|
759
|
((__3 ()) fmt) x;
|
760
|
true) false x);
|
761
|
Format.fprintf fmt "@,]@]")) x.shared_uses;
|
762
|
Format.fprintf fmt "@]");
|
763
|
Format.fprintf fmt "@ }@]")
|
764
|
[@ocaml.warning "-A"])
|
765
|
|
766
|
and show_mini_vhdl_package_t :
|
767
|
mini_vhdl_package_t -> Ppx_deriving_runtime.string =
|
768
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_package_t x
|
769
|
|
770
|
let rec pp_mini_vhdl_component_t :
|
771
|
Format.formatter -> mini_vhdl_component_t -> Ppx_deriving_runtime.unit =
|
772
|
let __6 () = pp_mini_vhdl_concurrent_stmt_t
|
773
|
|
774
|
and __5 () = pp_vhdl_definition_t
|
775
|
|
776
|
and __4 () = pp_mini_vhdl_declaration_t
|
777
|
|
778
|
and __3 () = pp_vhdl_load_t
|
779
|
|
780
|
and __2 () = pp_vhdl_port_t
|
781
|
|
782
|
and __1 () = pp_vhdl_port_t
|
783
|
|
784
|
and __0 () = pp_vhdl_name_t
|
785
|
in
|
786
|
((let open! Ppx_deriving_runtime in
|
787
|
fun fmt ->
|
788
|
fun x ->
|
789
|
Format.fprintf fmt "@[<v 2>component ";
|
790
|
(match x.names with
|
791
|
| [] -> ()
|
792
|
| _ ->
|
793
|
((fun x ->
|
794
|
ignore
|
795
|
(List.fold_left
|
796
|
(fun sep ->
|
797
|
fun x ->
|
798
|
if sep then Format.fprintf fmt "__";
|
799
|
((__0 ()) fmt) x;
|
800
|
true) false x))) x.names);
|
801
|
Format.fprintf fmt " is";
|
802
|
(match x.generics with
|
803
|
| [] -> ()
|
804
|
| _ ->
|
805
|
Format.fprintf fmt "@;generics (@[";
|
806
|
((fun x ->
|
807
|
ignore
|
808
|
(List.fold_left
|
809
|
(fun sep ->
|
810
|
fun x ->
|
811
|
if sep then Format.fprintf fmt ",@ ";
|
812
|
((__1 ()) fmt) x;
|
813
|
true) false x))) x.generics;
|
814
|
Format.fprintf fmt "@]);");
|
815
|
(match x.ports with
|
816
|
| [] -> ()
|
817
|
| _ ->
|
818
|
Format.fprintf fmt "@;ports (@[";
|
819
|
((fun x ->
|
820
|
ignore
|
821
|
(List.fold_left
|
822
|
(fun sep ->
|
823
|
fun x ->
|
824
|
if sep then Format.fprintf fmt ",@ ";
|
825
|
((__2 ()) fmt) x;
|
826
|
true) false x))) x.ports;
|
827
|
Format.fprintf fmt "@]);");
|
828
|
(match x.contexts with
|
829
|
| [] -> ()
|
830
|
| _ ->
|
831
|
Format.fprintf fmt "@;";
|
832
|
((fun x ->
|
833
|
ignore
|
834
|
(List.fold_left
|
835
|
(fun sep ->
|
836
|
fun x ->
|
837
|
if sep then Format.fprintf fmt ";@;";
|
838
|
((__3 ()) fmt) x;
|
839
|
true) false x))) x.contexts);
|
840
|
(match x.declarations with
|
841
|
| [] -> ()
|
842
|
| _ ->
|
843
|
Format.fprintf fmt "@;";
|
844
|
((fun x ->
|
845
|
ignore
|
846
|
(List.fold_left
|
847
|
(fun sep ->
|
848
|
fun x ->
|
849
|
if sep then Format.fprintf fmt "@;";
|
850
|
((__4 ()) fmt) x;
|
851
|
Format.fprintf fmt ";";
|
852
|
true) false x))) x.declarations);
|
853
|
(match x.definitions with
|
854
|
| [] -> ()
|
855
|
| _ ->
|
856
|
Format.fprintf fmt "@;";
|
857
|
((fun x ->
|
858
|
ignore
|
859
|
(List.fold_left
|
860
|
(fun sep ->
|
861
|
fun x ->
|
862
|
if sep then Format.fprintf fmt "@;";
|
863
|
((__5 ()) fmt) x;
|
864
|
Format.fprintf fmt ";";
|
865
|
true) false x))) x.definitions);
|
866
|
Format.fprintf fmt "@]@;@[<v 2>begin";
|
867
|
(match x.body with
|
868
|
| [] -> ()
|
869
|
| _ ->
|
870
|
Format.fprintf fmt "@;";
|
871
|
((fun x ->
|
872
|
ignore
|
873
|
(List.fold_left
|
874
|
(fun sep ->
|
875
|
fun x ->
|
876
|
if sep then Format.fprintf fmt "@;";
|
877
|
((__6 ()) fmt) x;
|
878
|
true) false x))) x.body);
|
879
|
Format.fprintf fmt "@]@;end;")
|
880
|
[@ocaml.warning "-A"])
|
881
|
|
882
|
and show_mini_vhdl_component_t :
|
883
|
mini_vhdl_component_t -> Ppx_deriving_runtime.string =
|
884
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_component_t x
|
885
|
|
886
|
let rec pp_mini_vhdl_design_file_t :
|
887
|
Format.formatter -> mini_vhdl_design_file_t -> Ppx_deriving_runtime.unit =
|
888
|
let __1 () = pp_mini_vhdl_package_t
|
889
|
|
890
|
and __0 () = pp_mini_vhdl_component_t
|
891
|
in
|
892
|
((let open! Ppx_deriving_runtime in
|
893
|
fun fmt ->
|
894
|
fun x ->
|
895
|
Format.fprintf fmt "@[<v>";
|
896
|
((fun x ->
|
897
|
ignore
|
898
|
(List.fold_left
|
899
|
(fun sep ->
|
900
|
fun x ->
|
901
|
if sep then Format.fprintf fmt "@;";
|
902
|
Format.fprintf fmt "package ";
|
903
|
((__1 ()) fmt) x;
|
904
|
true) false x))) x.packages;
|
905
|
(match x.components with
|
906
|
| [] -> ()
|
907
|
| _ ->
|
908
|
Format.fprintf fmt "@;";
|
909
|
((fun x ->
|
910
|
ignore
|
911
|
(List.fold_left
|
912
|
(fun sep ->
|
913
|
fun x ->
|
914
|
if sep then Format.fprintf fmt "@;";
|
915
|
((__0 ()) fmt) x;
|
916
|
true) false x))) x.components);
|
917
|
Format.fprintf fmt "@]")
|
918
|
[@ocaml.warning "-A"])
|
919
|
|
920
|
and show_mini_vhdl_design_file_t :
|
921
|
mini_vhdl_design_file_t -> Ppx_deriving_runtime.string =
|
922
|
fun x -> Format.asprintf "%a" pp_mini_vhdl_design_file_t x
|