Commit 3300825b authored by erwan's avatar erwan
Browse files

Update: enhance some error messages

parent db127044
Pipeline #70318 passed with stages
in 4 minutes and 21 seconds
(* Time-stamp: <modified the 15/03/2021 (at 12:28) by Erwan Jahier> *)
(* Time-stamp: <modified the 15/03/2021 (at 23:50) by Erwan Jahier> *)
open AstV6
open Lxm
......@@ -340,7 +340,7 @@ could try one the options: -2c, -2c-exec, -exec, -ec, -lic, or -h for more optio
print_runtime_error lxm "An assertion is violated in the Lustre program";
my_exit opt 1
| Failure msg ->
Printf.eprintf "\nRuntime Error: %s\n" msg;
Printf.eprintf "\nError: %s\n" msg;
my_exit opt 1
| Assert_failure (file, line, col) ->
prerr_string (
......
(* Time-stamp: <modified the 29/08/2019 (at 15:47) by Erwan Jahier> *)
(* Time-stamp: <modified the 22/03/2021 (at 16:37) by Erwan Jahier> *)
open Lxm
......@@ -222,7 +222,7 @@ let (mk_output_subst : local_ctx -> Lxm.t -> subst -> var_info list -> Lic.left
we create
- a fresh var "_v"
- define the equation "x.field = _v;"
- create the substition n_output_par/_v
- create the substitution n_output_par/_v
*)
let (aa,ae,av) = acc in
let new_base = get_new_base (Lic.clock_of_left left) (snd v.var_clock_eff) in
......@@ -239,7 +239,9 @@ let (mk_output_subst : local_ctx -> Lxm.t -> subst -> var_info list -> Lic.left
in
let new_base = match new_base_opt with
| Some x -> x
| None -> assert false (* a node outgth to have at least an input or an output *)
| None ->
raise (Lv6errors.Compile_error (
lxm, "a node ought to have at least one input or one output"))
in
s,acc,new_base
......
(* Time-stamp: <modified the 03/03/2020 (at 15:28) by Erwan Jahier> *)
(* Time-stamp: <modified the 07/05/2021 (at 10:11) by Erwan Jahier> *)
(*
Le manager d'argument adapt de celui de lutin, plus joli
N.B. solution un peu batarde : les options sont stockes, comme avant, dans Global,
......@@ -203,13 +203,13 @@ let dev_help opt ()= (
)
let unexpected s opt = (
prerr_string ("unexpected argument \""^s^"\"");
prerr_string ("Error: unexpected argument \""^s^"\"");
prerr_newline ();
usage stderr opt;
exit 1
)
let file_notfound f opt = (
prerr_string ("File not found: \""^f^"\"");
prerr_string ("Error: file not found: \""^f^"\"");
prerr_newline ();
usage stderr opt;
exit 1
......
==> lus2lic0.sum <==
Test run by jahier on Mon Mar 15 23:09:33
Test run by jahier on Thu Jul 1 10:56:43
Native configuration is x86_64-pc-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 Mar 15 23:09:34
Test run by jahier on Thu Jul 1 10:56:43
Native configuration is x86_64-pc-linux-gnu
=== lus2lic1 tests ===
......@@ -238,6 +238,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c cpt.lus {}
PASS: ./lus2lic {-2c cst.lus -n cst}
PASS: sh cst.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c cst.lus {}
PASS: ./lus2lic {-2c dadic.lus -n dadic}
PASS: ./lus2lic {-2c deSimone.lus -n deSimone}
PASS: sh deSimone.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c deSimone.lus {}
......@@ -413,7 +414,7 @@ PASS: ./lus2lic {-2c multipar.lus -n multipar}
PASS: sh multipar.sh
==> lus2lic2.sum <==
Test run by jahier on Mon Mar 15 23:10:02
Test run by jahier on Thu Jul 1 10:57:07
Native configuration is x86_64-pc-linux-gnu
=== lus2lic2 tests ===
......@@ -753,7 +754,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 Mar 15 23:10:38
Test run by jahier on Thu Jul 1 10:57:39
Native configuration is x86_64-pc-linux-gnu
=== lus2lic3 tests ===
......@@ -994,9 +995,10 @@ PASS: ./lus2lic {} {-lic -o cst.lic cst.lus -n cst}
PASS: ./lus2lic {-ec -o cst.ec cst.lus -n cst}
PASS: ./myec2c {-o cst.c cst.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node cst.lus {}
PASS: ./lus2lic { dadic.lv6} {-lic -o dadic_x5_a.lic dadic_x5_a.lus -n dadic_x5_a}
PASS: ./lus2lic { dadic.lv6} {-lic -o dadic_x5_b.lic dadic_x5_b.lus -n dadic_x5_b}
FAIL: without any option: ./lus2lic {} {-lic -o dadic_x5_c.lic dadic_x5_c.lus -n dadic_x5_c}
PASS: ./lus2lic {} {-lic -o dadic.lic dadic.lus -n dadic}
PASS: ./lus2lic {-ec -o dadic.ec dadic.lus -n dadic}
PASS: ./myec2c {-o dadic.c dadic.ec}
FAIL: without any option: ./lus2lic { dadic.lus} {-lic -o dadic_x5_c.lic dadic_x5_c.lus -n dadic_x5_c}
PASS: ./lus2lic {} {-lic -o deSimone.lic deSimone.lus -n deSimone}
PASS: ./lus2lic {-ec -o deSimone.ec deSimone.lus -n deSimone}
PASS: ./myec2c {-o deSimone.c deSimone.ec}
......@@ -1267,7 +1269,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <==
Test run by jahier on Mon Mar 15 23:11:23
Test run by jahier on Thu Jul 1 10:58:21
Native configuration is x86_64-pc-linux-gnu
=== lus2lic4 tests ===
......@@ -1759,11 +1761,11 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
# of expected failures 54
==> lus2lic1.sum <==
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus 34133 {}
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus 39847 {}
=== lus2lic1 Summary ===
# of expected passes 336
# of expected passes 337
==> lus2lic2.sum <==
......@@ -1775,7 +1777,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus 34133
==> lus2lic3.sum <==
=== lus2lic3 Summary ===
# of expected passes 497
# of expected passes 498
# of unexpected failures 3
# of unresolved testcases 1
......@@ -1787,14 +1789,14 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus 34133
# of unexpected failures 6
===============================
# Total number of failures: 10
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 28 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 36 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 45 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 26 seconds
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 24 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 32 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 41 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 23 seconds
* Ref time:
85.81user 18.64system 2:16.24elapsed 76%CPU (0avgtext+0avgdata 42376maxresident)k
0inputs+150784outputs (0major+8408425minor)pagefaults 0swaps
72.65user 16.39system 2:01.61elapsed 73%CPU (0avgtext+0avgdata 42048maxresident)k
0inputs+142488outputs (0major+8285622minor)pagefaults 0swaps
* Quick time (-j 4):
83.16user 16.25system 1:22.57elapsed 120%CPU (0avgtext+0avgdata 42428maxresident)k
6000inputs+148480outputs (8major+8310354minor)pagefaults 0swaps
94.72user 19.23system 0:48.77elapsed 233%CPU (0avgtext+0avgdata 42156maxresident)k
8inputs+120384outputs (1major+7050488minor)pagefaults 0swaps
......@@ -27,7 +27,7 @@ let
else
state { idy = ps.idy ; leader = ps.leader; level = ps.level };
tel
node simu(ck:bool^5) returns (s: state^n);
node bug_map_fby(ck:bool^5) returns (s: state^n);
var ps : state^n;
let
ps = map<<fby, 5>>(inits, s);
......
......@@ -2,7 +2,7 @@
dadic.lv6 version 1.00
******************************************************)
package Dadic
package dadic
provides
(* O : x -> 2*x *)
node O(x : bool) returns (y : bool);
......@@ -15,6 +15,9 @@ provides
(* Mult : const n, x -> n*x *)
node Mult<<const n : int>>(x : bool) returns (y : bool);
(* OfInt : const n -> x *)
(* for the nonreg test *)
node dadic(x : bool) returns (y : bool);
body
node O(x : bool) returns (y : bool);
......@@ -68,5 +71,6 @@ let
I(OfInt<<(n-1) div 2>>(true));
tel
node dadic = Mult<<42>>;
end
-- nonreg: dadic.lv6
node dadic_x5_a = Dadic::Mult<<5>>;
-- nonreg: dadic.lv6
package Toto1
provides
node x5(x:bool)returns (y:bool);
body
node x5 = Dadic::Mult<<5>>;
end
-- nonreg: dadic.lus
package Toto2
uses Dadic;
provides
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment