Project

General

Profile

« Previous | Next » 

Revision fc36d0a0

Added by Xavier Thirioux over 1 year ago

added some cleaning about hash-tables used for typing, clocking, etc.

View differences:

src/backends/C/c_backend_makefile.ml
49 49
  let compiled_dep = compiled_dependencies dep in
50 50
  (* Format.eprintf "Compiled Deps: %a@." pp_deps compiled_dep; *)
51 51
 
52
  List.iter (fun s -> Log.report ~level:1 (fun fmt -> fprintf fmt "Adding dependency: %s@." s);  
52
  List.iter (fun s -> Log.report ~level:3 (fun fmt -> fprintf fmt "Adding dependency: %s@." s);  
53 53
    fprintf fmt "\t${GCC} -I${INC} -c %s@." s)
54 54
    (("${INC}/io_frontend.c"):: (* IO functions when a main function is computed *)
55 55
	(List.map 
src/checks/algebraicLoop.ml
141 141
  Log.report ~level:3
142 142
    (fun fmt -> Format.fprintf fmt "@[<v 2>Fast revalidation: normalization + schedulability@ ");
143 143
  Options.verbose_level := !Options.verbose_level - 2;
144
  
145
  Global.initialize ();
146
  Corelang.add_internal_funs ();
144 147

  
145 148
  (* Mini stage 1 *)
146 149
  (* Extracting dependencies: fill some table with typing info *)
147 150
  ignore (Compiler_common.import_dependencies prog);
148 151
  (* Local inlining *)
149 152
  let prog = Inliner.local_inline prog (* type_env clock_env *) in
153
  Log.report ~level:3
154
    (fun fmt -> Format.fprintf fmt "Inlined prog: %a@." Printers.pp_prog prog);
150 155
  (* Checking stateless/stateful status *)
151 156
  if Plugins.check_force_stateful () then
152 157
    Compiler_common.force_stateful_decls prog
......
311 316
  let open Format in
312 317
  fprintf fmt "@[<v 0>";
313 318
  fprintf fmt "variables in the alg. loop: @[<hov 0>%a@]@ "
314
    (fprintf_list ~sep:",@ " pp_print_string) partition;
319
    (fprintf_list ~sep:",@ " pp_print_string) partition; 
315 320
  fprintf fmt "@ involved node calls: @[<v 0>%a@]@ "
316 321
    (fprintf_list ~sep:",@ "
317 322
       (fun fmt ((funid, expr, eq), status) ->
src/global.ml
16 16
let initialize () =
17 17
  begin
18 18
    main_node := !Options.main_node;
19
    type_env  := Basic_library.type_env;
20
    clock_env := Basic_library.clock_env;
19 21
  end
20 22

  
21 23
(* Local Variables: *)
src/typing.ml
267 267
    (* Expected type ty1, got type ty2 *)
268 268
    let try_unify ?(sub=false) ?(semi=false) ty1 ty2 loc =
269 269
      try
270
        (*Format.eprintf "try_unify %B %B %a %a@." sub semi print_ty ty1 print_ty ty2;*)
270 271
        unify ~sub:sub ~semi:semi ty1 ty2
271 272
      with
272 273
      | Unify _ ->
......
531 532
           expr.expr_type <- Expr_type_hub.export typ_out;
532 533
           typ_out
533 534
      in 
534
      Log.report ~level:3 (fun fmt -> Format.fprintf fmt "Type of expr %a: %a@." Printers.pp_expr expr (* Types. *)print_ty resulting_ty);
535
      Log.report ~level:4 (fun fmt -> Format.fprintf fmt "Type of expr %a: %a@." Printers.pp_expr expr (* Types. *)print_ty resulting_ty);
535 536
      resulting_ty
536 537

  
537 538
    and type_branches ?(is_annot=false) env in_main loc const hl =
......
625 626
      | _                   -> ()
626 627

  
627 628
    let type_var_decl vd_env env vdecl =
628
      (*Format.eprintf "Typing.type_var_decl START %a:%a@." Printers.pp_var vdecl Printers.print_dec_ty vdecl.var_dec_type.ty_dec_desc;*)
629
      (*Format.eprintf "Typing.type_var_decl START %a in %a@." Printers.pp_var vdecl (Env.pp_env print_ty) env;*)
629 630
      check_type_declaration vdecl.var_loc vdecl.var_dec_type.ty_dec_desc;
631
      
630 632
      let eval_const id = (* Types. *)get_static_value (Env.lookup_value env id) in
631 633
      let type_dim d =
632 634
        begin
......
634 636
          Dimension.eval Basic_library.eval_env eval_const d;
635 637
        end in
636 638
      let ty = type_coretype type_dim vdecl.var_dec_type.ty_dec_desc in
637

  
638 639
      let ty_static =
639 640
        if vdecl.var_dec_const
640 641
        then (* Type_predef. *)type_static (Dimension.mkdim_var ()) ty
......
645 646
      try_unify ty_static (Expr_type_hub.import vdecl.var_type) vdecl.var_loc;
646 647
      let new_env = Env.add_value env vdecl.var_id ty_static in
647 648
      type_coreclock (new_env,vd_env) vdecl.var_dec_clock vdecl.var_id vdecl.var_loc;
648
      (*Format.eprintf "END %a@." Types.print_ty ty_static;*)
649
      (*Format.eprintf "END@.";*)
649 650
      new_env
650 651

  
651 652
    let type_var_decl_list vd_env env l =
......
675 676
    (** [type_node env nd loc] types node [nd] in environment env. The
676 677
    location is used for error reports. *)
677 678
    let type_node env nd loc =
679
      (*Log.report ~level:3 (fun fmt -> Format.fprintf fmt "Typing node %s in %a@." nd.node_id (Env.pp_env print_ty) env);*)
678 680
      let is_main = nd.node_id = !Options.main_node in
679 681
      let vd_env_ol = nd.node_outputs@nd.node_locals in
680 682
      let vd_env =  nd.node_inputs@vd_env_ol in
681 683
      check_vd_env vd_env;
684
      
682 685
      let init_env = env in
683 686
      let delta_env = type_var_decl_list vd_env init_env nd.node_inputs in
684 687
      let delta_env = type_var_decl_list vd_env delta_env nd.node_outputs in

Also available in: Unified diff