1
|
open Vhdl_ast
|
2
|
|
3
|
type mini_vhdl_sequential_stmt_t =
|
4
|
| MiniVarAssign of {
|
5
|
label: vhdl_name_t option;
|
6
|
lhs: vhdl_name_t;
|
7
|
rhs: vhdl_expr_t }
|
8
|
| MiniSigSeqAssign of {
|
9
|
label: vhdl_name_t option;
|
10
|
lhs: vhdl_name_t;
|
11
|
rhs: vhdl_waveform_element_t list}
|
12
|
| MiniSigCondAssign of {
|
13
|
label: vhdl_name_t option;
|
14
|
lhs: vhdl_name_t;
|
15
|
rhs: vhdl_signal_condition_t list;
|
16
|
delay: vhdl_expr_t option}
|
17
|
| MiniSigSelectAssign of {
|
18
|
label: vhdl_name_t option;
|
19
|
lhs: vhdl_name_t;
|
20
|
sel: vhdl_expr_t;
|
21
|
branches: vhdl_signal_selection_t list;
|
22
|
delay: vhdl_expr_t option}
|
23
|
| MiniIf of {
|
24
|
label: vhdl_name_t option;
|
25
|
if_cases: mini_vhdl_if_case_t list;
|
26
|
default: mini_vhdl_sequential_stmt_t list}
|
27
|
| MiniCase of {
|
28
|
label: vhdl_name_t option;
|
29
|
guard: vhdl_expr_t;
|
30
|
branches: mini_vhdl_case_item_t list }
|
31
|
| MiniExit of {
|
32
|
label: vhdl_name_t option;
|
33
|
loop_label: string option;
|
34
|
condition: vhdl_expr_t option}
|
35
|
| MiniAssert of {
|
36
|
label: vhdl_name_t option;
|
37
|
cond: vhdl_expr_t;
|
38
|
report: vhdl_expr_t;
|
39
|
severity: vhdl_expr_t}
|
40
|
| MiniProcedureCall of {
|
41
|
label: vhdl_name_t option;
|
42
|
name: vhdl_name_t;
|
43
|
assocs: vhdl_assoc_element_t list }
|
44
|
| MiniWait
|
45
|
| MiniNull of {
|
46
|
label: vhdl_name_t option}
|
47
|
| MiniReturn of {
|
48
|
label: vhdl_name_t option;
|
49
|
expr: vhdl_expr_t option}
|
50
|
and mini_vhdl_if_case_t =
|
51
|
{
|
52
|
if_cond: vhdl_expr_t;
|
53
|
if_block_mini: mini_vhdl_sequential_stmt_t list;
|
54
|
}
|
55
|
and mini_vhdl_case_item_t =
|
56
|
{
|
57
|
when_cond: vhdl_expr_t list;
|
58
|
when_stmt_mini: mini_vhdl_sequential_stmt_t list;
|
59
|
}
|
60
|
|
61
|
and mini_vhdl_declaration_t =
|
62
|
| MiniVarDecl of {
|
63
|
names : vhdl_name_t list;
|
64
|
typ : vhdl_subtype_indication_t;
|
65
|
init_val : vhdl_expr_t
|
66
|
}
|
67
|
| MiniCstDecl of {
|
68
|
names : vhdl_name_t list;
|
69
|
typ : vhdl_subtype_indication_t;
|
70
|
init_val : vhdl_expr_t
|
71
|
}
|
72
|
| MiniSigDecl of {
|
73
|
names : vhdl_name_t list;
|
74
|
typ : vhdl_subtype_indication_t;
|
75
|
init_val : vhdl_expr_t
|
76
|
}
|
77
|
| MiniComponentDecl of {
|
78
|
name: vhdl_name_t;
|
79
|
generics: vhdl_port_t list;
|
80
|
ports: vhdl_port_t list;
|
81
|
}
|
82
|
| MiniSubprogram of {
|
83
|
spec: vhdl_subprogram_spec_t;
|
84
|
decl_part: mini_vhdl_declaration_t list;
|
85
|
stmts: mini_vhdl_sequential_stmt_t list
|
86
|
}
|
87
|
|
88
|
and mini_vhdl_declarative_item_t =
|
89
|
{
|
90
|
use_clause: vhdl_load_t option;
|
91
|
declaration: mini_vhdl_declaration_t option;
|
92
|
definition: vhdl_definition_t option;
|
93
|
}
|
94
|
|
95
|
and mini_vhdl_component_instantiation_t =
|
96
|
{
|
97
|
ci_name: vhdl_name_t;
|
98
|
archi: vhdl_architecture_t;
|
99
|
entity: vhdl_entity_t;
|
100
|
generic_map: vhdl_assoc_element_t list;
|
101
|
port_map: vhdl_assoc_element_t list;
|
102
|
}
|
103
|
|
104
|
and mini_vhdl_process_t =
|
105
|
{
|
106
|
id: vhdl_name_t;
|
107
|
p_declarations: mini_vhdl_declarative_item_t list;
|
108
|
active_sigs: vhdl_name_t list;
|
109
|
p_body: mini_vhdl_sequential_stmt_t list;
|
110
|
postponed: bool;
|
111
|
label: vhdl_name_t option
|
112
|
}
|
113
|
|
114
|
and mini_vhdl_concurrent_stmt_t =
|
115
|
| MiniProcess of mini_vhdl_process_t
|
116
|
| MiniComponentInst of mini_vhdl_component_instantiation_t
|
117
|
|
118
|
and mini_vhdl_package_t =
|
119
|
{
|
120
|
p_name: vhdl_name_t;
|
121
|
shared_defs: vhdl_definition_t list;
|
122
|
shared_decls: mini_vhdl_declaration_t list;
|
123
|
shared_uses: vhdl_load_t list;
|
124
|
}
|
125
|
|
126
|
and mini_vhdl_component_t =
|
127
|
{
|
128
|
names: vhdl_name_t list;
|
129
|
generics: vhdl_port_t list; (* From related 'entity' *)
|
130
|
ports: vhdl_port_t list; (* From related 'entity' *)
|
131
|
contexts: vhdl_load_t list; (* Related 'declarations' contexts + relatated entity contexts *)
|
132
|
c_declarations: mini_vhdl_declaration_t list; (* From inlined 'declarations' + entity.declaration *)
|
133
|
definitions: vhdl_definition_t list; (* From inlined 'declarations' + entity.declaration *)
|
134
|
c_body: mini_vhdl_concurrent_stmt_t list; (* + entity.stmts *)
|
135
|
}
|
136
|
|
137
|
and mini_vhdl_design_file_t =
|
138
|
{
|
139
|
components: mini_vhdl_component_t list;
|
140
|
packages: mini_vhdl_package_t list;
|
141
|
}
|
142
|
(*[@@deriving show { with_path = false }]*)
|
143
|
[@@deriving visitors { variety = "iter"; name = "mini_vhdl_iter"; ancestors = ["vhdl_iter"]; polymorphic = true }]
|