Project

General

Profile

Download (66 KB) Statistics
| Branch: | Tag: | Revision:
1
open Vhdl_ast
2

    
3
let rec (pp_vhdl_cst_val_t :
4
          Format.formatter -> vhdl_cst_val_t -> Ppx_deriving_runtime.unit)
5
  =
6
  ((let open! Ppx_deriving_runtime in
7
      fun fmt  ->
8
        function
9
        | CstInt a0 ->
10
             (Format.fprintf fmt "%d") a0;
11
        | CstStdLogic a0 ->
12
             (Format.fprintf fmt "%S") a0;
13
        | CstLiteral a0 ->
14
             (Format.fprintf fmt "%s") a0;)
15
  [@ocaml.warning "-A"])
16

    
17
and show_vhdl_cst_val_t : vhdl_cst_val_t -> Ppx_deriving_runtime.string =
18
  fun x  -> Format.asprintf "%a" pp_vhdl_cst_val_t x
19

    
20
let rec pp_vhdl_type_t :
21
  Format.formatter -> vhdl_type_t -> Ppx_deriving_runtime.unit =
22
  let __4 () = pp_vhdl_name_t
23
  
24
  and __3 () = pp_vhdl_element_declaration_t
25
  
26
  and __2 () = pp_vhdl_subtype_indication_t
27
  
28
  and __1 () = pp_vhdl_constraint_t
29
  
30
  and __0 () = pp_vhdl_name_t
31
in
32
  ((let open! Ppx_deriving_runtime in
33
      fun fmt  ->
34
        function
35
        | Base a0 ->
36
             (Format.fprintf fmt "%s") a0;
37
        | Range (a0,a1,a2) ->
38
             ((
39
               (Format.fprintf fmt "%d") a1);
40
               ((function
41
                 | None  -> Format.pp_print_string fmt ""
42
                 | Some x ->
43
                      (Format.fprintf fmt "%s") x;
44
                      )) a0;
45
              (Format.fprintf fmt "%d") a2);
46
        | Bit_vector (a0,a1) ->
47
             (Format.fprintf fmt "array (%d,%d) of bit") a0 a1;
48
        | Array
49
            { indexes = aindexes; const = aconst; definition = adefinition }
50
            ->
51
            Format.fprintf fmt "array";
52
            (match aindexes with
53
            | [] -> Format.fprintf fmt "";
54
            | _ ->
55
              Format.fprintf fmt "(@[<v>";
56
              ((fun x  ->
57
                ignore
58
                (List.fold_left
59
                  (fun sep  ->
60
                    fun x  ->
61
                      if sep then Format.fprintf fmt ",@ ";
62
                      ((__0 ()) fmt) x;
63
                      Format.fprintf fmt " range <>";
64
                      true) false x)) aindexes);
65
              Format.fprintf fmt ")@]");
66
            (function
67
              | None  -> Format.pp_print_string fmt ""
68
              | Some x ->
69
                ((__1 ()) fmt) x) aconst;
70
            Format.fprintf fmt " of ";
71
            ((__2 ()) fmt) adefinition;
72
        | Record a0 ->
73
            Format.fprintf fmt "@[<v 2>record@;";
74
            (fun x  ->
75
              ignore
76
                (List.fold_left
77
                  (fun sep  ->
78
                    fun x  ->
79
                      if sep then ();
80
                        ((__3 ()) fmt) x;
81
                        Format.fprintf fmt ";@;";
82
                        true) false x);
83
              Format.fprintf fmt "@]end record") a0;
84
        | Enumerated a0 ->
85
            (Format.fprintf fmt "(";
86
            ((fun x  ->
87
              ignore
88
              (List.fold_left
89
                (fun sep  ->
90
                  fun x  ->
91
                    if sep then Format.fprintf fmt ",@ ";
92
                      ((__4 ()) fmt) x;
93
                    true) false x))) a0;
94
             Format.fprintf fmt ")");
95
        | Void  -> Format.pp_print_string fmt "")
96
    [@ocaml.warning "-A"])
97

    
98
and show_vhdl_type_t : vhdl_type_t -> Ppx_deriving_runtime.string =
99
  fun x  -> Format.asprintf "%a" pp_vhdl_type_t x
100

    
101
and pp_vhdl_element_declaration_t :
102
  Format.formatter -> vhdl_element_declaration_t -> Ppx_deriving_runtime.unit
103
  =
104
  let __1 () = pp_vhdl_subtype_indication_t
105
  
106
  and __0 () = pp_vhdl_name_t
107
   in
108
  ((let open! Ppx_deriving_runtime in
109
      fun fmt  ->
110
        fun x  ->
111
            (fun x  ->
112
                ignore
113
                  (List.fold_left
114
                     (fun sep  ->
115
                        fun x  ->
116
                          if sep then Format.fprintf fmt ", ";
117
                          ((__0 ()) fmt) x;
118
                          true) false x)) x.names;
119
           Format.fprintf fmt ": ";
120
           ((__1 ()) fmt) x.definition)
121
    [@ocaml.warning "-A"])
122

    
123
and show_vhdl_element_declaration_t :
124
  vhdl_element_declaration_t -> Ppx_deriving_runtime.string =
125
  fun x  -> Format.asprintf "%a" pp_vhdl_element_declaration_t x
126

    
127
and pp_vhdl_subtype_indication_t :
128
  Format.formatter -> vhdl_subtype_indication_t -> Ppx_deriving_runtime.unit
129
  =
130
  let __2 () = pp_vhdl_constraint_t
131
  
132
  and __1 () = pp_vhdl_name_t
133
  
134
  and __0 () = pp_vhdl_name_t
135
   in
136
  ((let open! Ppx_deriving_runtime in
137
      fun fmt  ->
138
        fun x  ->
139
          ((__0 ()) fmt) x.name;
140
          ((__1 ()) fmt) x.functionName;
141
          (match x.const with
142
            | NoConstraint -> Format.fprintf fmt "";
143
            | _ -> Format.fprintf fmt " ";
144
                   ((__2 ()) fmt) x.const))
145
    [@ocaml.warning "-A"])
146

    
147
and show_vhdl_subtype_indication_t :
148
  vhdl_subtype_indication_t -> Ppx_deriving_runtime.string =
149
  fun x  -> Format.asprintf "%a" pp_vhdl_subtype_indication_t x
150

    
151
and pp_vhdl_discrete_range_t :
152
  Format.formatter -> vhdl_discrete_range_t -> Ppx_deriving_runtime.unit =
153
  let __3 () = pp_vhdl_expr_t
154
  
155
  and __2 () = pp_vhdl_expr_t
156
  
157
  and __1 () = pp_vhdl_name_t
158
  
159
  and __0 () = pp_vhdl_subtype_indication_t
160
   in
161
  ((let open! Ppx_deriving_runtime in
162
      fun fmt  ->
163
        function
164
        | SubDiscreteRange a0 ->
165
             ((__0 ()) fmt) a0;
166
        | NamedRange a0 ->
167
             ((__1 ()) fmt) a0;
168
        | DirectedRange { direction = adirection; from = afrom; _to = a_to }
169
            ->
170
               ((__2 ()) fmt) afrom;
171
               (Format.fprintf fmt " %s ") adirection;
172
               ((__3 ()) fmt) a_to;
173
    )
174
    [@ocaml.warning "-A"])
175

    
176
and show_vhdl_discrete_range_t :
177
  vhdl_discrete_range_t -> Ppx_deriving_runtime.string =
178
  fun x  -> Format.asprintf "%a" pp_vhdl_discrete_range_t x
179

    
180
(* TODO Adapt for: ArrayConstraint, RecordConstraint *)
181
and pp_vhdl_constraint_t :
182
  Format.formatter -> vhdl_constraint_t -> Ppx_deriving_runtime.unit =
183
  let __4 () = pp_vhdl_constraint_t
184
  
185
  and __3 () = pp_vhdl_discrete_range_t
186
  
187
  and __2 () = pp_vhdl_discrete_range_t
188
  
189
  and __1 () = pp_vhdl_discrete_range_t
190
  
191
  and __0 () = pp_vhdl_name_t
192
   in
193
  ((let open! Ppx_deriving_runtime in
194
      fun fmt  ->
195
        function
196
        | RefConstraint { ref_name = aref_name } ->
197
             (Format.fprintf fmt "(";
198
              ((__0 ()) fmt) aref_name;
199
              Format.fprintf fmt ")");
200
        | RangeConstraint { range = arange } ->
201
             (Format.fprintf fmt "(";
202
              ((__1 ()) fmt) arange;
203
              Format.fprintf fmt ")");
204
        | IndexConstraint { ranges = aranges } ->
205
            Format.fprintf fmt "(";
206
            ((fun x  ->
207
                ignore
208
                  (List.fold_left
209
                     (fun sep  ->
210
                        fun x  ->
211
                          if sep then Format.fprintf fmt ", ";
212
                          ((__2 ()) fmt) x;
213
                          true) false x))) aranges;
214
            Format.fprintf fmt ")";
215
        | ArrayConstraint { ranges = aranges; sub = asub } ->
216
            (Format.fprintf fmt "@[<2>ArrayConstraint {@,";
217
             ((Format.fprintf fmt "@[%s =@ " "ranges";
218
               ((fun x  ->
219
                   Format.fprintf fmt "@[<2>[";
220
                   ignore
221
                     (List.fold_left
222
                        (fun sep  ->
223
                           fun x  ->
224
                             if sep then Format.fprintf fmt ";@ ";
225
                             ((__3 ()) fmt) x;
226
                             true) false x);
227
                   Format.fprintf fmt "@,]@]")) aranges;
228
               Format.fprintf fmt "@]");
229
              Format.fprintf fmt ";@ ";
230
              Format.fprintf fmt "@[%s =@ " "sub";
231
              ((__4 ()) fmt) asub;
232
              Format.fprintf fmt "@]");
233
             Format.fprintf fmt "@]}")
234
        | RecordConstraint  -> Format.pp_print_string fmt ""
235
        | NoConstraint  -> Format.pp_print_string fmt "")
236
    [@ocaml.warning "-A"])
237

    
238
and show_vhdl_constraint_t : vhdl_constraint_t -> Ppx_deriving_runtime.string
239
  = fun x  -> Format.asprintf "%a" pp_vhdl_constraint_t x
240

    
241
and pp_vhdl_definition_t :
242
  Format.formatter -> vhdl_definition_t -> Ppx_deriving_runtime.unit =
243
  let __3 () = pp_vhdl_subtype_indication_t
244
  
245
  and __2 () = pp_vhdl_name_t
246
  
247
  and __1 () = pp_vhdl_type_t
248
  
249
  and __0 () = pp_vhdl_name_t
250
   in
251
  ((let open! Ppx_deriving_runtime in
252
      fun fmt  ->
253
        function
254
        | Type { name = aname; definition = adefinition } ->
255
            Format.fprintf fmt "type ";
256
            ((__0 ()) fmt) aname;
257
            Format.fprintf fmt " is ";
258
            ((__1 ()) fmt) adefinition;
259
        | Subtype { name = aname; typ = atyp } ->
260
            Format.fprintf fmt "subtype ";
261
            ((__2 ()) fmt) aname;
262
            Format.fprintf fmt " is ";
263
            ((__3 ()) fmt) atyp;
264
   )
265
    [@ocaml.warning "-A"])
266

    
267
and show_vhdl_definition_t : vhdl_definition_t -> Ppx_deriving_runtime.string
268
  = fun x  -> Format.asprintf "%a" pp_vhdl_definition_t x
269

    
270
(* TODO adapt for Op (more than 2 operand), Time, Sig, suffixMod *)
271
and pp_vhdl_expr_t :
272
  Format.formatter -> vhdl_expr_t -> Ppx_deriving_runtime.unit =
273
  let __11 () = pp_vhdl_expr_t
274
  
275
  and __10 () = pp_vhdl_element_assoc_t
276
  
277
  and __9 () = pp_vhdl_name_t
278
  
279
  and __8 () = pp_vhdl_element_assoc_t
280
  
281
  and __7 () = pp_vhdl_suffix_selection_t
282
  
283
  and __6 () = pp_vhdl_expr_t
284
  
285
  and __5 () = pp_vhdl_signal_attributes_t
286
  
287
  and __4 () = pp_vhdl_name_t
288
  
289
  and __3 () = pp_vhdl_expr_t
290
  
291
  and __2 () = pp_vhdl_name_t
292
  
293
  and __1 () = pp_vhdl_cst_val_t
294
  
295
  and __0 () = pp_vhdl_name_t
296
   in
297
  ((let open! Ppx_deriving_runtime in
298
      fun fmt  ->
299
        function
300
        | Call a0 ->
301
             ((__0 ()) fmt) a0;
302
        | Cst { value = avalue; unit_name = aunit_name } ->
303
             ((__1 ()) fmt) avalue;
304
             (function
305
                | None  -> Format.pp_print_string fmt ""
306
                | Some x ->
307
                    Format.fprintf fmt " ";
308
                    ((__2 ()) fmt) x) aunit_name;
309
        | Op { id = aid; args = aargs } ->
310
            (match aargs with
311
            | [] -> (Format.fprintf fmt "%s") aid;
312
            | hd::[] ->
313
               (Format.fprintf fmt "%s ") aid;
314
               ((__3 ()) fmt) hd
315
            | hd::(hd2::[]) ->
316
               Format.fprintf fmt "(";
317
               ((__3 ()) fmt) hd;
318
               (Format.fprintf fmt " %s ") aid;
319
               ((__3 ()) fmt) hd2;
320
               Format.fprintf fmt ")"
321
            | _ ->
322
            (Format.fprintf fmt "@[<2>Op {@,";
323
             ((Format.fprintf fmt "@[%s =@ " "id";
324
               (Format.fprintf fmt "%S") aid;
325
               Format.fprintf fmt "@]");
326
              Format.fprintf fmt ";@ ";
327
              Format.fprintf fmt "@[%s =@ " "args";
328
              ((fun x  ->
329
                  Format.fprintf fmt "@[<2>[";
330
                  ignore
331
                    (List.fold_left
332
                       (fun sep  ->
333
                          fun x  ->
334
                            if sep then Format.fprintf fmt ";@ ";
335
                            ((__3 ()) fmt) x;
336
                            true) false x);
337
                  Format.fprintf fmt "@,]@]")) aargs;
338
              Format.fprintf fmt "@]");
339
             Format.fprintf fmt "@]}"))
340
        | IsNull  -> Format.pp_print_string fmt ""
341
        | Time { value = avalue; phy_unit = aphy_unit } ->
342
            (Format.fprintf fmt "@[<2>Time {@,";
343
             ((Format.fprintf fmt "@[%s =@ " "value";
344
               (Format.fprintf fmt "%d") avalue;
345
               Format.fprintf fmt "@]");
346
              Format.fprintf fmt ";@ ";
347
              Format.fprintf fmt "@[%s =@ " "phy_unit";
348
              (Format.fprintf fmt "%S") aphy_unit;
349
              Format.fprintf fmt "@]");
350
             Format.fprintf fmt "@]}")
351
        | Sig { name = aname; att = aatt } ->
352
            (Format.fprintf fmt "--@[<2>Sig {@,";
353
             ((Format.fprintf fmt "@[%s =@ " "name";
354
               ((__4 ()) fmt) aname;
355
               Format.fprintf fmt "@]");
356
              Format.fprintf fmt ";@ ";
357
              Format.fprintf fmt "@[%s =@ " "att";
358
              ((function
359
                | None  -> Format.pp_print_string fmt "None"
360
                | Some x ->
361
                    (Format.pp_print_string fmt "(Some ";
362
                     ((__5 ()) fmt) x;
363
                     Format.pp_print_string fmt ")"))) aatt;
364
              Format.fprintf fmt "@]");
365
             Format.fprintf fmt "@]}")
366
        | SuffixMod { expr = aexpr; selection = aselection } ->
367
            (Format.fprintf fmt "--@[<2>SuffixMod {@,";
368
             ((Format.fprintf fmt "@[%s =@ " "expr";
369
               ((__6 ()) fmt) aexpr;
370
               Format.fprintf fmt "@]");
371
              Format.fprintf fmt ";@ ";
372
              Format.fprintf fmt "@[%s =@ " "selection";
373
              ((__7 ()) fmt) aselection;
374
              Format.fprintf fmt "@]");
375
             Format.fprintf fmt "@]}")
376
        | Aggregate { elems = aelems } ->
377
            (match aelems with
378
            | [] -> Format.fprintf fmt "";
379
            | _ ->
380
              (Format.fprintf fmt "(@[";
381
              ((fun x  ->
382
                  ignore
383
                    (List.fold_left
384
                       (fun sep  ->
385
                          fun x  ->
386
                            if sep then Format.fprintf fmt ", ";
387
                            ((__8 ()) fmt) x;
388
                            true) false x))) aelems;
389
              Format.fprintf fmt ")@]");)
390
        | QualifiedExpression
391
            { type_mark = atype_mark; aggregate = aaggregate;
392
              expression = aexpression }
393
            ->
394
              ((__9 ()) fmt) atype_mark;
395
              Format.fprintf fmt "'";
396
              (match aaggregate with
397
              | [] -> Format.fprintf fmt "";
398
              | _ -> 
399
                Format.fprintf fmt "(@[<v>";
400
                ((fun x  ->
401
                   ignore
402
                     (List.fold_left
403
                        (fun sep  ->
404
                           fun x  ->
405
                             if sep then Format.fprintf fmt ",@ ";
406
                             ((__10 ()) fmt) x;
407
                             true) false x))) aaggregate;
408
              Format.fprintf fmt ")@]");
409
              (match aexpression with
410
              | None  -> Format.pp_print_string fmt ""
411
              | Some x ->
412
                  Format.fprintf fmt "(@[<v>";
413
                  ((__11 ()) fmt) x;
414
                  Format.fprintf fmt ")@]");
415
        | Others  -> Format.pp_print_string fmt "others")
416
    [@ocaml.warning "-A"])
417

    
418
and show_vhdl_expr_t : vhdl_expr_t -> Ppx_deriving_runtime.string =
419
  fun x  -> Format.asprintf "%a" pp_vhdl_expr_t x
420

    
421
and pp_vhdl_name_t :
422
  Format.formatter -> vhdl_name_t -> Ppx_deriving_runtime.unit =
423
  let __9 () = pp_vhdl_assoc_element_t
424
  
425
  and __8 () = pp_vhdl_name_t
426
  
427
  and __7 () = pp_vhdl_expr_t
428
  
429
  and __6 () = pp_vhdl_name_t
430
  
431
  and __5 () = pp_vhdl_name_t
432
  
433
  and __4 () = pp_vhdl_discrete_range_t
434
  
435
  and __3 () = pp_vhdl_name_t
436
  
437
  and __2 () = pp_vhdl_expr_t
438
  
439
  and __1 () = pp_vhdl_name_t
440
  
441
  and __0 () = pp_vhdl_name_t
442
   in
443
  ((let open! Ppx_deriving_runtime in
444
      fun fmt  ->
445
        function
446
        | Simple a0 ->
447
             (Format.fprintf fmt "%s") a0;
448
        | Identifier a0 ->
449
             (Format.fprintf fmt "%s") a0;
450
        | Selected a0 ->
451
             ((fun x  ->
452
                 ignore
453
                   (List.fold_left
454
                      (fun sep  ->
455
                         fun x  ->
456
                           if sep then Format.fprintf fmt ".";
457
                           ((__0 ()) fmt) x;
458
                           true) false x);) a0;)
459
        | Index { id = aid; exprs = aexprs } ->
460
            ((__1 ()) fmt) aid;
461
            Format.fprintf fmt "(";
462
            (fun x  ->
463
                ignore
464
                (List.fold_left
465
                  (fun sep  ->
466
                    fun x  ->
467
                      if sep then Format.fprintf fmt ",@ ";
468
                                  ((__2 ()) fmt) x;
469
                                  true
470
                  ) false x);
471
            ) aexprs;
472
            Format.fprintf fmt ")";
473
        | Slice { id = aid; range = arange } ->
474
              ((__3 ()) fmt) aid;
475
              Format.fprintf fmt "(";
476
              ((__4 ()) fmt) arange;
477
              Format.fprintf fmt ")";
478
        | Attribute { id = aid; designator = adesignator; expr = aexpr } ->
479
              ((__5 ()) fmt) aid;
480
              Format.fprintf fmt "\'";
481
              ((__6 ()) fmt) adesignator;
482
              (match aexpr with
483
              | IsNull -> Format.fprintf fmt "";
484
              | _ ->
485
                Format.fprintf fmt "(";
486
                ((__7 ()) fmt) aexpr;
487
                Format.fprintf fmt ")")
488
        | Function { id = aid; assoc_list = aassoc_list } ->
489
            (((__8 ()) fmt) aid;
490
            Format.fprintf fmt "(";
491
            ((fun x  ->
492
              Format.fprintf fmt "@[";
493
              ignore
494
                (List.fold_left
495
                   (fun sep  ->
496
                      fun x  ->
497
                        if sep then Format.fprintf fmt ",@ ";
498
                        ((__9 ()) fmt) x;
499
                        true) false x);
500
            Format.fprintf fmt "@]")) aassoc_list;
501
            Format.fprintf fmt ")";)
502
        | Open -> Format.pp_print_string fmt "open"
503
        | 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
(* TODO *)
678
let rec pp_vhdl_type_attributes_t
679
  =
680
  ((let open! Ppx_deriving_runtime in
681
      fun poly_basetype  ->
682
        fun fmt  ->
683
          function
684
          | TAttNoArg { id = aid } ->
685
              (Format.fprintf fmt "@[<2>TAttNoArg {@,";
686
               (Format.fprintf fmt "@[%s =@ " "id";
687
                (Format.fprintf fmt "%S") aid;
688
                Format.fprintf fmt "@]");
689
               Format.fprintf fmt "@]}")
690
          | TAttIntArg { id = aid; arg = aarg } ->
691
              (Format.fprintf fmt "@[<2>TAttIntArg {@,";
692
               ((Format.fprintf fmt "@[%s =@ " "id";
693
                 (Format.fprintf fmt "%S") aid;
694
                 Format.fprintf fmt "@]");
695
                Format.fprintf fmt ";@ ";
696
                Format.fprintf fmt "@[%s =@ " "arg";
697
                (Format.fprintf fmt "%d") aarg;
698
                Format.fprintf fmt "@]");
699
               Format.fprintf fmt "@]}")
700
          | TAttValArg { id = aid; arg = aarg } ->
701
              (Format.fprintf fmt "@[<2>TAttValArg {@,";
702
               ((Format.fprintf fmt "@[%s =@ " "id";
703
                 (Format.fprintf fmt "%S") aid;
704
                 Format.fprintf fmt "@]");
705
                Format.fprintf fmt ";@ ";
706
                Format.fprintf fmt "@[%s =@ " "arg";
707
                (poly_basetype fmt) aarg;
708
                Format.fprintf fmt "@]");
709
               Format.fprintf fmt "@]}")
710
          | TAttStringArg { id = aid; arg = aarg } ->
711
              (Format.fprintf fmt "@[<2>TAttStringArg {@,";
712
               ((Format.fprintf fmt "@[%s =@ " "id";
713
                 (Format.fprintf fmt "%S") aid;
714
                 Format.fprintf fmt "@]");
715
                Format.fprintf fmt ";@ ";
716
                Format.fprintf fmt "@[%s =@ " "arg";
717
                (Format.fprintf fmt "%S") aarg;
718
                Format.fprintf fmt "@]");
719
               Format.fprintf fmt "@]}"))
720
  [@ocaml.warning "-A"])
721

    
722
and show_vhdl_type_attributes_t  =
723
  fun poly_basetype  ->
724
    fun x  ->
725
      Format.asprintf "%a" (pp_vhdl_type_attributes_t poly_basetype) x
726

    
727
let rec pp_vhdl_parameter_t :
728
  Format.formatter -> vhdl_parameter_t -> Ppx_deriving_runtime.unit =
729
  let __2 () = pp_vhdl_cst_val_t
730
  
731
  and __1 () = pp_vhdl_subtype_indication_t
732
  
733
  and __0 () = pp_vhdl_name_t
734
   in
735
  ((let open! Ppx_deriving_runtime in
736
      fun fmt  ->
737
        fun x  ->
738
          ((fun x  ->
739
             ignore
740
               (List.fold_left
741
                 (fun sep  ->
742
                   fun x  ->
743
                     if sep then Format.fprintf fmt ", ";
744
                       ((__0 ()) fmt) x;
745
                       true) false x))) x.names;
746
          Format.fprintf fmt ": ";
747
          ((fun x  ->
748
             ignore
749
               (List.fold_left
750
                 (fun sep  ->
751
                   fun x  ->
752
                     if sep then Format.fprintf fmt "";
753
                       Format.fprintf fmt "%s " x;
754
                       true) false x))) x.mode;
755
          ((__1 ()) fmt) x.typ;
756
          (match x.init_val with
757
           | None  -> Format.pp_print_string fmt ""
758
           | Some x ->
759
                 (Format.pp_print_string fmt " := ";
760
                 ((__2 ()) fmt) x));)
761
    [@ocaml.warning "-A"])
762

    
763
and show_vhdl_parameter_t : vhdl_parameter_t -> Ppx_deriving_runtime.string =
764
  fun x  -> Format.asprintf "%a" pp_vhdl_parameter_t x
765

    
766
let rec pp_vhdl_subprogram_spec_t :
767
  Format.formatter -> vhdl_subprogram_spec_t -> Ppx_deriving_runtime.unit =
768
  let __1 () = pp_vhdl_parameter_t
769
  
770
  and __0 () = pp_vhdl_name_t
771
   in
772
  ((let open! Ppx_deriving_runtime in
773
      fun fmt  ->
774
        fun x  ->
775
          (match x.subprogram_type with
776
          | "function" -> 
777
              if (x.isPure) then
778
                Format.fprintf fmt "pure %s %s" x.subprogram_type x.name
779
              else
780
                Format.fprintf fmt "impure %s %s" x.subprogram_type x.name
781
          | "procedure" ->
782
              Format.fprintf fmt "%s %s" x.subprogram_type x.name);
783
          (match x.parameters with
784
          | [] -> Format.fprintf fmt "";
785
          | _ -> 
786
            Format.fprintf fmt "(@[";
787
            ((fun x  ->
788
                ignore
789
                  (List.fold_left
790
                     (fun sep  ->
791
                        fun x  ->
792
                          if sep then Format.fprintf fmt ";@ ";
793
                          ((__1 ()) fmt) x;
794
                          true) false x))) x.parameters;
795
            Format.fprintf fmt "@])");
796
          (match x.typeMark with
797
          | NoName -> Format.fprintf fmt "";
798
          | _ -> 
799
              Format.fprintf fmt "return ";
800
              ((__0 ()) fmt) x.typeMark))
801
   [@ocaml.warning "-A"])
802

    
803
and show_vhdl_subprogram_spec_t :
804
  vhdl_subprogram_spec_t -> Ppx_deriving_runtime.string =
805
  fun x  -> Format.asprintf "%a" pp_vhdl_subprogram_spec_t x
806

    
807
let rec pp_vhdl_waveform_element_t :
808
  Format.formatter -> vhdl_waveform_element_t -> Ppx_deriving_runtime.unit =
809
  let __1 () = pp_vhdl_expr_t
810
  
811
  and __0 () = pp_vhdl_expr_t
812
   in
813
  ((let open! Ppx_deriving_runtime in
814
      fun fmt  ->
815
        fun x  ->
816
          (match x.value with
817
          | None -> Format.fprintf fmt "";
818
          | Some IsNull -> Format.fprintf fmt "null";
819
          | Some v -> ((__0 ()) fmt) v);
820
          (match x.delay with
821
          | None -> Format.fprintf fmt "";
822
          | Some v -> 
823
              Format.fprintf fmt " after ";
824
              ((__1 ()) fmt) v))
825
    [@ocaml.warning "-A"])
826

    
827
and show_vhdl_waveform_element_t :
828
  vhdl_waveform_element_t -> Ppx_deriving_runtime.string =
829
  fun x  -> Format.asprintf "%a" pp_vhdl_waveform_element_t x
830

    
831
let rec pp_vhdl_sequential_stmt_t :
832
  Format.formatter -> vhdl_sequential_stmt_t -> Ppx_deriving_runtime.unit =
833
  let __23 () = pp_vhdl_expr_t
834
  
835
  and __22 () = pp_vhdl_name_t
836
  
837
  and __21 () = pp_vhdl_name_t
838
  
839
  and __20 () = pp_vhdl_assoc_element_t
840
  
841
  and __19 () = pp_vhdl_name_t
842
  
843
  and __18 () = pp_vhdl_name_t
844
  
845
  and __17 () = pp_vhdl_expr_t
846
  
847
  and __16 () = pp_vhdl_expr_t
848
  
849
  and __15 () = pp_vhdl_expr_t
850
  
851
  and __14 () = pp_vhdl_name_t
852
  
853
  and __13 () = pp_vhdl_expr_t
854
  
855
  and __12 () = pp_vhdl_name_t
856
  
857
  and __11 () = pp_vhdl_case_item_t
858
  
859
  and __10 () = pp_vhdl_expr_t
860
  
861
  and __9 () = pp_vhdl_name_t
862
  
863
  and __8 () = pp_vhdl_sequential_stmt_t
864
  
865
  and __7 () = pp_vhdl_if_case_t
866
  
867
  and __6 () = pp_vhdl_name_t
868
  
869
  and __5 () = pp_vhdl_waveform_element_t
870
  
871
  and __4 () = pp_vhdl_name_t
872
  
873
  and __3 () = pp_vhdl_name_t
874
  
875
  and __2 () = pp_vhdl_expr_t
876
  
877
  and __1 () = pp_vhdl_name_t
878
  
879
  and __0 () = pp_vhdl_name_t
880
  in
881
  ((let open! Ppx_deriving_runtime in
882
      fun fmt  ->
883
        function
884
        | VarAssign { label = alabel; lhs = alhs; rhs = arhs } ->
885
            (match alabel with
886
              | NoName -> Format.fprintf fmt "";
887
              | _ -> (((__0 ()) fmt) alabel;
888
                     Format.fprintf fmt ": ")
889
            );
890
            ((__1 ()) fmt) alhs;
891
            Format.fprintf fmt " := ";
892
            ((__2 ()) fmt) arhs;
893
(* TODO: Check
894
            (Format.fprintf fmt "@[<2>VarAssign {@,";
895
             (((Format.fprintf fmt "@[%s =@ " "label";
896
                ((__0 ()) fmt) alabel;
897
                Format.fprintf fmt "@]");
898
               Format.fprintf fmt ";@ ";
899
               Format.fprintf fmt "@[%s =@ " "lhs";
900
               ((__1 ()) fmt) alhs;
901
               Format.fprintf fmt "@]");
902
              Format.fprintf fmt ";@ ";
903
              Format.fprintf fmt "@[%s =@ " "rhs";
904
              ((__2 ()) fmt) arhs;
905
              Format.fprintf fmt "@]");
906
             Format.fprintf fmt "@]}") *)
907
        | SigSeqAssign { label = alabel; lhs = alhs; rhs = arhs } ->
908
            (match alabel with
909
              | NoName -> Format.fprintf fmt "";
910
              | _ -> (((__3 ()) fmt) alabel;
911
                     Format.fprintf fmt ":@ ")
912
            );
913
            Format.fprintf fmt "@[<2>";
914
            ((__4 ()) fmt) alhs;
915
            Format.fprintf fmt "@ <=@ ";
916
            ((fun x  ->
917
               Format.fprintf fmt "@[";
918
               ignore
919
                 (List.fold_left
920
                   (fun sep  ->
921
                     fun x  ->
922
                       if sep then Format.fprintf fmt ", ";
923
                        ((__5 ()) fmt) x;
924
                        true) false x);
925
            Format.fprintf fmt "@]@]")) arhs;
926
        | If { label = alabel; if_cases = aif_cases; default = adefault } ->
927
            (match alabel with
928
              | NoName -> Format.fprintf fmt "";
929
              | _ -> (((__6 ()) fmt) alabel;
930
                     Format.fprintf fmt ":@ ")
931
            );
932
            Format.fprintf fmt "@[<v>if";
933
            ((fun x ->
934
               ignore
935
               (List.fold_left
936
                 (fun sep  ->
937
                   fun x  ->
938
                           if sep then Format.fprintf fmt "@;elsif";
939
                                ((__7 ()) fmt) x;
940
                                true
941
                 ) false x);
942
             )) aif_cases;
943
             (match adefault with
944
              | [] -> Format.fprintf fmt "";
945
              | _  -> (Format.fprintf fmt "@;else";
946
                      ((fun x  ->
947
                          Format.fprintf fmt "@;<0 2>";
948
                          ignore
949
                            (List.fold_left
950
                              (fun sep  ->
951
                                fun x  ->
952
                                        if sep then Format.fprintf fmt "";
953
                          ((__8 ()) fmt) x;
954
                          Format.fprintf fmt ";";
955
                          true) false x))) adefault));
956
            Format.fprintf fmt "@;end if@]"
957
        | Case { label = alabel; guard = aguard; branches = abranches } ->
958
            (match alabel with
959
              | NoName -> Format.fprintf fmt "";
960
              | _ -> (((__9 ()) fmt) alabel;
961
                     Format.fprintf fmt ":@ ")
962
            );
963
            Format.fprintf fmt "@[<v>case ";
964
            ((__10 ()) fmt) aguard;
965
            Format.fprintf fmt " is";
966
            ((fun x  ->
967
                ignore
968
                  (List.fold_left
969
                     (fun sep  ->
970
                        fun x  ->
971
                          if sep then Format.fprintf fmt "";
972
                          ((__11 ()) fmt) x;
973
                          true) false x);)) abranches;
974
            Format.fprintf fmt "@;end case@]";
975
        | Exit
976
            { label = alabel; loop_label = aloop_label;
977
              condition = acondition }
978
            ->
979
            (match alabel with
980
              | NoName -> Format.fprintf fmt "";
981
              | _ -> (((__12 ()) fmt) alabel;
982
                     Format.fprintf fmt ":@ ")
983
            );
984
            Format.fprintf fmt "exit";
985
            (match aloop_label with
986
               | None  -> Format.pp_print_string fmt ""
987
               | Some x -> (Format.fprintf fmt "@ %s@ ") x);
988
            ((function
989
               | None  -> Format.pp_print_string fmt ""
990
               | Some x ->
991
                   (Format.pp_print_string fmt "when@ ";
992
                    ((__13 ()) fmt) x;))) acondition;
993
        | Assert
994
            { label = alabel; cond = acond; report = areport;
995
              severity = aseverity }
996
            ->
997
            Format.fprintf fmt "@[<v 2>";
998
            (match alabel with
999
              | NoName -> Format.fprintf fmt "";
1000
              | _ -> (((__14 ()) fmt) alabel;
1001
                     Format.fprintf fmt ":@ ")
1002
            );
1003
            Format.fprintf fmt "assert ";
1004
            ((__15 ()) fmt) acond;
1005
            (match areport with
1006
            | IsNull -> Format.fprintf fmt "";
1007
            | _ -> 
1008
                Format.fprintf fmt "@;report ";
1009
                ((__16 ()) fmt) areport);
1010
            (match aseverity with
1011
            | IsNull -> Format.fprintf fmt "";
1012
            | _ -> 
1013
                Format.fprintf fmt "@;severity ";
1014
                ((__17 ()) fmt) aseverity);
1015
            Format.fprintf fmt "@]";
1016
        | ProcedureCall { label = alabel; name = aname; assocs = aassocs } ->
1017
            (match alabel with
1018
              | NoName -> Format.fprintf fmt "";
1019
              | _ -> (((__18 ()) fmt) alabel;
1020
                     Format.fprintf fmt ":@ ")
1021
            );
1022
            ((__19 ()) fmt) aname;
1023
            (match aassocs with
1024
            | [] -> Format.fprintf fmt "";
1025
            | _ ->
1026
               Format.fprintf fmt "(@[<v>";
1027
               ((fun x  ->
1028
                ignore
1029
                  (List.fold_left
1030
                     (fun sep  ->
1031
                        fun x  ->
1032
                          if sep then Format.fprintf fmt ",@ ";
1033
                          ((__20 ()) fmt) x;
1034
                          true) false x))) aassocs;
1035
               Format.fprintf fmt "@])");
1036
        | Wait  -> Format.pp_print_string fmt "wait"
1037
        | Null { label = alabel } ->
1038
            (match alabel with
1039
              | NoName -> Format.fprintf fmt "";
1040
              | _ -> (((__18 ()) fmt) alabel;
1041
                     Format.fprintf fmt ":@ ")
1042
            );
1043
            Format.fprintf fmt "null";
1044
        | Return { label = alabel; expr = aexpr } ->
1045
            (match alabel with
1046
              | None -> ();
1047
              | Some a -> (((__19 ()) fmt) a;
1048
                     Format.fprintf fmt ":@ ")
1049
            );
1050
            Format.fprintf fmt "return";
1051
            (match aexpr with
1052
                | None  -> ()
1053
                | Some a ->
1054
                     ((__23 ()) fmt) a);)
1055
    [@ocaml.warning "-A"])
1056

    
1057
and show_vhdl_sequential_stmt_t :
1058
  vhdl_sequential_stmt_t -> Ppx_deriving_runtime.string =
1059
  fun x  -> Format.asprintf "%a" pp_vhdl_sequential_stmt_t x
1060

    
1061
and pp_vhdl_if_case_t :
1062
  Format.formatter -> vhdl_if_case_t -> Ppx_deriving_runtime.unit =
1063
  let __1 () = pp_vhdl_sequential_stmt_t
1064
  
1065
  and __0 () = pp_vhdl_expr_t
1066
   in
1067
  ((let open! Ppx_deriving_runtime in
1068
      fun fmt  ->
1069
        fun x  ->
1070
          Format.fprintf fmt " (";
1071
          ((__0 ()) fmt) x.if_cond;
1072
          Format.fprintf fmt ") then@;<0 2>";
1073
          ((fun x  ->
1074
             ignore
1075
               (List.fold_left
1076
                  (fun sep  ->
1077
                     fun x  ->
1078
                             if sep then Format.fprintf fmt "@;<0 2>";
1079
                       ((__1 ()) fmt) x;
1080
                       Format.fprintf fmt ";";
1081
                       true) false x);
1082
          )) x.if_block;)
1083
    [@ocaml.warning "-A"])
1084

    
1085
and show_vhdl_if_case_t : vhdl_if_case_t -> Ppx_deriving_runtime.string =
1086
  fun x  -> Format.asprintf "%a" pp_vhdl_if_case_t x
1087

    
1088
and pp_vhdl_case_item_t :
1089
  Format.formatter -> vhdl_case_item_t -> Ppx_deriving_runtime.unit =
1090
  let __1 () = pp_vhdl_sequential_stmt_t
1091
  
1092
  and __0 () = pp_vhdl_expr_t
1093
   in
1094
  ((let open! Ppx_deriving_runtime in
1095
      fun fmt  ->
1096
        fun x  ->
1097
                Format.fprintf fmt "@;@[<v 2>when ";
1098
            ((fun x  ->
1099
                ignore
1100
                  (List.fold_left
1101
                     (fun sep  ->
1102
                        fun x  ->
1103
                          if sep then Format.fprintf fmt "@ |@ ";
1104
                          ((__0 ()) fmt) x;
1105
                          true) false x);)) x.when_cond;
1106
           Format.fprintf fmt " => ";
1107
           (fun x  ->
1108
               ignore
1109
                 (List.fold_left
1110
                    (fun sep  ->
1111
                       fun x  ->
1112
                         if sep then Format.fprintf fmt "@;";
1113
                         ((__1 ()) fmt) x;
1114
                         Format.fprintf fmt ";";
1115
                         true) ((List.length x) > 1) x);) x.when_stmt;
1116
           Format.fprintf fmt "@]")
1117
    [@ocaml.warning "-A"])
1118

    
1119
and show_vhdl_case_item_t : vhdl_case_item_t -> Ppx_deriving_runtime.string =
1120
  fun x  -> Format.asprintf "%a" pp_vhdl_case_item_t x
1121

    
1122
let rec (pp_vhdl_port_mode_t :
1123
          Format.formatter -> vhdl_port_mode_t -> Ppx_deriving_runtime.unit)
1124
  =
1125
  ((let open! Ppx_deriving_runtime in
1126
      fun fmt  ->
1127
        function
1128
        | InPort  -> Format.pp_print_string fmt "in"
1129
        | OutPort  -> Format.pp_print_string fmt "out"
1130
        | InoutPort  -> Format.pp_print_string fmt "inout"
1131
        | BufferPort  -> Format.pp_print_string fmt "buffer")
1132
  [@ocaml.warning "-A"])
1133

    
1134
and show_vhdl_port_mode_t : vhdl_port_mode_t -> Ppx_deriving_runtime.string =
1135
  fun x  -> Format.asprintf "%a" pp_vhdl_port_mode_t x
1136

    
1137

    
1138
let rec pp_vhdl_port_t :
1139
  Format.formatter -> vhdl_port_t -> Ppx_deriving_runtime.unit =
1140
  let __3 () = pp_vhdl_expr_t
1141
  
1142
  and __2 () = pp_vhdl_subtype_indication_t
1143
  
1144
  and __1 () = pp_vhdl_port_mode_t
1145
  
1146
  and __0 () = pp_vhdl_name_t
1147
   in
1148
  ((let open! Ppx_deriving_runtime in
1149
      fun fmt  ->
1150
        fun x  ->
1151
          Format.fprintf fmt "@[";
1152
          ((((
1153
              ((fun x  ->
1154
                  Format.fprintf fmt "@[";
1155
                  ignore
1156
                    (List.fold_left
1157
                       (fun sep  ->
1158
                          fun x  ->
1159
                            if sep then Format.fprintf fmt ",@ ";
1160
                            ((__0 ()) fmt) x;
1161
                            true) false x);
1162
                  Format.fprintf fmt "@,@]")) x.names;
1163
              );
1164
             Format.fprintf fmt ": ";
1165
             ((__1 ()) fmt) x.mode;
1166
             );
1167
             Format.fprintf fmt " ";
1168
            ((__2 ()) fmt) x.typ;
1169
            );
1170
          (match x.expr with
1171
           | IsNull -> Format.fprintf fmt "";
1172
           | _ -> (Format.fprintf fmt "@[:= ";
1173
                   ((__3 ()) fmt) x.expr;
1174
                   Format.fprintf fmt "@]"));
1175
          Format.fprintf fmt "@]"))
1176
    [@ocaml.warning "-A"])
1177

    
1178
and show_vhdl_port_t : vhdl_port_t -> Ppx_deriving_runtime.string =
1179
  fun x  -> Format.asprintf "%a" pp_vhdl_port_t x
1180

    
1181
let rec pp_vhdl_declaration_t :
1182
  Format.formatter -> vhdl_declaration_t -> Ppx_deriving_runtime.unit =
1183
  let __14 () = pp_vhdl_sequential_stmt_t
1184
  
1185
  and __13 () = pp_vhdl_declaration_t
1186
  
1187
  and __12 () = pp_vhdl_subprogram_spec_t
1188

    
1189
  and __11 () = pp_vhdl_port_t
1190
  
1191
  and __10 () = pp_vhdl_port_t
1192
  
1193
  and __9 () = pp_vhdl_name_t
1194
  
1195
  and __8 () = pp_vhdl_expr_t
1196
  
1197
  and __7 () = pp_vhdl_subtype_indication_t
1198
  
1199
  and __6 () = pp_vhdl_name_t
1200
  
1201
  and __5 () = pp_vhdl_expr_t
1202
  
1203
  and __4 () = pp_vhdl_subtype_indication_t
1204
  
1205
  and __3 () = pp_vhdl_name_t
1206
  
1207
  and __2 () = pp_vhdl_expr_t
1208
  
1209
  and __1 () = pp_vhdl_subtype_indication_t
1210
  
1211
  and __0 () = pp_vhdl_name_t
1212
   in
1213
  ((let open! Ppx_deriving_runtime in
1214
      fun fmt  ->
1215
        function
1216
        | VarDecl { names = anames; typ = atyp; init_val = ainit_val } ->
1217
            (Format.fprintf fmt "variable ";
1218
             ((((fun x  ->
1219
                    ignore
1220
                      (List.fold_left
1221
                         (fun sep  ->
1222
                            fun x  ->
1223
                              if sep then Format.fprintf fmt ",";
1224
                              ((__0 ()) fmt) x;
1225
                              true) false x);)) anames;
1226
               Format.fprintf fmt " : ";
1227
               ((__1 ()) fmt) atyp;
1228
               (match ainit_val with
1229
                | IsNull  -> Format.pp_print_string fmt ""
1230
                | _ ->
1231
                    (Format.fprintf fmt ":=";
1232
                     ((__2 ()) fmt) ainit_val;))));)
1233
        | CstDecl { names = anames; typ = atyp; init_val = ainit_val } ->
1234
            (Format.fprintf fmt "constant ";
1235
             ((((fun x  ->
1236
                    ignore
1237
                      (List.fold_left
1238
                         (fun sep  ->
1239
                            fun x  ->
1240
                              if sep then Format.fprintf fmt ",";
1241
                              ((__3 ()) fmt) x;
1242
                              true) false x);)) anames;
1243
              Format.fprintf fmt " : ";
1244
              ((__4 ()) fmt) atyp;
1245
              Format.fprintf fmt " := ";
1246
              ((__5 ()) fmt) ainit_val)))
1247
        | SigDecl { names = anames; typ = atyp; init_val = ainit_val } ->
1248
            (Format.fprintf fmt "signal ";
1249
            ((fun x  ->
1250
              ignore
1251
              (List.fold_left
1252
                (fun sep  ->
1253
                  fun x  ->
1254
                    if sep then Format.fprintf fmt ",";
1255
                                ((__6 ()) fmt) x;
1256
                                true) false x);
1257
              )) anames;
1258
            Format.fprintf fmt " : ";
1259
            ((__7 ()) fmt) atyp;
1260
            (match ainit_val with
1261
              | IsNull  -> Format.pp_print_string fmt ""
1262
              | _ ->
1263
                  (Format.fprintf fmt ":=";
1264
                  ((__8 ()) fmt) ainit_val;)))
1265
        | ComponentDecl
1266
            { name = aname; generics = agenerics; ports = aports } ->
1267
            Format.fprintf fmt "@[<v 2>component ";
1268
            ((__9 ()) fmt) aname;
1269
            Format.fprintf fmt " is@;";
1270
            (match agenerics with
1271
            | [] -> ()
1272
            | _ ->
1273
                Format.fprintf fmt "generic (@[<v>";
1274
                ((fun x  ->
1275
                  ignore
1276
                    (List.fold_left
1277
                      (fun sep  ->
1278
                        fun x  ->
1279
                          if sep then Format.fprintf fmt ";@;";
1280
                            ((__10 ()) fmt) x;
1281
                            true) false x))) agenerics;
1282
                Format.fprintf fmt "@]);");
1283
            (match aports with
1284
            | [] -> ()
1285
            | _ ->
1286
                Format.fprintf fmt "port (@[<v>";
1287
                ((fun x  ->
1288
                  ignore
1289
                    (List.fold_left
1290
                      (fun sep  ->
1291
                        fun x  ->
1292
                          if sep then Format.fprintf fmt ";@;";
1293
                            ((__11 ()) fmt) x;
1294
                            true) false x))) aports;
1295
                Format.fprintf fmt "@]);");
1296
            Format.fprintf fmt "@]@;end component";
1297
        | Subprogram
1298
            { spec = aspec; decl_part = adecl_part; stmts = astmts }
1299
            ->
1300
              Format.fprintf fmt "@[<v 2>";
1301
              ((__12 ()) fmt) aspec;
1302
              Format.fprintf fmt " is";
1303
              (match adecl_part with
1304
              | [] -> Format.fprintf fmt "";
1305
              | _ ->
1306
                ((fun x  ->
1307
                  ignore
1308
                    (List.fold_left
1309
                      (fun sep  ->
1310
                         fun x  ->
1311
                           if sep then Format.fprintf fmt "";
1312
                             Format.fprintf fmt "@;";
1313
                             ((__13 ()) fmt) x;
1314
                             Format.fprintf fmt ";";
1315
                             true) false x))) adecl_part);
1316
              Format.fprintf fmt "@]@;";
1317
              Format.fprintf fmt "@[<v 2>begin@;";
1318
              ((fun x  ->
1319
                  ignore
1320
                    (List.fold_left
1321
                       (fun sep  ->
1322
                          fun x  ->
1323
                            if sep then Format.fprintf fmt "@;";
1324
                            ((__14 ()) fmt) x;
1325
                            Format.fprintf fmt ";";
1326
                            true) false x))) astmts;
1327
              Format.fprintf fmt "@]@;end";)
1328
    [@ocaml.warning "-A"])
1329

    
1330
and show_vhdl_declaration_t :
1331
  vhdl_declaration_t -> Ppx_deriving_runtime.string =
1332
  fun x  -> Format.asprintf "%a" pp_vhdl_declaration_t x
1333

    
1334
let rec pp_vhdl_load_t :
1335
  Format.formatter -> vhdl_load_t -> Ppx_deriving_runtime.unit =
1336
  let __1 () = pp_vhdl_name_t
1337
  
1338
  and __0 () = pp_vhdl_name_t
1339
   in
1340
  ((let open! Ppx_deriving_runtime in
1341
      fun fmt  ->
1342
        function
1343
        | Library a0 ->
1344
            (Format.fprintf fmt "library ";
1345
             ((fun x  ->
1346
                 ignore
1347
                   (List.fold_left
1348
                      (fun sep  ->
1349
                         fun x  ->
1350
                           if sep then Format.fprintf fmt ",";
1351
                           ((__0 ()) fmt) x;
1352
                           true) false x))) a0);
1353
        | Use a0 ->
1354
            (Format.fprintf fmt "use ";
1355
             ((fun x  ->
1356
                 ignore
1357
                   (List.fold_left
1358
                      (fun sep  ->
1359
                         fun x  ->
1360
                           if sep then Format.fprintf fmt ".";
1361
                           ((__1 ()) fmt) x;
1362
                           true) false x))) a0))
1363
    [@ocaml.warning "-A"])
1364

    
1365
and show_vhdl_load_t : vhdl_load_t -> Ppx_deriving_runtime.string =
1366
  fun x  -> Format.asprintf "%a" pp_vhdl_load_t x
1367

    
1368
let rec pp_vhdl_declarative_item_t :
1369
  Format.formatter -> vhdl_declarative_item_t -> Ppx_deriving_runtime.unit =
1370
  let __2 () = pp_vhdl_definition_t
1371
  
1372
  and __1 () = pp_vhdl_declaration_t
1373
  
1374
  and __0 () = pp_vhdl_load_t
1375
   in
1376
  ((let open! Ppx_deriving_runtime in
1377
      fun fmt  ->
1378
        fun x  ->
1379
          (match x.use_clause with
1380
          | None -> Format.fprintf fmt "";
1381
          | Some e -> ((__0 ()) fmt) e);
1382
          (match x.declaration with
1383
          | None -> Format.fprintf fmt "";
1384
          | Some e -> ((__1 ()) fmt) e);
1385
          (match x.definition with
1386
          | None -> Format.fprintf fmt "";
1387
          | Some e -> ((__2 ()) fmt) e);)
1388
    [@ocaml.warning "-A"])
1389

    
1390
and show_vhdl_declarative_item_t :
1391
  vhdl_declarative_item_t -> Ppx_deriving_runtime.string =
1392
  fun x  -> Format.asprintf "%a" pp_vhdl_declarative_item_t x
1393

    
1394
let rec pp_vhdl_signal_condition_t :
1395
  Format.formatter -> vhdl_signal_condition_t -> Ppx_deriving_runtime.unit =
1396
  let __1 () = pp_vhdl_expr_t
1397
  
1398
  and __0 () = pp_vhdl_waveform_element_t
1399
   in
1400
  ((let open! Ppx_deriving_runtime in
1401
      fun fmt  ->
1402
        fun x  ->
1403
          ((fun x  ->
1404
                ignore
1405
                  (List.fold_left
1406
                     (fun sep  ->
1407
                        fun x  ->
1408
                          if sep then Format.fprintf fmt ",@,";
1409
                          ((__0 ()) fmt) x;
1410
                          true) false x))) x.expr;
1411
          (match x.cond with
1412
          | None -> Format.fprintf fmt "";
1413
          | Some e -> Format.fprintf fmt " when ";
1414
                 ((__1 ()) fmt) e);)
1415
    [@ocaml.warning "-A"])
1416

    
1417
and show_vhdl_signal_condition_t :
1418
  vhdl_signal_condition_t -> Ppx_deriving_runtime.string =
1419
  fun x  -> Format.asprintf "%a" pp_vhdl_signal_condition_t x
1420

    
1421
let rec pp_vhdl_signal_selection_t :
1422
  Format.formatter -> vhdl_signal_selection_t -> Ppx_deriving_runtime.unit =
1423
  let __1 () = pp_vhdl_expr_t
1424
  
1425
  and __0 () = pp_vhdl_waveform_element_t
1426
   in
1427
  ((let open! Ppx_deriving_runtime in
1428
      fun fmt  ->
1429
        fun x  ->
1430
          ((fun x  ->
1431
            ignore
1432
              (List.fold_left
1433
                (fun sep  ->
1434
                  fun x  ->
1435
                    if sep then Format.fprintf fmt "@ ";
1436
                      ((__0 ()) fmt) x;
1437
                      true) false x))) x.expr;
1438
          Format.fprintf fmt " when ";
1439
          ((fun x  ->
1440
            ignore
1441
              (List.fold_left
1442
                (fun sep  ->
1443
                  fun x  ->
1444
                    if sep then Format.fprintf fmt "|@ ";
1445
                      ((__1 ()) fmt) x;
1446
                      true) false x))) x.when_sel)
1447
    [@ocaml.warning "-A"])
1448

    
1449
and show_vhdl_signal_selection_t :
1450
  vhdl_signal_selection_t -> Ppx_deriving_runtime.string =
1451
  fun x  -> Format.asprintf "%a" pp_vhdl_signal_selection_t x
1452

    
1453
let rec pp_vhdl_conditional_signal_t :
1454
  Format.formatter -> vhdl_conditional_signal_t -> Ppx_deriving_runtime.unit
1455
  =
1456
  let __3 () = pp_vhdl_expr_t
1457
  
1458
  and __2 () = pp_vhdl_signal_condition_t
1459
  
1460
  and __1 () = pp_vhdl_name_t
1461
  
1462
  and __0 () = pp_vhdl_name_t
1463
   in
1464
  ((let open! Ppx_deriving_runtime in
1465
      fun fmt  ->
1466
        fun x  ->
1467
          (match x.label with
1468
            | NoName -> Format.fprintf fmt "";
1469
            | _ -> (((__0 ()) fmt) x.label;
1470
                   Format.fprintf fmt ":@ ")
1471
          );
1472
          if (x.postponed) then Format.fprintf fmt "postponed@ ";
1473
          ((__1 ()) fmt) x.lhs;
1474
          Format.fprintf fmt " <= ";
1475
          (match x.delay with
1476
            | IsNull -> Format.fprintf fmt "";
1477
            | _ -> ((__3 ()) fmt) x.delay;
1478
                   Format.fprintf fmt " ");
1479
          ((fun x  ->
1480
             Format.fprintf fmt "@[";
1481
             ignore
1482
               (List.fold_left
1483
                 (fun sep  ->
1484
                   fun x  ->
1485
                     if sep then Format.fprintf fmt " else ";
1486
                      ((__2 ()) fmt) x;
1487
                      true) false x);
1488
          Format.fprintf fmt "@]")) x.rhs;
1489
          Format.fprintf fmt ";")
1490
   [@ocaml.warning "-A"])
1491

    
1492
and show_vhdl_conditional_signal_t :
1493
  vhdl_conditional_signal_t -> Ppx_deriving_runtime.string =
1494
  fun x  -> Format.asprintf "%a" pp_vhdl_conditional_signal_t x
1495

    
1496
let rec pp_vhdl_process_t :
1497
  Format.formatter -> vhdl_process_t -> Ppx_deriving_runtime.unit =
1498
  let __3 () = pp_vhdl_sequential_stmt_t
1499
  
1500
  and __2 () = pp_vhdl_name_t
1501
  
1502
  and __1 () = pp_vhdl_declarative_item_t
1503
  
1504
  and __0 () = pp_vhdl_name_t
1505
   in
1506
  ((let open! Ppx_deriving_runtime in
1507
      fun fmt  ->
1508
        fun x  ->
1509
          Format.fprintf fmt "@[<v 2>";
1510
          (match x.id with
1511
          | NoName -> Format.fprintf fmt "";
1512
          | _ -> 
1513
              ((__0 ()) fmt) x.id;
1514
              Format.fprintf fmt ": ");
1515
          Format.fprintf fmt "process ";
1516
          (match x.active_sigs with
1517
          | [] -> Format.fprintf fmt "";
1518
          | _ -> Format.fprintf fmt "(";
1519
                 ((fun x  ->
1520
                    ignore
1521
                      (List.fold_left
1522
                         (fun sep  ->
1523
                            fun x  ->
1524
                              if sep then Format.fprintf fmt ",";
1525
                              ((__2 ()) fmt) x;
1526
                              true) false x))) x.active_sigs;
1527
                 Format.fprintf fmt ")");
1528
          Format.fprintf fmt " is";
1529
          (match x.declarations with
1530
          | [] -> Format.fprintf fmt "";
1531
          | _ -> 
1532
              (Format.fprintf fmt "@;";
1533
              ((fun x  ->
1534
                ignore
1535
                (List.fold_left
1536
                  (fun sep  ->
1537
                    fun x  ->
1538
                      if sep then Format.fprintf fmt "@;";
1539
                        ((__1 ()) fmt) x;
1540
                        Format.fprintf fmt ";";
1541
                        true) false x))) x.declarations));
1542
          Format.fprintf fmt "@]@;@[<v 2>begin@;";
1543
          ((fun x  ->
1544
               ignore
1545
                 (List.fold_left
1546
                    (fun sep  ->
1547
                       fun x  ->
1548
                         if sep then Format.fprintf fmt "@;";
1549
                         ((__3 ()) fmt) x;
1550
                         Format.fprintf fmt ";";
1551
                         true) false x);)) x.body;
1552
          Format.fprintf fmt "@]@;end process;@;")
1553
    [@ocaml.warning "-A"])
1554

    
1555
and show_vhdl_process_t : vhdl_process_t -> Ppx_deriving_runtime.string =
1556
  fun x  -> Format.asprintf "%a" pp_vhdl_process_t x
1557

    
1558
let rec pp_vhdl_selected_signal_t :
1559
  Format.formatter -> vhdl_selected_signal_t -> Ppx_deriving_runtime.unit =
1560
  let __4 () = pp_vhdl_expr_t
1561
  
1562
  and __3 () = pp_vhdl_signal_selection_t
1563
  
1564
  and __2 () = pp_vhdl_expr_t
1565
  
1566
  and __1 () = pp_vhdl_name_t
1567
  
1568
  and __0 () = pp_vhdl_name_t
1569
   in
1570
  ((let open! Ppx_deriving_runtime in
1571
      fun fmt  ->
1572
        fun x  ->
1573
          Format.fprintf fmt "@[<v 2>";
1574
          (match x.label with
1575
            | NoName -> Format.fprintf fmt "";
1576
            | _ -> (((__0 ()) fmt) x.label;
1577
                   Format.fprintf fmt ":@ ")
1578
          );
1579
          Format.fprintf fmt "with ";
1580
          ((__2 ()) fmt) x.sel;
1581
          Format.fprintf fmt " select@;";
1582
          ((__1 ()) fmt) x.lhs;
1583
          Format.fprintf fmt " <= ";
1584
          ((function
1585
            | None  -> Format.pp_print_string fmt ""
1586
            | Some x ->
1587
               ((__4 ()) fmt) x)) x.delay;
1588
          ((fun x  ->
1589
            ignore
1590
              (List.fold_left
1591
                (fun sep  ->
1592
                  fun x  ->
1593
                    if sep then Format.fprintf fmt ",@ ";
1594
                      ((__3 ()) fmt) x;
1595
                      true) false x))) x.branches;
1596
          Format.fprintf fmt ";@]";)
1597
    [@ocaml.warning "-A"])
1598

    
1599
and show_vhdl_selected_signal_t :
1600
  vhdl_selected_signal_t -> Ppx_deriving_runtime.string =
1601
  fun x  -> Format.asprintf "%a" pp_vhdl_selected_signal_t x
1602

    
1603
let rec pp_vhdl_component_instantiation_t :
1604
  Format.formatter ->
1605
    vhdl_component_instantiation_t -> Ppx_deriving_runtime.unit
1606
  =
1607
  let __4 () = pp_vhdl_assoc_element_t
1608
  
1609
  and __3 () = pp_vhdl_assoc_element_t
1610
  
1611
  and __2 () = pp_vhdl_name_t
1612
  
1613
  and __1 () = pp_vhdl_name_t
1614
  
1615
  and __0 () = pp_vhdl_name_t
1616
   in
1617
  ((let open! Ppx_deriving_runtime in
1618
      fun fmt  ->
1619
        fun x  ->
1620
          Format.fprintf fmt "@[<v 2>";
1621
          ((__0 ()) fmt) x.name;
1622
          Format.fprintf fmt " : ";
1623
          Format.fprintf fmt "%s " x.inst_unit_type;
1624
          ((__1 ()) fmt) x.inst_unit;
1625
          ((function
1626
             | None  -> Format.pp_print_string fmt ""
1627
             | Some x ->
1628
                 (Format.fprintf fmt "(";
1629
                 ((__2 ()) fmt) x;
1630
                 Format.fprintf fmt ")@;"))) x.archi_name;
1631
          (match x.generic_map with
1632
          | [] -> Format.fprintf fmt "";
1633
          | _ ->
1634
            (Format.fprintf fmt " generic map (@[<v 2>";
1635
            ((fun x  ->
1636
            ignore
1637
            (List.fold_left
1638
               (fun sep  ->
1639
                 fun x  ->
1640
                   if sep then Format.fprintf fmt ",@,";
1641
                   ((__3 ()) fmt) x;
1642
                   true) false x))) x.generic_map;
1643
            Format.fprintf fmt ")@]@;"));
1644
          (match x.port_map with
1645
          | [] -> Format.fprintf fmt ";";
1646
          | _ ->
1647
            (Format.fprintf fmt " port map (@[<v 2>";
1648
            ((fun x  ->
1649
            ignore
1650
            (List.fold_left
1651
               (fun sep  ->
1652
                 fun x  ->
1653
                   if sep then Format.fprintf fmt ",@,";
1654
                   ((__4 ()) fmt) x;
1655
                   true) false x))) x.port_map;
1656
            Format.fprintf fmt ")@];"));
1657
          Format.fprintf fmt "@]")
1658
    [@ocaml.warning "-A"])
1659

    
1660
and show_vhdl_component_instantiation_t :
1661
  vhdl_component_instantiation_t -> Ppx_deriving_runtime.string =
1662
  fun x  -> Format.asprintf "%a" pp_vhdl_component_instantiation_t x
1663

    
1664
let rec pp_vhdl_concurrent_stmt_t :
1665
  Format.formatter -> vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit =
1666
  let __3 () = pp_vhdl_component_instantiation_t
1667
  
1668
  and __2 () = pp_vhdl_selected_signal_t
1669
  
1670
  and __1 () = pp_vhdl_process_t
1671
  
1672
  and __0 () = pp_vhdl_conditional_signal_t
1673
   in
1674
  ((let open! Ppx_deriving_runtime in
1675
      fun fmt  ->
1676
        function
1677
        | SigAssign a0 ->
1678
             ((__0 ()) fmt) a0;
1679
        | Process a0 ->
1680
             ((__1 ()) fmt) a0;
1681
        | SelectedSig a0 ->
1682
             ((__2 ()) fmt) a0;
1683
        | ComponentInst a0 ->
1684
             ((__3 ()) fmt) a0;
1685
    )
1686
    [@ocaml.warning "-A"])
1687

    
1688
and show_vhdl_concurrent_stmt_t :
1689
  vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.string =
1690
  fun x  -> Format.asprintf "%a" pp_vhdl_concurrent_stmt_t x
1691

    
1692
let rec pp_vhdl_entity_t :
1693
  Format.formatter -> vhdl_entity_t -> Ppx_deriving_runtime.unit =
1694
  let __4 () = pp_vhdl_concurrent_stmt_t
1695
  
1696
  and __3 () = pp_vhdl_declarative_item_t
1697
  
1698
  and __2 () = pp_vhdl_port_t
1699
  
1700
  and __1 () = pp_vhdl_port_t
1701
  
1702
  and __0 () = pp_vhdl_name_t
1703
   in
1704
  ((let open! Ppx_deriving_runtime in
1705
      fun fmt  ->
1706
        fun x  ->
1707
          ((__0 ()) fmt) x.name;
1708
          Format.fprintf fmt " is@;";
1709
          (match x.generics with
1710
          | [] -> Format.fprintf fmt "";
1711
          | _ -> 
1712
              Format.fprintf fmt "generic (@[<v>";
1713
              ((fun x  ->
1714
                ignore
1715
                (List.fold_left
1716
                  (fun sep  ->
1717
                    fun x  ->
1718
                      if sep then Format.fprintf fmt ";@;";
1719
                        ((__1 ()) fmt) x;
1720
                        true) false x))) x.generics;
1721
              Format.fprintf fmt "@]);");
1722
          (match x.ports with
1723
          | [] -> Format.fprintf fmt "";
1724
          | _ -> 
1725
              Format.fprintf fmt "port (@[<v>";
1726
              ((fun x  ->
1727
                 ignore
1728
                   (List.fold_left
1729
                      (fun sep  ->
1730
                         fun x  ->
1731
                           if sep then Format.fprintf fmt ";@;";
1732
                           ((__2 ()) fmt) x;
1733
                           true) false x))) x.ports;
1734
              Format.fprintf fmt "@]);");
1735
          (match x.declaration with
1736
          | [] -> Format.fprintf fmt "";
1737
          | _ ->
1738
              Format.fprintf fmt "@;";
1739
              ((fun x  ->
1740
                ignore
1741
                  (List.fold_left
1742
                     (fun sep  ->
1743
                        fun x  ->
1744
                          if sep then Format.fprintf fmt ";@;";
1745
                          ((__3 ()) fmt) x;
1746
                          true) false x))) x.declaration;
1747
              Format.fprintf fmt ";");
1748
          (match x.stmts with
1749
          | [] -> Format.fprintf fmt "";
1750
          | _ ->
1751
              Format.fprintf fmt "@;@[<v 2>begin@;";
1752
              ((fun x  ->
1753
                ignore
1754
                  (List.fold_left
1755
                    (fun sep  ->
1756
                       fun x  ->
1757
                         if sep then Format.fprintf fmt ";@;";
1758
                         ((__4 ()) fmt) x;
1759
                         true) false x))) x.stmts;
1760
              Format.fprintf fmt ";@]");)
1761
    [@ocaml.warning "-A"])
1762

    
1763
and show_vhdl_entity_t : vhdl_entity_t -> Ppx_deriving_runtime.string =
1764
  fun x  -> Format.asprintf "%a" pp_vhdl_entity_t x
1765

    
1766
let rec pp_vhdl_package_t :
1767
  Format.formatter -> vhdl_package_t -> Ppx_deriving_runtime.unit =
1768
  let __3 () = pp_vhdl_load_t
1769
  
1770
  and __2 () = pp_vhdl_declaration_t
1771
  
1772
  and __1 () = pp_vhdl_definition_t
1773
  
1774
  and __0 () = pp_vhdl_name_t
1775
   in
1776
  ((let open! Ppx_deriving_runtime in
1777
      fun fmt  ->
1778
        fun x  ->
1779
          ((__0 ()) fmt) x.name;
1780
          Format.fprintf fmt " is";
1781
          ((fun x  ->
1782
             ignore
1783
               (List.fold_left
1784
                  (fun sep  ->
1785
                     fun x  ->
1786
                       Format.fprintf fmt "@;";
1787
                       if sep then Format.fprintf fmt "";
1788
                       ((__1 ()) fmt) x;
1789
                       Format.fprintf fmt ";";
1790
                       true) false x))) x.shared_defs;
1791
          ((fun x  ->
1792
               ignore
1793
                 (List.fold_left
1794
                    (fun sep  ->
1795
                       fun x  ->
1796
                         Format.fprintf fmt "@;";
1797
                         if sep then Format.fprintf fmt "";
1798
                         ((__2 ()) fmt) x;
1799
                         Format.fprintf fmt ";";
1800
                         true) false x))) x.shared_decls;
1801
          ((fun x  ->
1802
               ignore
1803
                 (List.fold_left
1804
                    (fun sep  ->
1805
                       fun x  ->
1806
                         Format.fprintf fmt "@;";
1807
                         if sep then Format.fprintf fmt "";
1808
                         ((__3 ()) fmt) x;
1809
                         Format.fprintf fmt ";";
1810
                         true) false x))) x.shared_uses;)
1811
    [@ocaml.warning "-A"])
1812

    
1813
and show_vhdl_package_t : vhdl_package_t -> Ppx_deriving_runtime.string =
1814
  fun x  -> Format.asprintf "%a" pp_vhdl_package_t x
1815

    
1816
let rec pp_vhdl_architecture_t :
1817
  Format.formatter -> vhdl_architecture_t -> Ppx_deriving_runtime.unit =
1818
  let __3 () = pp_vhdl_concurrent_stmt_t
1819
  
1820
  and __2 () = pp_vhdl_declarative_item_t
1821
  
1822
  and __1 () = pp_vhdl_name_t
1823
  
1824
  and __0 () = pp_vhdl_name_t
1825
   in
1826
  ((let open! Ppx_deriving_runtime in
1827
      fun fmt  ->
1828
        fun x  ->
1829
          ((__0 ()) fmt) x.name;
1830
          Format.fprintf fmt " of ";
1831
          ((__1 ()) fmt) x.entity;
1832
          Format.fprintf fmt " is@;";
1833
            ((fun x  ->
1834
             ignore
1835
               (List.fold_left
1836
                  (fun sep  ->
1837
                     fun x  ->
1838
                       if sep then Format.fprintf fmt "@;";
1839
                       ((__2 ()) fmt) x;
1840
                       Format.fprintf fmt ";";
1841
                       true) false x))) x.declarations;
1842
          Format.fprintf fmt "@;";
1843
          Format.fprintf fmt "@[<v 2>begin@;";
1844
          (match x.body with
1845
            | [] -> Format.fprintf fmt "";
1846
            | _ ->
1847
               ((fun x  ->
1848
               ignore
1849
                 (List.fold_left
1850
                    (fun sep  ->
1851
                       fun x  ->
1852
                         if sep then Format.fprintf fmt "@;";
1853
                         ((__3 ()) fmt) x;
1854
                         true) false x))) x.body);
1855
          Format.fprintf fmt "@]@;")
1856
    [@ocaml.warning "-A"])
1857

    
1858
and show_vhdl_architecture_t :
1859
  vhdl_architecture_t -> Ppx_deriving_runtime.string =
1860
  fun x  -> Format.asprintf "%a" pp_vhdl_architecture_t x
1861

    
1862

    
1863
let rec (pp_vhdl_configuration_t :
1864
          Format.formatter ->
1865
            vhdl_configuration_t -> Ppx_deriving_runtime.unit)
1866
  =
1867
  ((let open! Ppx_deriving_runtime in
1868
      fun fmt  -> fun ()  -> Format.pp_print_string fmt "()")
1869
  [@ocaml.warning "-A"])
1870

    
1871
and show_vhdl_configuration_t :
1872
  vhdl_configuration_t -> Ppx_deriving_runtime.string =
1873
  fun x  -> Format.asprintf "%a" pp_vhdl_configuration_t x
1874

    
1875

    
1876
let rec pp_vhdl_library_unit_t :
1877
  Format.formatter -> vhdl_library_unit_t -> Ppx_deriving_runtime.unit =
1878
  let __3 () = pp_vhdl_configuration_t
1879
  
1880
  and __2 () = pp_vhdl_architecture_t
1881
  
1882
  and __1 () = pp_vhdl_entity_t
1883
  
1884
  and __0 () = pp_vhdl_package_t
1885
   in
1886
  ((let open! Ppx_deriving_runtime in
1887
      fun fmt  ->
1888
        function
1889
        | Package a0 ->
1890
            (Format.fprintf fmt "@[<v 2>package ";
1891
             ((__0 ()) fmt) a0;
1892
             Format.fprintf fmt "@.end;@]")
1893
        | Entities a0 ->
1894
            (Format.fprintf fmt "@[<v 2>entity ";
1895
             ((__1 ()) fmt) a0;
1896
             Format.fprintf fmt "@.end;@]")
1897
        | Architecture a0 ->
1898
            (Format.fprintf fmt "@[<v 2>architecture ";
1899
             ((__2 ()) fmt) a0;
1900
             Format.fprintf fmt "@.end;@]")
1901
        | Configuration a0 ->
1902
            (Format.fprintf fmt "@[<v 2>configuration ";
1903
             ((__3 ()) fmt) a0;
1904
             Format.fprintf fmt "@.end;@]"))
1905
    [@ocaml.warning "-A"])
1906

    
1907
and show_vhdl_library_unit_t :
1908
  vhdl_library_unit_t -> Ppx_deriving_runtime.string =
1909
  fun x  -> Format.asprintf "%a" pp_vhdl_library_unit_t x
1910

    
1911
let rec pp_vhdl_design_unit_t :
1912
  Format.formatter -> vhdl_design_unit_t -> Ppx_deriving_runtime.unit =
1913
  let __1 () = pp_vhdl_library_unit_t
1914
  
1915
  and __0 () = pp_vhdl_load_t
1916
   in
1917
  ((let open! Ppx_deriving_runtime in
1918
      fun fmt  ->
1919
        fun x  ->
1920
           (match x.contexts with
1921
           | [] -> Format.fprintf fmt "";
1922
           | _ -> 
1923
            ((fun x  ->
1924
                ignore
1925
                  (List.fold_left
1926
                     (fun sep  ->
1927
                        fun x  ->
1928
                          if sep then Format.fprintf fmt "@.";
1929
                          ((__0 ()) fmt) x;
1930
                          Format.fprintf fmt ";";
1931
                          true) false x);
1932
                )) x.contexts;
1933
           Format.fprintf fmt "@.";);
1934
           ((__1 ()) fmt) x.library;)
1935
    [@ocaml.warning "-A"])
1936

    
1937
and show_vhdl_design_unit_t :
1938
  vhdl_design_unit_t -> Ppx_deriving_runtime.string =
1939
  fun x  -> Format.asprintf "%a" pp_vhdl_design_unit_t x
1940

    
1941
let rec pp_vhdl_design_file_t :
1942
  Format.formatter -> vhdl_design_file_t -> Ppx_deriving_runtime.unit =
1943
  let __0 () = pp_vhdl_design_unit_t  in
1944
  ((let open! Ppx_deriving_runtime in
1945
      fun fmt  ->
1946
        fun x  ->
1947
           ((fun x  ->
1948
               ignore
1949
                 (List.fold_left
1950
                    (fun sep  ->
1951
                       fun x  ->
1952
                         if sep then Format.fprintf fmt "@.";
1953
                         ((__0 ()) fmt) x;
1954
                         true) false x);
1955
             )) x.design_units)
1956
    [@ocaml.warning "-A"])
1957

    
1958
and show_vhdl_design_file_t :
1959
  vhdl_design_file_t -> Ppx_deriving_runtime.string =
1960
  fun x  -> Format.asprintf "%a" pp_vhdl_design_file_t x
1961

    
1962
let rec pp_vhdl_file_t :
1963
  Format.formatter -> vhdl_file_t -> Ppx_deriving_runtime.unit =
1964
  let __0 () = pp_vhdl_design_file_t  in
1965
  ((let open! Ppx_deriving_runtime in
1966
      fun fmt  ->
1967
        fun x  ->
1968
           ((__0 ()) fmt) x.design_file;
1969
   )
1970
    [@ocaml.warning "-A"])
1971

    
1972
and show_vhdl_file_t : vhdl_file_t -> Ppx_deriving_runtime.string =
1973
  fun x  -> Format.asprintf "%a" pp_vhdl_file_t x
1974

    
(8-8/12)