Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / src / backends / VHDL / vhdl_ast_pp.ml @ ccd386cb

History | View | Annotate | Download (66.4 KB)

1 58f8ddf5 Arnaud Dieumegard
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 20d354f4 Arnaud Dieumegard
                          true) false x)) x.ed_names;
119 58f8ddf5 Arnaud Dieumegard
           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 20d354f4 Arnaud Dieumegard
          ((__0 ()) fmt) x.si_name;
140 58f8ddf5 Arnaud Dieumegard
          ((__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 10d196bc Arnaud Dieumegard
               (Format.fprintf fmt "%s ") aid;
314 58f8ddf5 Arnaud Dieumegard
               ((__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 5cef1e41 Arnaud Dieumegard
        | Open -> Format.pp_print_string fmt "open"
503 58f8ddf5 Arnaud Dieumegard
        | NoName  -> Format.pp_print_string fmt "")
504
    [@ocaml.warning "-A"])
505
506
and show_vhdl_name_t : vhdl_name_t -> Ppx_deriving_runtime.string =
507
  fun x  -> Format.asprintf "%a" pp_vhdl_name_t x
508
509
and pp_vhdl_assoc_element_t :
510
  Format.formatter -> vhdl_assoc_element_t -> Ppx_deriving_runtime.unit =
511
  let __4 () = pp_vhdl_expr_t
512
  
513
  and __3 () = pp_vhdl_name_t
514
  
515
  and __2 () = pp_vhdl_name_t
516
  
517
  and __1 () = pp_vhdl_name_t
518
  
519
  and __0 () = pp_vhdl_name_t
520
   in
521
  ((let open! Ppx_deriving_runtime in
522
      fun fmt  ->
523
        fun x  ->
524
          (match x.formal_name with
525
          | None -> Format.pp_print_string fmt ""
526
          | Some NoName -> Format.pp_print_string fmt ""
527
          | Some a -> 
528
              (((__0 ()) fmt) a;
529
              (match x.formal_arg with
530
              | None -> Format.pp_print_string fmt ""
531
              | Some b -> ((__1 ()) fmt) b);
532
              Format.fprintf fmt " => "));
533
          (match x.actual_name with
534
          | None -> 
535
              ((match x.actual_designator with
536
              | None -> Format.pp_print_string fmt ""
537
              | Some NoName -> Format.pp_print_string fmt ""
538
              | Some b -> ((__3 ()) fmt) b);
539
              (match x.actual_expr with
540
              | None -> Format.pp_print_string fmt ""
541
              | Some IsNull -> Format.pp_print_string fmt ""
542
              | Some c -> ((__4 ()) fmt) c);)
543
          | Some a -> 
544
              (((__2 ()) fmt) a;
545
              (match a with
546
              | NoName -> ()
547
              | _ -> Format.fprintf fmt "(");
548
              (match x.actual_designator with
549
              | None -> Format.pp_print_string fmt ""
550
              | Some b -> ((__3 ()) fmt) b);
551
              (match x.actual_expr with
552
              | None -> Format.pp_print_string fmt ""
553
              | Some IsNull -> Format.pp_print_string fmt ""
554
              | Some c -> ((__4 ()) fmt) c);
555
              (match a with
556
              | NoName -> ()
557
              | _ -> Format.fprintf fmt ")")));)
558
    [@ocaml.warning "-A"])
559
560
and show_vhdl_assoc_element_t :
561
  vhdl_assoc_element_t -> Ppx_deriving_runtime.string =
562
  fun x  -> Format.asprintf "%a" pp_vhdl_assoc_element_t x
563
564
and pp_vhdl_element_assoc_t :
565
  Format.formatter -> vhdl_element_assoc_t -> Ppx_deriving_runtime.unit =
566
  let __1 () = pp_vhdl_expr_t
567
  
568
  and __0 () = pp_vhdl_expr_t
569
   in
570
  ((let open! Ppx_deriving_runtime in
571
      fun fmt  ->
572
        fun x  ->
573
            (match x.choices with
574
            | [] -> Format.fprintf fmt "";
575
            | _ -> 
576
              (((fun x  ->
577
                ignore
578
                  (List.fold_left
579
                     (fun sep  ->
580
                        fun x  ->
581
                          if sep then Format.fprintf fmt "|@ ";
582
                          ((__0 ()) fmt) x;
583
                          true) false x))) x.choices;
584
              Format.fprintf fmt " => ";));
585
           ((__1 ()) fmt) x.expr)
586
    [@ocaml.warning "-A"])
587
588
and show_vhdl_element_assoc_t :
589
  vhdl_element_assoc_t -> Ppx_deriving_runtime.string =
590
  fun x  -> Format.asprintf "%a" pp_vhdl_element_assoc_t x
591
592
(* TODO *)
593
and (pp_vhdl_array_attributes_t :
594
      Format.formatter ->
595
        vhdl_array_attributes_t -> Ppx_deriving_runtime.unit)
596
  =
597
  ((let open! Ppx_deriving_runtime in
598
      fun fmt  ->
599
        function
600
        | AAttInt { id = aid; arg = aarg } ->
601
            (Format.fprintf fmt "@[<2>AAttInt {@,";
602
             ((Format.fprintf fmt "@[%s =@ " "id";
603
               (Format.fprintf fmt "%S") aid;
604
               Format.fprintf fmt "@]");
605
              Format.fprintf fmt ";@ ";
606
              Format.fprintf fmt "@[%s =@ " "arg";
607
              (Format.fprintf fmt "%d") aarg;
608
              Format.fprintf fmt "@]");
609
             Format.fprintf fmt "@]}")
610
        | AAttAscending  -> Format.pp_print_string fmt "AAttAscending")
611
  [@ocaml.warning "-A"])
612
613
and show_vhdl_array_attributes_t :
614
  vhdl_array_attributes_t -> Ppx_deriving_runtime.string =
615
  fun x  -> Format.asprintf "%a" pp_vhdl_array_attributes_t x
616
617
(* TODO *)
618
and (pp_vhdl_signal_attributes_t :
619
      Format.formatter ->
620
        vhdl_signal_attributes_t -> Ppx_deriving_runtime.unit)
621
  =
622
  ((let open! Ppx_deriving_runtime in
623
      fun fmt  ->
624
        function
625
        | SigAtt a0 ->
626
            (Format.fprintf fmt "(@[<2>SigAtt@ ";
627
             (Format.fprintf fmt "%S") a0;
628
             Format.fprintf fmt "@])"))
629
  [@ocaml.warning "-A"])
630
631
and show_vhdl_signal_attributes_t :
632
  vhdl_signal_attributes_t -> Ppx_deriving_runtime.string =
633
  fun x  -> Format.asprintf "%a" pp_vhdl_signal_attributes_t x
634
635
(* TODO *)
636
and (pp_vhdl_string_attributes_t :
637
      Format.formatter ->
638
        vhdl_string_attributes_t -> Ppx_deriving_runtime.unit)
639
  =
640
  ((let open! Ppx_deriving_runtime in
641
      fun fmt  ->
642
        function
643
        | StringAtt a0 ->
644
            (Format.fprintf fmt "(@[<2>StringAtt@ ";
645
             (Format.fprintf fmt "%S") a0;
646
             Format.fprintf fmt "@])"))
647
  [@ocaml.warning "-A"])
648
649
and show_vhdl_string_attributes_t :
650
  vhdl_string_attributes_t -> Ppx_deriving_runtime.string =
651
  fun x  -> Format.asprintf "%a" pp_vhdl_string_attributes_t x
652
653
(* TODO *)
654
and (pp_vhdl_suffix_selection_t :
655
      Format.formatter ->
656
        vhdl_suffix_selection_t -> Ppx_deriving_runtime.unit)
657
  =
658
  ((let open! Ppx_deriving_runtime in
659
      fun fmt  ->
660
        function
661
        | Idx a0 ->
662
            (Format.fprintf fmt "(@[<2>Idx@ ";
663
             (Format.fprintf fmt "%d") a0;
664
             Format.fprintf fmt "@])")
665
        | SuffixRange (a0,a1) ->
666
            (Format.fprintf fmt "(@[<2>SuffixRange (@,";
667
             ((Format.fprintf fmt "%d") a0;
668
              Format.fprintf fmt ",@ ";
669
              (Format.fprintf fmt "%d") a1);
670
             Format.fprintf fmt "@,))@]"))
671
  [@ocaml.warning "-A"])
672
673
and show_vhdl_suffix_selection_t :
674
  vhdl_suffix_selection_t -> Ppx_deriving_runtime.string =
675
  fun x  -> Format.asprintf "%a" pp_vhdl_suffix_selection_t x
676
677 20d354f4 Arnaud Dieumegard
(*
678 58f8ddf5 Arnaud Dieumegard
(* TODO *)
679
let rec pp_vhdl_type_attributes_t
680
  =
681
  ((let open! Ppx_deriving_runtime in
682
      fun poly_basetype  ->
683
        fun fmt  ->
684
          function
685
          | TAttNoArg { id = aid } ->
686
              (Format.fprintf fmt "@[<2>TAttNoArg {@,";
687
               (Format.fprintf fmt "@[%s =@ " "id";
688
                (Format.fprintf fmt "%S") aid;
689
                Format.fprintf fmt "@]");
690
               Format.fprintf fmt "@]}")
691
          | TAttIntArg { id = aid; arg = aarg } ->
692
              (Format.fprintf fmt "@[<2>TAttIntArg {@,";
693
               ((Format.fprintf fmt "@[%s =@ " "id";
694
                 (Format.fprintf fmt "%S") aid;
695
                 Format.fprintf fmt "@]");
696
                Format.fprintf fmt ";@ ";
697
                Format.fprintf fmt "@[%s =@ " "arg";
698
                (Format.fprintf fmt "%d") aarg;
699
                Format.fprintf fmt "@]");
700
               Format.fprintf fmt "@]}")
701
          | TAttValArg { id = aid; arg = aarg } ->
702
              (Format.fprintf fmt "@[<2>TAttValArg {@,";
703
               ((Format.fprintf fmt "@[%s =@ " "id";
704
                 (Format.fprintf fmt "%S") aid;
705
                 Format.fprintf fmt "@]");
706
                Format.fprintf fmt ";@ ";
707
                Format.fprintf fmt "@[%s =@ " "arg";
708
                (poly_basetype fmt) aarg;
709
                Format.fprintf fmt "@]");
710
               Format.fprintf fmt "@]}")
711
          | TAttStringArg { id = aid; arg = aarg } ->
712
              (Format.fprintf fmt "@[<2>TAttStringArg {@,";
713
               ((Format.fprintf fmt "@[%s =@ " "id";
714
                 (Format.fprintf fmt "%S") aid;
715
                 Format.fprintf fmt "@]");
716
                Format.fprintf fmt ";@ ";
717
                Format.fprintf fmt "@[%s =@ " "arg";
718
                (Format.fprintf fmt "%S") aarg;
719
                Format.fprintf fmt "@]");
720
               Format.fprintf fmt "@]}"))
721
  [@ocaml.warning "-A"])
722
723
and show_vhdl_type_attributes_t  =
724
  fun poly_basetype  ->
725
    fun x  ->
726
      Format.asprintf "%a" (pp_vhdl_type_attributes_t poly_basetype) x
727 20d354f4 Arnaud Dieumegard
*)
728 58f8ddf5 Arnaud Dieumegard
729
let rec pp_vhdl_parameter_t :
730
  Format.formatter -> vhdl_parameter_t -> Ppx_deriving_runtime.unit =
731
  let __2 () = pp_vhdl_cst_val_t
732
  
733
  and __1 () = pp_vhdl_subtype_indication_t
734
  
735
  and __0 () = pp_vhdl_name_t
736
   in
737
  ((let open! Ppx_deriving_runtime in
738
      fun fmt  ->
739
        fun x  ->
740
          ((fun x  ->
741
             ignore
742
               (List.fold_left
743
                 (fun sep  ->
744
                   fun x  ->
745
                     if sep then Format.fprintf fmt ", ";
746
                       ((__0 ()) fmt) x;
747 20d354f4 Arnaud Dieumegard
                       true) false x))) x.parameter_names;
748 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt ": ";
749
          ((fun x  ->
750
             ignore
751
               (List.fold_left
752
                 (fun sep  ->
753
                   fun x  ->
754
                     if sep then Format.fprintf fmt "";
755
                       Format.fprintf fmt "%s " x;
756 20d354f4 Arnaud Dieumegard
                       true) false x))) x.parameter_mode;
757
          ((__1 ()) fmt) x.parameter_typ;
758 58f8ddf5 Arnaud Dieumegard
          (match x.init_val with
759
           | None  -> Format.pp_print_string fmt ""
760
           | Some x ->
761
                 (Format.pp_print_string fmt " := ";
762
                 ((__2 ()) fmt) x));)
763
    [@ocaml.warning "-A"])
764
765
and show_vhdl_parameter_t : vhdl_parameter_t -> Ppx_deriving_runtime.string =
766
  fun x  -> Format.asprintf "%a" pp_vhdl_parameter_t x
767
768
let rec pp_vhdl_subprogram_spec_t :
769
  Format.formatter -> vhdl_subprogram_spec_t -> Ppx_deriving_runtime.unit =
770
  let __1 () = pp_vhdl_parameter_t
771
  
772
  and __0 () = pp_vhdl_name_t
773
   in
774
  ((let open! Ppx_deriving_runtime in
775
      fun fmt  ->
776
        fun x  ->
777
          (match x.subprogram_type with
778
          | "function" -> 
779
              if (x.isPure) then
780 20d354f4 Arnaud Dieumegard
                Format.fprintf fmt "pure %s %s" x.subprogram_type x.ss_name
781 58f8ddf5 Arnaud Dieumegard
              else
782 20d354f4 Arnaud Dieumegard
                Format.fprintf fmt "impure %s %s" x.subprogram_type x.ss_name
783 58f8ddf5 Arnaud Dieumegard
          | "procedure" ->
784 20d354f4 Arnaud Dieumegard
              Format.fprintf fmt "%s %s" x.subprogram_type x.ss_name);
785 58f8ddf5 Arnaud Dieumegard
          (match x.parameters with
786
          | [] -> Format.fprintf fmt "";
787
          | _ -> 
788
            Format.fprintf fmt "(@[";
789
            ((fun x  ->
790
                ignore
791
                  (List.fold_left
792
                     (fun sep  ->
793
                        fun x  ->
794
                          if sep then Format.fprintf fmt ";@ ";
795
                          ((__1 ()) fmt) x;
796
                          true) false x))) x.parameters;
797
            Format.fprintf fmt "@])");
798
          (match x.typeMark with
799
          | NoName -> Format.fprintf fmt "";
800
          | _ -> 
801
              Format.fprintf fmt "return ";
802
              ((__0 ()) fmt) x.typeMark))
803
   [@ocaml.warning "-A"])
804
805
and show_vhdl_subprogram_spec_t :
806
  vhdl_subprogram_spec_t -> Ppx_deriving_runtime.string =
807
  fun x  -> Format.asprintf "%a" pp_vhdl_subprogram_spec_t x
808
809
let rec pp_vhdl_waveform_element_t :
810
  Format.formatter -> vhdl_waveform_element_t -> Ppx_deriving_runtime.unit =
811
  let __1 () = pp_vhdl_expr_t
812
  
813
  and __0 () = pp_vhdl_expr_t
814
   in
815
  ((let open! Ppx_deriving_runtime in
816
      fun fmt  ->
817
        fun x  ->
818
          (match x.value with
819
          | None -> Format.fprintf fmt "";
820
          | Some IsNull -> Format.fprintf fmt "null";
821
          | Some v -> ((__0 ()) fmt) v);
822 20d354f4 Arnaud Dieumegard
          (match x.we_delay with
823 58f8ddf5 Arnaud Dieumegard
          | None -> Format.fprintf fmt "";
824
          | Some v -> 
825
              Format.fprintf fmt " after ";
826
              ((__1 ()) fmt) v))
827
    [@ocaml.warning "-A"])
828
829
and show_vhdl_waveform_element_t :
830
  vhdl_waveform_element_t -> Ppx_deriving_runtime.string =
831
  fun x  -> Format.asprintf "%a" pp_vhdl_waveform_element_t x
832
833
let rec pp_vhdl_sequential_stmt_t :
834
  Format.formatter -> vhdl_sequential_stmt_t -> Ppx_deriving_runtime.unit =
835
  let __23 () = pp_vhdl_expr_t
836
  
837
  and __22 () = pp_vhdl_name_t
838
  
839
  and __21 () = pp_vhdl_name_t
840
  
841
  and __20 () = pp_vhdl_assoc_element_t
842
  
843
  and __19 () = pp_vhdl_name_t
844
  
845
  and __18 () = pp_vhdl_name_t
846
  
847
  and __17 () = pp_vhdl_expr_t
848
  
849
  and __16 () = pp_vhdl_expr_t
850
  
851
  and __15 () = pp_vhdl_expr_t
852
  
853
  and __14 () = pp_vhdl_name_t
854
  
855
  and __13 () = pp_vhdl_expr_t
856
  
857
  and __12 () = pp_vhdl_name_t
858
  
859
  and __11 () = pp_vhdl_case_item_t
860
  
861
  and __10 () = pp_vhdl_expr_t
862
  
863
  and __9 () = pp_vhdl_name_t
864
  
865
  and __8 () = pp_vhdl_sequential_stmt_t
866
  
867
  and __7 () = pp_vhdl_if_case_t
868
  
869
  and __6 () = pp_vhdl_name_t
870
  
871
  and __5 () = pp_vhdl_waveform_element_t
872
  
873
  and __4 () = pp_vhdl_name_t
874
  
875
  and __3 () = pp_vhdl_name_t
876
  
877
  and __2 () = pp_vhdl_expr_t
878
  
879
  and __1 () = pp_vhdl_name_t
880
  
881
  and __0 () = pp_vhdl_name_t
882
  in
883
  ((let open! Ppx_deriving_runtime in
884
      fun fmt  ->
885
        function
886 20d354f4 Arnaud Dieumegard
        | VarAssign { label = alabel; seqs_lhs = alhs; rhs = arhs } ->
887 58f8ddf5 Arnaud Dieumegard
            (match alabel with
888 c1b877b6 Arnaud Dieumegard
              | None -> ();
889
              | Some a -> (((__0 ()) fmt) a;
890 58f8ddf5 Arnaud Dieumegard
                     Format.fprintf fmt ": ")
891
            );
892
            ((__1 ()) fmt) alhs;
893
            Format.fprintf fmt " := ";
894
            ((__2 ()) fmt) arhs;
895
(* TODO: Check
896
            (Format.fprintf fmt "@[<2>VarAssign {@,";
897
             (((Format.fprintf fmt "@[%s =@ " "label";
898
                ((__0 ()) fmt) alabel;
899
                Format.fprintf fmt "@]");
900
               Format.fprintf fmt ";@ ";
901
               Format.fprintf fmt "@[%s =@ " "lhs";
902
               ((__1 ()) fmt) alhs;
903
               Format.fprintf fmt "@]");
904
              Format.fprintf fmt ";@ ";
905
              Format.fprintf fmt "@[%s =@ " "rhs";
906
              ((__2 ()) fmt) arhs;
907
              Format.fprintf fmt "@]");
908
             Format.fprintf fmt "@]}") *)
909 20d354f4 Arnaud Dieumegard
        | SigSeqAssign { label = alabel; seqs_lhs = alhs; rhs = arhs } ->
910 58f8ddf5 Arnaud Dieumegard
            (match alabel with
911 c1b877b6 Arnaud Dieumegard
              | None -> ();
912
              | Some a -> (((__3 ()) fmt) a;
913 58f8ddf5 Arnaud Dieumegard
                     Format.fprintf fmt ":@ ")
914
            );
915
            Format.fprintf fmt "@[<2>";
916
            ((__4 ()) fmt) alhs;
917
            Format.fprintf fmt "@ <=@ ";
918
            ((fun x  ->
919
               Format.fprintf fmt "@[";
920
               ignore
921
                 (List.fold_left
922
                   (fun sep  ->
923
                     fun x  ->
924
                       if sep then Format.fprintf fmt ", ";
925
                        ((__5 ()) fmt) x;
926
                        true) false x);
927
            Format.fprintf fmt "@]@]")) arhs;
928
        | If { label = alabel; if_cases = aif_cases; default = adefault } ->
929
            (match alabel with
930 c1b877b6 Arnaud Dieumegard
              | None -> ();
931
              | Some a -> (((__6 ()) fmt) a;
932 58f8ddf5 Arnaud Dieumegard
                     Format.fprintf fmt ":@ ")
933
            );
934
            Format.fprintf fmt "@[<v>if";
935
            ((fun x ->
936
               ignore
937
               (List.fold_left
938
                 (fun sep  ->
939
                   fun x  ->
940
                           if sep then Format.fprintf fmt "@;elsif";
941
                                ((__7 ()) fmt) x;
942
                                true
943
                 ) false x);
944
             )) aif_cases;
945
             (match adefault with
946
              | [] -> Format.fprintf fmt "";
947
              | _  -> (Format.fprintf fmt "@;else";
948
                      ((fun x  ->
949
                          Format.fprintf fmt "@;<0 2>";
950
                          ignore
951
                            (List.fold_left
952
                              (fun sep  ->
953
                                fun x  ->
954
                                        if sep then Format.fprintf fmt "";
955
                          ((__8 ()) fmt) x;
956
                          Format.fprintf fmt ";";
957
                          true) false x))) adefault));
958
            Format.fprintf fmt "@;end if@]"
959
        | Case { label = alabel; guard = aguard; branches = abranches } ->
960
            (match alabel with
961 c1b877b6 Arnaud Dieumegard
              | None -> ();
962
              | Some a -> (((__9 ()) fmt) a;
963 58f8ddf5 Arnaud Dieumegard
                     Format.fprintf fmt ":@ ")
964
            );
965
            Format.fprintf fmt "@[<v>case ";
966
            ((__10 ()) fmt) aguard;
967
            Format.fprintf fmt " is";
968
            ((fun x  ->
969
                ignore
970
                  (List.fold_left
971
                     (fun sep  ->
972
                        fun x  ->
973
                          if sep then Format.fprintf fmt "";
974
                          ((__11 ()) fmt) x;
975
                          true) false x);)) abranches;
976
            Format.fprintf fmt "@;end case@]";
977
        | Exit
978
            { label = alabel; loop_label = aloop_label;
979
              condition = acondition }
980
            ->
981
            (match alabel with
982 c1b877b6 Arnaud Dieumegard
              | None -> ();
983
              | Some a -> (((__12 ()) fmt) a;
984 58f8ddf5 Arnaud Dieumegard
                     Format.fprintf fmt ":@ ")
985
            );
986
            Format.fprintf fmt "exit";
987
            (match aloop_label with
988
               | None  -> Format.pp_print_string fmt ""
989
               | Some x -> (Format.fprintf fmt "@ %s@ ") x);
990
            ((function
991
               | None  -> Format.pp_print_string fmt ""
992
               | Some x ->
993
                   (Format.pp_print_string fmt "when@ ";
994
                    ((__13 ()) fmt) x;))) acondition;
995
        | Assert
996
            { label = alabel; cond = acond; report = areport;
997
              severity = aseverity }
998
            ->
999
            Format.fprintf fmt "@[<v 2>";
1000
            (match alabel with
1001 c1b877b6 Arnaud Dieumegard
              | None -> ();
1002
              | Some a -> (((__14 ()) fmt) a;
1003 58f8ddf5 Arnaud Dieumegard
                     Format.fprintf fmt ":@ ")
1004
            );
1005
            Format.fprintf fmt "assert ";
1006
            ((__15 ()) fmt) acond;
1007
            (match areport with
1008
            | IsNull -> Format.fprintf fmt "";
1009
            | _ -> 
1010
                Format.fprintf fmt "@;report ";
1011
                ((__16 ()) fmt) areport);
1012
            (match aseverity with
1013
            | IsNull -> Format.fprintf fmt "";
1014
            | _ -> 
1015
                Format.fprintf fmt "@;severity ";
1016
                ((__17 ()) fmt) aseverity);
1017
            Format.fprintf fmt "@]";
1018
        | ProcedureCall { label = alabel; name = aname; assocs = aassocs } ->
1019
            (match alabel with
1020 c1b877b6 Arnaud Dieumegard
              | None -> ();
1021
              | Some a -> (((__18 ()) fmt) a;
1022 58f8ddf5 Arnaud Dieumegard
                     Format.fprintf fmt ":@ ")
1023
            );
1024
            ((__19 ()) fmt) aname;
1025
            (match aassocs with
1026
            | [] -> Format.fprintf fmt "";
1027
            | _ ->
1028
               Format.fprintf fmt "(@[<v>";
1029
               ((fun x  ->
1030
                ignore
1031
                  (List.fold_left
1032
                     (fun sep  ->
1033
                        fun x  ->
1034
                          if sep then Format.fprintf fmt ",@ ";
1035
                          ((__20 ()) fmt) x;
1036
                          true) false x))) aassocs;
1037
               Format.fprintf fmt "@])");
1038 bd1f1929 Arnaud Dieumegard
        | Wait { sensitivity = sensit_list } -> 
1039
            Format.pp_print_string fmt "wait";
1040
            (match sensit_list with
1041
            | [] -> ();
1042
            | _ ->
1043 ccd386cb Arnaud Dieumegard
               Format.fprintf fmt " on (@[<v>";
1044 bd1f1929 Arnaud Dieumegard
               ((fun x  ->
1045
                ignore
1046
                  (List.fold_left
1047
                     (fun sep  ->
1048
                        fun x  ->
1049
                          if sep then Format.fprintf fmt ",@ ";
1050
                          ((__19 ()) fmt) x;
1051
                          true) false x))) sensit_list;
1052
               Format.fprintf fmt "@])");
1053 58f8ddf5 Arnaud Dieumegard
        | Null { label = alabel } ->
1054
            (match alabel with
1055 c1b877b6 Arnaud Dieumegard
              | None -> ();
1056
              | Some a -> (((__18 ()) fmt) a;
1057 58f8ddf5 Arnaud Dieumegard
                     Format.fprintf fmt ":@ ")
1058
            );
1059
            Format.fprintf fmt "null";
1060
        | Return { label = alabel; expr = aexpr } ->
1061
            (match alabel with
1062
              | None -> ();
1063
              | Some a -> (((__19 ()) fmt) a;
1064
                     Format.fprintf fmt ":@ ")
1065
            );
1066
            Format.fprintf fmt "return";
1067
            (match aexpr with
1068
                | None  -> ()
1069
                | Some a ->
1070
                     ((__23 ()) fmt) a);)
1071
    [@ocaml.warning "-A"])
1072
1073
and show_vhdl_sequential_stmt_t :
1074
  vhdl_sequential_stmt_t -> Ppx_deriving_runtime.string =
1075
  fun x  -> Format.asprintf "%a" pp_vhdl_sequential_stmt_t x
1076
1077
and pp_vhdl_if_case_t :
1078
  Format.formatter -> vhdl_if_case_t -> Ppx_deriving_runtime.unit =
1079
  let __1 () = pp_vhdl_sequential_stmt_t
1080
  
1081
  and __0 () = pp_vhdl_expr_t
1082
   in
1083
  ((let open! Ppx_deriving_runtime in
1084
      fun fmt  ->
1085
        fun x  ->
1086
          Format.fprintf fmt " (";
1087
          ((__0 ()) fmt) x.if_cond;
1088
          Format.fprintf fmt ") then@;<0 2>";
1089
          ((fun x  ->
1090
             ignore
1091
               (List.fold_left
1092
                  (fun sep  ->
1093
                     fun x  ->
1094
                             if sep then Format.fprintf fmt "@;<0 2>";
1095
                       ((__1 ()) fmt) x;
1096
                       Format.fprintf fmt ";";
1097
                       true) false x);
1098
          )) x.if_block;)
1099
    [@ocaml.warning "-A"])
1100
1101
and show_vhdl_if_case_t : vhdl_if_case_t -> Ppx_deriving_runtime.string =
1102
  fun x  -> Format.asprintf "%a" pp_vhdl_if_case_t x
1103
1104
and pp_vhdl_case_item_t :
1105
  Format.formatter -> vhdl_case_item_t -> Ppx_deriving_runtime.unit =
1106
  let __1 () = pp_vhdl_sequential_stmt_t
1107
  
1108
  and __0 () = pp_vhdl_expr_t
1109
   in
1110
  ((let open! Ppx_deriving_runtime in
1111
      fun fmt  ->
1112
        fun x  ->
1113
                Format.fprintf fmt "@;@[<v 2>when ";
1114
            ((fun x  ->
1115
                ignore
1116
                  (List.fold_left
1117
                     (fun sep  ->
1118
                        fun x  ->
1119
                          if sep then Format.fprintf fmt "@ |@ ";
1120
                          ((__0 ()) fmt) x;
1121
                          true) false x);)) x.when_cond;
1122
           Format.fprintf fmt " => ";
1123
           (fun x  ->
1124
               ignore
1125
                 (List.fold_left
1126
                    (fun sep  ->
1127
                       fun x  ->
1128
                         if sep then Format.fprintf fmt "@;";
1129
                         ((__1 ()) fmt) x;
1130
                         Format.fprintf fmt ";";
1131
                         true) ((List.length x) > 1) x);) x.when_stmt;
1132
           Format.fprintf fmt "@]")
1133
    [@ocaml.warning "-A"])
1134
1135
and show_vhdl_case_item_t : vhdl_case_item_t -> Ppx_deriving_runtime.string =
1136
  fun x  -> Format.asprintf "%a" pp_vhdl_case_item_t x
1137
1138
let rec (pp_vhdl_port_mode_t :
1139
          Format.formatter -> vhdl_port_mode_t -> Ppx_deriving_runtime.unit)
1140
  =
1141
  ((let open! Ppx_deriving_runtime in
1142
      fun fmt  ->
1143
        function
1144
        | InPort  -> Format.pp_print_string fmt "in"
1145
        | OutPort  -> Format.pp_print_string fmt "out"
1146
        | InoutPort  -> Format.pp_print_string fmt "inout"
1147
        | BufferPort  -> Format.pp_print_string fmt "buffer")
1148
  [@ocaml.warning "-A"])
1149
1150
and show_vhdl_port_mode_t : vhdl_port_mode_t -> Ppx_deriving_runtime.string =
1151
  fun x  -> Format.asprintf "%a" pp_vhdl_port_mode_t x
1152
1153
1154
let rec pp_vhdl_port_t :
1155
  Format.formatter -> vhdl_port_t -> Ppx_deriving_runtime.unit =
1156
  let __3 () = pp_vhdl_expr_t
1157
  
1158
  and __2 () = pp_vhdl_subtype_indication_t
1159
  
1160
  and __1 () = pp_vhdl_port_mode_t
1161
  
1162
  and __0 () = pp_vhdl_name_t
1163
   in
1164
  ((let open! Ppx_deriving_runtime in
1165
      fun fmt  ->
1166
        fun x  ->
1167
          Format.fprintf fmt "@[";
1168
          ((((
1169
              ((fun x  ->
1170
                  Format.fprintf fmt "@[";
1171
                  ignore
1172
                    (List.fold_left
1173
                       (fun sep  ->
1174
                          fun x  ->
1175
                            if sep then Format.fprintf fmt ",@ ";
1176
                            ((__0 ()) fmt) x;
1177
                            true) false x);
1178 20d354f4 Arnaud Dieumegard
                  Format.fprintf fmt "@,@]")) x.port_names;
1179 58f8ddf5 Arnaud Dieumegard
              );
1180
             Format.fprintf fmt ": ";
1181 20d354f4 Arnaud Dieumegard
             ((__1 ()) fmt) x.port_mode;
1182 58f8ddf5 Arnaud Dieumegard
             );
1183
             Format.fprintf fmt " ";
1184 20d354f4 Arnaud Dieumegard
            ((__2 ()) fmt) x.port_typ;
1185 58f8ddf5 Arnaud Dieumegard
            );
1186 20d354f4 Arnaud Dieumegard
          (match x.port_expr with
1187 58f8ddf5 Arnaud Dieumegard
           | IsNull -> Format.fprintf fmt "";
1188
           | _ -> (Format.fprintf fmt "@[:= ";
1189 20d354f4 Arnaud Dieumegard
                   ((__3 ()) fmt) x.port_expr;
1190 58f8ddf5 Arnaud Dieumegard
                   Format.fprintf fmt "@]"));
1191
          Format.fprintf fmt "@]"))
1192
    [@ocaml.warning "-A"])
1193
1194
and show_vhdl_port_t : vhdl_port_t -> Ppx_deriving_runtime.string =
1195
  fun x  -> Format.asprintf "%a" pp_vhdl_port_t x
1196
1197
let rec pp_vhdl_declaration_t :
1198
  Format.formatter -> vhdl_declaration_t -> Ppx_deriving_runtime.unit =
1199
  let __14 () = pp_vhdl_sequential_stmt_t
1200
  
1201
  and __13 () = pp_vhdl_declaration_t
1202
  
1203
  and __12 () = pp_vhdl_subprogram_spec_t
1204
1205
  and __11 () = pp_vhdl_port_t
1206
  
1207
  and __10 () = pp_vhdl_port_t
1208
  
1209
  and __9 () = pp_vhdl_name_t
1210
  
1211
  and __8 () = pp_vhdl_expr_t
1212
  
1213
  and __7 () = pp_vhdl_subtype_indication_t
1214
  
1215
  and __6 () = pp_vhdl_name_t
1216
  
1217
  and __5 () = pp_vhdl_expr_t
1218
  
1219
  and __4 () = pp_vhdl_subtype_indication_t
1220
  
1221
  and __3 () = pp_vhdl_name_t
1222
  
1223
  and __2 () = pp_vhdl_expr_t
1224
  
1225
  and __1 () = pp_vhdl_subtype_indication_t
1226
  
1227
  and __0 () = pp_vhdl_name_t
1228
   in
1229
  ((let open! Ppx_deriving_runtime in
1230
      fun fmt  ->
1231
        function
1232
        | VarDecl { names = anames; typ = atyp; init_val = ainit_val } ->
1233
            (Format.fprintf fmt "variable ";
1234
             ((((fun x  ->
1235
                    ignore
1236
                      (List.fold_left
1237
                         (fun sep  ->
1238
                            fun x  ->
1239
                              if sep then Format.fprintf fmt ",";
1240
                              ((__0 ()) fmt) x;
1241
                              true) false x);)) anames;
1242
               Format.fprintf fmt " : ";
1243
               ((__1 ()) fmt) atyp;
1244
               (match ainit_val with
1245
                | IsNull  -> Format.pp_print_string fmt ""
1246
                | _ ->
1247
                    (Format.fprintf fmt ":=";
1248
                     ((__2 ()) fmt) ainit_val;))));)
1249
        | CstDecl { names = anames; typ = atyp; init_val = ainit_val } ->
1250
            (Format.fprintf fmt "constant ";
1251
             ((((fun x  ->
1252
                    ignore
1253
                      (List.fold_left
1254
                         (fun sep  ->
1255
                            fun x  ->
1256
                              if sep then Format.fprintf fmt ",";
1257
                              ((__3 ()) fmt) x;
1258
                              true) false x);)) anames;
1259
              Format.fprintf fmt " : ";
1260
              ((__4 ()) fmt) atyp;
1261
              Format.fprintf fmt " := ";
1262
              ((__5 ()) fmt) ainit_val)))
1263
        | SigDecl { names = anames; typ = atyp; init_val = ainit_val } ->
1264
            (Format.fprintf fmt "signal ";
1265
            ((fun x  ->
1266
              ignore
1267
              (List.fold_left
1268
                (fun sep  ->
1269
                  fun x  ->
1270
                    if sep then Format.fprintf fmt ",";
1271
                                ((__6 ()) fmt) x;
1272
                                true) false x);
1273
              )) anames;
1274
            Format.fprintf fmt " : ";
1275
            ((__7 ()) fmt) atyp;
1276
            (match ainit_val with
1277
              | IsNull  -> Format.pp_print_string fmt ""
1278
              | _ ->
1279
                  (Format.fprintf fmt ":=";
1280
                  ((__8 ()) fmt) ainit_val;)))
1281
        | ComponentDecl
1282
            { name = aname; generics = agenerics; ports = aports } ->
1283
            Format.fprintf fmt "@[<v 2>component ";
1284
            ((__9 ()) fmt) aname;
1285
            Format.fprintf fmt " is@;";
1286
            (match agenerics with
1287
            | [] -> ()
1288
            | _ ->
1289
                Format.fprintf fmt "generic (@[<v>";
1290
                ((fun x  ->
1291
                  ignore
1292
                    (List.fold_left
1293
                      (fun sep  ->
1294
                        fun x  ->
1295
                          if sep then Format.fprintf fmt ";@;";
1296
                            ((__10 ()) fmt) x;
1297
                            true) false x))) agenerics;
1298
                Format.fprintf fmt "@]);");
1299
            (match aports with
1300
            | [] -> ()
1301
            | _ ->
1302
                Format.fprintf fmt "port (@[<v>";
1303
                ((fun x  ->
1304
                  ignore
1305
                    (List.fold_left
1306
                      (fun sep  ->
1307
                        fun x  ->
1308
                          if sep then Format.fprintf fmt ";@;";
1309
                            ((__11 ()) fmt) x;
1310
                            true) false x))) aports;
1311
                Format.fprintf fmt "@]);");
1312
            Format.fprintf fmt "@]@;end component";
1313
        | Subprogram
1314
            { spec = aspec; decl_part = adecl_part; stmts = astmts }
1315
            ->
1316
              Format.fprintf fmt "@[<v 2>";
1317
              ((__12 ()) fmt) aspec;
1318
              Format.fprintf fmt " is";
1319
              (match adecl_part with
1320
              | [] -> Format.fprintf fmt "";
1321
              | _ ->
1322
                ((fun x  ->
1323
                  ignore
1324
                    (List.fold_left
1325
                      (fun sep  ->
1326
                         fun x  ->
1327
                           if sep then Format.fprintf fmt "";
1328
                             Format.fprintf fmt "@;";
1329
                             ((__13 ()) fmt) x;
1330
                             Format.fprintf fmt ";";
1331
                             true) false x))) adecl_part);
1332
              Format.fprintf fmt "@]@;";
1333
              Format.fprintf fmt "@[<v 2>begin@;";
1334
              ((fun x  ->
1335
                  ignore
1336
                    (List.fold_left
1337
                       (fun sep  ->
1338
                          fun x  ->
1339
                            if sep then Format.fprintf fmt "@;";
1340
                            ((__14 ()) fmt) x;
1341
                            Format.fprintf fmt ";";
1342
                            true) false x))) astmts;
1343
              Format.fprintf fmt "@]@;end";)
1344
    [@ocaml.warning "-A"])
1345
1346
and show_vhdl_declaration_t :
1347
  vhdl_declaration_t -> Ppx_deriving_runtime.string =
1348
  fun x  -> Format.asprintf "%a" pp_vhdl_declaration_t x
1349
1350
let rec pp_vhdl_load_t :
1351
  Format.formatter -> vhdl_load_t -> Ppx_deriving_runtime.unit =
1352
  let __1 () = pp_vhdl_name_t
1353
  
1354
  and __0 () = pp_vhdl_name_t
1355
   in
1356
  ((let open! Ppx_deriving_runtime in
1357
      fun fmt  ->
1358
        function
1359
        | Library a0 ->
1360
            (Format.fprintf fmt "library ";
1361
             ((fun x  ->
1362
                 ignore
1363
                   (List.fold_left
1364
                      (fun sep  ->
1365
                         fun x  ->
1366
                           if sep then Format.fprintf fmt ",";
1367
                           ((__0 ()) fmt) x;
1368
                           true) false x))) a0);
1369
        | Use a0 ->
1370
            (Format.fprintf fmt "use ";
1371
             ((fun x  ->
1372
                 ignore
1373
                   (List.fold_left
1374
                      (fun sep  ->
1375
                         fun x  ->
1376
                           if sep then Format.fprintf fmt ".";
1377
                           ((__1 ()) fmt) x;
1378
                           true) false x))) a0))
1379
    [@ocaml.warning "-A"])
1380
1381
and show_vhdl_load_t : vhdl_load_t -> Ppx_deriving_runtime.string =
1382
  fun x  -> Format.asprintf "%a" pp_vhdl_load_t x
1383
1384
let rec pp_vhdl_declarative_item_t :
1385
  Format.formatter -> vhdl_declarative_item_t -> Ppx_deriving_runtime.unit =
1386
  let __2 () = pp_vhdl_definition_t
1387
  
1388
  and __1 () = pp_vhdl_declaration_t
1389
  
1390
  and __0 () = pp_vhdl_load_t
1391
   in
1392
  ((let open! Ppx_deriving_runtime in
1393
      fun fmt  ->
1394
        fun x  ->
1395
          (match x.use_clause with
1396
          | None -> Format.fprintf fmt "";
1397
          | Some e -> ((__0 ()) fmt) e);
1398 20d354f4 Arnaud Dieumegard
          (match x.di_declaration with
1399 58f8ddf5 Arnaud Dieumegard
          | None -> Format.fprintf fmt "";
1400
          | Some e -> ((__1 ()) fmt) e);
1401 20d354f4 Arnaud Dieumegard
          (match x.di_definition with
1402 58f8ddf5 Arnaud Dieumegard
          | None -> Format.fprintf fmt "";
1403
          | Some e -> ((__2 ()) fmt) e);)
1404
    [@ocaml.warning "-A"])
1405
1406
and show_vhdl_declarative_item_t :
1407
  vhdl_declarative_item_t -> Ppx_deriving_runtime.string =
1408
  fun x  -> Format.asprintf "%a" pp_vhdl_declarative_item_t x
1409
1410
let rec pp_vhdl_signal_condition_t :
1411
  Format.formatter -> vhdl_signal_condition_t -> Ppx_deriving_runtime.unit =
1412
  let __1 () = pp_vhdl_expr_t
1413
  
1414
  and __0 () = pp_vhdl_waveform_element_t
1415
   in
1416
  ((let open! Ppx_deriving_runtime in
1417
      fun fmt  ->
1418
        fun x  ->
1419
          ((fun x  ->
1420
                ignore
1421
                  (List.fold_left
1422
                     (fun sep  ->
1423
                        fun x  ->
1424
                          if sep then Format.fprintf fmt ",@,";
1425
                          ((__0 ()) fmt) x;
1426 20d354f4 Arnaud Dieumegard
                          true) false x))) x.sc_expr;
1427 58f8ddf5 Arnaud Dieumegard
          (match x.cond with
1428
          | None -> Format.fprintf fmt "";
1429
          | Some e -> Format.fprintf fmt " when ";
1430
                 ((__1 ()) fmt) e);)
1431
    [@ocaml.warning "-A"])
1432
1433
and show_vhdl_signal_condition_t :
1434
  vhdl_signal_condition_t -> Ppx_deriving_runtime.string =
1435
  fun x  -> Format.asprintf "%a" pp_vhdl_signal_condition_t x
1436
1437
let rec pp_vhdl_signal_selection_t :
1438
  Format.formatter -> vhdl_signal_selection_t -> Ppx_deriving_runtime.unit =
1439
  let __1 () = pp_vhdl_expr_t
1440
  
1441
  and __0 () = pp_vhdl_waveform_element_t
1442
   in
1443
  ((let open! Ppx_deriving_runtime in
1444
      fun fmt  ->
1445
        fun x  ->
1446
          ((fun x  ->
1447
            ignore
1448
              (List.fold_left
1449
                (fun sep  ->
1450
                  fun x  ->
1451
                    if sep then Format.fprintf fmt "@ ";
1452
                      ((__0 ()) fmt) x;
1453 20d354f4 Arnaud Dieumegard
                      true) false x))) x.ss_expr;
1454 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt " when ";
1455
          ((fun x  ->
1456
            ignore
1457
              (List.fold_left
1458
                (fun sep  ->
1459
                  fun x  ->
1460
                    if sep then Format.fprintf fmt "|@ ";
1461
                      ((__1 ()) fmt) x;
1462
                      true) false x))) x.when_sel)
1463
    [@ocaml.warning "-A"])
1464
1465
and show_vhdl_signal_selection_t :
1466
  vhdl_signal_selection_t -> Ppx_deriving_runtime.string =
1467
  fun x  -> Format.asprintf "%a" pp_vhdl_signal_selection_t x
1468
1469
let rec pp_vhdl_conditional_signal_t :
1470
  Format.formatter -> vhdl_conditional_signal_t -> Ppx_deriving_runtime.unit
1471
  =
1472
  let __3 () = pp_vhdl_expr_t
1473
  
1474
  and __2 () = pp_vhdl_signal_condition_t
1475
  
1476
  and __1 () = pp_vhdl_name_t
1477
  
1478
  and __0 () = pp_vhdl_name_t
1479
   in
1480
  ((let open! Ppx_deriving_runtime in
1481
      fun fmt  ->
1482
        fun x  ->
1483 20d354f4 Arnaud Dieumegard
          (match x.cs_label with
1484 c1b877b6 Arnaud Dieumegard
            | None -> ();
1485
            | Some a -> (((__0 ()) fmt) a;
1486 58f8ddf5 Arnaud Dieumegard
                   Format.fprintf fmt ":@ ")
1487
          );
1488 20d354f4 Arnaud Dieumegard
          if (x.cs_postponed) then Format.fprintf fmt "postponed@ ";
1489
          ((__1 ()) fmt) x.cs_lhs;
1490 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt " <= ";
1491 20d354f4 Arnaud Dieumegard
          (match x.cs_delay with
1492 58f8ddf5 Arnaud Dieumegard
            | IsNull -> Format.fprintf fmt "";
1493 20d354f4 Arnaud Dieumegard
            | _ -> ((__3 ()) fmt) x.cs_delay;
1494 58f8ddf5 Arnaud Dieumegard
                   Format.fprintf fmt " ");
1495
          ((fun x  ->
1496
             Format.fprintf fmt "@[";
1497
             ignore
1498
               (List.fold_left
1499
                 (fun sep  ->
1500
                   fun x  ->
1501
                     if sep then Format.fprintf fmt " else ";
1502
                      ((__2 ()) fmt) x;
1503
                      true) false x);
1504
          Format.fprintf fmt "@]")) x.rhs;
1505
          Format.fprintf fmt ";")
1506
   [@ocaml.warning "-A"])
1507
1508
and show_vhdl_conditional_signal_t :
1509
  vhdl_conditional_signal_t -> Ppx_deriving_runtime.string =
1510
  fun x  -> Format.asprintf "%a" pp_vhdl_conditional_signal_t x
1511
1512
let rec pp_vhdl_process_t :
1513
  Format.formatter -> vhdl_process_t -> Ppx_deriving_runtime.unit =
1514
  let __3 () = pp_vhdl_sequential_stmt_t
1515
  
1516
  and __2 () = pp_vhdl_name_t
1517
  
1518
  and __1 () = pp_vhdl_declarative_item_t
1519
  
1520
  and __0 () = pp_vhdl_name_t
1521
   in
1522
  ((let open! Ppx_deriving_runtime in
1523
      fun fmt  ->
1524
        fun x  ->
1525
          Format.fprintf fmt "@[<v 2>";
1526
          (match x.id with
1527
          | NoName -> Format.fprintf fmt "";
1528
          | _ -> 
1529
              ((__0 ()) fmt) x.id;
1530
              Format.fprintf fmt ": ");
1531
          Format.fprintf fmt "process ";
1532
          (match x.active_sigs with
1533 ccd386cb Arnaud Dieumegard
          | [] -> ();
1534 58f8ddf5 Arnaud Dieumegard
          | _ -> Format.fprintf fmt "(";
1535
                 ((fun x  ->
1536
                    ignore
1537
                      (List.fold_left
1538
                         (fun sep  ->
1539
                            fun x  ->
1540
                              if sep then Format.fprintf fmt ",";
1541
                              ((__2 ()) fmt) x;
1542
                              true) false x))) x.active_sigs;
1543 ccd386cb Arnaud Dieumegard
                 Format.fprintf fmt ") is");
1544 20d354f4 Arnaud Dieumegard
          (match x.p_declarations with
1545 6a2c1a43 Arnaud Dieumegard
          | [] -> Format.fprintf fmt "";
1546
          | _ -> 
1547
              (Format.fprintf fmt "@;";
1548
              ((fun x  ->
1549
                ignore
1550
                (List.fold_left
1551
                  (fun sep  ->
1552
                    fun x  ->
1553
                      if sep then Format.fprintf fmt "@;";
1554
                        ((__1 ()) fmt) x;
1555
                        Format.fprintf fmt ";";
1556 20d354f4 Arnaud Dieumegard
                        true) false x))) x.p_declarations));
1557 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt "@]@;@[<v 2>begin@;";
1558
          ((fun x  ->
1559
               ignore
1560
                 (List.fold_left
1561
                    (fun sep  ->
1562
                       fun x  ->
1563
                         if sep then Format.fprintf fmt "@;";
1564
                         ((__3 ()) fmt) x;
1565
                         Format.fprintf fmt ";";
1566 20d354f4 Arnaud Dieumegard
                         true) false x);)) x.p_body;
1567 02440160 Arnaud Dieumegard
          Format.fprintf fmt "@]@;end process;")
1568 58f8ddf5 Arnaud Dieumegard
    [@ocaml.warning "-A"])
1569
1570
and show_vhdl_process_t : vhdl_process_t -> Ppx_deriving_runtime.string =
1571
  fun x  -> Format.asprintf "%a" pp_vhdl_process_t x
1572
1573 20d354f4 Arnaud Dieumegard
let rec pp_vhdl_selected_signal_t : (* FIXME Missing ss_postponed attribute *)
1574 58f8ddf5 Arnaud Dieumegard
  Format.formatter -> vhdl_selected_signal_t -> Ppx_deriving_runtime.unit =
1575
  let __4 () = pp_vhdl_expr_t
1576
  
1577
  and __3 () = pp_vhdl_signal_selection_t
1578
  
1579
  and __2 () = pp_vhdl_expr_t
1580
  
1581
  and __1 () = pp_vhdl_name_t
1582
  
1583
  and __0 () = pp_vhdl_name_t
1584
   in
1585
  ((let open! Ppx_deriving_runtime in
1586
      fun fmt  ->
1587
        fun x  ->
1588
          Format.fprintf fmt "@[<v 2>";
1589 20d354f4 Arnaud Dieumegard
          (match x.ss_label with
1590 c1b877b6 Arnaud Dieumegard
            | None -> ();
1591
            | Some a -> (((__0 ()) fmt) a;
1592 58f8ddf5 Arnaud Dieumegard
                   Format.fprintf fmt ":@ ")
1593
          );
1594
          Format.fprintf fmt "with ";
1595
          ((__2 ()) fmt) x.sel;
1596
          Format.fprintf fmt " select@;";
1597 20d354f4 Arnaud Dieumegard
          ((__1 ()) fmt) x.ss_lhs;
1598 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt " <= ";
1599
          ((function
1600
            | None  -> Format.pp_print_string fmt ""
1601
            | Some x ->
1602 20d354f4 Arnaud Dieumegard
               ((__4 ()) fmt) x)) x.ss_delay;
1603 58f8ddf5 Arnaud Dieumegard
          ((fun x  ->
1604
            ignore
1605
              (List.fold_left
1606
                (fun sep  ->
1607
                  fun x  ->
1608
                    if sep then Format.fprintf fmt ",@ ";
1609
                      ((__3 ()) fmt) x;
1610
                      true) false x))) x.branches;
1611
          Format.fprintf fmt ";@]";)
1612
    [@ocaml.warning "-A"])
1613
1614
and show_vhdl_selected_signal_t :
1615
  vhdl_selected_signal_t -> Ppx_deriving_runtime.string =
1616
  fun x  -> Format.asprintf "%a" pp_vhdl_selected_signal_t x
1617
1618
let rec pp_vhdl_component_instantiation_t :
1619
  Format.formatter ->
1620
    vhdl_component_instantiation_t -> Ppx_deriving_runtime.unit
1621
  =
1622
  let __4 () = pp_vhdl_assoc_element_t
1623
  
1624
  and __3 () = pp_vhdl_assoc_element_t
1625
  
1626
  and __2 () = pp_vhdl_name_t
1627
  
1628
  and __1 () = pp_vhdl_name_t
1629
  
1630
  and __0 () = pp_vhdl_name_t
1631
   in
1632
  ((let open! Ppx_deriving_runtime in
1633
      fun fmt  ->
1634
        fun x  ->
1635
          Format.fprintf fmt "@[<v 2>";
1636 20d354f4 Arnaud Dieumegard
          ((__0 ()) fmt) x.ci_name;
1637 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt " : ";
1638
          Format.fprintf fmt "%s " x.inst_unit_type;
1639
          ((__1 ()) fmt) x.inst_unit;
1640
          ((function
1641
             | None  -> Format.pp_print_string fmt ""
1642
             | Some x ->
1643
                 (Format.fprintf fmt "(";
1644
                 ((__2 ()) fmt) x;
1645
                 Format.fprintf fmt ")@;"))) x.archi_name;
1646
          (match x.generic_map with
1647
          | [] -> Format.fprintf fmt "";
1648
          | _ ->
1649 02440160 Arnaud Dieumegard
            (Format.fprintf fmt " generic map (@[";
1650 58f8ddf5 Arnaud Dieumegard
            ((fun x  ->
1651
            ignore
1652
            (List.fold_left
1653
               (fun sep  ->
1654
                 fun x  ->
1655 02440160 Arnaud Dieumegard
                   if sep then Format.fprintf fmt ",@ ";
1656 58f8ddf5 Arnaud Dieumegard
                   ((__3 ()) fmt) x;
1657
                   true) false x))) x.generic_map;
1658
            Format.fprintf fmt ")@]@;"));
1659
          (match x.port_map with
1660
          | [] -> Format.fprintf fmt ";";
1661
          | _ ->
1662 02440160 Arnaud Dieumegard
            (Format.fprintf fmt " port map (@[";
1663 58f8ddf5 Arnaud Dieumegard
            ((fun x  ->
1664
            ignore
1665
            (List.fold_left
1666
               (fun sep  ->
1667
                 fun x  ->
1668 02440160 Arnaud Dieumegard
                   if sep then Format.fprintf fmt ",@ ";
1669 58f8ddf5 Arnaud Dieumegard
                   ((__4 ()) fmt) x;
1670
                   true) false x))) x.port_map;
1671
            Format.fprintf fmt ")@];"));
1672
          Format.fprintf fmt "@]")
1673
    [@ocaml.warning "-A"])
1674
1675
and show_vhdl_component_instantiation_t :
1676
  vhdl_component_instantiation_t -> Ppx_deriving_runtime.string =
1677
  fun x  -> Format.asprintf "%a" pp_vhdl_component_instantiation_t x
1678
1679
let rec pp_vhdl_concurrent_stmt_t :
1680
  Format.formatter -> vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit =
1681
  let __3 () = pp_vhdl_component_instantiation_t
1682
  
1683
  and __2 () = pp_vhdl_selected_signal_t
1684
  
1685
  and __1 () = pp_vhdl_process_t
1686
  
1687
  and __0 () = pp_vhdl_conditional_signal_t
1688
   in
1689
  ((let open! Ppx_deriving_runtime in
1690
      fun fmt  ->
1691
        function
1692
        | SigAssign a0 ->
1693
             ((__0 ()) fmt) a0;
1694
        | Process a0 ->
1695
             ((__1 ()) fmt) a0;
1696
        | SelectedSig a0 ->
1697
             ((__2 ()) fmt) a0;
1698
        | ComponentInst a0 ->
1699
             ((__3 ()) fmt) a0;
1700
    )
1701
    [@ocaml.warning "-A"])
1702
1703
and show_vhdl_concurrent_stmt_t :
1704
  vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.string =
1705
  fun x  -> Format.asprintf "%a" pp_vhdl_concurrent_stmt_t x
1706
1707
let rec pp_vhdl_entity_t :
1708
  Format.formatter -> vhdl_entity_t -> Ppx_deriving_runtime.unit =
1709
  let __4 () = pp_vhdl_concurrent_stmt_t
1710
  
1711
  and __3 () = pp_vhdl_declarative_item_t
1712
  
1713
  and __2 () = pp_vhdl_port_t
1714
  
1715
  and __1 () = pp_vhdl_port_t
1716
  
1717
  and __0 () = pp_vhdl_name_t
1718
   in
1719
  ((let open! Ppx_deriving_runtime in
1720
      fun fmt  ->
1721
        fun x  ->
1722 20d354f4 Arnaud Dieumegard
          ((__0 ()) fmt) x.e_name;
1723 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt " is@;";
1724
          (match x.generics with
1725
          | [] -> Format.fprintf fmt "";
1726
          | _ -> 
1727 02440160 Arnaud Dieumegard
              Format.fprintf fmt "generic (@[";
1728 58f8ddf5 Arnaud Dieumegard
              ((fun x  ->
1729
                ignore
1730
                (List.fold_left
1731
                  (fun sep  ->
1732
                    fun x  ->
1733 02440160 Arnaud Dieumegard
                      if sep then Format.fprintf fmt ";@ ";
1734 58f8ddf5 Arnaud Dieumegard
                        ((__1 ()) fmt) x;
1735
                        true) false x))) x.generics;
1736
              Format.fprintf fmt "@]);");
1737
          (match x.ports with
1738
          | [] -> Format.fprintf fmt "";
1739
          | _ -> 
1740 02440160 Arnaud Dieumegard
              Format.fprintf fmt "port (@[";
1741 58f8ddf5 Arnaud Dieumegard
              ((fun x  ->
1742
                 ignore
1743
                   (List.fold_left
1744
                      (fun sep  ->
1745
                         fun x  ->
1746 02440160 Arnaud Dieumegard
                           if sep then Format.fprintf fmt ";@ ";
1747 58f8ddf5 Arnaud Dieumegard
                           ((__2 ()) fmt) x;
1748
                           true) false x))) x.ports;
1749
              Format.fprintf fmt "@]);");
1750 20d354f4 Arnaud Dieumegard
          (match x.e_declaration with
1751 58f8ddf5 Arnaud Dieumegard
          | [] -> Format.fprintf fmt "";
1752
          | _ ->
1753
              Format.fprintf fmt "@;";
1754
              ((fun x  ->
1755
                ignore
1756
                  (List.fold_left
1757
                     (fun sep  ->
1758
                        fun x  ->
1759
                          if sep then Format.fprintf fmt ";@;";
1760
                          ((__3 ()) fmt) x;
1761 20d354f4 Arnaud Dieumegard
                          true) false x))) x.e_declaration;
1762 58f8ddf5 Arnaud Dieumegard
              Format.fprintf fmt ";");
1763
          (match x.stmts with
1764
          | [] -> Format.fprintf fmt "";
1765
          | _ ->
1766
              Format.fprintf fmt "@;@[<v 2>begin@;";
1767
              ((fun x  ->
1768
                ignore
1769
                  (List.fold_left
1770
                    (fun sep  ->
1771
                       fun x  ->
1772
                         if sep then Format.fprintf fmt ";@;";
1773
                         ((__4 ()) fmt) x;
1774
                         true) false x))) x.stmts;
1775
              Format.fprintf fmt ";@]");)
1776
    [@ocaml.warning "-A"])
1777
1778
and show_vhdl_entity_t : vhdl_entity_t -> Ppx_deriving_runtime.string =
1779
  fun x  -> Format.asprintf "%a" pp_vhdl_entity_t x
1780
1781
let rec pp_vhdl_package_t :
1782
  Format.formatter -> vhdl_package_t -> Ppx_deriving_runtime.unit =
1783
  let __3 () = pp_vhdl_load_t
1784
  
1785
  and __2 () = pp_vhdl_declaration_t
1786
  
1787
  and __1 () = pp_vhdl_definition_t
1788
  
1789
  and __0 () = pp_vhdl_name_t
1790
   in
1791
  ((let open! Ppx_deriving_runtime in
1792
      fun fmt  ->
1793
        fun x  ->
1794 20d354f4 Arnaud Dieumegard
          ((__0 ()) fmt) x.p_name;
1795 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt " is";
1796
          ((fun x  ->
1797
             ignore
1798
               (List.fold_left
1799
                  (fun sep  ->
1800
                     fun x  ->
1801
                       Format.fprintf fmt "@;";
1802
                       if sep then Format.fprintf fmt "";
1803
                       ((__1 ()) fmt) x;
1804
                       Format.fprintf fmt ";";
1805
                       true) false x))) x.shared_defs;
1806
          ((fun x  ->
1807
               ignore
1808
                 (List.fold_left
1809
                    (fun sep  ->
1810
                       fun x  ->
1811
                         Format.fprintf fmt "@;";
1812
                         if sep then Format.fprintf fmt "";
1813
                         ((__2 ()) fmt) x;
1814
                         Format.fprintf fmt ";";
1815
                         true) false x))) x.shared_decls;
1816
          ((fun x  ->
1817
               ignore
1818
                 (List.fold_left
1819
                    (fun sep  ->
1820
                       fun x  ->
1821
                         Format.fprintf fmt "@;";
1822
                         if sep then Format.fprintf fmt "";
1823
                         ((__3 ()) fmt) x;
1824
                         Format.fprintf fmt ";";
1825
                         true) false x))) x.shared_uses;)
1826
    [@ocaml.warning "-A"])
1827
1828
and show_vhdl_package_t : vhdl_package_t -> Ppx_deriving_runtime.string =
1829
  fun x  -> Format.asprintf "%a" pp_vhdl_package_t x
1830
1831
let rec pp_vhdl_architecture_t :
1832
  Format.formatter -> vhdl_architecture_t -> Ppx_deriving_runtime.unit =
1833
  let __3 () = pp_vhdl_concurrent_stmt_t
1834
  
1835
  and __2 () = pp_vhdl_declarative_item_t
1836
  
1837
  and __1 () = pp_vhdl_name_t
1838
  
1839
  and __0 () = pp_vhdl_name_t
1840
   in
1841
  ((let open! Ppx_deriving_runtime in
1842
      fun fmt  ->
1843
        fun x  ->
1844 20d354f4 Arnaud Dieumegard
          ((__0 ()) fmt) x.a_name;
1845 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt " of ";
1846
          ((__1 ()) fmt) x.entity;
1847
          Format.fprintf fmt " is@;";
1848
            ((fun x  ->
1849
             ignore
1850
               (List.fold_left
1851
                  (fun sep  ->
1852
                     fun x  ->
1853
                       if sep then Format.fprintf fmt "@;";
1854
                       ((__2 ()) fmt) x;
1855
                       Format.fprintf fmt ";";
1856 20d354f4 Arnaud Dieumegard
                       true) false x))) x.a_declarations;
1857 02440160 Arnaud Dieumegard
          Format.fprintf fmt "@.";
1858 58f8ddf5 Arnaud Dieumegard
          Format.fprintf fmt "@[<v 2>begin@;";
1859 20d354f4 Arnaud Dieumegard
          (match x.a_body with
1860 58f8ddf5 Arnaud Dieumegard
            | [] -> Format.fprintf fmt "";
1861
            | _ ->
1862
               ((fun x  ->
1863
               ignore
1864
                 (List.fold_left
1865
                    (fun sep  ->
1866
                       fun x  ->
1867
                         if sep then Format.fprintf fmt "@;";
1868
                         ((__3 ()) fmt) x;
1869 20d354f4 Arnaud Dieumegard
                         true) false x))) x.a_body);
1870 02440160 Arnaud Dieumegard
          Format.fprintf fmt "@]")
1871 58f8ddf5 Arnaud Dieumegard
    [@ocaml.warning "-A"])
1872
1873
and show_vhdl_architecture_t :
1874
  vhdl_architecture_t -> Ppx_deriving_runtime.string =
1875
  fun x  -> Format.asprintf "%a" pp_vhdl_architecture_t x
1876
1877
1878
let rec (pp_vhdl_configuration_t :
1879
          Format.formatter ->
1880
            vhdl_configuration_t -> Ppx_deriving_runtime.unit)
1881
  =
1882
  ((let open! Ppx_deriving_runtime in
1883
      fun fmt  -> fun ()  -> Format.pp_print_string fmt "()")
1884
  [@ocaml.warning "-A"])
1885
1886
and show_vhdl_configuration_t :
1887
  vhdl_configuration_t -> Ppx_deriving_runtime.string =
1888
  fun x  -> Format.asprintf "%a" pp_vhdl_configuration_t x
1889
1890
1891
let rec pp_vhdl_library_unit_t :
1892
  Format.formatter -> vhdl_library_unit_t -> Ppx_deriving_runtime.unit =
1893
  let __3 () = pp_vhdl_configuration_t
1894
  
1895
  and __2 () = pp_vhdl_architecture_t
1896
  
1897
  and __1 () = pp_vhdl_entity_t
1898
  
1899
  and __0 () = pp_vhdl_package_t
1900
   in
1901
  ((let open! Ppx_deriving_runtime in
1902
      fun fmt  ->
1903
        function
1904
        | Package a0 ->
1905
            (Format.fprintf fmt "@[<v 2>package ";
1906
             ((__0 ()) fmt) a0;
1907
             Format.fprintf fmt "@.end;@]")
1908
        | Entities a0 ->
1909
            (Format.fprintf fmt "@[<v 2>entity ";
1910
             ((__1 ()) fmt) a0;
1911
             Format.fprintf fmt "@.end;@]")
1912
        | Architecture a0 ->
1913
            (Format.fprintf fmt "@[<v 2>architecture ";
1914
             ((__2 ()) fmt) a0;
1915 02440160 Arnaud Dieumegard
             Format.fprintf fmt "@.end;")
1916 58f8ddf5 Arnaud Dieumegard
        | Configuration a0 ->
1917
            (Format.fprintf fmt "@[<v 2>configuration ";
1918
             ((__3 ()) fmt) a0;
1919
             Format.fprintf fmt "@.end;@]"))
1920
    [@ocaml.warning "-A"])
1921
1922
and show_vhdl_library_unit_t :
1923
  vhdl_library_unit_t -> Ppx_deriving_runtime.string =
1924
  fun x  -> Format.asprintf "%a" pp_vhdl_library_unit_t x
1925
1926
let rec pp_vhdl_design_unit_t :
1927
  Format.formatter -> vhdl_design_unit_t -> Ppx_deriving_runtime.unit =
1928
  let __1 () = pp_vhdl_library_unit_t
1929
  
1930
  and __0 () = pp_vhdl_load_t
1931
   in
1932
  ((let open! Ppx_deriving_runtime in
1933
      fun fmt  ->
1934
        fun x  ->
1935
           (match x.contexts with
1936
           | [] -> Format.fprintf fmt "";
1937
           | _ -> 
1938
            ((fun x  ->
1939
                ignore
1940
                  (List.fold_left
1941
                     (fun sep  ->
1942
                        fun x  ->
1943
                          if sep then Format.fprintf fmt "@.";
1944
                          ((__0 ()) fmt) x;
1945
                          Format.fprintf fmt ";";
1946
                          true) false x);
1947
                )) x.contexts;
1948
           Format.fprintf fmt "@.";);
1949
           ((__1 ()) fmt) x.library;)
1950
    [@ocaml.warning "-A"])
1951
1952
and show_vhdl_design_unit_t :
1953
  vhdl_design_unit_t -> Ppx_deriving_runtime.string =
1954
  fun x  -> Format.asprintf "%a" pp_vhdl_design_unit_t x
1955
1956
let rec pp_vhdl_design_file_t :
1957
  Format.formatter -> vhdl_design_file_t -> Ppx_deriving_runtime.unit =
1958
  let __0 () = pp_vhdl_design_unit_t  in
1959
  ((let open! Ppx_deriving_runtime in
1960
      fun fmt  ->
1961
        fun x  ->
1962
           ((fun x  ->
1963
               ignore
1964
                 (List.fold_left
1965
                    (fun sep  ->
1966
                       fun x  ->
1967
                         if sep then Format.fprintf fmt "@.";
1968
                         ((__0 ()) fmt) x;
1969
                         true) false x);
1970
             )) x.design_units)
1971
    [@ocaml.warning "-A"])
1972
1973
and show_vhdl_design_file_t :
1974
  vhdl_design_file_t -> Ppx_deriving_runtime.string =
1975
  fun x  -> Format.asprintf "%a" pp_vhdl_design_file_t x
1976
1977
let rec pp_vhdl_file_t :
1978
  Format.formatter -> vhdl_file_t -> Ppx_deriving_runtime.unit =
1979
  let __0 () = pp_vhdl_design_file_t  in
1980
  ((let open! Ppx_deriving_runtime in
1981
      fun fmt  ->
1982
        fun x  ->
1983
           ((__0 ()) fmt) x.design_file;
1984
   )
1985
    [@ocaml.warning "-A"])
1986
1987
and show_vhdl_file_t : vhdl_file_t -> Ppx_deriving_runtime.string =
1988
  fun x  -> Format.asprintf "%a" pp_vhdl_file_t x