diff --git a/_oasis b/_oasis index d3279d7b7b9738b4556c5c2bc2cb5908f26e068c..0550e5d08185a149d1d37cd78d971ea1dca7fcf5 100644 --- a/_oasis +++ b/_oasis @@ -1,6 +1,6 @@ OASISFormat: 0.4 Name: lustre-v6 -Version: 1.733 +Version: 1.734 Synopsis: The Lustre V6 Verimag compiler Description: This package contains: - lus2lic: the (current) name of the compiler (and interpreter via -exec) diff --git a/lv6-ref-man/lv6-ref-man.pdf b/lv6-ref-man/lv6-ref-man.pdf index 257468bad6c412ace3d0b5f91ba69184c6718b3d..ccdca251d1a74a2caec8b1ec24706eb9b337e1b3 100644 Binary files a/lv6-ref-man/lv6-ref-man.pdf and b/lv6-ref-man/lv6-ref-man.pdf differ diff --git a/src/lic2soc.ml b/src/lic2soc.ml index 16cde1989e934797d7174779e99190aa4b854d27..bbba7cd1687b9285264e4670c210dcf391007d2e 100644 --- a/src/lic2soc.ml +++ b/src/lic2soc.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 11/09/2017 (at 16:47) by Erwan Jahier> *) +(** Time-stamp: <modified the 21/03/2018 (at 17:22) by Erwan Jahier> *) (* XXX ce module est mal écrit. A reprendre. (R1) *) @@ -803,6 +803,7 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = let soc = { Soc.key = soc_key ; Soc.profile = soc_profile_of_node node; + Soc.clock_profile = []; Soc.instances = inst ; Soc.step = [ { @@ -864,6 +865,7 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = let soc = { Soc.key = soc_key; Soc.profile = soc_profile_of_node node; + Soc.clock_profile = []; Soc.instances = instances ; Soc.step = [step]; Soc.memory = Soc.No_mem; @@ -903,6 +905,7 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = let soc = { Soc.key = soc_key; Soc.profile = soc_profile_of_node node; + Soc.clock_profile = []; Soc.instances = instances ; Soc.step = [ { @@ -946,6 +949,7 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = let soc = { Soc.key = soc_key; Soc.profile = soc_profile_of_node node; + Soc.clock_profile = []; Soc.instances = [] ; Soc.step = [ { @@ -976,6 +980,7 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = let soc = { Soc.key = soc_key; Soc.profile = soc_profile_of_node node; + Soc.clock_profile = []; Soc.instances = [] ; Soc.step = [step]; Soc.memory = diff --git a/src/lv6version.ml b/src/lv6version.ml index 5fb6102904ba5ccd698aab7226a46261a82fc614..ebfbf033fb3d9aad46d00bdcf670ec2062128904 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 = "733" -let sha_1 = "8fd1d262784f8a40fdde9b9fdb1345b4fad850c0" +let commit = "734" +let sha_1 = "342785b6636005cf00391b5d7cabf55334790a59" let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")") let maintainer = "erwan.jahier@univ-grenoble-alpes.fr" diff --git a/src/soc.ml b/src/soc.ml index 3e83bca7abe3de949e34874bb3e853eb8e30b796..cd9d1e4c4b2ffff807fbe5717c2dfb9c37a8f9f4 100644 --- a/src/soc.ml +++ b/src/soc.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 03/07/2017 (at 10:15) by Erwan Jahier> *) +(* Time-stamp: <modified the 21/03/2018 (at 17:17) by Erwan Jahier> *) (** Synchronous Object Component *) @@ -88,6 +88,8 @@ type memory = type t = { key : key; profile : var list * var list; + clock_profile : (var * (var * Lv6Id.long)) list; + (* associate to (profile) var a clock, if not on base *) step : step_method list; (* the order in the list is a valid w.r.t. the partial order defined in precedences *) precedences : precedence list; (* partial order over step methods *) diff --git a/src/soc2c.ml b/src/soc2c.ml index adfecb88451a8956d4ff6b302d0ce43306a2d5fc..db5fb2589349d5bb6f21e9c881b7e384e737baef 100644 --- a/src/soc2c.ml +++ b/src/soc2c.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 22/02/2018 (at 15:48) by Erwan Jahier> *) +(* Time-stamp: <modified the 22/03/2018 (at 08:43) by Erwan Jahier> *) (* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *) @@ -605,6 +605,7 @@ let (gen_loop_file : LicPrg.t -> Soc.t -> string -> out_channel -> Soc.tbl -> un let outputs_io = SocVar.expand_profile true false outputs in let inputs_exp = SocVar.expand_profile true true inputs in let outputs_exp= SocVar.expand_profile true true outputs in + Lv6util.entete oc "/*" "*/"; putc (" #include <stdlib.h> @@ -735,14 +736,17 @@ int main(){ ++_s; "); List.iter (fun (id,t) -> - let t = type_to_string2 t in - let str = - if io_transmit_mode () = Lv6MainArgs.Stack - then Printf.sprintf " %s = _get_%s(\"%s\");\n" id t id - else Printf.sprintf " ctx->%s = _get_%s(\"%s\");\n" id t id - in - putc str - ) + let t = type_to_string2 t in + let clk = "" in (* XXX finish me: get the clock if id using soc.clock_profile + and set this string to something like "if (clk_id)" + *) + let str = + if io_transmit_mode () = Lv6MainArgs.Stack + then Printf.sprintf " %s %s = _get_%s(\"%s\");\n" clk id t id + else Printf.sprintf " %s ctx->%s = _get_%s(\"%s\");\n" clk id t id + in + putc str + ) inputs_exp; let inputs_fmt = List.map (fun (_,t) -> type_to_format_string t) inputs_io in let outputs_fmt = List.map (fun (_,t) -> type_to_format_string t) outputs_io in diff --git a/src/socPredef.ml b/src/socPredef.ml index c7e6205e3a54900f8eb06317e33ff51ba4747132..2f3966cacd005def5b7affda45cbe4e5249611ad 100644 --- a/src/socPredef.ml +++ b/src/socPredef.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 06/09/2017 (at 16:45) by Erwan Jahier> *) +(* Time-stamp: <modified the 21/03/2018 (at 17:21) by Erwan Jahier> *) (** Synchronous Object Code for Predefined operators. *) @@ -57,6 +57,7 @@ let step21 lxm impl str = { (* a useful alias again *) let make_soc key profile steps = { key = key; profile = profile; + clock_profile = []; instances = []; (* init = None; *) precedences = []; @@ -92,6 +93,7 @@ let of_fby_soc_key :Lxm.t -> Soc.var_expr -> Soc.key -> Soc.t = { key = sk; profile = prof; + clock_profile = []; instances = []; memory = Mem t; (* so that pre_mem exist *) step = [ @@ -187,6 +189,7 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = { key = sk; profile = (sp tl); + clock_profile = []; instances = []; memory = Mem (t); step = [ @@ -219,6 +222,7 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = { key = sk; profile = (sp tl); + clock_profile = []; instances = []; memory = Mem (t); (* so that pre_mem exist *) step = [ @@ -249,6 +253,7 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = { key = sk; profile = prof; + clock_profile = []; instances = []; step = [ { @@ -266,6 +271,7 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = | "Lustre::if" -> { key = sk; profile = (sp tl); + clock_profile = []; instances = []; (* init = None; *) precedences = []; @@ -292,6 +298,7 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = { Soc.key = sk; Soc.profile = sp_nary tl; + Soc.clock_profile = []; Soc.instances = [] ; Soc.step = [ { @@ -318,6 +325,7 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = { Soc.key = sk; Soc.profile = sp_nary tl; + Soc.clock_profile = []; Soc.instances = [] ; Soc.step = [ { @@ -399,6 +407,7 @@ let make_array_slice_soc : Lxm.t -> Lic.slice_info -> int -> Data.t -> Soc.t = key = ("Lustre::array_slice", key_prof, Slic(si.Lic.se_first,si.Lic.se_last,si.Lic.se_step)); profile = (["i1", array_type_in], ["out", array_type_out]); + clock_profile = []; instances = []; step = [ { @@ -428,6 +437,7 @@ let make_array_soc: Lxm.t -> int -> Data.t -> Soc.t = { key = ("Lustre::array", key_prof, Nomore); profile = (iprof, ["out", array_type]); + clock_profile = []; instances = []; step = [ { @@ -451,6 +461,7 @@ let make_array_concat_soc: Lxm.t -> int -> int -> Data.t -> Soc.t = { key = ("Lustre::concat", key_prof, Nomore); profile = iprof; + clock_profile = []; instances = []; step = [ { @@ -476,6 +487,7 @@ let make_hat_soc: Lxm.t -> int -> Data.t -> Soc.t = { key = ("Lustre::hat", [t;array_type], Nomore); profile = ([("i1", t)], ["out", array_type]); + clock_profile = []; instances = []; step = [ { diff --git a/src/socVar.ml b/src/socVar.ml index 88460b6e3d04c045243b40ed493dfcd663ffe172..dc2cc10435f362c287b9028eb3040e1beaa0e7fe 100644 --- a/src/socVar.ml +++ b/src/socVar.ml @@ -1,9 +1,9 @@ -(* Time-stamp: <modified the 07/01/2015 (at 11:21) by Erwan Jahier> *) +(* Time-stamp: <modified the 21/03/2018 (at 17:30) by Erwan Jahier> *) open Data let rec (expand_profile : bool -> bool -> Soc.var list -> Soc.var list) = - fun enum_flag c_access vl -> + fun enum_flag c_access vl -> let res = List.flatten (List.map (expand_var enum_flag c_access) vl) in (* fix point. now useless ? *) if List.length res = List.length vl then res else diff --git a/src/socVar.mli b/src/socVar.mli index 4decbb75b63e2366ead28607ab1a6f0daf4b2f00..f7532ff6cb6e8f3f5cacf4055017d56a71f4d0cb 100644 --- a/src/socVar.mli +++ b/src/socVar.mli @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 10/06/2014 (at 10:44) by Erwan Jahier> *) +(* Time-stamp: <modified the 21/03/2018 (at 17:30) by Erwan Jahier> *) (** Expand struct and arrays when communicating with the outside world *) @@ -9,6 +9,7 @@ If the second one is true, we generate var name that actually corresponds to their access in C. For instance, an array element that is itself in a structure would be named "S.f[3]" instead of "S_f_3" + XXX should be 2 functions: expand_profile and expand_profile_for_c *) val expand_profile : bool -> bool -> Soc.var list -> Soc.var list diff --git a/test/lus2lic.sum b/test/lus2lic.sum index e4b6f823ce6b1e1a9206d3b7ef3d7877c64b067d..958eedb0d502ef8c3deb8628cdb91459715f9848 100644 --- a/test/lus2lic.sum +++ b/test/lus2lic.sum @@ -1,5 +1,5 @@ ==> lus2lic0.sum <== -Test Run By jahier on Mon Dec 18 11:21:09 +Test Run By jahier on Thu Mar 22 08:50:03 Native configuration is x86_64-unknown-linux-gnu === lus2lic0 tests === @@ -66,7 +66,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 Mon Dec 18 11:21:09 +Test Run By jahier on Thu Mar 22 08:50:04 Native configuration is x86_64-unknown-linux-gnu === lus2lic1 tests === @@ -409,7 +409,7 @@ PASS: sh multipar.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {} ==> lus2lic2.sum <== -Test Run By jahier on Mon Dec 18 11:21:52 +Test Run By jahier on Thu Mar 22 08:50:46 Native configuration is x86_64-unknown-linux-gnu === lus2lic2 tests === @@ -749,7 +749,7 @@ PASS: sh zzz2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {} ==> lus2lic3.sum <== -Test Run By jahier on Mon Dec 18 11:22:40 +Test Run By jahier on Thu Mar 22 08:51:30 Native configuration is x86_64-unknown-linux-gnu === lus2lic3 tests === @@ -1258,7 +1258,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {} ==> lus2lic4.sum <== -Test Run By jahier on Mon Dec 18 11:23:37 +Test Run By jahier on Thu Mar 22 08:52:29 Native configuration is x86_64-unknown-linux-gnu === lus2lic4 tests === @@ -1775,14 +1775,14 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {} # of unexpected failures 6 =============================== # Total number of failures: 13 -lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds -lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 43 seconds -lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 48 seconds -lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 57 seconds -lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 35 seconds +lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds +lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 42 seconds +lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 44 seconds +lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 59 seconds +lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 31 seconds * Ref time: -126.14user 22.51system 3:02.98elapsed 81%CPU (0avgtext+0avgdata 61268maxresident)k -0inputs+5218848outputs (0major+13040413minor)pagefaults 0swaps +118.72user 26.88system 2:57.25elapsed 82%CPU (0avgtext+0avgdata 283400maxresident)k +8inputs+6007488outputs (0major+21724435minor)pagefaults 0swaps * Quick time (-j 4): -155.06user 25.88system 2:09.34elapsed 139%CPU (0avgtext+0avgdata 61300maxresident)k -0inputs+5180480outputs (0major+12978447minor)pagefaults 0swaps +167.43user 35.36system 2:25.12elapsed 139%CPU (0avgtext+0avgdata 283240maxresident)k +5256inputs+5874296outputs (11major+21309306minor)pagefaults 0swaps