Project

General

Profile

Download (7.35 KB) Statistics
| Branch: | Tag: | Revision:
1 50a8778a Lélio Brun
open Utils
2 a7062da6 Lélio Brun
open Format
3
open Lustre_types
4
open Machine_code_types
5 50a8778a Lélio Brun
6 cc852504 Lélio Brun
val pp_file_decl : formatter -> ident -> int -> unit
7
8
val pp_file_open : formatter -> ident -> int -> string
9
10
val pp_put_var : formatter -> string -> ident -> Types.t -> ident -> unit
11
12
val pp_ptr : formatter -> ident -> unit
13
14
val pp_machine_set_reset_name : formatter -> ident -> unit
15
16
val pp_machine_clear_reset_name : formatter -> ident -> unit
17
18
val pp_machine_init_name : formatter -> ident -> unit
19
20
val pp_machine_clear_name : formatter -> ident -> unit
21
22
val pp_machine_step_name : formatter -> ident -> unit
23
24
val pp_machine_alloc_name : formatter -> ident -> unit
25
26 d978c46e Lélio Brun
val pp_machine_static_alloc_name : ?ghost:bool -> formatter -> ident -> unit
27 cc852504 Lélio Brun
28
val pp_machine_dealloc_name : formatter -> ident -> unit
29
30
val pp_global_init_name : formatter -> ident -> unit
31
32
val pp_global_clear_name : formatter -> ident -> unit
33
34 d978c46e Lélio Brun
val pp_machine_static_declare_name : ?ghost:bool -> formatter -> ident -> unit
35 cc852504 Lélio Brun
36 d978c46e Lélio Brun
val pp_machine_static_link_name : ?ghost:bool -> formatter -> ident -> unit
37 cc852504 Lélio Brun
38
val pp_global_init_prototype : formatter -> ident -> unit
39
40
val pp_global_clear_prototype : formatter -> ident -> unit
41
42
val pp_alloc_prototype : formatter -> ident * var_decl list -> unit
43
44
val pp_dealloc_prototype : formatter -> ident -> unit
45
46
val pp_import_prototype : formatter -> dep_t -> unit
47
48
val pp_import_alloc_prototype : formatter -> dep_t -> unit
49
50
val pp_c_var_read :
51
  ?test_output:bool -> machine_t -> formatter -> var_decl -> unit
52
53
val pp_c_var_write : machine_t -> formatter -> var_decl -> unit
54
55
val pp_c_var :
56
  machine_t ->
57
  ident ->
58
  (formatter -> var_decl -> unit) ->
59
  formatter ->
60
  var_decl ->
61
  unit
62
63
val pp_c_dimension : formatter -> Dimension.t -> unit
64
65
val pp_label : formatter -> label -> unit
66
67
val pp_c_tag : formatter -> label -> unit
68
69
val pp_reset_assign : ident -> formatter -> bool -> unit
70
71
val pp_assign :
72
  machine_t ->
73
  ident ->
74
  (formatter -> var_decl -> unit) ->
75
  formatter ->
76
  var_decl * value_t ->
77
  unit
78
79
val pp_c_type :
80 5b98398a Lélio Brun
  ?var_is_contract:bool ->
81 cc852504 Lélio Brun
  ?pp_c_basic_type_desc:(Types.t -> string) ->
82
  ?var_opt:var_decl ->
83
  ident ->
84
  formatter ->
85
  Types.t ->
86
  unit
87
88
val pp_basic_c_type :
89
  ?pp_c_basic_type_desc:(Types.t -> string) ->
90
  ?var_opt:var_decl ->
91
  formatter ->
92
  Types.t ->
93
  unit
94
95
val pp_machine_memtype_name : ?ghost:bool -> formatter -> ident -> unit
96
97
val pp_array_suffix : formatter -> ident list -> unit
98
99
val pp_print_version : formatter -> unit -> unit
100
101
val pp_machine_struct : ?ghost:bool -> formatter -> machine_t -> unit
102
103
val pp_reset_flag :
104
  ?indirect:bool -> (formatter -> 'a -> unit) -> formatter -> 'a -> unit
105
106
val pp_reset_flag' : ?indirect:bool -> formatter -> ident -> unit
107
108
val pp_machine_decl :
109
  ?ghost:bool -> (formatter -> 'a -> unit) -> formatter -> ident * 'a -> unit
110
111
val pp_machine_decl' : ?ghost:bool -> formatter -> ident * ident -> unit
112
113
val pp_file : ident -> formatter -> ident * ident -> unit
114
115
val pp_basic_lib_fun :
116
  bool -> ident -> (formatter -> 'a -> unit) -> formatter -> 'a list -> unit
117
118
val pp_c_decl_input_var : formatter -> var_decl -> unit
119 a7062da6 Lélio Brun
120
(* Prints a value expression [v], with internal function calls only. [pp_var] is
121
   a printer for variables (typically [pp_c_var_read]), but an offset suffix may
122
   be added for array variables *)
123 cc852504 Lélio Brun
val pp_c_val :
124 e77a0fa5 Lélio Brun
  ?indirect:bool ->
125 cc852504 Lélio Brun
  machine_t ->
126
  ident ->
127
  (formatter -> var_decl -> unit) ->
128
  formatter ->
129
  value_t ->
130
  unit
131 a7062da6 Lélio Brun
132 cc852504 Lélio Brun
(* Prints a constant value *)
133
val pp_c_const : formatter -> constant -> unit
134 a7062da6 Lélio Brun
135
(* Declaration of a local/mem variable: - if it's an array/matrix/etc, its
136
   size(s) should be known in order to statically allocate memory, so we print
137
   the full type *)
138 cc852504 Lélio Brun
val pp_c_decl_local_var :
139
  ?pp_c_basic_type_desc:(Types.t -> string) ->
140
  machine_t ->
141
  formatter ->
142
  var_decl ->
143
  unit
144 a7062da6 Lélio Brun
145
(* type directed initialization: useless wrt the lustre compilation model,
146
   except for MPFR injection, where values are dynamically allocated *)
147 cc852504 Lélio Brun
val pp_initialize :
148
  machine_t ->
149
  ident ->
150
  (formatter -> var_decl -> unit) ->
151
  formatter ->
152
  var_decl ->
153
  unit
154 a7062da6 Lélio Brun
155
(* type directed clear: useless wrt the lustre compilation model, except for
156
   MPFR injection, where values are dynamically allocated *)
157 cc852504 Lélio Brun
val pp_clear :
158
  machine_t ->
159
  ident ->
160
  (formatter -> var_decl -> unit) ->
161
  formatter ->
162
  var_decl ->
163
  unit
164 a7062da6 Lélio Brun
165 d978c46e Lélio Brun
val pp_static_declare_macro :
166
  ?ghost:bool -> formatter -> machine_t * ident * ident -> unit
167
168
val pp_static_link_macro :
169
  ?ghost:bool -> formatter -> machine_t * ident * ident -> unit
170
171
val pp_static_alloc_macro :
172
  ?ghost:bool -> formatter -> machine_t * ident * ident -> unit
173
174 cc852504 Lélio Brun
val mk_call_var_decl : Location.t -> ident -> var_decl
175 a7062da6 Lélio Brun
176 cc852504 Lélio Brun
val pp_c_basic_type_desc : Types.t -> string
177 a7062da6 Lélio Brun
178 cc852504 Lélio Brun
val has_c_prototype : ident -> dep_t list -> bool
179 a7062da6 Lélio Brun
180 cc852504 Lélio Brun
val reset_label : label
181 a7062da6 Lélio Brun
182
type loop_index = LVar of ident | LInt of int ref | LAcc of value_t
183
184 cc852504 Lélio Brun
val mk_loop_var : machine_t -> unit -> ident
185 a7062da6 Lélio Brun
186
(* Computes the list of nested loop variables together with their dimension
187
   bounds.
188
 *  - LInt r stands for loop expansion (no loop variable, but int loop
189
      index)
190
 *  - LVar v stands for loop variable v *)
191 cc852504 Lélio Brun
val mk_loop_variables :
192
  machine_t -> Types.t -> int -> (Dimension.t * loop_index) list
193 a7062da6 Lélio Brun
194 cc852504 Lélio Brun
val reset_loop_counter : unit -> unit
195 a7062da6 Lélio Brun
196 cc852504 Lélio Brun
val reorder_loop_variables :
197
  (Dimension.t * loop_index) list -> (Dimension.t * loop_index) list
198 a7062da6 Lélio Brun
199 cc852504 Lélio Brun
(* Prints a [value] of type [var_type] indexed by the suffix list [loop_vars] *)
200
val pp_value_suffix :
201
  ?indirect:bool ->
202
  machine_t ->
203
  ident ->
204
  Types.t ->
205
  (Dimension.t * loop_index) list ->
206
  (formatter -> var_decl -> unit) ->
207
  formatter ->
208
  value_t ->
209
  unit
210 a7062da6 Lélio Brun
211
(* Generation of a non-clashing name for the self memory variable (for step and
212
   reset functions) *)
213 cc852504 Lélio Brun
val mk_self : machine_t -> ident
214
215
val mk_mem : machine_t -> ident
216
217 4fef1a04 Lélio Brun
val mk_mem_c : machine_t -> ident
218
219 cc852504 Lélio Brun
val mk_mem_in : machine_t -> ident
220
221
val mk_mem_out : machine_t -> ident
222
223 4fef1a04 Lélio Brun
val mk_mem_in_c : machine_t -> ident
224
225
val mk_mem_out_c : machine_t -> ident
226
227 cc852504 Lélio Brun
val mk_mem_reset : machine_t -> ident
228 a7062da6 Lélio Brun
229
(* Generation of a non-clashing name for the attribute variable of static
230
   allocation macro *)
231 cc852504 Lélio Brun
val mk_attribute : machine_t -> ident
232 a7062da6 Lélio Brun
233
(* Generation of a non-clashing name for the instance variable of static
234
   allocation macro *)
235 cc852504 Lélio Brun
val mk_instance : machine_t -> ident
236 a7062da6 Lélio Brun
237 cc852504 Lélio Brun
val mpfr_vars : var_decl list -> var_decl list
238 a7062da6 Lélio Brun
239 cc852504 Lélio Brun
val mpfr_consts : const_desc list -> const_desc list
240 a7062da6 Lélio Brun
241 cc852504 Lélio Brun
val reset_flag_name : string
242 a7062da6 Lélio Brun
243 cc852504 Lélio Brun
val file_to_module_name : string -> string
244
245
val protect_filename : string -> string
246 a7062da6 Lélio Brun
247
(* Computes the depth to which multi-dimension array assignments should be
248
   expanded. It equals the maximum number of nested static array constructions
249
   accessible from root [v]. *)
250 cc852504 Lélio Brun
val expansion_depth : value_t -> int
251 a7062da6 Lélio Brun
252
module type MODIFIERS_GHOST_PROTO = sig
253
  val pp_ghost_parameters :
254
    ?cut:bool ->
255
    formatter ->
256
    (string * (formatter -> string -> unit)) list ->
257
    unit
258
end
259
260
module EmptyGhostProto : MODIFIERS_GHOST_PROTO
261
262 cc852504 Lélio Brun
module Protos (Mod : MODIFIERS_GHOST_PROTO) : sig
263 d978c46e Lélio Brun
  val pp_stateless_prototype :
264 cc852504 Lélio Brun
    formatter -> ident * var_decl list * var_decl list -> unit
265
266 d978c46e Lélio Brun
  val pp_clear_reset_prototype :
267 cc852504 Lélio Brun
    ident -> ident -> formatter -> ident * var_decl list -> unit
268
269 d978c46e Lélio Brun
  val pp_set_reset_prototype :
270 cc852504 Lélio Brun
    ident -> ident -> formatter -> ident * var_decl list -> unit
271
272 d978c46e Lélio Brun
  val pp_step_prototype :
273 cc852504 Lélio Brun
    ident -> ident -> formatter -> ident * var_decl list * var_decl list -> unit
274
275 d978c46e Lélio Brun
  val pp_init_prototype : ident -> formatter -> ident * var_decl list -> unit
276 cc852504 Lélio Brun
277 d978c46e Lélio Brun
  val pp_clear_prototype : ident -> formatter -> ident * var_decl list -> unit
278 a7062da6 Lélio Brun
end