Project

General

Profile

Revision 8b30c441

View differences:

README.lustrei
1
To compile Lustrei:
2
-------------------
3

  
4
# autoconf
5
# ./configure
6
# make
7
# make install
8

  
9
To use lustrei:
10
---------------
11

  
12
# lustrei -gen_vhdl -vhdl <filename.json>
13
will parse the json and pretty-print it back as vhdl code
14

  
15
# lustrei -gen_minivhdl -vhdl <filename.json>
16
will parse the json and transform it to mini_vhdl
17

  
18
# lustrei -vhdl <filename.json>
19
will parse the json and transform it to lustre (-gen_lustre option does the same thing)
20

  
21
Add
22
# -o <outputfilename>
23
to redirect the output to a specific file
24

  
25
Check teh input vhdl
26
# -check
27
flag will analyse the vhdl and display the results of the analysis (experimental)
28

  
29
To develop lustrei:
30
-------------------
31

  
32
Project hierarchy:
33
==================
34

  
35
> src/backends/VHDL/
36
> ├── mini_vhdl_ast.ml              < mini_vhdl language data structure
37
> ├── mini_vhdl_ast_pp.ml           < mini_vhdl pretty printer
38
> ├── mini_vhdl_utils.ml            < mini_vhdl utility functions
39
> ├── vhdl_2_mini_vhdl_map.ml       < vhdl to mini_vhdl transformation (instantiated in vhdl_ast_utils)
40
> ├── vhdl_ast_fold_sensitivity.ml  < utility visitor for processes sensitivity list extraction
41
> ├── vhdl_ast_map.ml               < generic map on vhdl_ast data structure (instantiated and extended in vhdl_ast_utils)
42
> ├── vhdl_ast.ml                   < vhdl language data structure
43
> ├── vhdl_ast_pp.ml                < vhdl pretty printer
44
> ├── vhdl_ast_raw.ml               < original proposal for vhdl_ast (ploc)
45
> ├── vhdl_ast_utils.ml             < visiting classes instantiations
46
> ├── vhdl_ast_yojson.ml            < yojson parser/printer: json <-> vhdl_ast data structure
47
> └── vhdl_test.ml                  < a few tests for vhdl_ast data structure manipulation
48
> 
49
> src/tools/importer/
50
> ├── main_lustre_importer.ml   < lustrei entry point
51
> ├── mini_vhdl_check.ml        < -check flag analysis
52
> └── mini_vhdl_to_lustre.ml    < mini_vhdl to lustre transformation (instantiated in vhdl_ast_utils)
53

  
54
Projects contribution details:
55
==============================
56

  
57
Entry point:
58
############
59

  
60
> src/tools/importer/main_lustre_importer.ml
61

  
62
The _ function have the following workflow:
63
- Parse input parameters/flags
64
- Parse json input => get vhdl_ast data structure instance (Load model with Yojson)
65
- Simplify vhdl_ast data structure instance (Fold Op)
66
- Transform vhdl_ast data structure to mini_vhdl_ast data structure
67
- Transform mini_vhdl_ast data structure to lustre data structure
68
- Calls pretty-printers according to selected lustrei input parameters
69

  
70
Vhdl ast:
71
#########
72

  
73
> src/backends/VHDL/vhdl_ast.ml
74

  
75
Mini_vhdl ast:
76
##############
77

  
78
> src/backends/VHDL/mini_vhdl_ast.ml
79

  
80
Vhdl to Mini_vhdl transformation:
81
#################################
82

  
83
> src_backends/VHDL/vhdl_2_mini_vhdl_map.ml
84

  
85
Mini_vhdl to Lustre transformation:
86
###################################
87

  
88
> src/tools/importer/mini_vhdl_2_lustre.ml
89

  
90
This file contains a class providing mappings from mini_vhdl_ast data structure and lustre data structure.
91
The starting point of the generation is provided in this file:
92
- Lustre nodes (top_decl_desc) are produced for each mini_vhdl_component_t object and mini_vhdl_package_t object. See mini_vhdl_component_t and mini_vhdl_package_t methods.
93
- Lustre equations (statement) are produced for each mini_vhdl_concurrent_stmt_t (Process). See mini_vhdl_concurrent_stmt_t and mini_vhdl_component_instantiation_t methods.
94

  
95
What needs to be done now, is to generate correct and complete lustre elements for process, component instantiation, architecture, boolean expressions, if-then-else expression, signal assignment.
96

  
97
This shall be sufficient for a starting point and the generation of lustre code for the two_counters example.

Also available in: Unified diff