Skip to content
Snippets Groups Projects
Commit 2650f12b authored by erwan's avatar erwan
Browse files

Make sure that int2real and real2int are translated into ec code that ecexe understand.

parent 969d070c
No related branches found
No related tags found
No related merge requests found
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
......
(* 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"
......
(** 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
......
(* 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
(*---------------------------------------------------------------------
......
(** 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"
==> 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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment