Project

General

Profile

Revision 29f59e36 src/main_lustre_compiler.ml

View differences:

src/main_lustre_compiler.ml
174 174
  if !Options.ansi then Causality.NodeDep.compute_generic_calls prog;
175 175
  (*Hashtbl.iter (fun id td -> match td.Corelang.top_decl_desc with Corelang.Node nd -> Format.eprintf "%s calls %a" id Causality.NodeDep.pp_generic_calls nd | _ -> ()) Corelang.node_table;*)
176 176

  
177
  if !Options.scopes_mode then (
178
    if !Options.main_node = "" then failwith "Main node is required for scopes option";
179
    Scopes.compute_all_scopes prog;
180
    (* Printing scopes *)
181
    if !Options.show_scopes then (
182
      Format.printf "Possible scopes are:@.%a@."
183
	Scopes.print_all_scopes ();
184
      exit 0;
185
    );
186
  );
187

  
177 188
  (* Normalization phase *)
178 189
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. normalization@,");
179 190
  (* Special treatment of arrows in lustre backend. We want to keep them *)
......
181 192
    Normalization.unfold_arrow_active := false;
182 193
  let prog = Normalization.normalize_prog prog in
183 194
  Log.report ~level:2 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Printers.pp_prog prog);
184

  
185 195
  (* Checking array accesses *)
186 196
  if !Options.check then
187 197
    begin
......
191 201

  
192 202
  (* Computation of node equation scheduling. It also breaks dependency cycles
193 203
     and warns about unused input or memory variables *)
194
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. scheduling@,");
204
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. scheduling@,@?");
195 205
  let prog, node_schs = Scheduling.schedule_prog prog in
196 206
  Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_warning_unused node_schs);
197 207
  Log.report ~level:3 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Scheduling.pp_schedule node_schs);
......
208 218
    else
209 219
      prog
210 220
  in
211

  
212 221
  (* DFS with modular code generation *)
213 222
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. machines generation@,");
214 223
  let machine_code = Machine_code.translate_prog prog node_schs in
......
237 246
  (Utils.fprintf_list ~sep:"@ " Machine_code.pp_machine)
238 247
  machine_code);
239 248

  
249
  if !Options.scopes_mode then (
250
    Scopes.check_scopes prog machine_code  
251
  );
252

  
240 253
  (* Printing code *)
241 254
  let basename    =  Filename.basename basename in
242 255
  let destname = !Options.dest_dir ^ "/" ^ basename in

Also available in: Unified diff