diff --git a/_oasis b/_oasis index 534828e9a4fb4d55c8cee65a728fa8166cc77624..dbbac0ad171ef5cbede865860ac46046289d584e 100644 --- a/_oasis +++ b/_oasis @@ -1,6 +1,6 @@ OASISFormat: 0.4 Name: lustre-v6 -Version: 1.657 +Version: 1.659 Synopsis: The Lustre V6 Verimag compiler Description: This package contains: (1) lus2lic: the (current) name of the compiler (and interpreter via -exec). diff --git a/src/l2lNoWhenNot.ml b/src/l2lNoWhenNot.ml index 488a0518a1a96b7d8b5b1786ac21054cc72c43aa..acada301642af37c3a272c7f1f9aced0b782cc55 100644 --- a/src/l2lNoWhenNot.ml +++ b/src/l2lNoWhenNot.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 26/08/2016 (at 15:31) by Erwan Jahier> *) +(** Time-stamp: <modified the 30/08/2016 (at 14:18) by Erwan Jahier> *) open Lxm open Lic @@ -25,11 +25,11 @@ type acc = let new_var cv type_eff clock_eff clk_tbl = try Hashtbl.find clk_tbl cv, true with Not_found -> + let id = Lv6Id.of_string (FreshName.local_var cv) in Lv6Verbose.exe ~flag:dbg (fun() -> Printf.printf - "L2lNoWhenNot: '%s' not found; create a var\n" cv); - let id = Lv6Id.of_string (FreshName.local_var cv) in + "L2lNoWhenNot: negation of '%s' not found; create %s\n" cv id); let var = { var_name_eff = id; var_nature_eff = AstCore.VarLocal; @@ -227,25 +227,21 @@ and (do_node : LicPrg.t -> Lic.node_exp -> Lic.node_exp) = acc b.asserts_eff in - let (nv,neqs,nass,tbl) = acc in - let nlocs = match n.loclist_eff with - | None -> nv (* SNO, but eats no bread *) - | Some v -> List.rev_append nv v - in let uvi = update_var_info_list n.lxm in let inlist_eff,acc = List.fold_left uvi ([],acc) n.inlist_eff in let outlist_eff,acc = List.fold_left uvi ([],acc) n.outlist_eff in - let loclist_eff,acc = List.fold_left uvi ([],acc) nlocs in + let locs = match n.loclist_eff with Some x -> x | None -> [] in + let loclist_eff,acc = List.fold_left uvi ([],acc) locs in + let (nv,neqs,nass,tbl) = acc in + let nlocs = List.rev_append nv loclist_eff in { n with def_eff = BodyLic { eqs_eff = neqs; asserts_eff = nass }; inlist_eff = List.rev inlist_eff; outlist_eff = List.rev outlist_eff; - loclist_eff = Some (List.rev loclist_eff) + loclist_eff = Some (List.rev nlocs) },acc in - let n,(_,_,_,tbl) = aux licprg n ([],[],[],tbl) in let n,acc = aux licprg n ([],[],[],tbl) in - (* do it twice to make sure they are all substituted *) n (* exported *) diff --git a/src/l2lWhenOnId.ml b/src/l2lWhenOnId.ml index 853eb00130189dafa7fe176c826de47a5a023088..da21228b3905c5f3a93c015a6e84e7b4878d28f0 100644 --- a/src/l2lWhenOnId.ml +++ b/src/l2lWhenOnId.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 26/08/2016 (at 15:27) by Erwan Jahier> *) +(** Time-stamp: <modified the 30/08/2016 (at 14:18) by Erwan Jahier> *) open Lxm open Lic @@ -238,25 +238,21 @@ and (do_node : LicPrg.t -> Lic.node_exp -> Lic.node_exp) = acc b.asserts_eff in - let (nv,neqs,nass,tbl) = acc in - let nlocs = match n.loclist_eff with - | None -> nv (* SNO, but eats no bread *) - | Some v -> List.rev_append nv v - in let uvi = update_var_info_list n.lxm in let inlist_eff,acc = List.fold_left uvi ([],acc) n.inlist_eff in let outlist_eff,acc = List.fold_left uvi ([],acc) n.outlist_eff in - let loclist_eff,acc = List.fold_left uvi ([],acc) nlocs in + let locs = match n.loclist_eff with Some x -> x | None -> [] in + let loclist_eff,acc = List.fold_left uvi ([],acc) locs in + let (nv,neqs,nass,tbl) = acc in + let nlocs = List.rev_append nv loclist_eff in { n with def_eff = BodyLic { eqs_eff = neqs; asserts_eff = nass }; inlist_eff = List.rev inlist_eff; outlist_eff = List.rev outlist_eff; - loclist_eff = Some (List.rev loclist_eff) + loclist_eff = Some (List.rev nlocs) },acc in - let n,(_,_,_,tbl) = aux licprg n ([],[],[],tbl) in let n,acc = aux licprg n ([],[],[],tbl) in - (* do it twice to make sure they are all substituted *) n (* exported *) diff --git a/src/lv6Compile.ml b/src/lv6Compile.ml index 778b52af035c9fd64ad7facb4c928c2a9c97730c..ef55bab6fad6e391b6af8e2dcf4ac4daf237c683 100644 --- a/src/lv6Compile.ml +++ b/src/lv6Compile.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 26/08/2016 (at 15:07) by Erwan Jahier> *) +(* Time-stamp: <modified the 26/08/2016 (at 15:39) by Erwan Jahier> *) open Lxm open Lv6errors @@ -189,13 +189,15 @@ let (get_source_list : Lv6MainArgs.t -> string list -> AstV6.pack_or_model list) if opt.Lv6MainArgs.tlex then test_lex lexbuf; match (lus_load lexbuf) with | PRPackBody(incl_files, pbdy) -> incl_files, [Unpacked pbdy] - | PRPack_or_models(incl_files, nsl) -> incl_files, (List.map (fun ns -> Packed ns) nsl) + | PRPack_or_models(incl_files, nsl) -> + incl_files, (List.map (fun ns -> Packed ns) nsl) in (* If included files have a relative path, strange things may happen. Hence we make the path absolute, using the directory of the includer. *) let includer_dir = Filename.dirname infile in - let fix_dir f = if Filename.is_relative f then Filename.concat includer_dir f else f in + let fix_dir f = if Filename.is_relative f then + Filename.concat includer_dir f else f in let incl_files = List.map fix_dir incl_files in incl_files, l in @@ -234,7 +236,8 @@ let (get_source_list : Lv6MainArgs.t -> string list -> AstV6.pack_or_model list) let first_file = assert (infile_list <> []); List.hd infile_list in let included_files, first_pack = get_one_source first_file in let (pack_list, _compiled_files, included_files) = - get_remaining_source_list (first_pack, [first_file], (List.tl infile_list) @ included_files) + get_remaining_source_list (first_pack, [first_file], + (List.tl infile_list) @ included_files) in let _ = assert (included_files=[]) in let packed_list, unpacked_list = @@ -257,16 +260,20 @@ let (get_source_list : Lv6MainArgs.t -> string list -> AstV6.pack_or_model list) (* Let's perform some clashes checks *) if Hashtbl.mem tbl x then let ybis = Hashtbl.find tbl x in - print_string ("*** Error: "^(Lv6Id.to_string x)^" is defined twice: \n\t" ^ + print_string ("*** Error: "^(Lv6Id.to_string x)^ + " is defined twice: \n\t" ^ (Lxm.details y.src) ^ "\n\t" ^ (Lxm.details ybis.src) ^ ".\n"); exit 2 else Hashtbl.add tbl x y in - Hashtbl.iter (fun x y -> add pbody_acc.pk_const_table x y) pbody.pk_const_table; - Hashtbl.iter (fun x y -> add pbody_acc.pk_type_table x y) pbody.pk_type_table; - Hashtbl.iter (fun x y -> add pbody_acc.pk_node_table x y) pbody.pk_node_table; + Hashtbl.iter (fun x y -> add pbody_acc.pk_const_table x y) + pbody.pk_const_table; + Hashtbl.iter (fun x y -> add pbody_acc.pk_type_table x y) + pbody.pk_type_table; + Hashtbl.iter (fun x y -> add pbody_acc.pk_node_table x y) + pbody.pk_node_table; Some { pbody_acc with pk_def_list=pbody_acc.pk_def_list@pbody.pk_def_list; } diff --git a/src/lv6MainArgs.ml b/src/lv6MainArgs.ml index 04d9d58d6faf47be5c0982a2a676cbe7de819b42..81ab7f106fcf85e00249868900a8f753b8714206 100644 --- a/src/lv6MainArgs.ml +++ b/src/lv6MainArgs.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 26/08/2016 (at 15:04) by Erwan Jahier> *) +(* Time-stamp: <modified the 26/08/2016 (at 16:57) by Erwan Jahier> *) (* Le manager d'argument adapté de celui de lutin, plus joli N.B. solution un peu batarde : les options sont stockées, comme avant, dans Global, @@ -246,7 +246,6 @@ let set_ec_options opt = global_opt.no_when_not <- true; global_opt.no_prefix <- true; opt.expand_nodes <- true; - opt.optim_ite <- false ; (* because merge won't work *) () (*** USER OPTIONS TAB **) @@ -521,13 +520,15 @@ let mkoptab (opt:t) : unit = ( mkopt opt ~doc_level:Dev ["--gen-autotest"] (Arg.Unit (fun () -> opt.gen_autotest <- true)) - ["Generate a Lutin Stimulator and a Lustre oracle to compare the result of 2 Lustre compilers"] + ["Generate a Lutin Stimulator and a Lustre oracle to compare the "; + "result of 2 Lustre compilers"] ; (* misc debug flag *) mkopt opt ~doc_level:Advanced ["-dbg"; "--debug"] (Arg.Symbol - ( Lv6Verbose.flag_list (), fun s -> let f = Lv6Verbose.get_flag s in Lv6Verbose.set_flag f)) + ( Lv6Verbose.flag_list (), + fun s -> let f = Lv6Verbose.get_flag s in Lv6Verbose.set_flag f)) [ "<dbg_flag>"; "Possible dbg_flag are: " ^(String.concat ", " (Lv6Verbose.flag_list())) ] ) diff --git a/src/lv6version.ml b/src/lv6version.ml index 84d1bc3708c047e128e5e5b4232b4ca76aefa130..34c6731dd99e3e392ce88ae22893c518857c3a2d 100644 --- a/src/lv6version.ml +++ b/src/lv6version.ml @@ -1,7 +1,7 @@ (** Automatically generated from Makefile *) let tool = "lus2lic" let branch = "master" -let commit = "657" -let sha_1 = "1a153291f645c667cb3189a1f1352817bf316944" +let commit = "659" +let sha_1 = "45552c629fedcb120c3fa59e5a71293bce192ec7" let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")") let maintainer = "jahier@imag.fr" diff --git a/test/lus2lic.sum b/test/lus2lic.sum index aa0d6b9a1ca2eb3e059d80d4ae0684f280ed69de..ebecc9090baf7c0626cf79e93d4e093180f4d352 100644 --- a/test/lus2lic.sum +++ b/test/lus2lic.sum @@ -1,5 +1,5 @@ ==> lus2lic0.sum <== -Test Run By jahier on Tue Jun 14 15:32:44 +Test Run By jahier on Tue Aug 30 14:29:56 Native configuration is x86_64-unknown-linux-gnu === lus2lic0 tests === @@ -64,7 +64,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus ==> lus2lic1.sum <== -Test Run By jahier on Tue Jun 14 15:32:44 +Test Run By jahier on Tue Aug 30 14:29:57 Native configuration is x86_64-unknown-linux-gnu === lus2lic1 tests === @@ -397,7 +397,7 @@ PASS: gcc -o multipar.exec multipar_multipar.c multipar_multipar_loop.c PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {} ==> lus2lic2.sum <== -Test Run By jahier on Tue Jun 14 15:33:01 +Test Run By jahier on Tue Aug 30 14:30:14 Native configuration is x86_64-unknown-linux-gnu === lus2lic2 tests === @@ -743,7 +743,7 @@ PASS: gcc -o zzz2.exec zzz2_zzz2.c zzz2_zzz2_loop.c PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {} ==> lus2lic3.sum <== -Test Run By jahier on Tue Jun 14 15:33:37 +Test Run By jahier on Tue Aug 30 14:30:52 Native configuration is x86_64-unknown-linux-gnu === lus2lic3 tests === @@ -1249,7 +1249,7 @@ PASS: ./myec2c {-o multipar.c multipar.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {} ==> lus2lic4.sum <== -Test Run By jahier on Tue Jun 14 15:33:49 +Test Run By jahier on Tue Aug 30 14:31:04 Native configuration is x86_64-unknown-linux-gnu === lus2lic4 tests === @@ -1773,14 +1773,14 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {} # of unexpected failures 4 =============================== # Total number of failures: 26 -lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds -lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 17 seconds -lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 36 seconds -lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 12 seconds +lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds +lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 16 seconds +lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 37 seconds +lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 11 seconds lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 39 seconds * Ref time: -0.04user 0.03system 1:44.23elapsed 0%CPU (0avgtext+0avgdata 5148maxresident)k -0inputs+0outputs (0major+5598minor)pagefaults 0swaps +0.07user 0.02system 1:46.41elapsed 0%CPU (0avgtext+0avgdata 5560maxresident)k +128inputs+0outputs (0major+6076minor)pagefaults 0swaps * Quick time (-j 4): -0.04user 0.01system 0:56.78elapsed 0%CPU (0avgtext+0avgdata 5152maxresident)k -32inputs+0outputs (0major+5619minor)pagefaults 0swaps +0.06user 0.01system 0:50.20elapsed 0%CPU (0avgtext+0avgdata 5680maxresident)k +64inputs+0outputs (0major+6069minor)pagefaults 0swaps