Project

General

Profile

Revision a1daa793 src/causality.ml

View differences:

src/causality.ml
216 216
    | Expr_fby (e1, e2)  -> add_dep true lhs e2 (add_dep false lhs e1 g)
217 217
    | Expr_pre e      -> add_dep true lhs e g
218 218
    | Expr_ident x -> add_var lhs_is_mem lhs x (add_clock lhs_is_mem lhs rhs.expr_clock g)
219
    | Expr_access (e1, _)
220
    | Expr_power (e1, _) -> add_dep lhs_is_mem lhs e1 g
219
    | Expr_access (e1, d)
220
    | Expr_power (e1, d) -> add_dep lhs_is_mem lhs e1 (add_dep lhs_is_mem lhs (expr_of_dimension d) g)
221 221
    | Expr_array a -> List.fold_right (add_dep lhs_is_mem lhs) a g
222 222
    | Expr_tuple t -> List.fold_right2 (fun l r -> add_dep lhs_is_mem [l] r) lhs t g
223 223
    | Expr_merge (c, hl) -> add_var lhs_is_mem lhs c (List.fold_right (fun (_, h) -> add_dep lhs_is_mem lhs h) hl g)
......
526 526
    IdentDepGraph.iter_edges (fun s t -> IdentDepGraph.add_edge g1 s t) g2
527 527
  end
528 528

  
529
let world = "!!_world"
530

  
529 531
let add_external_dependency outputs mems g =
530
  let caller ="!!_world" in
531 532
  begin
532
    IdentDepGraph.add_vertex g caller;
533
    ISet.iter (fun o -> IdentDepGraph.add_edge g caller o) outputs;
534
    ISet.iter (fun m -> IdentDepGraph.add_edge g caller m) mems;
533
    IdentDepGraph.add_vertex g world;
534
    ISet.iter (fun o -> IdentDepGraph.add_edge g world o) outputs;
535
    ISet.iter (fun m -> IdentDepGraph.add_edge g world m) mems;
535 536
  end
536 537

  
537 538
let global_dependency node =

Also available in: Unified diff