Project

General

Profile

Download (1.64 KB) Statistics
| Branch: | Tag: | Revision:
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
  | LocalVar of var_decl
13
  | StateVar of var_decl
14
  | Fun of ident * value_t list
15
  | Array of value_t list
16
  | Access of value_t * value_t
17
  | Power of value_t * value_t
18

    
19
type instr_t =
20
  {
21
    instr_desc: instr_t_desc; (* main data: the content *)
22
    (* lustre_expr: expr option; (* possible representation as a lustre expression *) *)
23
    lustre_eq: eq option;     (* possible representation as a lustre flow equation *)
24
  }
25
and instr_t_desc =
26
  | MLocalAssign of var_decl * value_t
27
  | MStateAssign of var_decl * value_t
28
  | MReset of ident
29
  | MNoReset of ident
30
  | MStep of var_decl list * ident * value_t list
31
  | MBranch of value_t * (label * instr_t list) list
32
  | MComment of string
33

    
34
      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

    
43
type static_call = top_decl * (Dimension.dim_expr list)
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: node_annot option;
55
  mannot: expr_annot list;
56
}
(42-42/73)