Project

General

Profile

Revision b1a97ade

View differences:

src/causality.ml
390 390
    match vdecls with
391 391
    | []         -> ()
392 392
    | vdecl :: q -> begin
393
		      Hashtbl.add map vdecl.var_id (List.fold_left (fun r v -> if Clocks.disjoint v.var_clock vdecl.var_clock then v::r else r) [] q);
393
		      Hashtbl.add map vdecl.var_id (List.fold_left (fun r v -> if Clocks.disjoint v.var_clock vdecl.var_clock then v.var_id::r else r) [] q);
394 394
                      add_vdecl map q
395 395
		    end
396 396

  
397
  let build_clock_map vdecls =
397
  let clock_disjoint_map vdecls =
398 398
    let root_branch vdecl = Clocks.root vdecl.var_clock, Clocks.branch vdecl.var_clock in
399 399
    let map = Hashtbl.create 23 in
400 400
    begin
401 401
      add_vdecl map (List.sort (fun v1 v2 -> compare (root_branch v1) (root_branch v2)) vdecls);
402 402
      map
403 403
    end
404

  
405
  let pp_disjoint_map fmt map =
406
    begin
407
      Format.fprintf fmt "{ /* disjoint map */@.";
408
      Hashtbl.iter (fun k v -> Format.fprintf fmt "%s # { %a }@." k (Utils.fprintf_list ~sep:", " Format.pp_print_string) v) map;
409
      Format.fprintf fmt "}@."
410
    end
404 411
end
405 412

  
406 413
let pp_dep_graph fmt g =
......
415 422
    (fprintf_list ~sep:"->" pp_print_string) trace
416 423

  
417 424
(* Merges elements of graph [g2] into graph [g1] *)
418
  let merge_with g1 g2 =
425
let merge_with g1 g2 =
419 426
    IdentDepGraph.iter_vertex (fun v -> IdentDepGraph.add_vertex g1 v) g2;
420 427
    IdentDepGraph.iter_edges (fun s t -> IdentDepGraph.add_edge g1 s t) g2
421 428

  
src/clocks.ml
354 354
  in
355 355
  let (a,b) = aux ck in
356 356
  simplify_rat (a,b)
357
    
357

  
358
let eq_carrier cr1 cr2 =
359
  match (carrier_repr cr1).carrier_desc, (carrier_repr cr2).carrier_desc with
360
 | Carry_const id1, Carry_const id2 -> id1 = id2
361
 | _                                -> cr1.carrier_id = cr2.carrier_id
362

  
358 363
(* Returns the clock root of a clock *)
359 364
let rec root ck =
360 365
  match (repr ck).cdesc with
......
379 384
 match br1, br2 with
380 385
 | []          , _
381 386
 | _           , []           -> false
382
 | (cr1,l1)::q1, (cr2,l2)::q2 -> cr1 = cr2 && ((l1 <> l2) || disjoint_branches q1 q2);;
387
 | (cr1,l1)::q1, (cr2,l2)::q2 -> eq_carrier cr1 cr2 && ((l1 <> l2) || disjoint_branches q1 q2);;
383 388

  
384 389
(* Disjunction relation between variables based upon their static clocks. *)
385 390
let disjoint ck1 ck2 =
src/scheduling.ml
113 113
    let death = Liveness.death_table n gg sort in
114 114
    Log.report ~level:5 (fun fmt -> Format.eprintf "death table for node %s: %a" n'.node_id Liveness.pp_death_table death);
115 115

  
116
    let disjoint = Disjunction.clock_disjoint_map (node_vars n) in
117
    Log.report ~level:5 (fun fmt -> Format.eprintf "clock disjoint map for node %s: %a" n'.node_id Disjunction.pp_disjoint_map disjoint);
118

  
116 119
    let reuse = Liveness.reuse_policy n sort death in
117 120
    Log.report ~level:5 (fun fmt -> Format.eprintf "reuse policy for node %s: %a" n'.node_id Liveness.pp_reuse_policy reuse);
118 121
 

Also available in: Unified diff