Project

General

Profile

Revision 45c13277 src/main_lustre_compiler.ml

View differences:

src/main_lustre_compiler.ml
260 260
     and warns about unused input or memory variables *)
261 261
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. scheduling@,");
262 262
  let prog, node_schs = Scheduling.schedule_prog prog in
263
  Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_warning_unused node_schs);
264
  Log.report ~level:2 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_schedule node_schs);
265
  Log.report ~level:2 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_fanin_table node_schs);
266
  Log.report ~level:2 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Printers.pp_prog prog);
263
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_warning_unused node_schs);
264
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_schedule node_schs);
265
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_fanin_table node_schs);
266
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Printers.pp_prog prog);
267 267

  
268 268
 (* Optimization of prog: 
269 269
    - Unfold consts 
......
279 279
  (* DFS with modular code generation *)
280 280
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. machines generation@,");
281 281
  let machine_code = Machine_code.translate_prog prog node_schs in
282
 (* experimental
283
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. machines optimization@,");
284
  let machine_code = Machine_code.prog_reuse_var machine_code node_schs in
285
  *)
286
  Log.report ~level:2 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@,"
287
    (Utils.fprintf_list ~sep:"@ " Machine_code.pp_machine)
288
    machine_code);
289 282

  
290
 
291 283
  (* Optimize machine code *)
292 284
  let machine_code = 
293
    if !Options.optimization >= 2 then
294
      Optimize_machine.optimize_machines machine_code
285
    if !Options.optimization >= 3 then
286
      begin
287
	Log.report ~level:1 (fun fmt -> fprintf fmt ".. machines optimization@,");
288
	Optimize_machine.machines_reuse_variables machine_code node_schs
289
      end
295 290
    else
296 291
      machine_code
297
  in
298
  
292
 in
293
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@,"
294
  (Utils.fprintf_list ~sep:"@ " Machine_code.pp_machine)
295
  machine_code);
296

  
299 297
  (* Creating destination directory if needed *)
300 298
  if not (Sys.file_exists !Options.dest_dir) then (
301 299
    Log.report ~level:1 (fun fmt -> fprintf fmt ".. creating destination directory@,");

Also available in: Unified diff