Project

General

Profile

Revision eb9a8c3c src/scheduling.ml

View differences:

src/scheduling.ml
245 245
   node_schs
246 246

  
247 247

  
248
   (* Sort eqs according to schedule *)
249
(* Sort the set of equations of node [nd] according
250
   to the computed schedule [sch]
251
*)
252
let sort_equations_from_schedule nd sch =
253
  (* Format.eprintf "%s schedule: %a@." *)
254
  (* 		 nd.node_id *)
255
  (* 		 (Utils.fprintf_list ~sep:" ; " Scheduling.pp_eq_schedule) sch; *)
256
  let eqs, auts = get_node_eqs nd in
257
  assert (auts = []); (* Automata should be expanded by now *)
258
  let split_eqs = Splitting.tuple_split_eq_list eqs in
259
  let eqs_rev, remainder =
260
    List.fold_left
261
      (fun (accu, node_eqs_remainder) vl ->
262
       if List.exists (fun eq -> List.exists (fun v -> List.mem v eq.eq_lhs) vl) accu
263
       then
264
	 (accu, node_eqs_remainder)
265
       else
266
	 let eq_v, remainder = find_eq vl node_eqs_remainder in
267
	 eq_v::accu, remainder
268
      )
269
      ([], split_eqs)
270
      sch
271
  in
272
  begin
273
    if List.length remainder > 0 then (
274
      let eqs, auts = get_node_eqs nd in
275
      assert (auts = []); (* Automata should be expanded by now *)
276
      Format.eprintf "Equations not used are@.%a@.Full equation set is:@.%a@.@?"
277
		     Printers.pp_node_eqs remainder
278
      		     Printers.pp_node_eqs eqs;
279
      assert false);
280
    List.rev eqs_rev
281
  end
282

  
248 283
(* Local Variables: *)
249 284
(* compile-command:"make -C .." *)
250 285
(* End: *)

Also available in: Unified diff