Project

General

Profile

Revision 54d032f5 src/machine_code.ml

View differences:

src/machine_code.ml
133 133
let dummy_var_decl name typ =
134 134
  {
135 135
    var_id = name;
136
    var_orig = false;
136 137
    var_dec_type = dummy_type_dec;
137 138
    var_dec_clock = dummy_clock_dec;
138 139
    var_dec_const = false;
......
327 328
let reset_instance node args i r c =
328 329
  match r with
329 330
  | None        -> []
330
  | Some (x, l) -> [control_on_clock node args c (MBranch (translate_ident node args x, [l, [MReset i]]))]
331
  | Some r      -> let g = translate_guard node args r in
332
                   [control_on_clock node args c (conditional g [MReset i] [])]
331 333

  
332 334
let translate_eq node ((m, si, j, d, s) as args) eq =
333 335
  (*Format.eprintf "translate_eq %a with clock %a@." Printers.pp_node_eq eq Clocks.print_ck eq.eq_rhs.expr_clock;*)
......
366 368
      node_f,
367 369
      NodeDep.filter_static_inputs (node_inputs node_f) el in 
368 370
    let o = new_instance node node_f eq.eq_rhs.expr_tag in
369
    let call_ck = Clocks.new_var true in
371
    let env_cks = List.fold_right (fun arg cks -> arg.expr_clock :: cks) el [eq.eq_rhs.expr_clock] in
372
    let call_ck = Clock_calculus.compute_root_clock (Clock_predef.ck_tuple env_cks) in
373
    (*Clocks.new_var true in
370 374
    Clock_calculus.unify_imported_clock (Some call_ck) eq.eq_rhs.expr_clock eq.eq_rhs.expr_loc;
375
    Format.eprintf "call %a: %a: %a@," Printers.pp_expr eq.eq_rhs Clocks.print_ck (Clock_predef.ck_tuple env_cks) Clocks.print_ck call_ck;*)
371 376
    (m,
372 377
     (if Stateless.check_node node_f then si else MReset o :: si),
373 378
     Utils.IMap.add o call_f j,

Also available in: Unified diff