Project

General

Profile

Revision f4cba4b8 src/machine_code.ml

View differences:

src/machine_code.ml
375 375
  
376 376
  ctx, ctx0.s
377 377

  
378
 
378 379
let translate_decl nd sch =
379 380
  (* Extracting eqs, variables ..  *)
380 381
  let eqs, auts = get_node_eqs nd in
......
395 396
  let sorted_eqs = Scheduling.sort_equations_from_schedule eqs schedule in
396 397

  
397 398
  let ctx, ctx0_s = translate_core (assert_instrs@sorted_eqs) locals inout_vars in
398
(* CODE QUI MARCHE
399
  let constant_eqs = constant_equations locals in
400 399
  
401
  (* Compute constants' instructions  *)
402
  let ctx0 = translate_eqs env ctx_init constant_eqs in
403
  assert (VSet.is_empty ctx0.m);
404
  assert (ctx0.si = []);
405
  assert (Utils.IMap.is_empty ctx0.j);
406

  
407
  (* Compute ctx for all eqs *)
408
  let ctx = translate_eqs env ctx_init (assert_instrs@sorted_eqs) in
409
 *)
410 400
  
411
  (*
412
  (* Processing spec: locals would be actual locals of the spec while
413
     non locals would be inputs/ouptpus of the node. Locals of the
414
     node are not visible. *)
415
  let spec =
416
    match nd.node_spec with
417
    | None -> None
418
    | Some spec -> translate_spec inout_vars spec
419
  in
420

  
421

  
422
        inout_vars spec =
423
    let locals = VSet.of_list spec.locals in
424
    let spec_consts = VSet.of_list spec.consts in
425
    let other_spec_vars = VSet.union inout_vars spec_consts in
426
    let spec_env = build_env spec_locals other_spec_vars in
427
   *)             
401
 
428 402
  let mmap = Utils.IMap.elements ctx.j in
429 403
  {
430 404
    mname = nd;
......
454 428
        );
455 429
        step_asserts = List.map (translate_expr env) nd_node_asserts;
456 430
      };
431

  
432
    (* Processing spec: there is no processing performed here. Contract
433
     have been processed already. Either one of the other machine is a
434
     cocospec node, or the current one is a cocospec node. Contract do
435
     not contain any statement or import. *)
436
 
457 437
    mspec = nd.node_spec;
458 438
    mannot = nd.node_annot;
459 439
    msch = Some sch;
......
462 442
(** takes the global declarations and the scheduling associated to each node *)
463 443
let translate_prog decls node_schs =
464 444
  let nodes = get_nodes decls in
465
  List.map
445
  let machines =
446
    List.map
466 447
    (fun decl ->
467 448
     let node = node_of_top decl in
468 449
      let sch = Utils.IMap.find node.node_id node_schs in
469 450
      translate_decl node sch
470 451
    ) nodes
471

  
452
  in
453
  machines
472 454

  
473 455
(* Local Variables: *)
474 456
(* compile-command:"make -C .." *)

Also available in: Unified diff