Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
verimag
synchrone
lustre-v6
Commits
074961b4
Commit
074961b4
authored
May 05, 2022
by
erwan
Browse files
feat: add a --remove-nested-call option, and do not split expression by default
parent
b6403e90
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/l2lExpandMetaOp.ml
View file @
074961b4
(** Time-stamp: <modified the
29
/0
8
/20
19
(at
15
:4
2
) by Erwan Jahier> *)
(** Time-stamp: <modified the
05
/0
5
/20
22
(at
08
:4
0
) by Erwan Jahier> *)
open
Lxm
open
Lic
...
...
@@ -311,10 +311,11 @@ let (create_map_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_in
for all i = 0, ..., c-1; (Y1[i], ... ,Yl[i]) = N(X_1[i], ... ,X_k[i])
*)
let
iter_node
,
c
=
match
List
.
sort
compare
sargs
with
|
[
ConstStaticArgLic
(
_
,
Int_const_eff
(
c
))
;
NodeStaticArgLic
(
_
,_
node_key
)]
|
[
ConstStaticArgLic
(
_
,
Int_const_eff
(
c
));
TypeStaticArgLic
(
_
);
NodeStaticArgLic
(
_
,_
node_key
)]
|
[
ConstStaticArgLic
(
_
,
Int_const_eff
(
c
))
;
NodeStaticArgLic
(
_
,
node_key
)]
|
[
ConstStaticArgLic
(
_
,
Int_const_eff
(
c
))
;
TypeStaticArgLic
(
_
);
NodeStaticArgLic
(
_
,
node_key
)]
->
_
node_key
,
c
node_key
,
c
|
_
->
assert
false
in
let
iter_node
=
Lxm
.
flagit
iter_node
lxm
in
...
...
@@ -324,14 +325,14 @@ let (create_map_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_in
let
index_list
=
fill
0
c
in
let
neqs
=
List
.
map
(
fun
i
->
(
fun
i
->
let
(
xi_j
:
val_exp
list
)
=
(* X1[i], ... ,Xn[i] *)
List
.
map
(
array_var_to_val_exp
lxm
i
)
y1_yl
in
let
(
lhs
:
left
list
)
=
(* Y1[i], ... ,Yl[i] *)
List
.
map
(
array_var_to_left
i
)
x1_xn
in
let
cl
=
let
cl
=
List
.
map
(
fun
l
->
snd
(
Lic
.
var_info_of_left
l
)
.
var_clock_eff
)
lhs
in
let
p
,
n
=
fst
iter_node
.
it
in
...
...
@@ -346,11 +347,12 @@ let (create_map_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_in
ve_src
=
lxm
}
in
let
eq
=
{
src
=
lxm
;
it
=
(
lhs
,
rhs
)
}
in
let
eq
=
{
src
=
lxm
;
it
=
(
lhs
,
rhs
)
}
in
eq
)
index_list
in
{
asserts_eff
=
[]
;
eqs_eff
=
List
.
rev
neqs
}
,
[]
let
(
create_boolred_body
:
local_ctx
->
int
->
int
->
int
->
Lic
.
node_body
*
var_info
list
)
=
...
...
lib/lv6MainArgs.ml
View file @
074961b4
(* Time-stamp: <modified the
22
/0
9
/202
1
(at
11:22
) by Erwan Jahier> *)
(* Time-stamp: <modified the
05
/0
5
/202
2
(at
08:47
) 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,
...
...
@@ -81,7 +81,7 @@ let (global_opt:global_opt) =
lv4
=
false
;
kcg
=
false
;
ec
=
false
;
one_op_per_equation
=
tru
e
;
one_op_per_equation
=
fals
e
;
when_on_ident
=
false
;
no_when_not
=
false
;
no_prefix
=
false
;
...
...
@@ -247,8 +247,8 @@ let set_v4_options opt =
|
AsInt
|
AsConst
|
AsBool
->
()
);
opt
.
inline_iterator
<-
true
;
global_opt
.
when_on_ident
<-
true
;
opt
.
expand_arrays
<-
true
;
opt
.
expand_nodes
<-
true
(* because expand_arrays is true *)
opt
.
expand_arrays
<-
true
(* ;
opt.expand_nodes <- true (* because expand_arrays is true *)
*)
let
set_ec_options
opt
=
...
...
@@ -263,7 +263,8 @@ let set_ec_options opt =
()
let
set_c_options
opt
=
opt
.
gen_c
<-
true
;
opt
.
gen_c
<-
true
;
global_opt
.
one_op_per_equation
<-
true
;
(
match
global_opt
.
expand_enums
with
|
AsEnum
->
global_opt
.
expand_enums
<-
AsInt
;
(* only override the default in this case *)
...
...
@@ -292,8 +293,9 @@ let mkoptab (opt:t) : unit = (
mkopt
opt
[
"-exec"
]
(
Arg
.
Unit
(
fun
_
->
opt
.
exec
<-
true
;
global_opt
.
expand_enums
<-
AsInt
;
opt
.
exec
<-
true
;
global_opt
.
one_op_per_equation
<-
true
;
global_opt
.
expand_enums
<-
AsInt
;
))
[
"Interpret the program using RIF conventions for I/O (force -eei)"
]
;
...
...
@@ -328,7 +330,12 @@ let mkoptab (opt:t) : unit = (
[
"-knc"
;
"--keep-nested-calls"
]
(
Arg
.
Unit
(
fun
_
->
global_opt
.
one_op_per_equation
<-
false
))
[
"Keep nested calls (inhibited by -en). By default, only one node "
;
"per equation is generated (don't work with -exec or -2c)"
]
"per equation is generated (ignored with -exec or -2c*)"
]
;
mkopt
opt
~
doc_level
:
Dev
[
"-rnc"
;
"--remove-nested-calls"
]
(
Arg
.
Unit
(
fun
_
->
global_opt
.
one_op_per_equation
<-
true
))
[
"Remove nested calls"
]
;
mkopt
opt
~
doc_level
:
Advanced
[
"--when-on-ident"
]
...
...
@@ -365,7 +372,7 @@ let mkoptab (opt:t) : unit = (
[
"-esa"
;
"--expand-structs-and-arrays"
]
(
Arg
.
Unit
(
fun
_
->
opt
.
expand_arrays
<-
true
;
opt
.
expand_nodes
<-
true
;
(*
opt.expand_nodes <- true;
*)
opt
.
inline_iterator
<-
true
))
[
"Expand structures and arrays (force '-ei' and '-en')"
]
;
...
...
@@ -478,7 +485,7 @@ let mkoptab (opt:t) : unit = (
;
(* to show Hidden opt *)
mkopt
opt
[
"-more"
;
"--advanced-options"
]
[
"-
m"
;
"-more"
;
"--
more"
;
"--advanced-options"
]
(* (Arg.Unit(fun _ -> opt.see_all_options <- true)) *)
(
Arg
.
Unit
(
full_help
opt
))
[
"Show more options"
]
...
...
@@ -579,7 +586,7 @@ let mkoptab (opt:t) : unit = (
;
mkopt
opt
~
doc_level
:
Dev
[
"--gen-autotest"
]
(
Arg
.
Unit
(
fun
()
->
global_opt
.
gen_autotest
<-
true
))
(
Arg
.
Unit
(
fun
()
->
global_opt
.
one_op_per_equation
<-
true
;
global_opt
.
gen_autotest
<-
true
))
[
"Generate a Lutin Stimulator and a Lustre oracle to compare the "
;
"result of 2 Lustre compilers"
]
;
...
...
test/lus2lic.sum
View file @
074961b4
==> lus2lic0.sum <==
Test run by jahier on
Fri Apr 8 15:06:47
Test run by jahier on
Thu May 5 08:47:41
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
Fri Apr 8 15:06:48
Test run by jahier on
Thu May 5 08:47:43
Native configuration is x86_64-pc-linux-gnu
=== lus2lic1 tests ===
...
...
@@ -112,11 +112,6 @@ PASS: sh Gyroscope.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c Gyroscope.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en Gyroscope.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang Gyroscope.lus {}
PASS: ./lus2lic {-2c Gyroscope2.lus -n Gyroscope2}
PASS: sh Gyroscope2.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c Gyroscope2.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en Gyroscope2.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang Gyroscope2.lus {}
PASS: ./lus2lic {-2c aa.lus -n aa}
PASS: sh aa.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c aa.lus {}
...
...
@@ -626,7 +621,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en multipar.lus {}
==> lus2lic2.sum <==
Test run by jahier on
Fri Apr 8 15:10:09
Test run by jahier on
Thu May 5 08:53:53
Native configuration is x86_64-pc-linux-gnu
=== lus2lic2 tests ===
...
...
@@ -925,7 +920,6 @@ PASS: sh redoptest.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c redoptest.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en redoptest.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang redoptest.lus {}
PASS: ./lus2lic {-2c remplissage.lus -n remplissage}
PASS: ./lus2lic {-2c rs.lus -n rs}
PASS: sh rs.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c rs.lus {}
...
...
@@ -1056,6 +1050,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_merge.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_merge.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_merge.lus {}
PASS: ./lus2lic {-2c test_model.lus -n test_model}
FAIL: Generate c code : ./lus2lic {-2c test_model2.lus -n test_model2}
PASS: ./lus2lic {-2c test_node_expand.lus -n test_node_expand}
PASS: sh test_node_expand.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_node_expand.lus {}
...
...
@@ -1170,7 +1165,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en zzz2.lus {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang zzz2.lus {}
==> lus2lic3.sum <==
Test run by jahier on
Fri Apr 8 15:13:53
Test run by jahier on
Thu May 5 09:01:28
Native configuration is x86_64-pc-linux-gnu
=== lus2lic3 tests ===
...
...
@@ -1210,10 +1205,7 @@ PASS: ./lus2lic {} {-lic -o Gyroscope.lic Gyroscope.lus -n Gyroscope}
PASS: ./lus2lic {-ec -o Gyroscope.ec Gyroscope.lus -n Gyroscope}
PASS: ./myec2c {-o Gyroscope.c Gyroscope.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node Gyroscope.lus {}
PASS: ./lus2lic {} {-lic -o Gyroscope2.lic Gyroscope2.lus -n Gyroscope2}
PASS: ./lus2lic {-ec -o Gyroscope2.ec Gyroscope2.lus -n Gyroscope2}
PASS: ./myec2c {-o Gyroscope2.c Gyroscope2.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node Gyroscope2.lus {}
FAIL: without any option: ./lus2lic {} {-lic -o Gyroscope2.lic Gyroscope2.lus -n Gyroscope2}
PASS: ./lus2lic {} {-lic -o aa.lic aa.lus -n aa}
PASS: ./lus2lic {-ec -o aa.ec aa.lus -n aa}
PASS: ./myec2c {-o aa.c aa.ec}
...
...
@@ -1685,7 +1677,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <==
Test run by jahier on
Fri Apr 8 15:14:4
7
Test run by jahier on
Thu May 5 09:02:3
7
Native configuration is x86_64-pc-linux-gnu
=== lus2lic4 tests ===
...
...
@@ -1947,9 +1939,7 @@ PASS: ./lus2lic {} {-lic -o redoptest.lic redoptest.lus -n redoptest}
PASS: ./lus2lic {-ec -o redoptest.ec redoptest.lus -n redoptest}
PASS: ./myec2c {-o redoptest.c redoptest.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node redoptest.lus {}
PASS: ./lus2lic {} {-lic -o remplissage.lic remplissage.lus -n remplissage}
PASS: ./lus2lic {-ec -o remplissage.ec remplissage.lus -n remplissage}
PASS: ./myec2c {-o remplissage.c remplissage.ec}
FAIL: without any option: ./lus2lic {} {-lic -o remplissage.lic remplissage.lus -n remplissage}
PASS: ./lus2lic {} {-lic -o rs.lic rs.lus -n rs}
PASS: ./lus2lic {-ec -o rs.ec rs.lus -n rs}
PASS: ./myec2c {-o rs.c rs.ec}
...
...
@@ -2073,7 +2063,9 @@ PASS: ./lus2lic {-ec -o test_merge.ec test_merge.lus -n test_merge}
PASS: ./lus2lic {} {-lic -o test_model.lic test_model.lus -n test_model}
PASS: ./lus2lic {-ec -o test_model.ec test_model.lus -n test_model}
PASS: ./myec2c {-o test_model.c test_model.ec}
FAIL: without any option: ./lus2lic {} {-lic -o test_model2.lic test_model2.lus -n test_model2}
PASS: ./lus2lic {} {-lic -o test_model2.lic test_model2.lus -n test_model2}
PASS: ./lus2lic {-ec -o test_model2.ec test_model2.lus -n test_model2}
PASS: ./myec2c {-o test_model2.c test_model2.ec}
PASS: ./lus2lic {} {-lic -o test_node_expand.lic test_node_expand.lus -n test_node_expand}
PASS: ./lus2lic {-ec -o test_node_expand.ec test_node_expand.lus -n test_node_expand}
PASS: ./myec2c {-o test_node_expand.c test_node_expand.ec}
...
...
@@ -2183,20 +2175,20 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang multipar.lus {}
=== lus2lic1 Summary ===
# of expected passes 54
9
# of expected passes 54
4
==> lus2lic2.sum <==
=== lus2lic2 Summary ===
# of expected passes 52
9
# of unexpected failures
3
# of expected passes 52
8
# of unexpected failures
4
==> lus2lic3.sum <==
=== lus2lic3 Summary ===
# of expected passes 49
3
# of unexpected failures
8
# of expected passes 4
8
9
# of unexpected failures
9
# of unresolved testcases 1
==> lus2lic4.sum <==
...
...
@@ -2206,13 +2198,13 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang multipar.lus {}
# of expected passes 470
# of unexpected failures 6
===============================
# Total number of failures: 1
7
# Total number of failures: 1
9
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in
201
seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in
223
seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in
54
seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in
3
5 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in
369
seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in
455
seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in
69
seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 5
9
seconds
* Ref time:
174.91
user
4
8.
7
2system
8:35.23
elapsed 4
3
%CPU (0avgtext+0avgdata 76
980
maxresident)k
195048
inputs+4
56896
outputs (
669
major+19
477308
minor)pagefaults 0swaps
331.43
user
9
8.
3
2system
15:55.64
elapsed 4
4
%CPU (0avgtext+0avgdata 76
876
maxresident)k
46544
inputs+4
49472
outputs (
111
major+19
306350
minor)pagefaults 0swaps
* Quick time (-j 4):
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment