Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / src / backends / VHDL / mini_vhdl_ast_pp.ml @ 6cfa0edc

History | View | Annotate | Download (30 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
        | MiniVarAssign { label = alabel; lhs = alhs; rhs = arhs } ->
79
            (match alabel with
80
              | None -> ();
81
              | Some e -> (((__0 ()) fmt) e;
82
                     Format.fprintf fmt ": ")
83
            );
84
            ((__1 ()) fmt) alhs;
85
            Format.fprintf fmt " := ";
86
            ((__2 ()) fmt) arhs;
87
        | MiniSigSeqAssign { label = alabel; lhs = alhs; rhs = arhs } ->
88
            (match alabel with
89
              | None -> ();
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
        | MiniSigCondAssign { label = alabel; lhs = alhs; rhs = arhs; delay = adelay } ->
107
            (match alabel with
108
              | None -> ();
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 -> ();
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
        | MiniSigSelectAssign
130
            { label = alabel; lhs = alhs; sel = asel; branches = abranches;
131
              delay = adelay }
132
            ->
133
            (match alabel with
134
              | None -> ();
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
        | MiniIf { label = alabel; if_cases = aif_cases; default = adefault } ->
158
            (match alabel with
159
              | None -> ();
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
        | MiniCase { label = alabel; guard = aguard; branches = abranches } ->
189
            (match alabel with
190
              | None -> ();
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
        | MiniExit
207
            { label = alabel; loop_label = aloop_label;
208
              condition = acondition }
209
            ->
210
            (match alabel with
211
              | None -> ();
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
        | MiniAssert
225
            { label = alabel; cond = acond; report = areport;
226
              severity = aseverity }
227
            ->
228
            Format.fprintf fmt "@[<v 2>";
229
            (match alabel with
230
              | None -> ();
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
        | MiniProcedureCall { label = alabel; name = aname; assocs = aassocs } ->
248
            (match alabel with
249
              | None -> ();
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
        | MiniWait { sensitivity = sensit_list } -> 
268
            Format.pp_print_string fmt "wait";
269
            (match sensit_list with
270
            | [] -> ();
271
            | _ ->
272
               Format.fprintf fmt " on (@[<v>";
273
               ((fun x  ->
274
                ignore
275
                  (List.fold_left
276
                     (fun sep  ->
277
                        fun x  ->
278
                          if sep then Format.fprintf fmt ",@ ";
279
                          ((__28 ()) fmt) x;
280
                          true) false x))) sensit_list;
281
               Format.fprintf fmt "@])");
282
        | MiniNull { label = alabel } ->
283
            (match alabel with
284
              | None -> ();
285
              | Some e -> (((__27 ()) fmt) e;
286
                     Format.fprintf fmt ":@ ")
287
            );
288
            Format.fprintf fmt "null";
289
        | MiniReturn { label = alabel; expr = aexpr } ->
290
            (match alabel with
291
              | None -> ();
292
              | Some a -> (((__28 ()) fmt) a;
293
                     Format.fprintf fmt ":@ ")
294
            );
295
            Format.fprintf fmt "return";
296
            (match aexpr with
297
                | None  -> ()
298
                | Some a ->
299
                     ((__32 ()) fmt) a);)
300
    [@ocaml.warning "-A"])
301

    
302
and show_mini_vhdl_sequential_stmt_t :
303
  mini_vhdl_sequential_stmt_t -> Ppx_deriving_runtime.string =
304
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_sequential_stmt_t x
305

    
306
and pp_mini_vhdl_if_case_t :
307
  Format.formatter -> mini_vhdl_if_case_t -> Ppx_deriving_runtime.unit =
308
  let __1 () = pp_mini_vhdl_sequential_stmt_t
309
  
310
  and __0 () = pp_vhdl_expr_t
311
   in
312
  ((let open! Ppx_deriving_runtime in
313
      fun fmt  ->
314
        fun x  ->
315
          Format.fprintf fmt " (";
316
          ((__0 ()) fmt) x.if_cond;
317
          Format.fprintf fmt ") then@;<0 2>";
318
          ((fun x  ->
319
             ignore
320
               (List.fold_left
321
                  (fun sep  ->
322
                     fun x  ->
323
                             if sep then Format.fprintf fmt "@;<0 2>";
324
                       ((__1 ()) fmt) x;
325
                       Format.fprintf fmt ";";
326
                       true) false x);
327
          )) x.if_block_mini;)
328
    [@ocaml.warning "-A"])
329

    
330
and show_mini_vhdl_if_case_t :
331
  mini_vhdl_if_case_t -> Ppx_deriving_runtime.string =
332
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_if_case_t x
333

    
334
and pp_mini_vhdl_case_item_t :
335
  Format.formatter -> mini_vhdl_case_item_t -> Ppx_deriving_runtime.unit =
336
  let __1 () = pp_mini_vhdl_sequential_stmt_t
337
  
338
  and __0 () = pp_vhdl_expr_t
339
   in
340
  ((let open! Ppx_deriving_runtime in
341
      fun fmt  ->
342
        fun x  ->
343
                Format.fprintf fmt "@;@[<v 2>when ";
344
            ((fun x  ->
345
                ignore
346
                  (List.fold_left
347
                     (fun sep  ->
348
                        fun x  ->
349
                          if sep then Format.fprintf fmt "@ |@ ";
350
                          ((__0 ()) fmt) x;
351
                          true) false x);)) x.when_cond;
352
           Format.fprintf fmt " => ";
353
           (fun x  ->
354
               ignore
355
                 (List.fold_left
356
                    (fun sep  ->
357
                       fun x  ->
358
                         if sep then Format.fprintf fmt "@;";
359
                         ((__1 ()) fmt) x;
360
                         Format.fprintf fmt ";";
361
                         true) ((List.length x) > 1) x);) x.when_stmt_mini;
362
           Format.fprintf fmt "@]")
363
    [@ocaml.warning "-A"])
364

    
365
and show_mini_vhdl_case_item_t :
366
  mini_vhdl_case_item_t -> Ppx_deriving_runtime.string =
367
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_case_item_t x
368

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

    
518
and show_mini_vhdl_declaration_t :
519
  mini_vhdl_declaration_t -> Ppx_deriving_runtime.string =
520
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_declaration_t x
521

    
522
let rec pp_mini_vhdl_declarative_item_t :
523
  Format.formatter ->
524
    mini_vhdl_declarative_item_t -> Ppx_deriving_runtime.unit
525
  =
526
  let __2 () = pp_vhdl_definition_t
527
  
528
  and __1 () = pp_mini_vhdl_declaration_t
529
  
530
  and __0 () = pp_vhdl_load_t
531
   in
532
  ((let open! Ppx_deriving_runtime in
533
      fun fmt  ->
534
        fun x  ->
535
          (match x.use_clause with
536
          | None -> ();
537
          | Some e -> ((__0 ()) fmt) e);
538
          (match x.declaration with
539
          | None -> ();
540
          | Some e -> ((__1 ()) fmt) e);
541
          (match x.definition with
542
          | None -> ();
543
          | Some e -> ((__2 ()) fmt) e);)
544
    [@ocaml.warning "-A"])
545

    
546
and show_mini_vhdl_declarative_item_t :
547
  mini_vhdl_declarative_item_t -> Ppx_deriving_runtime.string =
548
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_declarative_item_t x
549

    
550
let rec pp_mini_vhdl_component_instantiation_t :
551
  Format.formatter ->
552
    mini_vhdl_component_instantiation_t -> Ppx_deriving_runtime.unit
553
  =
554
  let __4 () = pp_vhdl_assoc_element_t
555
  
556
  and __3 () = pp_vhdl_assoc_element_t
557
  
558
  and __2 () = pp_vhdl_entity_t
559
  
560
  and __1 () = pp_vhdl_architecture_t
561
  
562
  and __0 () = pp_vhdl_name_t
563
   in
564
  ((let open! Ppx_deriving_runtime in
565
      fun fmt  ->
566
        fun x  ->
567
          Format.fprintf fmt "@[<v 2>";
568
          ((__0 ()) fmt) x.ci_name;
569
          Format.fprintf fmt "__";
570
          ((__0 ()) fmt) x.archi.a_name;
571
          Format.fprintf fmt "__";
572
          ((__0 ()) fmt) x.entity.e_name;
573
          (match x.generic_map with
574
          | [] -> Format.fprintf fmt "";
575
          | _ ->
576
            (Format.fprintf fmt " generic map (@[";
577
            ((fun x  ->
578
            ignore
579
            (List.fold_left
580
               (fun sep  ->
581
                 fun x  ->
582
                   if sep then Format.fprintf fmt ",@ ";
583
                   ((__3 ()) fmt) x;
584
                   true) false x))) x.generic_map;
585
            Format.fprintf fmt "@])@;"));
586
          (match x.port_map with
587
          | [] -> Format.fprintf fmt ";";
588
          | _ ->
589
            (Format.fprintf fmt " port map (@[";
590
            ((fun x  ->
591
            ignore
592
            (List.fold_left
593
               (fun sep  ->
594
                 fun x  ->
595
                   if sep then Format.fprintf fmt ",@ ";
596
                   ((__4 ()) fmt) x;
597
                   true) false x))) x.port_map;
598
            Format.fprintf fmt "@]);"));
599
          Format.fprintf fmt "@]")
600
    [@ocaml.warning "-A"])
601

    
602
and show_mini_vhdl_component_instantiation_t :
603
  mini_vhdl_component_instantiation_t -> Ppx_deriving_runtime.string =
604
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_component_instantiation_t x
605

    
606
let rec pp_mini_vhdl_process_t :
607
  Format.formatter -> mini_vhdl_process_t -> Ppx_deriving_runtime.unit =
608
  let __3 () = pp_mini_vhdl_sequential_stmt_t
609
  
610
  and __2 () = pp_vhdl_name_t
611
  
612
  and __1 () = pp_mini_vhdl_declarative_item_t
613
  
614
  and __0 () = pp_vhdl_name_t
615
   in
616
  ((let open! Ppx_deriving_runtime in
617
      fun fmt  ->
618
        fun x  ->
619
          Format.fprintf fmt "@[<v 2>";
620
          (match x.id with
621
          | NoName -> Format.fprintf fmt "";
622
          | _ -> 
623
              ((__0 ()) fmt) x.id;
624
              Format.fprintf fmt ": ");
625
          Format.fprintf fmt "process ";
626
          (match x.active_sigs with
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
                              ((__2 ()) fmt) x;
636
                              true) false x))) x.active_sigs;
637
                 Format.fprintf fmt ") is");
638
          (match x.p_declarations with
639
          | [] -> Format.fprintf fmt "";
640
          | _ -> 
641
              (Format.fprintf fmt "@;";
642
              ((fun x  ->
643
                ignore
644
                (List.fold_left
645
                  (fun sep  ->
646
                    fun x  ->
647
                      if sep then Format.fprintf fmt "@;";
648
                        ((__1 ()) fmt) x;
649
                        Format.fprintf fmt ";";
650
                        true) false x))) x.p_declarations));
651
          Format.fprintf fmt "@]@;@[<v 2>begin@;";
652
          ((fun x  ->
653
               ignore
654
                 (List.fold_left
655
                    (fun sep  ->
656
                       fun x  ->
657
                         if sep then Format.fprintf fmt "@;";
658
                         ((__3 ()) fmt) x;
659
                         Format.fprintf fmt ";";
660
                         true) false x);)) x.p_body;
661
          Format.fprintf fmt "@]@;end process;")
662
    [@ocaml.warning "-A"])
663

    
664
and show_mini_vhdl_process_t :
665
  mini_vhdl_process_t -> Ppx_deriving_runtime.string =
666
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_process_t x
667

    
668
let rec pp_mini_vhdl_concurrent_stmt_t :
669
  Format.formatter ->
670
    mini_vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit
671
  =
672
  let __1 () = pp_mini_vhdl_component_instantiation_t
673
  
674
  and __0 () = pp_mini_vhdl_process_t
675
   in
676
  ((let open! Ppx_deriving_runtime in
677
      fun fmt  ->
678
        function
679
        | MiniProcess a0 ->
680
             ((__0 ()) fmt) a0;
681
        | MiniComponentInst a0 ->
682
             ((__1 ()) fmt) a0;
683
    )
684
    [@ocaml.warning "-A"])
685

    
686
and show_mini_vhdl_concurrent_stmt_t :
687
  mini_vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.string =
688
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_concurrent_stmt_t x
689

    
690
let rec pp_mini_vhdl_package_t :
691
  Format.formatter -> mini_vhdl_package_t -> Ppx_deriving_runtime.unit =
692
  let __3 () = pp_vhdl_load_t
693
  
694
  and __2 () = pp_mini_vhdl_declaration_t
695
  
696
  and __1 () = pp_vhdl_definition_t
697
  
698
  and __0 () = pp_vhdl_name_t
699
   in
700
  ((let open! Ppx_deriving_runtime in
701
      fun fmt  ->
702
        fun x  ->
703
          ((__0 ()) fmt) x.p_name;
704
          Format.fprintf fmt " is";
705
          ((fun x  ->
706
             ignore
707
               (List.fold_left
708
                  (fun sep  ->
709
                     fun x  ->
710
                       Format.fprintf fmt "@;";
711
                       if sep then Format.fprintf fmt "";
712
                       ((__1 ()) fmt) x;
713
                       Format.fprintf fmt ";";
714
                       true) false x))) x.shared_defs;
715
          ((fun x  ->
716
               ignore
717
                 (List.fold_left
718
                    (fun sep  ->
719
                       fun x  ->
720
                         Format.fprintf fmt "@;";
721
                         if sep then Format.fprintf fmt "";
722
                         ((__2 ()) fmt) x;
723
                         Format.fprintf fmt ";";
724
                         true) false x))) x.shared_decls;
725
          ((fun x  ->
726
               ignore
727
                 (List.fold_left
728
                    (fun sep  ->
729
                       fun x  ->
730
                         Format.fprintf fmt "@;";
731
                         if sep then Format.fprintf fmt "";
732
                         ((__3 ()) fmt) x;
733
                         true) false x))) x.shared_uses;)
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 __7 () = pp_mini_vhdl_component_t
743

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

    
865
and show_mini_vhdl_component_t :
866
  mini_vhdl_component_t -> Ppx_deriving_runtime.string =
867
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_component_t x
868

    
869
let rec pp_mini_vhdl_design_file_t :
870
  Format.formatter -> mini_vhdl_design_file_t -> Ppx_deriving_runtime.unit =
871
  let __1 () = pp_mini_vhdl_package_t
872
  
873
  and __0 () = pp_mini_vhdl_component_t
874
   in
875
  ((let open! Ppx_deriving_runtime in
876
      fun fmt  ->
877
        fun x  ->
878
           ((fun x  ->
879
               ignore
880
                 (List.fold_left
881
                    (fun sep  ->
882
                       fun x  ->
883
                         if sep then Format.fprintf fmt "@;";
884
                         Format.fprintf fmt "@[<v 2>package ";
885
                         ((__1 ()) fmt) x;
886
                         Format.fprintf fmt "@.end;@]";
887
                         true) false x))) x.packages;
888
            (match x.components with
889
            | [] -> ()
890
            | _ ->
891
                Format.fprintf fmt "@;";
892
                ((fun x  ->
893
                ignore
894
                  (List.fold_left
895
                     (fun sep  ->
896
                        fun x  ->
897
                          if sep then Format.fprintf fmt "@;";
898
                          ((__0 ()) fmt) x;
899
                          true) false x))) x.components);
900
           Format.fprintf fmt "@]")
901
    [@ocaml.warning "-A"])
902

    
903
and show_mini_vhdl_design_file_t :
904
  mini_vhdl_design_file_t -> Ppx_deriving_runtime.string =
905
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_design_file_t x