diff --git a/_oasis b/_oasis index 2085685f94aa514b99fda07ff266f92eeb2a43b1..d5ce33cfd6fd229f1726bc8a451c39c66f4975ca 100644 --- a/_oasis +++ b/_oasis @@ -1,6 +1,6 @@ OASISFormat: 0.4 Name: lustre-v6 -Version: 1.695 +Version: 1.696 Synopsis: The Lustre V6 Verimag compiler Description: This package contains: (1) lus2lic: the (current) name of the compiler (and interpreter via -exec). @@ -35,7 +35,7 @@ Executable "lus2lic.dbg" # to use ocamldebug: # - here: set CompiledObject from native to byte -# - from emacs: [M-x ocamldebug] ./main.byte +# - from emacs: [M-x ocamldebug] ~/lus2lic/_build/src/main.byte/main.byte # - from ocamldebug prompt: # cd test # set arg blabla diff --git a/src/astPredef.ml b/src/astPredef.ml index 41942ad664fbbb99bc3deacb4ad2a5482a477d7b..2b9fe9d5d534be3995731e7fc4d7aebec8a7c6af 100644 --- a/src/astPredef.ml +++ b/src/astPredef.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 26/02/2015 (at 11:25) by Erwan Jahier> *) +(* Time-stamp: <modified the 21/06/2017 (at 15:24) by Erwan Jahier> *) (** Predefined operators Type definition *) @@ -89,7 +89,7 @@ let op2string = function | RCONST_n id -> Lv6Id.to_string id | NOT_n -> "not" | REAL2INT_n -> "real2int" - | INT2REAL_n -> "int2real" + | INT2REAL_n -> "int2real" | AND_n -> "and" | OR_n -> "or" | XOR_n -> "xor" diff --git a/src/lic2soc.ml b/src/lic2soc.ml index a436074d70c2268a9679cbd8350309bd9cd990c9..02595679172eb4b3735e57eb4d11ee2462c1b5a6 100644 --- a/src/lic2soc.ml +++ b/src/lic2soc.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 21/04/2017 (at 17:28) by Erwan Jahier> *) +(** Time-stamp: <modified the 21/06/2017 (at 10:20) by Erwan Jahier> *) (* XXX ce module est mal écrit. A reprendre. (R1) *) @@ -738,10 +738,10 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = "*** "^ (LicDump.string_of_node_key_rec false nk) ^ " not defined (as lic).\n" ^ "*** Defined nodes are:"^ - (String.concat ",\n" - (List.map (fun (nk,_) -> - "\""^LicDump.string_of_node_key_rec false nk - ^"\"") + (String.concat + ",\n" + (List.map (fun (nk,_) -> + "\""^LicDump.string_of_node_key_rec false nk ^"\"") (LicPrg.list_nodes prog))) ); assert false diff --git a/src/licDump.ml b/src/licDump.ml index b93bae586329a16436089d25b0b3993f5c54ca02..de1180d0adaa0b6969da43ac25ec2141189be428 100644 --- a/src/licDump.ml +++ b/src/licDump.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 20/06/2017 (at 17:13) by Erwan Jahier> *) +(* Time-stamp: <modified the 21/06/2017 (at 15:27) by Erwan Jahier> *) open Lv6errors open Printf @@ -444,7 +444,7 @@ and (string_of_by_pos_op_eff: Lic.by_pos_op srcflagged -> Lic.val_exp list -> st | PREDEF_CALL(op), vel -> ( if AstPredef.is_a_predef_op (snd(fst op.it)) then let op_str = snd (fst op.it) in - let op_short_str = AstPredef.op2string (AstPredef.string_to_op op_str) in + let op_short_str = op2string (AstPredef.string_to_op op_str) in if AstPredef.is_infix (AstPredef.string_to_op op_str) then ( match vel with | [ve1; ve2] -> @@ -833,6 +833,7 @@ and string_of_clock (ck : Lic.clock) = and op2string op = (* Une verrue pour être compatible avec les outils qui mangent du ec... *) if global_opt.ec && op = AstPredef.INT2REAL_n then "real" else + if global_opt.ec && op = AstPredef.REAL2INT_n then "int" else AstPredef.op2string op (*--------------------------------------------------------------------- diff --git a/src/lv6version.ml b/src/lv6version.ml index 5d5a579c804b367082cd91b3c65f6fbb6891b668..03786a134b76259d2fe520d902e4b2f5cb853d1c 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 = "695" -let sha_1 = "d58c6a13a0d4dfc0834d8b0d3712c089fdbad6ad" +let commit = "696" +let sha_1 = "969d070ce2d5e297c91633c77cc0014b2dc5b1f4" let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")") let maintainer = "jahier@imag.fr" diff --git a/test/lus2lic.sum b/test/lus2lic.sum index 5deb2bea9a81a4eae878e718f3db59679d378e13..4fbf275a88a0220ec9b3c783cec4d24f98b4b6e2 100644 --- a/test/lus2lic.sum +++ b/test/lus2lic.sum @@ -1,5 +1,5 @@ ==> lus2lic0.sum <== -Test Run By jahier on Tue Jun 20 18:01:41 +Test Run By jahier on Wed Jun 21 15:31:17 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 20 18:01:42 +Test Run By jahier on Wed Jun 21 15:31:18 Native configuration is x86_64-unknown-linux-gnu === lus2lic1 tests === @@ -217,6 +217,9 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c consensus2.lus {} PASS: ./lus2lic {-2c contractForElementSelectionInArray.lus -n contractForElementSelectionInArray} PASS: sh contractForElementSelectionInArray.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c contractForElementSelectionInArray.lus {} +PASS: ./lus2lic {-2c convert.lus -n convert} +PASS: sh convert.sh +PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c convert.lus {} PASS: ./lus2lic {-2c count.lus -n count} PASS: sh count.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c count.lus {} @@ -395,7 +398,7 @@ PASS: sh multipar.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {} ==> lus2lic2.sum <== -Test Run By jahier on Tue Jun 20 18:02:32 +Test Run By jahier on Wed Jun 21 15:32:09 Native configuration is x86_64-unknown-linux-gnu === lus2lic2 tests === @@ -735,7 +738,7 @@ PASS: sh zzz2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {} ==> lus2lic3.sum <== -Test Run By jahier on Tue Jun 20 18:03:28 +Test Run By jahier on Wed Jun 21 15:33:05 Native configuration is x86_64-unknown-linux-gnu === lus2lic3 tests === @@ -956,6 +959,10 @@ PASS: ./lus2lic {-o contractForElementSelectionInArray.lic contractForElementSel PASS: ./lus2lic {-ec -o contractForElementSelectionInArray.ec contractForElementSelectionInArray.lus} PASS: ./myec2c {-o contractForElementSelectionInArray.c contractForElementSelectionInArray.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node contractForElementSelectionInArray.lus {} +PASS: ./lus2lic {-o convert.lic convert.lus} +PASS: ./lus2lic {-ec -o convert.ec convert.lus} +PASS: ./myec2c {-o convert.c convert.ec} +PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node convert.lus {} PASS: ./lus2lic {-o count.lic count.lus} PASS: ./lus2lic {-ec -o count.ec count.lus} PASS: ./myec2c {-o count.c count.ec} @@ -1236,7 +1243,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {} ==> lus2lic4.sum <== -Test Run By jahier on Tue Jun 20 18:04:39 +Test Run By jahier on Wed Jun 21 15:34:21 Native configuration is x86_64-unknown-linux-gnu === lus2lic4 tests === @@ -1728,7 +1735,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {} === lus2lic1 Summary === -# of expected passes 315 +# of expected passes 318 # of unexpected failures 4 ==> lus2lic2.sum <== @@ -1741,7 +1748,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {} ==> lus2lic3.sum <== === lus2lic3 Summary === -# of expected passes 477 +# of expected passes 481 # of unexpected failures 10 # of unresolved testcases 1 @@ -1754,13 +1761,13 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {} =============================== # Total number of failures: 22 lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds -lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 50 seconds -lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 55 seconds +lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 51 seconds +lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 56 seconds lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 71 seconds -lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 47 seconds +lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 48 seconds * Ref time: -0.06user 0.01system 3:45.74elapsed 0%CPU (0avgtext+0avgdata 5628maxresident)k -64inputs+0outputs (0major+6118minor)pagefaults 0swaps +0.04user 0.02system 3:52.24elapsed 0%CPU (0avgtext+0avgdata 5656maxresident)k +32inputs+0outputs (0major+6158minor)pagefaults 0swaps * Quick time (-j 4): -0.06user 0.02system 1:42.58elapsed 0%CPU (0avgtext+0avgdata 5676maxresident)k -96inputs+0outputs (0major+6112minor)pagefaults 0swaps +0.04user 0.03system 1:42.32elapsed 0%CPU (0avgtext+0avgdata 5664maxresident)k +32inputs+0outputs (0major+6182minor)pagefaults 0swaps diff --git a/test/should_work/convert.lus b/test/should_work/convert.lus new file mode 100644 index 0000000000000000000000000000000000000000..303a16e68d0202fabcf55e777b32b10756678681 --- /dev/null +++ b/test/should_work/convert.lus @@ -0,0 +1,6 @@ +node convert(x:int; y:real) returns (a:int; b:real); +let + b = Lustre::int2real(x); + a = Lustre::real2int(y); +tel + -- end of convert \ No newline at end of file