Project

General

Profile

« Previous | Next » 

Revision 7ee5f69e

Added by LĂ©lio Brun 9 months ago

corrections on loggers + spec in AST

View differences:

src/compiler_stages.ml
32 32
          not lusic.Lusic.from_lusi)
33 33
    then
34 34
      begin
35
        Log.report ~level:1 (fun fmt -> fprintf fmt ".. generating compiled header file %s@," header_name);
35
        Log.report ~level:1 (fun fmt -> fprintf fmt "@ .. generating compiled header file %s@,"
36
                                header_name);
36 37
        Lusic.write_lusic
37 38
          from_lusi (* is it a lusi file ? *)
38 39
          (if from_lusi then prog else Lusic.extract_header dirname basename prog)
......
42 43
      end
43 44
    else (* Lusic exists and is usable. Checking compatibility *)
44 45
      begin
45
        Log.report ~level:1 (fun fmt -> fprintf fmt ".. loading compiled header file %s@," header_name);
46
        Log.report ~level:1 (fun fmt -> fprintf fmt "@ .. loading compiled header file %s@,"
47
                                header_name);
46 48
        let lusic = Lusic.read_lusic destname lusic_ext in
47 49
        Lusic.check_obsolete lusic destname;
48 50
        let header = lusic.Lusic.contents in
......
61 63

  
62 64
  (* Removing automata *)
63 65
  let prog = expand_automata prog in
64
  Log.report ~level:4 (fun fmt -> fprintf fmt ".. after automata expansion:@,  @[<v 2>@,%a@]@ " Printers.pp_prog prog);
66
  Log.report ~level:4 (fun fmt ->
67
      fprintf fmt "@[<v 2>.. after automata expansion:@ %a@]@ "
68
        Printers.pp_prog prog
69
        (* Utils.Format.pp_print_nothing () *)
70
    );
65 71

  
66 72
  (* Importing source *)
67 73
  let prog, dependencies, (typ_env, clk_env) = Modules.load ~is_header:(extension = ".lusi") prog in
......
78 84
  let prog = resolve_contracts prog in
79 85
  let prog = SortProg.sort prog in
80 86
  Log.report ~level:3 (fun fmt ->
81
      Format.fprintf fmt "@[<v 0>Contracts resolved:@ %a@ @]@ " Printers.pp_prog prog);
87
      Format.fprintf fmt "@ @[<v 2>.. contracts resolved:@ %a@ @]@ " Printers.pp_prog prog);
82 88

  
83 89
  (* Consolidating main node *)
84 90
  let _ =
......
201 207
  (* Machine_types.load prog; *)
202 208

  
203 209
  (* Normalization phase *)
204
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. normalization@,");
210
  Log.report ~level:1 (fun fmt -> fprintf fmt "@ .. normalization@ ");
205 211
  let prog = Normalization.normalize_prog params prog in
206
  Log.report ~level:2 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Printers.pp_prog_short prog);
207
  Log.report ~level:3  (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Printers.pp_prog prog);
212
  Log.report ~level:2 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@ "
213
                          Printers.pp_prog_short prog);
214
  Log.report ~level:3  (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@ "
215
                           Printers.pp_prog prog);
208 216
  
209 217
  (* Compatibility with Lusi *)
210 218
  (* If compiling a lusi, generate the lusic. If this is a lus file, Check the existence of a lusi (Lustre Interface file) *)
......
217 225
    if !Options.mpfr
218 226
    then
219 227
      begin
220
	Log.report ~level:1 (fun fmt -> fprintf fmt ".. targetting MPFR library@,");
228
	Log.report ~level:1 (fun fmt -> fprintf fmt "@ .. targetting MPFR library@,");
221 229
	Mpfr.inject_prog prog
222 230
      end
223 231
    else
224 232
      begin
225
	Log.report ~level:1 (fun fmt -> fprintf fmt ".. keeping floating-point numbers@,");
233
	Log.report ~level:1 (fun fmt -> fprintf fmt "@ .. keeping floating-point numbers@,");
226 234
	prog
227 235
      end in
228 236
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Printers.pp_prog prog);
......
230 238
  (* Checking array accesses *)
231 239
  if !Options.check then
232 240
    begin
233
      Log.report ~level:1 (fun fmt -> fprintf fmt ".. checking array accesses@,");
241
      Log.report ~level:1 (fun fmt -> fprintf fmt "@ .. checking array accesses@,");
234 242
      Access.check_prog prog;
235 243
    end;
236 244

  
......
244 252
let stage2 params prog =
245 253
  (* Computation of node equation scheduling. It also breaks dependency cycles
246 254
     and warns about unused input or memory variables *)
247
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. @[<v 2>scheduling@ ");
255
  Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v 2>.. scheduling@ ");
248 256
  let prog, node_schs =
249 257
    try
250 258
      Scheduling.schedule_prog prog
......
252 260
				 systemtic way in AlgebraicLoop module *)
253 261
      AlgebraicLoop.analyze prog
254 262
  in
255
  Log.report ~level:1 (fun fmt -> fprintf fmt "%a"              Scheduling.pp_warning_unused node_schs);
256
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_schedule node_schs);
257
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_fanin_table node_schs);
258
  Log.report ~level:5 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_dep_graph node_schs);
259
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Printers.pp_prog prog);
260
  Log.report ~level:1 (fun fmt -> fprintf fmt "@]@ ");
263
  Scheduling.(
264
    Log.report ~level:1 (fun fmt -> pp_warning_unused fmt node_schs);
265
    Log.report ~level:3 (fun fmt -> fprintf fmt "@ %a" pp_schedule node_schs);
266
    Log.report ~level:3 (fun fmt -> fprintf fmt "@ %a" pp_fanin_table node_schs);
267
    Log.report ~level:5 (fun fmt -> fprintf fmt "@ %a" pp_dep_graph node_schs);
268
    Log.report ~level:3 (fun fmt -> fprintf fmt "@ %a" Printers.pp_prog prog);
269
    Log.report ~level:1 (fun fmt -> fprintf fmt "@]@ "));
261 270

  
262 271
  (* TODO Salsa optimize prog:
263 272
     - emits warning for programs with pre inside expressions
......
265 274
     - introduce fresh local variables for each real pure subexpression
266 275
  *)
267 276
  (* DFS with modular code generation *)
268
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. machines generation@,");
277
  Log.report ~level:1 (fun fmt -> fprintf fmt "@ @[<v 2>.. machines generation@ ");
269 278
  let machine_code = Machine_code.translate_prog prog node_schs in
279
  Log.report ~level:1 (fun fmt -> fprintf fmt "@]");
270 280

  
271
  Log.report ~level:3 (fun fmt -> fprintf fmt ".. generated machines (unoptimized):@ %a@ " Machine_code_common.pp_machines machine_code);
281
  Log.report ~level:3 (fun fmt -> fprintf fmt "@ @[<v 2>.. generated machines (unoptimized):@ %a@]@ "
282
                          Machine_code_common.pp_machines machine_code);
272 283

  
273 284
  (* Optimize machine code *)
274 285
  Optimize_machine.optimize params prog node_schs machine_code

Also available in: Unified diff