Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (29.6 KB)

1 5bbf7413 Arnaud Dieumegard
open Mini_vhdl_ast
2
open Vhdl_ast
3
open Vhdl_ast_pp
4
5 3831b5cc Arnaud Dieumegard
let rec pp_mini_vhdl_sequential_stmt_t :
6
  Format.formatter ->
7
    mini_vhdl_sequential_stmt_t -> Ppx_deriving_runtime.unit
8
  =
9 b2ca2f67 Arnaud Dieumegard
  let __32 () = pp_vhdl_expr_t
10 3831b5cc Arnaud Dieumegard
  
11 b2ca2f67 Arnaud Dieumegard
  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 3831b5cc Arnaud Dieumegard
  
31
  and __21 () = pp_vhdl_name_t
32
  
33 b2ca2f67 Arnaud Dieumegard
  and __20 () = pp_mini_vhdl_case_item_t
34 3831b5cc Arnaud Dieumegard
  
35 b2ca2f67 Arnaud Dieumegard
  and __19 () = pp_vhdl_expr_t
36 3831b5cc Arnaud Dieumegard
  
37
  and __18 () = pp_vhdl_name_t
38
  
39 b2ca2f67 Arnaud Dieumegard
  and __17 () = pp_mini_vhdl_sequential_stmt_t
40 3831b5cc Arnaud Dieumegard
  
41 b2ca2f67 Arnaud Dieumegard
  and __16 () = pp_mini_vhdl_if_case_t
42 3831b5cc Arnaud Dieumegard
  
43 b2ca2f67 Arnaud Dieumegard
  and __15 () = pp_vhdl_name_t
44 3831b5cc Arnaud Dieumegard
  
45 b2ca2f67 Arnaud Dieumegard
  and __14 () = pp_vhdl_expr_t
46 3831b5cc Arnaud Dieumegard
  
47 b2ca2f67 Arnaud Dieumegard
  and __13 () = pp_vhdl_signal_selection_t
48 3831b5cc Arnaud Dieumegard
  
49 b2ca2f67 Arnaud Dieumegard
  and __12 () = pp_vhdl_expr_t
50 3831b5cc Arnaud Dieumegard
  
51 b2ca2f67 Arnaud Dieumegard
  and __11 () = pp_vhdl_name_t
52 3831b5cc Arnaud Dieumegard
  
53 b2ca2f67 Arnaud Dieumegard
  and __10 () = pp_vhdl_name_t
54 3831b5cc Arnaud Dieumegard
  
55 b2ca2f67 Arnaud Dieumegard
  and __9 () = pp_vhdl_expr_t
56 3831b5cc Arnaud Dieumegard
  
57 b2ca2f67 Arnaud Dieumegard
  and __8 () = pp_vhdl_signal_condition_t
58 3831b5cc Arnaud Dieumegard
  
59 b2ca2f67 Arnaud Dieumegard
  and __7 () = pp_vhdl_name_t
60 3831b5cc Arnaud Dieumegard
  
61
  and __6 () = pp_vhdl_name_t
62
  
63 b2ca2f67 Arnaud Dieumegard
  and __5 () = pp_vhdl_waveform_element_t
64 3831b5cc Arnaud Dieumegard
  
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 c1b877b6 Arnaud Dieumegard
        | MiniVarAssign { label = alabel; lhs = alhs; rhs = arhs } ->
79 b2ca2f67 Arnaud Dieumegard
            (match alabel with
80 c1b877b6 Arnaud Dieumegard
              | None -> ();
81 b2ca2f67 Arnaud Dieumegard
              | Some e -> (((__0 ()) fmt) e;
82
                     Format.fprintf fmt ": ")
83
            );
84
            ((__1 ()) fmt) alhs;
85
            Format.fprintf fmt " := ";
86
            ((__2 ()) fmt) arhs;
87 c1b877b6 Arnaud Dieumegard
        | MiniSigSeqAssign { label = alabel; lhs = alhs; rhs = arhs } ->
88 b2ca2f67 Arnaud Dieumegard
            (match alabel with
89 c1b877b6 Arnaud Dieumegard
              | None -> ();
90 b2ca2f67 Arnaud Dieumegard
              | 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 c1b877b6 Arnaud Dieumegard
        | MiniSigCondAssign { label = alabel; lhs = alhs; rhs = arhs; delay = adelay } ->
107 b2ca2f67 Arnaud Dieumegard
            (match alabel with
108 c1b877b6 Arnaud Dieumegard
              | None -> ();
109 b2ca2f67 Arnaud Dieumegard
              | 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 c1b877b6 Arnaud Dieumegard
              | None -> ();
117 b2ca2f67 Arnaud Dieumegard
              | 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 c1b877b6 Arnaud Dieumegard
        | MiniSigSelectAssign
130 b2ca2f67 Arnaud Dieumegard
            { label = alabel; lhs = alhs; sel = asel; branches = abranches;
131
              delay = adelay }
132
            ->
133
            (match alabel with
134 c1b877b6 Arnaud Dieumegard
              | None -> ();
135 b2ca2f67 Arnaud Dieumegard
              | 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 c1b877b6 Arnaud Dieumegard
        | MiniIf { label = alabel; if_cases = aif_cases; default = adefault } ->
158 b2ca2f67 Arnaud Dieumegard
            (match alabel with
159 c1b877b6 Arnaud Dieumegard
              | None -> ();
160 b2ca2f67 Arnaud Dieumegard
              | 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 c1b877b6 Arnaud Dieumegard
        | MiniCase { label = alabel; guard = aguard; branches = abranches } ->
189 b2ca2f67 Arnaud Dieumegard
            (match alabel with
190 c1b877b6 Arnaud Dieumegard
              | None -> ();
191 b2ca2f67 Arnaud Dieumegard
              | 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 c1b877b6 Arnaud Dieumegard
        | MiniExit
207 3831b5cc Arnaud Dieumegard
            { label = alabel; loop_label = aloop_label;
208
              condition = acondition }
209
            ->
210 b2ca2f67 Arnaud Dieumegard
            (match alabel with
211 c1b877b6 Arnaud Dieumegard
              | None -> ();
212 b2ca2f67 Arnaud Dieumegard
              | 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 c1b877b6 Arnaud Dieumegard
        | MiniAssert
225 3831b5cc Arnaud Dieumegard
            { label = alabel; cond = acond; report = areport;
226
              severity = aseverity }
227
            ->
228 b2ca2f67 Arnaud Dieumegard
            Format.fprintf fmt "@[<v 2>";
229
            (match alabel with
230 c1b877b6 Arnaud Dieumegard
              | None -> ();
231 b2ca2f67 Arnaud Dieumegard
              | 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 c1b877b6 Arnaud Dieumegard
        | MiniProcedureCall { label = alabel; name = aname; assocs = aassocs } ->
248 b2ca2f67 Arnaud Dieumegard
            (match alabel with
249 c1b877b6 Arnaud Dieumegard
              | None -> ();
250 b2ca2f67 Arnaud Dieumegard
              | 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 bd1f1929 Arnaud Dieumegard
        | MiniWait { sensitivity = sensit_list } -> 
268
            Format.pp_print_string fmt "wait";
269
            (match sensit_list with
270
            | [] -> ();
271
            | _ ->
272 ccd386cb Arnaud Dieumegard
               Format.fprintf fmt " on (@[<v>";
273 bd1f1929 Arnaud Dieumegard
               ((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 c1b877b6 Arnaud Dieumegard
        | MiniNull { label = alabel } ->
283 b2ca2f67 Arnaud Dieumegard
            (match alabel with
284 c1b877b6 Arnaud Dieumegard
              | None -> ();
285 b2ca2f67 Arnaud Dieumegard
              | Some e -> (((__27 ()) fmt) e;
286
                     Format.fprintf fmt ":@ ")
287
            );
288
            Format.fprintf fmt "null";
289 c1b877b6 Arnaud Dieumegard
        | MiniReturn { label = alabel; expr = aexpr } ->
290 b2ca2f67 Arnaud Dieumegard
            (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 3831b5cc Arnaud Dieumegard
    [@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 990ae4ee Arnaud Dieumegard
          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 5360dcf8 Arnaud Dieumegard
          )) x.if_block_mini;)
328 3831b5cc Arnaud Dieumegard
    [@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 990ae4ee Arnaud Dieumegard
                Format.fprintf fmt "@;@[<v 2>when ";
344 3831b5cc Arnaud Dieumegard
            ((fun x  ->
345
                ignore
346
                  (List.fold_left
347
                     (fun sep  ->
348
                        fun x  ->
349 990ae4ee Arnaud Dieumegard
                          if sep then Format.fprintf fmt "@ |@ ";
350 3831b5cc Arnaud Dieumegard
                          ((__0 ()) fmt) x;
351 990ae4ee Arnaud Dieumegard
                          true) false x);)) x.when_cond;
352
           Format.fprintf fmt " => ";
353
           (fun x  ->
354 3831b5cc Arnaud Dieumegard
               ignore
355
                 (List.fold_left
356
                    (fun sep  ->
357
                       fun x  ->
358 990ae4ee Arnaud Dieumegard
                         if sep then Format.fprintf fmt "@;";
359 3831b5cc Arnaud Dieumegard
                         ((__1 ()) fmt) x;
360 990ae4ee Arnaud Dieumegard
                         Format.fprintf fmt ";";
361 5360dcf8 Arnaud Dieumegard
                         true) ((List.length x) > 1) x);) x.when_stmt_mini;
362 990ae4ee Arnaud Dieumegard
           Format.fprintf fmt "@]")
363 3831b5cc Arnaud Dieumegard
    [@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 c1b877b6 Arnaud Dieumegard
        | MiniVarDecl { names = anames; typ = atyp; init_val = ainit_val } ->
405 6a2c1a43 Arnaud Dieumegard
            (Format.fprintf fmt "variable ";
406
             ((((fun x  ->
407 3831b5cc Arnaud Dieumegard
                    ignore
408
                      (List.fold_left
409
                         (fun sep  ->
410
                            fun x  ->
411 6a2c1a43 Arnaud Dieumegard
                              if sep then Format.fprintf fmt ",";
412 3831b5cc Arnaud Dieumegard
                              ((__0 ()) fmt) x;
413 6a2c1a43 Arnaud Dieumegard
                              true) false x);)) anames;
414
               Format.fprintf fmt " : ";
415 3831b5cc Arnaud Dieumegard
               ((__1 ()) fmt) atyp;
416 6a2c1a43 Arnaud Dieumegard
               (match ainit_val with
417
                | IsNull  -> Format.pp_print_string fmt ""
418
                | _ ->
419
                    (Format.fprintf fmt ":=";
420
                     ((__2 ()) fmt) ainit_val;))));)
421 c1b877b6 Arnaud Dieumegard
        | MiniCstDecl { names = anames; typ = atyp; init_val = ainit_val } ->
422 6a2c1a43 Arnaud Dieumegard
            (Format.fprintf fmt "constant ";
423
             ((((fun x  ->
424 3831b5cc Arnaud Dieumegard
                    ignore
425
                      (List.fold_left
426
                         (fun sep  ->
427
                            fun x  ->
428 6a2c1a43 Arnaud Dieumegard
                              if sep then Format.fprintf fmt ",";
429 3831b5cc Arnaud Dieumegard
                              ((__3 ()) fmt) x;
430 6a2c1a43 Arnaud Dieumegard
                              true) false x);)) anames;
431
              Format.fprintf fmt " : ";
432
              ((__4 ()) fmt) atyp;
433
              Format.fprintf fmt " := ";
434
              ((__5 ()) fmt) ainit_val)))
435 c1b877b6 Arnaud Dieumegard
        | MiniSigDecl { names = anames; typ = atyp; init_val = ainit_val } ->
436 6a2c1a43 Arnaud Dieumegard
            (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 c1b877b6 Arnaud Dieumegard
        | MiniComponentDecl
454 3831b5cc Arnaud Dieumegard
            { name = aname; generics = agenerics; ports = aports } ->
455 6a2c1a43 Arnaud Dieumegard
            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 3831b5cc Arnaud Dieumegard
                  ignore
464
                    (List.fold_left
465 6a2c1a43 Arnaud Dieumegard
                      (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 3831b5cc Arnaud Dieumegard
                            ((__11 ()) fmt) x;
482 6a2c1a43 Arnaud Dieumegard
                            true) false x))) aports;
483
                Format.fprintf fmt "@]);");
484
            Format.fprintf fmt "@]@;end component";
485 c1b877b6 Arnaud Dieumegard
        | MiniSubprogram
486 6a2c1a43 Arnaud Dieumegard
            { spec = aspec; decl_part = adecl_part; stmts = astmts }
487 3831b5cc Arnaud Dieumegard
            ->
488 6a2c1a43 Arnaud Dieumegard
              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 3831b5cc Arnaud Dieumegard
                             ((__13 ()) fmt) x;
502 6a2c1a43 Arnaud Dieumegard
                             Format.fprintf fmt ";";
503
                             true) false x))) adecl_part);
504
              Format.fprintf fmt "@]@;";
505
              Format.fprintf fmt "@[<v 2>begin@;";
506 3831b5cc Arnaud Dieumegard
              ((fun x  ->
507
                  ignore
508
                    (List.fold_left
509
                       (fun sep  ->
510
                          fun x  ->
511 6a2c1a43 Arnaud Dieumegard
                            if sep then Format.fprintf fmt "@;";
512 3831b5cc Arnaud Dieumegard
                            ((__14 ()) fmt) x;
513 6a2c1a43 Arnaud Dieumegard
                            Format.fprintf fmt ";";
514
                            true) false x))) astmts;
515 990ae4ee Arnaud Dieumegard
              Format.fprintf fmt "@]@;end";)
516
    [@ocaml.warning "-A"])
517 3831b5cc Arnaud Dieumegard
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 990ae4ee Arnaud Dieumegard
          (match x.use_clause with
536 c1b877b6 Arnaud Dieumegard
          | None -> ();
537 990ae4ee Arnaud Dieumegard
          | Some e -> ((__0 ()) fmt) e);
538
          (match x.declaration with
539 c1b877b6 Arnaud Dieumegard
          | None -> ();
540 990ae4ee Arnaud Dieumegard
          | Some e -> ((__1 ()) fmt) e);
541
          (match x.definition with
542 c1b877b6 Arnaud Dieumegard
          | None -> ();
543 990ae4ee Arnaud Dieumegard
          | Some e -> ((__2 ()) fmt) e);)
544 3831b5cc Arnaud Dieumegard
    [@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 96cb9cf2 Arnaud Dieumegard
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 20d354f4 Arnaud Dieumegard
          ((__0 ()) fmt) x.ci_name;
569 96cb9cf2 Arnaud Dieumegard
          Format.fprintf fmt "__";
570 20d354f4 Arnaud Dieumegard
          ((__0 ()) fmt) x.archi.a_name;
571 96cb9cf2 Arnaud Dieumegard
          Format.fprintf fmt "__";
572 20d354f4 Arnaud Dieumegard
          ((__0 ()) fmt) x.entity.e_name;
573 96cb9cf2 Arnaud Dieumegard
          (match x.generic_map with
574
          | [] -> Format.fprintf fmt "";
575
          | _ ->
576 02440160 Arnaud Dieumegard
            (Format.fprintf fmt " generic map (@[";
577 96cb9cf2 Arnaud Dieumegard
            ((fun x  ->
578
            ignore
579
            (List.fold_left
580
               (fun sep  ->
581
                 fun x  ->
582 02440160 Arnaud Dieumegard
                   if sep then Format.fprintf fmt ",@ ";
583 96cb9cf2 Arnaud Dieumegard
                   ((__3 ()) fmt) x;
584
                   true) false x))) x.generic_map;
585 02440160 Arnaud Dieumegard
            Format.fprintf fmt "@])@;"));
586 96cb9cf2 Arnaud Dieumegard
          (match x.port_map with
587
          | [] -> Format.fprintf fmt ";";
588
          | _ ->
589 02440160 Arnaud Dieumegard
            (Format.fprintf fmt " port map (@[";
590 96cb9cf2 Arnaud Dieumegard
            ((fun x  ->
591
            ignore
592
            (List.fold_left
593
               (fun sep  ->
594
                 fun x  ->
595 02440160 Arnaud Dieumegard
                   if sep then Format.fprintf fmt ",@ ";
596 96cb9cf2 Arnaud Dieumegard
                   ((__4 ()) fmt) x;
597
                   true) false x))) x.port_map;
598 02440160 Arnaud Dieumegard
            Format.fprintf fmt "@]);"));
599 96cb9cf2 Arnaud Dieumegard
          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 3831b5cc Arnaud Dieumegard
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 b2ca2f67 Arnaud Dieumegard
          Format.fprintf fmt "@[<v 2>";
620
          (match x.id with
621
          | NoName -> Format.fprintf fmt "";
622
          | _ -> 
623 3831b5cc Arnaud Dieumegard
              ((__0 ()) fmt) x.id;
624 b2ca2f67 Arnaud Dieumegard
              Format.fprintf fmt ": ");
625
          Format.fprintf fmt "process ";
626
          (match x.active_sigs with
627 ccd386cb Arnaud Dieumegard
          | [] -> ();
628 b2ca2f67 Arnaud Dieumegard
          | _ -> 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 ccd386cb Arnaud Dieumegard
                 Format.fprintf fmt ") is");
638 20d354f4 Arnaud Dieumegard
          (match x.p_declarations with
639 6a2c1a43 Arnaud Dieumegard
          | [] -> 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 20d354f4 Arnaud Dieumegard
                        true) false x))) x.p_declarations));
651 b2ca2f67 Arnaud Dieumegard
          Format.fprintf fmt "@]@;@[<v 2>begin@;";
652
          ((fun x  ->
653 3831b5cc Arnaud Dieumegard
               ignore
654
                 (List.fold_left
655
                    (fun sep  ->
656
                       fun x  ->
657 b2ca2f67 Arnaud Dieumegard
                         if sep then Format.fprintf fmt "@;";
658 3831b5cc Arnaud Dieumegard
                         ((__3 ()) fmt) x;
659 b2ca2f67 Arnaud Dieumegard
                         Format.fprintf fmt ";";
660 20d354f4 Arnaud Dieumegard
                         true) false x);)) x.p_body;
661 02440160 Arnaud Dieumegard
          Format.fprintf fmt "@]@;end process;")
662 3831b5cc Arnaud Dieumegard
    [@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 96cb9cf2 Arnaud Dieumegard
let rec pp_mini_vhdl_concurrent_stmt_t :
669
  Format.formatter ->
670
    mini_vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit
671
  =
672 b6ff3e98 Arnaud Dieumegard
  let __1 () = pp_mini_vhdl_component_instantiation_t
673 96cb9cf2 Arnaud Dieumegard
  
674 3831b5cc Arnaud Dieumegard
  and __0 () = pp_mini_vhdl_process_t
675 96cb9cf2 Arnaud Dieumegard
   in
676
  ((let open! Ppx_deriving_runtime in
677
      fun fmt  ->
678
        function
679 c1b877b6 Arnaud Dieumegard
        | MiniProcess a0 ->
680 3831b5cc Arnaud Dieumegard
             ((__0 ()) fmt) a0;
681 c1b877b6 Arnaud Dieumegard
        | MiniComponentInst a0 ->
682 b6ff3e98 Arnaud Dieumegard
             ((__1 ()) fmt) a0;
683 96cb9cf2 Arnaud Dieumegard
    )
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 3831b5cc Arnaud Dieumegard
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 4515d925 Arnaud Dieumegard
          ((__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 3831b5cc Arnaud Dieumegard
               ignore
727
                 (List.fold_left
728
                    (fun sep  ->
729
                       fun x  ->
730 4515d925 Arnaud Dieumegard
                         Format.fprintf fmt "@;";
731
                         if sep then Format.fprintf fmt "";
732 3831b5cc Arnaud Dieumegard
                         ((__3 ()) fmt) x;
733 4515d925 Arnaud Dieumegard
                         Format.fprintf fmt ";";
734
                         true) false x))) x.shared_uses;)
735 3831b5cc Arnaud Dieumegard
    [@ocaml.warning "-A"])
736
737
and show_mini_vhdl_package_t :
738
  mini_vhdl_package_t -> Ppx_deriving_runtime.string =
739
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_package_t x
740
741 5bbf7413 Arnaud Dieumegard
let rec pp_mini_vhdl_component_t :
742
  Format.formatter -> mini_vhdl_component_t -> Ppx_deriving_runtime.unit =
743 96cb9cf2 Arnaud Dieumegard
  let __6 () = pp_mini_vhdl_concurrent_stmt_t
744 5bbf7413 Arnaud Dieumegard
  
745
  and __5 () = pp_vhdl_definition_t
746
  
747 3831b5cc Arnaud Dieumegard
  and __4 () = pp_mini_vhdl_declaration_t
748 5bbf7413 Arnaud Dieumegard
  
749
  and __3 () = pp_vhdl_load_t
750
  
751
  and __2 () = pp_vhdl_port_t
752
  
753
  and __1 () = pp_vhdl_port_t
754
  
755
  and __0 () = pp_vhdl_name_t
756
   in
757
  ((let open! Ppx_deriving_runtime in
758
      fun fmt  ->
759
        fun x  ->
760
          Format.fprintf fmt "@[<v 2>component ";
761
          (match x.names with
762
          | [] -> ()
763
          | _ ->
764
            ((fun x  ->
765
              ignore
766
              (List.fold_left
767
                (fun sep  ->
768
                  fun x  ->
769
                    if sep then Format.fprintf fmt "__";
770
                      ((__0 ()) fmt) x;
771
                      true) false x))) x.names);
772
          Format.fprintf fmt " is";
773
          (match x.generics with
774
          | [] -> ()
775
          | _ ->
776
              Format.fprintf fmt "@;generics (@[";
777
                ((fun x  ->
778
                    ignore
779
                      (List.fold_left
780
                         (fun sep  ->
781
                            fun x  ->
782
                              if sep then Format.fprintf fmt ",@ ";
783
                              ((__1 ()) fmt) x;
784
                              true) false x))) x.generics;
785
              Format.fprintf fmt "@]);");
786
          (match x.ports with
787
          | [] -> ()
788
          | _ ->
789
              Format.fprintf fmt "@;ports (@[";
790
               ((fun x  ->
791
                   ignore
792
                     (List.fold_left
793
                        (fun sep  ->
794
                           fun x  ->
795
                             if sep then Format.fprintf fmt ",@ ";
796
                             ((__2 ()) fmt) x;
797
                             true) false x))) x.ports;
798
               Format.fprintf fmt "@]);");
799
          (match x.contexts with
800
          | [] -> ()
801
          | _ ->
802
            Format.fprintf fmt "@;";
803
            ((fun x  ->
804
            ignore
805
              (List.fold_left
806
                (fun sep  ->
807
                  fun x  ->
808
                    if sep then Format.fprintf fmt ";@;";
809
                      ((__3 ()) fmt) x;
810
                      true) false x))) x.contexts);
811 20d354f4 Arnaud Dieumegard
          (match x.c_declarations with
812 5bbf7413 Arnaud Dieumegard
          | [] -> ()
813
          | _ ->
814
            Format.fprintf fmt "@;";
815
            ((fun x  ->
816
            ignore
817
              (List.fold_left
818
                (fun sep  ->
819
                  fun x  ->
820
                    if sep then Format.fprintf fmt "@;";
821
                      ((__4 ()) fmt) x;
822
                      Format.fprintf fmt ";";
823 20d354f4 Arnaud Dieumegard
                      true) false x))) x.c_declarations);
824 5bbf7413 Arnaud Dieumegard
          (match x.definitions with
825
          | [] -> ()
826
          | _ ->
827
            Format.fprintf fmt "@;";
828
            ((fun x  ->
829
            ignore
830
              (List.fold_left
831
                (fun sep  ->
832
                  fun x  ->
833
                    if sep then Format.fprintf fmt "@;";
834
                      ((__5 ()) fmt) x;
835
                      Format.fprintf fmt ";";
836
                      true) false x))) x.definitions);
837
          Format.fprintf fmt "@]@;@[<v 2>begin";
838 20d354f4 Arnaud Dieumegard
          (match x.c_body with
839 5bbf7413 Arnaud Dieumegard
          | [] -> ()
840
          | _ ->
841
            Format.fprintf fmt "@;";
842
            ((fun x  ->
843
            ignore
844
              (List.fold_left
845
                (fun sep  ->
846
                  fun x  ->
847
                    if sep then Format.fprintf fmt "@;";
848
                      ((__6 ()) fmt) x;
849 20d354f4 Arnaud Dieumegard
                         true) false x))) x.c_body);
850 5bbf7413 Arnaud Dieumegard
           Format.fprintf fmt "@]@;end;")
851
    [@ocaml.warning "-A"])
852
853
and show_mini_vhdl_component_t :
854
  mini_vhdl_component_t -> Ppx_deriving_runtime.string =
855
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_component_t x
856
857
let rec pp_mini_vhdl_design_file_t :
858
  Format.formatter -> mini_vhdl_design_file_t -> Ppx_deriving_runtime.unit =
859 3831b5cc Arnaud Dieumegard
  let __1 () = pp_mini_vhdl_package_t
860 5bbf7413 Arnaud Dieumegard
  
861
  and __0 () = pp_mini_vhdl_component_t
862
   in
863
  ((let open! Ppx_deriving_runtime in
864
      fun fmt  ->
865
        fun x  ->
866
           ((fun x  ->
867
               ignore
868
                 (List.fold_left
869
                    (fun sep  ->
870
                       fun x  ->
871
                         if sep then Format.fprintf fmt "@;";
872 4515d925 Arnaud Dieumegard
                         Format.fprintf fmt "@[<v 2>package ";
873 5bbf7413 Arnaud Dieumegard
                         ((__1 ()) fmt) x;
874 4515d925 Arnaud Dieumegard
                         Format.fprintf fmt "@.end;@]";
875 5bbf7413 Arnaud Dieumegard
                         true) false x))) x.packages;
876 9c1ed3ad Arnaud Dieumegard
            (match x.components with
877
            | [] -> ()
878
            | _ ->
879
                Format.fprintf fmt "@;";
880
                ((fun x  ->
881
                ignore
882
                  (List.fold_left
883
                     (fun sep  ->
884
                        fun x  ->
885
                          if sep then Format.fprintf fmt "@;";
886
                          ((__0 ()) fmt) x;
887
                          true) false x))) x.components);
888 5bbf7413 Arnaud Dieumegard
           Format.fprintf fmt "@]")
889
    [@ocaml.warning "-A"])
890
891
and show_mini_vhdl_design_file_t :
892
  mini_vhdl_design_file_t -> Ppx_deriving_runtime.string =
893
  fun x  -> Format.asprintf "%a" pp_mini_vhdl_design_file_t x