1
|
(************ Machine code types *************)
|
2
|
open Lustre_types
|
3
|
|
4
|
type value_t =
|
5
|
{
|
6
|
value_desc: value_t_desc;
|
7
|
value_type: Types.type_expr;
|
8
|
value_annot: expr_annot option
|
9
|
}
|
10
|
and value_t_desc =
|
11
|
| Cst of constant
|
12
|
| Var of var_decl
|
13
|
| Fun of ident * value_t list
|
14
|
| Array of value_t list
|
15
|
| Access of value_t * value_t
|
16
|
| Power of value_t * value_t
|
17
|
|
18
|
type instr_t =
|
19
|
{
|
20
|
instr_desc: instr_t_desc; (* main data: the content *)
|
21
|
(* lustre_expr: expr option; (* possible representation as a lustre expression *) *)
|
22
|
lustre_eq: eq option; (* possible representation as a lustre flow equation *)
|
23
|
}
|
24
|
and instr_t_desc =
|
25
|
| MLocalAssign of var_decl * value_t
|
26
|
| MStateAssign of var_decl * value_t
|
27
|
| MReset of ident
|
28
|
| MNoReset of ident
|
29
|
| MStep of var_decl list * ident * value_t list
|
30
|
| MBranch of value_t * (label * instr_t list) list
|
31
|
| MComment of string
|
32
|
|
33
|
type step_t = {
|
34
|
step_checks: (Location.t * value_t) list;
|
35
|
step_inputs: var_decl list;
|
36
|
step_outputs: var_decl list;
|
37
|
step_locals: var_decl list;
|
38
|
step_instrs: instr_t list;
|
39
|
step_asserts: value_t list;
|
40
|
}
|
41
|
|
42
|
type static_call = top_decl * (Dimension.dim_expr list)
|
43
|
|
44
|
|
45
|
type machine_t = {
|
46
|
mname: node_desc;
|
47
|
mmemory: var_decl list;
|
48
|
mcalls: (ident * static_call) list; (* map from stateful/stateless instance to node, no internals *)
|
49
|
minstances: (ident * static_call) list; (* sub-map of mcalls, from stateful instance to node *)
|
50
|
minit: instr_t list;
|
51
|
mstatic: var_decl list; (* static inputs only *)
|
52
|
mconst: instr_t list; (* assignments of node constant locals *)
|
53
|
mstep: step_t;
|
54
|
mspec: contract_desc option;
|
55
|
mannot: expr_annot list;
|
56
|
msch: Scheduling_type.schedule_report option; (* Equations scheduling *)
|
57
|
}
|