Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / src / backends / VHDL / mini_vhdl_ast_pp.ml @ 990ae4ee

History | View | Annotate | Download (29.9 KB)

1
open Mini_vhdl_ast
2
open Vhdl_ast
3
open Vhdl_ast_pp
4

    
5
let rec pp_mini_vhdl_sequential_stmt_t :
6
  Format.formatter ->
7
    mini_vhdl_sequential_stmt_t -> Ppx_deriving_runtime.unit
8
  =
9
  let __32 () = pp_vhdl_expr_t
10
  
11
  and __31 () = pp_vhdl_name_t
12
  
13
  and __30 () = pp_vhdl_name_t
14
  
15
  and __29 () = pp_vhdl_assoc_element_t
16
  
17
  and __28 () = pp_vhdl_name_t
18
  
19
  and __27 () = pp_vhdl_name_t
20
  
21
  and __26 () = pp_vhdl_expr_t
22
  
23
  and __25 () = pp_vhdl_expr_t
24
  
25
  and __24 () = pp_vhdl_expr_t
26
  
27
  and __23 () = pp_vhdl_name_t
28
  
29
  and __22 () = pp_vhdl_expr_t
30
  
31
  and __21 () = pp_vhdl_name_t
32
  
33
  and __20 () = pp_mini_vhdl_case_item_t
34
  
35
  and __19 () = pp_vhdl_expr_t
36
  
37
  and __18 () = pp_vhdl_name_t
38
  
39
  and __17 () = pp_mini_vhdl_sequential_stmt_t
40
  
41
  and __16 () = pp_mini_vhdl_if_case_t
42
  
43
  and __15 () = pp_vhdl_name_t
44
  
45
  and __14 () = pp_vhdl_expr_t
46
  
47
  and __13 () = pp_vhdl_signal_selection_t
48
  
49
  and __12 () = pp_vhdl_expr_t
50
  
51
  and __11 () = pp_vhdl_name_t
52
  
53
  and __10 () = pp_vhdl_name_t
54
  
55
  and __9 () = pp_vhdl_expr_t
56
  
57
  and __8 () = pp_vhdl_signal_condition_t
58
  
59
  and __7 () = pp_vhdl_name_t
60
  
61
  and __6 () = pp_vhdl_name_t
62
  
63
  and __5 () = pp_vhdl_waveform_element_t
64
  
65
  and __4 () = pp_vhdl_name_t
66
  
67
  and __3 () = pp_vhdl_name_t
68
  
69
  and __2 () = pp_vhdl_expr_t
70
  
71
  and __1 () = pp_vhdl_name_t
72
  
73
  and __0 () = pp_vhdl_name_t
74
   in
75
  ((let open! Ppx_deriving_runtime in
76
      fun fmt  ->
77
        function
78
        | VarAssign { label = alabel; lhs = alhs; rhs = arhs } ->
79
            (match alabel with
80
              | None -> Format.fprintf fmt "";
81
              | Some e -> (((__0 ()) fmt) e;
82
                     Format.fprintf fmt ": ")
83
            );
84
            ((__1 ()) fmt) alhs;
85
            Format.fprintf fmt " := ";
86
            ((__2 ()) fmt) arhs;
87
        | SigSeqAssign { label = alabel; lhs = alhs; rhs = arhs } ->
88
            (match alabel with
89
              | None -> Format.fprintf fmt "";
90
              | Some e -> (((__3 ()) fmt) e;
91
                     Format.fprintf fmt ":@ ")
92
            );
93
            Format.fprintf fmt "@[<2>";
94
            ((__4 ()) fmt) alhs;
95
            Format.fprintf fmt "@ <=@ ";
96
            ((fun x  ->
97
               Format.fprintf fmt "@[";
98
               ignore
99
                 (List.fold_left
100
                   (fun sep  ->
101
                     fun x  ->
102
                       if sep then Format.fprintf fmt ", ";
103
                        ((__5 ()) fmt) x;
104
                        true) false x);
105
            Format.fprintf fmt "@]@]")) arhs;
106
        | SigCondAssign { label = alabel; lhs = alhs; rhs = arhs; delay = adelay } ->
107
            (match alabel with
108
              | None -> Format.fprintf fmt "";
109
              | Some e -> (((__6 ()) fmt) e;
110
                     Format.fprintf fmt ":@ ")
111
            );
112
            Format.fprintf fmt "@[<2>";
113
            ((__7 ()) fmt) alhs;
114
            Format.fprintf fmt "@ <=@ ";
115
            (match adelay with
116
              | None -> Format.fprintf fmt "";
117
              | Some e -> ((__9 ()) fmt) e;
118
                     Format.fprintf fmt " ");
119
            ((fun x  ->
120
               Format.fprintf fmt "@[";
121
               ignore
122
                 (List.fold_left
123
                   (fun sep  ->
124
                     fun x  ->
125
                       if sep then Format.fprintf fmt " else ";
126
                        ((__8 ()) fmt) x;
127
                        true) false x);
128
            Format.fprintf fmt "@]@]")) arhs;
129
        | SigSelectAssign
130
            { label = alabel; lhs = alhs; sel = asel; branches = abranches;
131
              delay = adelay }
132
            ->
133
            (match alabel with
134
              | None -> Format.fprintf fmt "";
135
              | Some e -> (((__10 ()) fmt) e;
136
                     Format.fprintf fmt ":@ ")
137
            );
138
            Format.fprintf fmt "@[<2>";
139
            Format.fprintf fmt "with ";
140
            ((__12 ()) fmt) asel;
141
            Format.fprintf fmt " select@;";
142
            ((__11 ()) fmt) alhs;
143
            Format.fprintf fmt " <= ";
144
            ((function
145
              | None  -> Format.pp_print_string fmt ""
146
              | Some x ->
147
                 ((__14 ()) fmt) x)) adelay;
148
            ((fun x  ->
149
              ignore
150
                (List.fold_left
151
                  (fun sep  ->
152
                    fun x  ->
153
                      if sep then Format.fprintf fmt ",@ ";
154
                        ((__13 ()) fmt) x;
155
                        true) false x))) abranches;
156
            Format.fprintf fmt ";@]"
157
        | If { label = alabel; if_cases = aif_cases; default = adefault } ->
158
            (match alabel with
159
              | None -> Format.fprintf fmt "";
160
              | Some e -> (((__15 ()) fmt) e;
161
                     Format.fprintf fmt ":@ ")
162
            );
163
            Format.fprintf fmt "@[<v>if";
164
            ((fun x ->
165
               ignore
166
               (List.fold_left
167
                 (fun sep  ->
168
                   fun x  ->
169
                           if sep then Format.fprintf fmt "@;elsif";
170
                                ((__16 ()) fmt) x;
171
                                true
172
                 ) false x);
173
             )) aif_cases;
174
             (match adefault with
175
              | [] -> Format.fprintf fmt "";
176
              | _  -> (Format.fprintf fmt "@;else";
177
                      ((fun x  ->
178
                          Format.fprintf fmt "@;<0 2>";
179
                          ignore
180
                            (List.fold_left
181
                              (fun sep  ->
182
                                fun x  ->
183
                                        if sep then Format.fprintf fmt "";
184
                          ((__17 ()) fmt) x;
185
                          Format.fprintf fmt ";";
186
                          true) false x))) adefault));
187
            Format.fprintf fmt "@;end if@]"
188
        | Case { label = alabel; guard = aguard; branches = abranches } ->
189
            (match alabel with
190
              | None -> Format.fprintf fmt "";
191
              | Some e -> (((__18 ()) fmt) e;
192
                     Format.fprintf fmt ":@ ")
193
            );
194
            Format.fprintf fmt "@[<v>case ";
195
            ((__19 ()) fmt) aguard;
196
            Format.fprintf fmt " is";
197
            ((fun x  ->
198
                ignore
199
                  (List.fold_left
200
                     (fun sep  ->
201
                        fun x  ->
202
                          if sep then Format.fprintf fmt "";
203
                          ((__20 ()) fmt) x;
204
                          true) false x);)) abranches;
205
            Format.fprintf fmt "@;end case@]";
206
        | Exit
207
            { label = alabel; loop_label = aloop_label;
208
              condition = acondition }
209
            ->
210
            (match alabel with
211
              | None -> Format.fprintf fmt "";
212
              | Some e -> (((__21 ()) fmt) e;
213
                     Format.fprintf fmt ":@ ")
214
            );
215
            Format.fprintf fmt "exit";
216
            (match aloop_label with
217
               | None  -> Format.pp_print_string fmt ""
218
               | Some x -> (Format.fprintf fmt "@ %s@ ") x);
219
            ((function
220
               | None  -> Format.pp_print_string fmt ""
221
               | Some x ->
222
                   (Format.pp_print_string fmt "when@ ";
223
                    ((__22 ()) fmt) x;))) acondition;
224
        | Assert
225
            { label = alabel; cond = acond; report = areport;
226
              severity = aseverity }
227
            ->
228
            Format.fprintf fmt "@[<v 2>";
229
            (match alabel with
230
              | None -> Format.fprintf fmt "";
231
              | Some e -> (((__23 ()) fmt) e;
232
                     Format.fprintf fmt ":@ ")
233
            );
234
            Format.fprintf fmt "assert ";
235
            ((__24 ()) fmt) acond;
236
            (match areport with
237
            | IsNull -> Format.fprintf fmt "";
238
            | _ -> 
239
                Format.fprintf fmt "@;report ";
240
                ((__25 ()) fmt) areport);
241
            (match aseverity with
242
            | IsNull -> Format.fprintf fmt "";
243
            | _ -> 
244
                Format.fprintf fmt "@;severity ";
245
                ((__26 ()) fmt) aseverity);
246
            Format.fprintf fmt "@]";
247
        | ProcedureCall { label = alabel; name = aname; assocs = aassocs } ->
248
            (match alabel with
249
              | None -> Format.fprintf fmt "";
250
              | Some e -> (((__27 ()) fmt) e;
251
                     Format.fprintf fmt ":@ ")
252
            );
253
            ((__28 ()) fmt) aname;
254
            (match aassocs with
255
            | [] -> Format.fprintf fmt "";
256
            | _ ->
257
               Format.fprintf fmt "(@[<v>";
258
               ((fun x  ->
259
                ignore
260
                  (List.fold_left
261
                     (fun sep  ->
262
                        fun x  ->
263
                          if sep then Format.fprintf fmt ",@ ";
264
                          ((__29 ()) fmt) x;
265
                          true) false x))) aassocs;
266
               Format.fprintf fmt "@])");
267
        | Wait  -> Format.pp_print_string fmt "wait"
268
        | Null { label = alabel } ->
269
            (match alabel with
270
              | None -> Format.fprintf fmt "";
271
              | Some e -> (((__27 ()) fmt) e;
272
                     Format.fprintf fmt ":@ ")
273
            );
274
            Format.fprintf fmt "null";
275
        | Return { label = alabel; expr = aexpr } ->
276
            (match alabel with
277
              | None -> ();
278
              | Some a -> (((__28 ()) fmt) a;
279
                     Format.fprintf fmt ":@ ")
280
            );
281
            Format.fprintf fmt "return";
282
            (match aexpr with
283
                | None  -> ()
284
                | Some a ->
285
                     ((__32 ()) fmt) a);)
286
    [@ocaml.warning "-A"])
287

    
288
and show_mini_vhdl_sequential_stmt_t :
289
  mini_vhdl_sequential_stmt_t -> Ppx_deriving_runtime.string =
290
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_sequential_stmt_t x
291

    
292
and pp_mini_vhdl_if_case_t :
293
  Format.formatter -> mini_vhdl_if_case_t -> Ppx_deriving_runtime.unit =
294
  let __1 () = pp_mini_vhdl_sequential_stmt_t
295
  
296
  and __0 () = pp_vhdl_expr_t
297
   in
298
  ((let open! Ppx_deriving_runtime in
299
      fun fmt  ->
300
        fun x  ->
301
          Format.fprintf fmt " (";
302
          ((__0 ()) fmt) x.if_cond;
303
          Format.fprintf fmt ") then@;<0 2>";
304
          ((fun x  ->
305
             ignore
306
               (List.fold_left
307
                  (fun sep  ->
308
                     fun x  ->
309
                             if sep then Format.fprintf fmt "@;<0 2>";
310
                       ((__1 ()) fmt) x;
311
                       Format.fprintf fmt ";";
312
                       true) false x);
313
          )) x.if_block;)
314
    [@ocaml.warning "-A"])
315

    
316
and show_mini_vhdl_if_case_t :
317
  mini_vhdl_if_case_t -> Ppx_deriving_runtime.string =
318
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_if_case_t x
319

    
320
and pp_mini_vhdl_case_item_t :
321
  Format.formatter -> mini_vhdl_case_item_t -> Ppx_deriving_runtime.unit =
322
  let __1 () = pp_mini_vhdl_sequential_stmt_t
323
  
324
  and __0 () = pp_vhdl_expr_t
325
   in
326
  ((let open! Ppx_deriving_runtime in
327
      fun fmt  ->
328
        fun x  ->
329
                Format.fprintf fmt "@;@[<v 2>when ";
330
            ((fun x  ->
331
                ignore
332
                  (List.fold_left
333
                     (fun sep  ->
334
                        fun x  ->
335
                          if sep then Format.fprintf fmt "@ |@ ";
336
                          ((__0 ()) fmt) x;
337
                          true) false x);)) x.when_cond;
338
           Format.fprintf fmt " => ";
339
           (fun x  ->
340
               ignore
341
                 (List.fold_left
342
                    (fun sep  ->
343
                       fun x  ->
344
                         if sep then Format.fprintf fmt "@;";
345
                         ((__1 ()) fmt) x;
346
                         Format.fprintf fmt ";";
347
                         true) ((List.length x) > 1) x);) x.when_stmt;
348
           Format.fprintf fmt "@]")
349
    [@ocaml.warning "-A"])
350

    
351
and show_mini_vhdl_case_item_t :
352
  mini_vhdl_case_item_t -> Ppx_deriving_runtime.string =
353
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_case_item_t x
354

    
355
let rec pp_mini_vhdl_declaration_t :
356
  Format.formatter -> mini_vhdl_declaration_t -> Ppx_deriving_runtime.unit =
357
  let __14 () = pp_mini_vhdl_sequential_stmt_t
358
  
359
  and __13 () = pp_mini_vhdl_declaration_t
360
  
361
  and __12 () = pp_vhdl_subprogram_spec_t
362
  
363
  and __11 () = pp_vhdl_port_t
364
  
365
  and __10 () = pp_vhdl_port_t
366
  
367
  and __9 () = pp_vhdl_name_t
368
  
369
  and __8 () = pp_vhdl_expr_t
370
  
371
  and __7 () = pp_vhdl_subtype_indication_t
372
  
373
  and __6 () = pp_vhdl_name_t
374
  
375
  and __5 () = pp_vhdl_expr_t
376
  
377
  and __4 () = pp_vhdl_subtype_indication_t
378
  
379
  and __3 () = pp_vhdl_name_t
380
  
381
  and __2 () = pp_vhdl_expr_t
382
  
383
  and __1 () = pp_vhdl_subtype_indication_t
384
  
385
  and __0 () = pp_vhdl_name_t
386
   in
387
  ((let open! Ppx_deriving_runtime in
388
      fun fmt  ->
389
        function
390
        | VarDecl { names = anames; typ = atyp; init_val = ainit_val } ->
391
            (Format.fprintf fmt "variable ";
392
             ((((fun x  ->
393
                    ignore
394
                      (List.fold_left
395
                         (fun sep  ->
396
                            fun x  ->
397
                              if sep then Format.fprintf fmt ",";
398
                              ((__0 ()) fmt) x;
399
                              true) false x);)) anames;
400
               Format.fprintf fmt " : ";
401
               ((__1 ()) fmt) atyp;
402
               (match ainit_val with
403
                | IsNull  -> Format.pp_print_string fmt ""
404
                | _ ->
405
                    (Format.fprintf fmt ":=";
406
                     ((__2 ()) fmt) ainit_val;))));)
407
        | CstDecl { names = anames; typ = atyp; init_val = ainit_val } ->
408
            (Format.fprintf fmt "constant ";
409
             ((((fun x  ->
410
                    ignore
411
                      (List.fold_left
412
                         (fun sep  ->
413
                            fun x  ->
414
                              if sep then Format.fprintf fmt ",";
415
                              ((__3 ()) fmt) x;
416
                              true) false x);)) anames;
417
              Format.fprintf fmt " : ";
418
              ((__4 ()) fmt) atyp;
419
              Format.fprintf fmt " := ";
420
              ((__5 ()) fmt) ainit_val)))
421
        | SigDecl { names = anames; typ = atyp; init_val = ainit_val } ->
422
            (Format.fprintf fmt "signal ";
423
            ((fun x  ->
424
              ignore
425
              (List.fold_left
426
                (fun sep  ->
427
                  fun x  ->
428
                    if sep then Format.fprintf fmt ",";
429
                                ((__6 ()) fmt) x;
430
                                true) false x);
431
              )) anames;
432
            Format.fprintf fmt " : ";
433
            ((__7 ()) fmt) atyp;
434
            (match ainit_val with
435
              | IsNull  -> Format.pp_print_string fmt ""
436
              | _ ->
437
                  (Format.fprintf fmt ":=";
438
                  ((__8 ()) fmt) ainit_val;)))
439
        | ComponentDecl
440
            { name = aname; generics = agenerics; ports = aports } ->
441
            Format.fprintf fmt "@[<v 2>component ";
442
            ((__9 ()) fmt) aname;
443
            Format.fprintf fmt " is@;";
444
            (match agenerics with
445
            | [] -> ()
446
            | _ ->
447
                Format.fprintf fmt "generic (@[<v>";
448
                ((fun x  ->
449
                  ignore
450
                    (List.fold_left
451
                      (fun sep  ->
452
                        fun x  ->
453
                          if sep then Format.fprintf fmt ";@;";
454
                            ((__10 ()) fmt) x;
455
                            true) false x))) agenerics;
456
                Format.fprintf fmt "@]);");
457
            (match aports with
458
            | [] -> ()
459
            | _ ->
460
                Format.fprintf fmt "port (@[<v>";
461
                ((fun x  ->
462
                  ignore
463
                    (List.fold_left
464
                      (fun sep  ->
465
                        fun x  ->
466
                          if sep then Format.fprintf fmt ";@;";
467
                            ((__11 ()) fmt) x;
468
                            true) false x))) aports;
469
                Format.fprintf fmt "@]);");
470
            Format.fprintf fmt "@]@;end component";
471
        | Subprogram
472
            { spec = aspec; decl_part = adecl_part; stmts = astmts }
473
            ->
474
              Format.fprintf fmt "@[<v 2>";
475
              ((__12 ()) fmt) aspec;
476
              Format.fprintf fmt " is";
477
              (match adecl_part with
478
              | [] -> Format.fprintf fmt "";
479
              | _ ->
480
                ((fun x  ->
481
                  ignore
482
                    (List.fold_left
483
                      (fun sep  ->
484
                         fun x  ->
485
                           if sep then Format.fprintf fmt "";
486
                             Format.fprintf fmt "@;";
487
                             ((__13 ()) fmt) x;
488
                             Format.fprintf fmt ";";
489
                             true) false x))) adecl_part);
490
              Format.fprintf fmt "@]@;";
491
              Format.fprintf fmt "@[<v 2>begin@;";
492
              ((fun x  ->
493
                  ignore
494
                    (List.fold_left
495
                       (fun sep  ->
496
                          fun x  ->
497
                            if sep then Format.fprintf fmt "@;";
498
                            ((__14 ()) fmt) x;
499
                            Format.fprintf fmt ";";
500
                            true) false x))) astmts;
501
              Format.fprintf fmt "@]@;end";)
502
    [@ocaml.warning "-A"])
503

    
504
and show_mini_vhdl_declaration_t :
505
  mini_vhdl_declaration_t -> Ppx_deriving_runtime.string =
506
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_declaration_t x
507

    
508
let rec pp_mini_vhdl_declarative_item_t :
509
  Format.formatter ->
510
    mini_vhdl_declarative_item_t -> Ppx_deriving_runtime.unit
511
  =
512
  let __2 () = pp_vhdl_definition_t
513
  
514
  and __1 () = pp_mini_vhdl_declaration_t
515
  
516
  and __0 () = pp_vhdl_load_t
517
   in
518
  ((let open! Ppx_deriving_runtime in
519
      fun fmt  ->
520
        fun x  ->
521
          (match x.use_clause with
522
          | None -> Format.fprintf fmt "";
523
          | Some e -> ((__0 ()) fmt) e);
524
          (match x.declaration with
525
          | None -> Format.fprintf fmt "";
526
          | Some e -> ((__1 ()) fmt) e);
527
          (match x.definition with
528
          | None -> Format.fprintf fmt "";
529
          | Some e -> ((__2 ()) fmt) e);)
530
    [@ocaml.warning "-A"])
531

    
532
and show_mini_vhdl_declarative_item_t :
533
  mini_vhdl_declarative_item_t -> Ppx_deriving_runtime.string =
534
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_declarative_item_t x
535

    
536
let rec pp_mini_vhdl_component_instantiation_t :
537
  Format.formatter ->
538
    mini_vhdl_component_instantiation_t -> Ppx_deriving_runtime.unit
539
  =
540
  let __4 () = pp_vhdl_assoc_element_t
541
  
542
  and __3 () = pp_vhdl_assoc_element_t
543
  
544
  and __2 () = pp_vhdl_entity_t
545
  
546
  and __1 () = pp_vhdl_architecture_t
547
  
548
  and __0 () = pp_vhdl_name_t
549
   in
550
  ((let open! Ppx_deriving_runtime in
551
      fun fmt  ->
552
        fun x  ->
553
          Format.fprintf fmt "@[<v 2>";
554
          ((__0 ()) fmt) x.name;
555
          Format.fprintf fmt "__";
556
          ((__0 ()) fmt) x.archi.name;
557
          Format.fprintf fmt "__";
558
          ((__0 ()) fmt) x.entity.name;
559
          (match x.generic_map with
560
          | [] -> Format.fprintf fmt "";
561
          | _ ->
562
            (Format.fprintf fmt " generic map (@[<v 2>";
563
            ((fun x  ->
564
            ignore
565
            (List.fold_left
566
               (fun sep  ->
567
                 fun x  ->
568
                   if sep then Format.fprintf fmt ",@,";
569
                   ((__3 ()) fmt) x;
570
                   true) false x))) x.generic_map;
571
            Format.fprintf fmt ")@]@;"));
572
          (match x.port_map with
573
          | [] -> Format.fprintf fmt ";";
574
          | _ ->
575
            (Format.fprintf fmt " port map (@[<v 2>";
576
            ((fun x  ->
577
            ignore
578
            (List.fold_left
579
               (fun sep  ->
580
                 fun x  ->
581
                   if sep then Format.fprintf fmt ",@,";
582
                   ((__4 ()) fmt) x;
583
                   true) false x))) x.port_map;
584
            Format.fprintf fmt ")@];"));
585
          Format.fprintf fmt "@]")
586
    [@ocaml.warning "-A"])
587

    
588
and show_mini_vhdl_component_instantiation_t :
589
  mini_vhdl_component_instantiation_t -> Ppx_deriving_runtime.string =
590
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_component_instantiation_t x
591

    
592
let rec pp_mini_vhdl_process_t :
593
  Format.formatter -> mini_vhdl_process_t -> Ppx_deriving_runtime.unit =
594
  let __3 () = pp_mini_vhdl_sequential_stmt_t
595
  
596
  and __2 () = pp_vhdl_name_t
597
  
598
  and __1 () = pp_mini_vhdl_declarative_item_t
599
  
600
  and __0 () = pp_vhdl_name_t
601
   in
602
  ((let open! Ppx_deriving_runtime in
603
      fun fmt  ->
604
        fun x  ->
605
          Format.fprintf fmt "@[<v 2>";
606
          (match x.id with
607
          | NoName -> Format.fprintf fmt "";
608
          | _ -> 
609
              ((__0 ()) fmt) x.id;
610
              Format.fprintf fmt ": ");
611
          Format.fprintf fmt "process ";
612
          (match x.active_sigs with
613
          | [] -> Format.fprintf fmt "";
614
          | _ -> Format.fprintf fmt "(";
615
                 ((fun x  ->
616
                    ignore
617
                      (List.fold_left
618
                         (fun sep  ->
619
                            fun x  ->
620
                              if sep then Format.fprintf fmt ",";
621
                              ((__2 ()) fmt) x;
622
                              true) false x))) x.active_sigs;
623
                 Format.fprintf fmt ")");
624
          Format.fprintf fmt " is";
625
          (match x.declarations with
626
          | [] -> Format.fprintf fmt "";
627
          | _ -> 
628
              (Format.fprintf fmt "@;";
629
              ((fun x  ->
630
                ignore
631
                (List.fold_left
632
                  (fun sep  ->
633
                    fun x  ->
634
                      if sep then Format.fprintf fmt "@;";
635
                        ((__1 ()) fmt) x;
636
                        Format.fprintf fmt ";";
637
                        true) false x))) x.declarations));
638
          Format.fprintf fmt "@]@;@[<v 2>begin@;";
639
          ((fun x  ->
640
               ignore
641
                 (List.fold_left
642
                    (fun sep  ->
643
                       fun x  ->
644
                         if sep then Format.fprintf fmt "@;";
645
                         ((__3 ()) fmt) x;
646
                         Format.fprintf fmt ";";
647
                         true) false x);)) x.body;
648
          Format.fprintf fmt "@]@;end process;@;")
649
    [@ocaml.warning "-A"])
650

    
651
and show_mini_vhdl_process_t :
652
  mini_vhdl_process_t -> Ppx_deriving_runtime.string =
653
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_process_t x
654

    
655
let rec pp_mini_vhdl_concurrent_stmt_t :
656
  Format.formatter ->
657
    mini_vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit
658
  =
659
  let __1 () = pp_mini_vhdl_component_instantiation_t
660
  
661
  and __0 () = pp_mini_vhdl_process_t
662
   in
663
  ((let open! Ppx_deriving_runtime in
664
      fun fmt  ->
665
        function
666
        | Process a0 ->
667
             ((__0 ()) fmt) a0;
668
        | ComponentInst a0 ->
669
             ((__1 ()) fmt) a0;
670
    )
671
    [@ocaml.warning "-A"])
672

    
673
and show_mini_vhdl_concurrent_stmt_t :
674
  mini_vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.string =
675
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_concurrent_stmt_t x
676

    
677
let rec pp_mini_vhdl_package_t :
678
  Format.formatter -> mini_vhdl_package_t -> Ppx_deriving_runtime.unit =
679
  let __3 () = pp_vhdl_load_t
680
  
681
  and __2 () = pp_mini_vhdl_declaration_t
682
  
683
  and __1 () = pp_vhdl_definition_t
684
  
685
  and __0 () = pp_vhdl_name_t
686
   in
687
  ((let open! Ppx_deriving_runtime in
688
      fun fmt  ->
689
        fun x  ->
690
          Format.fprintf fmt "@[<2>{ ";
691
          ((((Format.fprintf fmt "@[%s =@ " "name";
692
              ((__0 ()) fmt) x.name;
693
              Format.fprintf fmt "@]");
694
             Format.fprintf fmt ";@ ";
695
             Format.fprintf fmt "@[%s =@ " "shared_defs";
696
             ((fun x  ->
697
                 Format.fprintf fmt "@[<2>[";
698
                 ignore
699
                   (List.fold_left
700
                      (fun sep  ->
701
                         fun x  ->
702
                           if sep then Format.fprintf fmt ";@ ";
703
                           ((__1 ()) fmt) x;
704
                           true) false x);
705
                 Format.fprintf fmt "@,]@]")) x.shared_defs;
706
             Format.fprintf fmt "@]");
707
            Format.fprintf fmt ";@ ";
708
            Format.fprintf fmt "@[%s =@ " "shared_decls";
709
            ((fun x  ->
710
                Format.fprintf fmt "@[<2>[";
711
                ignore
712
                  (List.fold_left
713
                     (fun sep  ->
714
                        fun x  ->
715
                          if sep then Format.fprintf fmt ";@ ";
716
                          ((__2 ()) fmt) x;
717
                          true) false x);
718
                Format.fprintf fmt "@,]@]")) x.shared_decls;
719
            Format.fprintf fmt "@]");
720
           Format.fprintf fmt ";@ ";
721
           Format.fprintf fmt "@[%s =@ " "shared_uses";
722
           ((fun x  ->
723
               Format.fprintf fmt "@[<2>[";
724
               ignore
725
                 (List.fold_left
726
                    (fun sep  ->
727
                       fun x  ->
728
                         if sep then Format.fprintf fmt ";@ ";
729
                         ((__3 ()) fmt) x;
730
                         true) false x);
731
               Format.fprintf fmt "@,]@]")) x.shared_uses;
732
           Format.fprintf fmt "@]");
733
          Format.fprintf fmt "@ }@]")
734
    [@ocaml.warning "-A"])
735

    
736
and show_mini_vhdl_package_t :
737
  mini_vhdl_package_t -> Ppx_deriving_runtime.string =
738
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_package_t x
739

    
740
let rec pp_mini_vhdl_component_t :
741
  Format.formatter -> mini_vhdl_component_t -> Ppx_deriving_runtime.unit =
742
  let __6 () = pp_mini_vhdl_concurrent_stmt_t
743
  
744
  and __5 () = pp_vhdl_definition_t
745
  
746
  and __4 () = pp_mini_vhdl_declaration_t
747
  
748
  and __3 () = pp_vhdl_load_t
749
  
750
  and __2 () = pp_vhdl_port_t
751
  
752
  and __1 () = pp_vhdl_port_t
753
  
754
  and __0 () = pp_vhdl_name_t
755
   in
756
  ((let open! Ppx_deriving_runtime in
757
      fun fmt  ->
758
        fun x  ->
759
          Format.fprintf fmt "@[<v 2>component ";
760
          (match x.names with
761
          | [] -> ()
762
          | _ ->
763
            ((fun x  ->
764
              ignore
765
              (List.fold_left
766
                (fun sep  ->
767
                  fun x  ->
768
                    if sep then Format.fprintf fmt "__";
769
                      ((__0 ()) fmt) x;
770
                      true) false x))) x.names);
771
          Format.fprintf fmt " is";
772
          (match x.generics with
773
          | [] -> ()
774
          | _ ->
775
              Format.fprintf fmt "@;generics (@[";
776
                ((fun x  ->
777
                    ignore
778
                      (List.fold_left
779
                         (fun sep  ->
780
                            fun x  ->
781
                              if sep then Format.fprintf fmt ",@ ";
782
                              ((__1 ()) fmt) x;
783
                              true) false x))) x.generics;
784
              Format.fprintf fmt "@]);");
785
          (match x.ports with
786
          | [] -> ()
787
          | _ ->
788
              Format.fprintf fmt "@;ports (@[";
789
               ((fun x  ->
790
                   ignore
791
                     (List.fold_left
792
                        (fun sep  ->
793
                           fun x  ->
794
                             if sep then Format.fprintf fmt ",@ ";
795
                             ((__2 ()) fmt) x;
796
                             true) false x))) x.ports;
797
               Format.fprintf fmt "@]);");
798
          (match x.contexts with
799
          | [] -> ()
800
          | _ ->
801
            Format.fprintf fmt "@;";
802
            ((fun x  ->
803
            ignore
804
              (List.fold_left
805
                (fun sep  ->
806
                  fun x  ->
807
                    if sep then Format.fprintf fmt ";@;";
808
                      ((__3 ()) fmt) x;
809
                      true) false x))) x.contexts);
810
          (match x.declarations with
811
          | [] -> ()
812
          | _ ->
813
            Format.fprintf fmt "@;";
814
            ((fun x  ->
815
            ignore
816
              (List.fold_left
817
                (fun sep  ->
818
                  fun x  ->
819
                    if sep then Format.fprintf fmt "@;";
820
                      ((__4 ()) fmt) x;
821
                      Format.fprintf fmt ";";
822
                      true) false x))) x.declarations);
823
          (match x.definitions with
824
          | [] -> ()
825
          | _ ->
826
            Format.fprintf fmt "@;";
827
            ((fun x  ->
828
            ignore
829
              (List.fold_left
830
                (fun sep  ->
831
                  fun x  ->
832
                    if sep then Format.fprintf fmt "@;";
833
                      ((__5 ()) fmt) x;
834
                      Format.fprintf fmt ";";
835
                      true) false x))) x.definitions);
836
          Format.fprintf fmt "@]@;@[<v 2>begin";
837
          (match x.body with
838
          | [] -> ()
839
          | _ ->
840
            Format.fprintf fmt "@;";
841
            ((fun x  ->
842
            ignore
843
              (List.fold_left
844
                (fun sep  ->
845
                  fun x  ->
846
                    if sep then Format.fprintf fmt "@;";
847
                      ((__6 ()) fmt) x;
848
                         true) false x))) x.body);
849
           Format.fprintf fmt "@]@;end;")
850
    [@ocaml.warning "-A"])
851

    
852
and show_mini_vhdl_component_t :
853
  mini_vhdl_component_t -> Ppx_deriving_runtime.string =
854
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_component_t x
855

    
856
let rec pp_mini_vhdl_design_file_t :
857
  Format.formatter -> mini_vhdl_design_file_t -> Ppx_deriving_runtime.unit =
858
  let __1 () = pp_mini_vhdl_package_t
859
  
860
  and __0 () = pp_mini_vhdl_component_t
861
   in
862
  ((let open! Ppx_deriving_runtime in
863
      fun fmt  ->
864
        fun x  ->
865
          Format.fprintf fmt "@[<v>";
866
           ((fun x  ->
867
               ignore
868
                 (List.fold_left
869
                    (fun sep  ->
870
                       fun x  ->
871
                         if sep then Format.fprintf fmt "@;";
872
                         Format.fprintf fmt "package ";
873
                         ((__1 ()) fmt) x;
874
                         true) false x))) x.packages;
875
            (match x.components with
876
            | [] -> ()
877
            | _ ->
878
                Format.fprintf fmt "@;";
879
                ((fun x  ->
880
                ignore
881
                  (List.fold_left
882
                     (fun sep  ->
883
                        fun x  ->
884
                          if sep then Format.fprintf fmt "@;";
885
                          ((__0 ()) fmt) x;
886
                          true) false x))) x.components);
887
           Format.fprintf fmt "@]")
888
    [@ocaml.warning "-A"])
889

    
890
and show_mini_vhdl_design_file_t :
891
  mini_vhdl_design_file_t -> Ppx_deriving_runtime.string =
892
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_design_file_t x