Project

General

Profile

Revision 389493d3

View differences:

src/backends/VHDL/vhdl_ast_deriving.ml
14 14
  | CstStdLogic of string 
15 15
  | CstLiteral of string [@name "CST_LITERAL"]
16 16

  
17
(* Adapted *)
18 17
let rec (pp_vhdl_cst_val_t :
19 18
          Format.formatter -> vhdl_cst_val_t -> Ppx_deriving_runtime.unit)
20 19
  =
......
186 185
             ((
187 186
               (Format.fprintf fmt "%d") a1);
188 187
               ((function
189
                 | None  -> Format.pp_print_string fmt "None"
188
                 | None  -> Format.pp_print_string fmt ""
190 189
                 | Some x ->
191
                      (Format.fprintf fmt "%S") x;
190
                      (Format.fprintf fmt "%s") x;
192 191
                      )) a0;
193 192
              (Format.fprintf fmt "%d") a2);
194 193
        | Bit_vector (a0,a1) ->
195
             (Format.fprintf fmt "%d .. %d") a0 a1;
194
             (Format.fprintf fmt "array (%d,%d) of bit") a0 a1;
196 195
        | Array (a0,a1,a2) ->
197
             (((__0 ()) fmt) a2;
198
              (Format.fprintf fmt "[%d,%d]") a0 a1);
196
             (Format.fprintf fmt "array ";
197
             (Format.fprintf fmt "(%d,%d)") a0 a1;
198
             Format.fprintf fmt " of ";
199
             ((__0 ()) fmt) a2)
199 200
        | Enumerated a0 ->
200 201
             ((fun x  ->
201
                 Format.fprintf fmt "@[<2>[";
202 202
                 ignore
203 203
                   (List.fold_left
204 204
                      (fun sep  ->
205 205
                         fun x  ->
206
                           if sep then Format.fprintf fmt ";@ ";
207
                           (Format.fprintf fmt "%S") x;
208
                           true) false x);
209
                 Format.fprintf fmt "@,]@]")) a0;
210
        | Void  -> Format.pp_print_string fmt "Void")
206
                           if sep then Format.fprintf fmt ",@ ";
207
                           (Format.fprintf fmt "%s") x;
208
                           true) false x))) a0;
209
        | Void  -> Format.pp_print_string fmt "")
211 210
    [@ocaml.warning "-A"])
212 211

  
213 212
and show_vhdl_type_t : vhdl_type_t -> Ppx_deriving_runtime.string =
214 213
  fun x  -> Format.asprintf "%a" pp_vhdl_type_t x
215 214

  
216
(* Adapted *)
217 215
and pp_vhdl_subtype_indication_t :
218 216
  Format.formatter -> vhdl_subtype_indication_t -> Ppx_deriving_runtime.unit
219 217
  =
......
238 236
  vhdl_subtype_indication_t -> Ppx_deriving_runtime.string =
239 237
  fun x  -> Format.asprintf "%a" pp_vhdl_subtype_indication_t x
240 238

  
241
(* Adapted *)
242 239
and pp_vhdl_discrete_range_t :
243 240
  Format.formatter -> vhdl_discrete_range_t -> Ppx_deriving_runtime.unit =
244 241
  let __3 () = pp_vhdl_expr_t
......
329 326
and show_vhdl_constraint_t : vhdl_constraint_t -> Ppx_deriving_runtime.string
330 327
  = fun x  -> Format.asprintf "%a" pp_vhdl_constraint_t x
331 328

  
332
(* TODO Adapt for Type *)
333 329
and pp_vhdl_definition_t :
334 330
  Format.formatter -> vhdl_definition_t -> Ppx_deriving_runtime.unit =
335 331
  let __3 () = pp_vhdl_subtype_indication_t
......
359 355
and show_vhdl_definition_t : vhdl_definition_t -> Ppx_deriving_runtime.string
360 356
  = fun x  -> Format.asprintf "%a" pp_vhdl_definition_t x
361 357

  
362
(* adaptation to be provided for Op, Time, Sig, suffixMod, Aggregate,  *)
358
(* TODO adapt for Op, Time, Sig, suffixMod, Aggregate *)
363 359
and pp_vhdl_expr_t :
364 360
  Format.formatter -> vhdl_expr_t -> Ppx_deriving_runtime.unit =
365 361
  let __7 () = pp_vhdl_element_assoc_t
......
426 422
              Format.fprintf fmt "@]");
427 423
             Format.fprintf fmt "@]}")
428 424
        | Sig { name = aname; att = aatt } ->
429
            (Format.fprintf fmt "@[<2>Sig {@,";
425
            (Format.fprintf fmt "--@[<2>Sig {@,";
430 426
             ((Format.fprintf fmt "@[%s =@ " "name";
431 427
               ((__3 ()) fmt) aname;
432 428
               Format.fprintf fmt "@]");
......
441 437
              Format.fprintf fmt "@]");
442 438
             Format.fprintf fmt "@]}")
443 439
        | SuffixMod { expr = aexpr; selection = aselection } ->
444
            (Format.fprintf fmt "@[<2>SuffixMod {@,";
440
            (Format.fprintf fmt "--@[<2>SuffixMod {@,";
445 441
             ((Format.fprintf fmt "@[%s =@ " "expr";
446 442
               ((__5 ()) fmt) aexpr;
447 443
               Format.fprintf fmt "@]");
......
451 447
              Format.fprintf fmt "@]");
452 448
             Format.fprintf fmt "@]}")
453 449
        | Aggregate { elems = aelems } ->
454
            (Format.fprintf fmt "@[<2>Aggregate {@,";
450
            (Format.fprintf fmt "--@[<2>Aggregate {@,";
455 451
             (Format.fprintf fmt "@[%s =@ " "elems";
456 452
              ((fun x  ->
457 453
                  Format.fprintf fmt "@[<2>[";
......
471 467
and show_vhdl_expr_t : vhdl_expr_t -> Ppx_deriving_runtime.string =
472 468
  fun x  -> Format.asprintf "%a" pp_vhdl_expr_t x
473 469

  
474
(* Adapted *)
475 470
and pp_vhdl_name_t :
476 471
  Format.formatter -> vhdl_name_t -> Ppx_deriving_runtime.unit =
477 472
  let __9 () = pp_vhdl_assoc_element_t
......
559 554
and show_vhdl_name_t : vhdl_name_t -> Ppx_deriving_runtime.string =
560 555
  fun x  -> Format.asprintf "%a" pp_vhdl_name_t x
561 556

  
562
(* Adapted *)
563 557
and pp_vhdl_assoc_element_t :
564 558
  Format.formatter -> vhdl_assoc_element_t -> Ppx_deriving_runtime.unit =
565 559
  let __4 () = pp_vhdl_expr_t
......
617 611
  ((let open! Ppx_deriving_runtime in
618 612
      fun fmt  ->
619 613
        fun x  ->
620
          Format.fprintf fmt "@[<2>{ ";
621
          ((Format.fprintf fmt "@[%s =@ " "choices";
622
            ((fun x  ->
614
            (match x.choices with
615
            | [] -> Format.fprintf fmt "";
616
            | _ -> 
617
              (((fun x  ->
623 618
                Format.fprintf fmt "@[<2>[";
624 619
                ignore
625 620
                  (List.fold_left
626 621
                     (fun sep  ->
627 622
                        fun x  ->
628
                          if sep then Format.fprintf fmt ";@ ";
623
                          if sep then Format.fprintf fmt "|@ ";
629 624
                          ((__0 ()) fmt) x;
630
                          true) false x);
631
                Format.fprintf fmt "@,]@]")) x.choices;
632
            Format.fprintf fmt "@]");
633
           Format.fprintf fmt ";@ ";
634
           Format.fprintf fmt "@[%s =@ " "expr";
635
           ((__1 ()) fmt) x.expr;
636
           Format.fprintf fmt "@]");
637
          Format.fprintf fmt "@ }@]")
625
                          true) false x))) x.choices;
626
              Format.fprintf fmt " => ";));
627
           ((__1 ()) fmt) x.expr)
638 628
    [@ocaml.warning "-A"])
639 629

  
640 630
and show_vhdl_element_assoc_t :
641 631
  vhdl_element_assoc_t -> Ppx_deriving_runtime.string =
642 632
  fun x  -> Format.asprintf "%a" pp_vhdl_element_assoc_t x
643 633

  
634
(* TODO *)
644 635
and (pp_vhdl_array_attributes_t :
645 636
      Format.formatter ->
646 637
        vhdl_array_attributes_t -> Ppx_deriving_runtime.unit)
......
665 656
  vhdl_array_attributes_t -> Ppx_deriving_runtime.string =
666 657
  fun x  -> Format.asprintf "%a" pp_vhdl_array_attributes_t x
667 658

  
659
(* TODO *)
668 660
and (pp_vhdl_signal_attributes_t :
669 661
      Format.formatter ->
670 662
        vhdl_signal_attributes_t -> Ppx_deriving_runtime.unit)
......
682 674
  vhdl_signal_attributes_t -> Ppx_deriving_runtime.string =
683 675
  fun x  -> Format.asprintf "%a" pp_vhdl_signal_attributes_t x
684 676

  
677
(* TODO *)
685 678
and (pp_vhdl_string_attributes_t :
686 679
      Format.formatter ->
687 680
        vhdl_string_attributes_t -> Ppx_deriving_runtime.unit)
......
699 692
  vhdl_string_attributes_t -> Ppx_deriving_runtime.string =
700 693
  fun x  -> Format.asprintf "%a" pp_vhdl_string_attributes_t x
701 694

  
695
(* TODO *)
702 696
and (pp_vhdl_suffix_selection_t :
703 697
      Format.formatter ->
704 698
        vhdl_suffix_selection_t -> Ppx_deriving_runtime.unit)
......
2024 2018
  id: string ;
2025 2019
  arg: string } 
2026 2020

  
2021
(* TODO *)
2027 2022
let rec pp_vhdl_type_attributes_t
2028 2023
  =
2029 2024
  ((let open! Ppx_deriving_runtime in
......
2274 2269
  typ: vhdl_subtype_indication_t ;
2275 2270
  init_val: vhdl_cst_val_t option [@default None]}
2276 2271

  
2272
(* TODO *)
2277 2273
let rec pp_vhdl_parameter_t :
2278 2274
  Format.formatter -> vhdl_parameter_t -> Ppx_deriving_runtime.unit =
2279 2275
  let __2 () = pp_vhdl_cst_val_t
......
2442 2438
  parameters: vhdl_parameter_t list ;
2443 2439
  isPure: bool [@default false]}
2444 2440

  
2441
(* TODO *)
2445 2442
let rec pp_vhdl_subprogram_spec_t :
2446 2443
  Format.formatter -> vhdl_subprogram_spec_t -> Ppx_deriving_runtime.unit =
2447 2444
  let __1 () = pp_vhdl_parameter_t
......
2647 2644
  when_cond: vhdl_expr_t list ;
2648 2645
  when_stmt: vhdl_sequential_stmt_t list }
2649 2646

  
2650
(* Needs adaptation for: Assert *)
2647
(* TODO Adapt for: Assert *)
2651 2648
let rec pp_vhdl_sequential_stmt_t :
2652 2649
  Format.formatter -> vhdl_sequential_stmt_t -> Ppx_deriving_runtime.unit =
2653 2650
  let __19 () = pp_vhdl_name_t
......
2699 2696
              | _ -> (((__0 ()) fmt) alabel;
2700 2697
                     Format.fprintf fmt ":@ ")
2701 2698
            );
2702
            Format.fprintf fmt "@[<2>";
2703 2699
            ((__1 ()) fmt) alhs;
2704 2700
            Format.fprintf fmt "@ :=@ ";
2705 2701
            ((__2 ()) fmt) arhs;
2706
            Format.fprintf fmt "@]";
2707 2702
(* TODO: Check
2708 2703
            (Format.fprintf fmt "@[<2>VarAssign {@,";
2709 2704
             (((Format.fprintf fmt "@[%s =@ " "label";
......
2846 2841
  vhdl_sequential_stmt_t -> Ppx_deriving_runtime.string =
2847 2842
  fun x  -> Format.asprintf "%a" pp_vhdl_sequential_stmt_t x
2848 2843

  
2849
(* Adapted *)
2850 2844
and pp_vhdl_if_case_t :
2851 2845
  Format.formatter -> vhdl_if_case_t -> Ppx_deriving_runtime.unit =
2852 2846
  let __1 () = pp_vhdl_sequential_stmt_t
......
2873 2867
and show_vhdl_if_case_t : vhdl_if_case_t -> Ppx_deriving_runtime.string =
2874 2868
  fun x  -> Format.asprintf "%a" pp_vhdl_if_case_t x
2875 2869

  
2876
(* Adapted *)
2877 2870
and pp_vhdl_case_item_t :
2878 2871
  Format.formatter -> vhdl_case_item_t -> Ppx_deriving_runtime.unit =
2879 2872
  let __1 () = pp_vhdl_sequential_stmt_t
......
4025 4018
  expr: vhdl_expr_t list ;
4026 4019
  cond: vhdl_expr_t [@default IsNull]}
4027 4020

  
4028
(* Adapted *)
4029 4021
let rec pp_vhdl_signal_condition_t :
4030 4022
  Format.formatter -> vhdl_signal_condition_t -> Ppx_deriving_runtime.unit =
4031 4023
  let __1 () = pp_vhdl_expr_t
......
4110 4102
  expr: vhdl_expr_t ;
4111 4103
  when_sel: vhdl_expr_t list [@default []]}
4112 4104

  
4105
(* TODO *)
4113 4106
let rec pp_vhdl_signal_selection_t :
4114 4107
  Format.formatter -> vhdl_signal_selection_t -> Ppx_deriving_runtime.unit =
4115 4108
  let __1 () = pp_vhdl_expr_t
......
4206 4199
  cond: vhdl_expr_t [@default IsNull];
4207 4200
  delay: vhdl_expr_t [@default IsNull]}
4208 4201

  
4209
(* Adapted *)
4210 4202
let rec pp_vhdl_conditional_signal_t :
4211 4203
  Format.formatter -> vhdl_conditional_signal_t -> Ppx_deriving_runtime.unit
4212 4204
  =
......
4387 4379
  body: vhdl_sequential_stmt_t list
4388 4380
    [@key "PROCESS_STATEMENT_PART"][@default []]}
4389 4381

  
4390
(* Adapted *)
4391 4382
let rec pp_vhdl_process_t :
4392 4383
  Format.formatter -> vhdl_process_t -> Ppx_deriving_runtime.unit =
4393 4384
  let __3 () = pp_vhdl_sequential_stmt_t
......
4568 4559
  branches: vhdl_signal_selection_t list [@default []];
4569 4560
  delay: vhdl_expr_t option }
4570 4561

  
4562
(* TODO *)
4571 4563
let rec pp_vhdl_selected_signal_t :
4572 4564
  Format.formatter -> vhdl_selected_signal_t -> Ppx_deriving_runtime.unit =
4573 4565
  let __4 () = pp_vhdl_expr_t
......
4762 4754
  | SelectedSig of vhdl_selected_signal_t
4763 4755
  [@name "SELECTED_SIGNAL_ASSIGNMENT"]
4764 4756

  
4765
(* Adapted *)
4766 4757
let rec pp_vhdl_concurrent_stmt_t :
4767 4758
  Format.formatter -> vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit =
4768 4759
  let __2 () = pp_vhdl_selected_signal_t
......
4874 4865
  typ: vhdl_subtype_indication_t ;
4875 4866
  expr: vhdl_expr_t [@default IsNull]}
4876 4867

  
4877
(* Adapted *)
4878 4868
let rec pp_vhdl_port_t :
4879 4869
  Format.formatter -> vhdl_port_t -> Ppx_deriving_runtime.unit =
4880 4870
  let __3 () = pp_vhdl_expr_t
......
5010 5000
  stmts: vhdl_concurrent_stmt_t list
5011 5001
    [@key "ENTITY_STATEMENT_PART"][@default []]}
5012 5002

  
5013
(* Adapted *)
5014 5003
let rec pp_vhdl_entity_t :
5015 5004
  Format.formatter -> vhdl_entity_t -> Ppx_deriving_runtime.unit =
5016 5005
  let __4 () = pp_vhdl_concurrent_stmt_t
......
5212 5201
  name: vhdl_name_t [@default NoName];
5213 5202
  shared_defs: vhdl_definition_t list [@default []]}
5214 5203

  
5215
(* Adapted *)
5216 5204
let rec pp_vhdl_package_t :
5217 5205
  Format.formatter -> vhdl_package_t -> Ppx_deriving_runtime.unit =
5218 5206
  let __1 () = pp_vhdl_definition_t
......
5376 5364
  body: vhdl_concurrent_stmt_t list
5377 5365
    [@key "ARCHITECTURE_STATEMENT_PART"][@default []]}
5378 5366

  
5379
(* Adapted *)
5380 5367
let rec pp_vhdl_architecture_t :
5381 5368
  Format.formatter -> vhdl_architecture_t -> Ppx_deriving_runtime.unit =
5382 5369
  let __3 () = pp_vhdl_concurrent_stmt_t
......
5561 5548
  | Architecture of vhdl_architecture_t [@name "ARCHITECTURE_BODY"]
5562 5549
  | Configuration of vhdl_configuration_t [@name "CONFIGURATION_DECLARATION"]
5563 5550

  
5564
(* Adapted *)
5565 5551
let rec pp_vhdl_library_unit_t :
5566 5552
  Format.formatter -> vhdl_library_unit_t -> Ppx_deriving_runtime.unit =
5567 5553
  let __3 () = pp_vhdl_configuration_t
......
5646 5632
  contexts: vhdl_load_t list [@default []];
5647 5633
  library: vhdl_library_unit_t }
5648 5634

  
5649
(* Adapted *)
5650 5635
let rec pp_vhdl_design_unit_t :
5651 5636
  Format.formatter -> vhdl_design_unit_t -> Ppx_deriving_runtime.unit =
5652 5637
  let __1 () = pp_vhdl_library_unit_t
......
5736 5721
  {
5737 5722
  design_units: vhdl_design_unit_t list [@default []]}
5738 5723

  
5739
(* Adapted *)
5740 5724
let rec pp_vhdl_design_file_t :
5741 5725
  Format.formatter -> vhdl_design_file_t -> Ppx_deriving_runtime.unit =
5742 5726
  let __0 () = pp_vhdl_design_unit_t  in
......
5808 5792
  design_file: vhdl_design_file_t
5809 5793
    [@default { design_units = [] }][@key "DESIGN_FILE"]}
5810 5794

  
5811
(* Adapted *)
5812 5795
let rec pp_vhdl_file_t :
5813 5796
  Format.formatter -> vhdl_file_t -> Ppx_deriving_runtime.unit =
5814 5797
  let __0 () = pp_vhdl_design_file_t  in

Also available in: Unified diff