Project

General

Profile

Revision 40364f53 src/tools/importer/main_lustre_importer.ml

View differences:

src/tools/importer/main_lustre_importer.ml
14 14
open Vhdl_test
15 15
  *)
16 16
open Yojson.Safe
17
open Vhdl_to_lustre
17 18
open Vhdl_ast_utils
18 19
open Vhdl_ast_map
19
open Vhdl_ast
20
open Ppxlib_traverse_builtins
20
open Vhdl_ast_deriving
21 21
open Printf
22
open Printers
23
open Format
22 24

  
23 25
let _ =
24 26
  (* Load model with Yojson *)
......
30 32
  (* Simplify VHDL values *)
31 33
  match vhdl with
32 34
    Ok x ->
35
      (* Parsed VHDL JSON value *)
33 36
      Format.printf "Parsed VHDL: \n%s\n" (pretty_to_string (vhdl_file_t_to_yojson x));
37
      (* Fold Op vhdl_expr_t values *)
34 38
      let folded = replace_op_expr#vhdl_file_t x in
35 39
      Format.printf "PP VHDL: \n%s\n" (show_vhdl_file_t folded);
40
      (* Translate vhdl_file_t value as lustre value *)
41
      let program = to_lustre#vhdl_file_t folded in
42
      Format.printf "PP VHDL: \n%s\n" (show_vhdl_file_t program);
43
      (* Pretty print lustre value *)
44
 (*     Printers.pp_prog std_formatter program; *)
45
      
36 46
  | Error e -> Format.printf "Error: %s\n" e;
37 47

  

Also available in: Unified diff