1 |
8446bf03
|
ploc
|
(************ 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 |
c35de73b
|
ploc
|
| Var of var_decl
|
13 |
8446bf03
|
ploc
|
| 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 |
9b0432bc
|
Corentin Lauverjat
|
[@@deriving show]
|
18 |
8446bf03
|
ploc
|
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 |
1fd3d002
|
ploc
|
| MSpec of string
|
33 |
9b0432bc
|
Corentin Lauverjat
|
[@@deriving show]
|
34 |
f4cba4b8
|
ploc
|
type step_t = {
|
35 |
|
|
step_checks: (Location.t * value_t) list;
|
36 |
|
|
step_inputs: var_decl list;
|
37 |
|
|
step_outputs: var_decl list;
|
38 |
|
|
step_locals: var_decl list;
|
39 |
|
|
step_instrs: instr_t list;
|
40 |
|
|
step_asserts: value_t list;
|
41 |
|
|
}
|
42 |
9b0432bc
|
Corentin Lauverjat
|
[@@deriving show]
|
43 |
089f94be
|
ploc
|
type static_call = top_decl * (Dimension.dim_expr list)
|
44 |
9b0432bc
|
Corentin Lauverjat
|
[@@deriving show]
|
45 |
f4cba4b8
|
ploc
|
|
46 |
089f94be
|
ploc
|
type machine_t = {
|
47 |
|
|
mname: node_desc;
|
48 |
|
|
mmemory: var_decl list;
|
49 |
|
|
mcalls: (ident * static_call) list; (* map from stateful/stateless instance to node, no internals *)
|
50 |
|
|
minstances: (ident * static_call) list; (* sub-map of mcalls, from stateful instance to node *)
|
51 |
|
|
minit: instr_t list;
|
52 |
|
|
mstatic: var_decl list; (* static inputs only *)
|
53 |
|
|
mconst: instr_t list; (* assignments of node constant locals *)
|
54 |
|
|
mstep: step_t;
|
55 |
f4cba4b8
|
ploc
|
mspec: node_spec_t option;
|
56 |
089f94be
|
ploc
|
mannot: expr_annot list;
|
57 |
9b0432bc
|
Corentin Lauverjat
|
msch: Scheduling_type.schedule_report option; [@opaque] (* Equations scheduling *)
|
58 |
089f94be
|
ploc
|
}
|
59 |
9b0432bc
|
Corentin Lauverjat
|
[@@deriving show]
|