Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-v6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
lustre-v6
Commits
0d12b155
Commit
0d12b155
authored
1 year ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
more work on -rte
parent
33110858
No related branches found
No related tags found
No related merge requests found
Pipeline
#168157
failed
1 year ago
Stage: build
Stage: test
Stage: release
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/licDump.ml
+31
-13
31 additions, 13 deletions
lib/licDump.ml
lib/lv6MainArgs.ml
+8
-8
8 additions, 8 deletions
lib/lv6MainArgs.ml
test/lus2lic.sum
+11
-11
11 additions, 11 deletions
test/lus2lic.sum
with
50 additions
and
32 deletions
lib/licDump.ml
+
31
−
13
View file @
0d12b155
(* Time-stamp: <modified the 1
7/1
1/202
3
(at 10:4
1
) by Erwan Jahier> *)
(* Time-stamp: <modified the 1
9/0
1/202
4
(at 10:4
8
) by Erwan Jahier> *)
(*
(*
This module is used both for
This module is used both for
...
@@ -55,7 +55,6 @@ let rec is_a_tuple (e:Lic.val_exp) : bool =
...
@@ -55,7 +55,6 @@ let rec is_a_tuple (e:Lic.val_exp) : bool =
|
CallByPosLic
({
it
=
TUPLE
;
_
}
,
vel
)
->
List
.
length
vel
>
1
|
CallByPosLic
({
it
=
TUPLE
;
_
}
,
vel
)
->
List
.
length
vel
>
1
|
_
->
false
|
_
->
false
(******************************************************************************)
(******************************************************************************)
let
string_of_ident
forprint
x
=
let
string_of_ident
forprint
x
=
if
global_opt
.
kcg
then
if
global_opt
.
kcg
then
...
@@ -66,6 +65,10 @@ let string_of_ident forprint x =
...
@@ -66,6 +65,10 @@ let string_of_ident forprint x =
else
Lv6Id
.
string_of_long
forprint
x
else
Lv6Id
.
string_of_long
forprint
x
let
(
machine_int
:
string
->
bool
)
=
function
|
"int8"
|
"int16"
|
"int32"
|
"int64"
->
true
|
_
->
false
(* the flag forprint controls whether those functions are used for printing
(* the flag forprint controls whether those functions are used for printing
into a file or not (i.e. for internal use) *)
into a file or not (i.e. for internal use) *)
...
@@ -193,10 +196,10 @@ and string_of_type_eff forprint = function
...
@@ -193,10 +196,10 @@ and string_of_type_eff forprint = function
|
Bool_type_eff
->
"bool"
|
Bool_type_eff
->
"bool"
|
Int_type_eff
->
|
Int_type_eff
->
(* XXX
ne marche que pour les entiers !!
*)
(* XXX
for integers only!
*)
(
match
global_opt
.
rte
with
(
match
global_opt
.
rte
with
|
Some
str
->
sprintf
"%s"
str
|
Some
str
->
sprintf
"%s"
str
|
None
->
"int"
)
|
None
->
"int"
)
|
Real_type_eff
->
"real"
|
Real_type_eff
->
"real"
...
@@ -446,7 +449,8 @@ and (array_of_size_one : Lic.val_exp -> bool) =
...
@@ -446,7 +449,8 @@ and (array_of_size_one : Lic.val_exp -> bool) =
|
{
ve_typ
=
[
Array_type_eff
(
Bool_type_eff
,
size
)]
;
_
}
->
size
=
1
|
{
ve_typ
=
[
Array_type_eff
(
Bool_type_eff
,
size
)]
;
_
}
->
size
=
1
|
{
ve_typ
=
[
_
];
_
}
->
true
|
{
ve_typ
=
[
_
];
_
}
->
true
|
_
->
false
|
_
->
false
and
(
string_of_by_pos_op_eff
:
bool
->
Lic
.
by_pos_op
srcflagged
->
Lic
.
val_exp
list
->
string
)
=
and
(
string_of_by_pos_op_eff
:
bool
->
Lic
.
by_pos_op
srcflagged
->
Lic
.
val_exp
list
->
string
)
=
fun
forprint
posop
vel
->
fun
forprint
posop
vel
->
let
sov
ve
=
string_of_val_exp_eff
forprint
ve
in
let
sov
ve
=
string_of_val_exp_eff
forprint
ve
in
let
tuple
vel
=
(
String
.
concat
", "
(
List
.
map
(
string_of_val_exp_eff
forprint
)
vel
))
in
let
tuple
vel
=
(
String
.
concat
", "
(
List
.
map
(
string_of_val_exp_eff
forprint
)
vel
))
in
...
@@ -490,9 +494,18 @@ and (string_of_by_pos_op_eff: bool -> Lic.by_pos_op srcflagged -> Lic.val_exp li
...
@@ -490,9 +494,18 @@ and (string_of_by_pos_op_eff: bool -> Lic.by_pos_op srcflagged -> Lic.val_exp li
if
AstPredef
.
is_a_predef_op
(
snd
(
fst
op
.
it
))
then
if
AstPredef
.
is_a_predef_op
(
snd
(
fst
op
.
it
))
then
let
op_str
=
snd
(
fst
op
.
it
)
in
let
op_str
=
snd
(
fst
op
.
it
)
in
let
op_short_str
,
rte
=
match
global_opt
.
rte
,
op_str
with
let
op_short_str
,
rte
=
match
global_opt
.
rte
,
op_str
with
|
Some
_
,
(
"plus"
|
"slash"
|
"minus"
|
"uminus"
|
"times"
|
"iplus"
|
Some
_
,
(
"plus"
|
"slash"
|
"minus"
|
"uminus"
|
"times"
|
"iplus"
|
"islash"
|
"iminus"
|
"iuminus"
|
"itimes"
|
"mod"
|
"islash"
|
"iminus"
|
"iuminus"
|
"itimes"
|
"mod"
|
"div"
)
->
"rte_"
^
op_str
,
true
|
"div"
)
->
(
try
let
ve
=
List
.
hd
vel
in
(
match
ve
.
ve_typ
with
|
(
External_type_eff
(
_
,
mint
))
::_
->
"rte_"
^
op_str
^
"_"
^
mint
,
true
|
_
->
assert
false
(* SNO *)
)
with
_
->
assert
false
(* SNO *)
)
|
_
,_
->
op2string
(
AstPredef
.
string_to_op
op_str
)
,
false
|
_
,_
->
op2string
(
AstPredef
.
string_to_op
op_str
)
,
false
in
in
if
AstPredef
.
is_infix
(
AstPredef
.
string_to_op
op_str
)
if
AstPredef
.
is_infix
(
AstPredef
.
string_to_op
op_str
)
...
@@ -510,14 +523,19 @@ and (string_of_by_pos_op_eff: bool -> Lic.by_pos_op srcflagged -> Lic.val_exp li
...
@@ -510,14 +523,19 @@ and (string_of_by_pos_op_eff: bool -> Lic.by_pos_op srcflagged -> Lic.val_exp li
)
)
)
)
else
else
let
rte
=
global_opt
.
rte
<>
None
in
let
nk
=
op
.
it
in
let
nk
=
op
.
it
in
let
vel_str
=
tuple_par
vel
in
let
vel_str
=
tuple_par
vel
in
assert
(
vel_str
<>
""
);
(* SNO *)
assert
(
vel_str
<>
""
);
(* SNO *)
let
vel_str
=
if
vel_str
.
[
0
]
<>
'
(
'
then
"("
^
vel_str
^
")"
else
vel_str
in
let
vel_str
_par
=
if
vel_str
.
[
0
]
<>
'
(
'
then
"("
^
vel_str
^
")"
else
vel_str
in
if
global_opt
.
lv4
||
global_opt
.
inline_iterator
then
if
global_opt
.
lv4
||
global_opt
.
inline_iterator
then
((
string_of_node_key_rec
forprint
global_opt
.
no_prefix
nk
)
^
vel_str
)
let
node_str
=
string_of_node_key_rec
forprint
global_opt
.
no_prefix
nk
in
if
rte
&&
machine_int
node_str
then
"("
^
node_str
^
" "
^
vel_str
^
")"
else
node_str
^
vel_str_par
else
else
((
string_of_node_key
forprint
nk
)
^
vel_str
)
((
string_of_node_key
forprint
nk
)
^
vel_str
_par
)
)
)
|
CONST_REF
idl
,
_
->
dump_long
forprint
idl
|
CONST_REF
idl
,
_
->
dump_long
forprint
idl
|
VAR_REF
id
,
_
->
id
|
VAR_REF
id
,
_
->
id
...
...
This diff is collapsed.
Click to expand it.
lib/lv6MainArgs.ml
+
8
−
8
View file @
0d12b155
(* Time-stamp: <modified the 1
6/1
1/202
3
(at 1
4:15
) by Erwan Jahier> *)
(* Time-stamp: <modified the 1
9/0
1/202
4
(at 1
0:47
) by Erwan Jahier> *)
(*
(*
Le manager d'argument adapt de celui de lutin, plus joli
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,
N.B. solution un peu batarde : les options sont stockes, comme avant, dans Global,
...
@@ -347,20 +347,20 @@ let mkoptab (opt:t) : unit = (
...
@@ -347,20 +347,20 @@ let mkoptab (opt:t) : unit = (
mkopt
opt
~
doc_level
:
Advanced
mkopt
opt
~
doc_level
:
Advanced
[
"-ocaml"
]
[
"-ocaml"
]
(
Arg
.
Unit
(
function
()
->
opt
.
gen_ocaml
<-
true
))
(
Arg
.
Unit
(
function
()
->
opt
.
gen_ocaml
<-
true
))
[
"Generate ocaml glue code that makes it possible to call the lv6 interpreter
"
;
[
"Generate ocaml glue code that makes it possible to call the lv6 interpreter"
;
"from ocaml with the current set of arguments (with Lv6Run.make)"
]
"from ocaml with the current set of arguments (with Lv6Run.make)"
]
;
;
mkopt
opt
~
doc_level
:
Dev
mkopt
opt
~
doc_level
:
Dev
[
"-knc"
;
"--keep-nested-calls"
]
[
"-knc"
;
"--keep-nested-calls"
]
(
Arg
.
Unit
(
fun
_
->
global_opt
.
one_op_per_equation_set
<-
true
;
global_opt
.
one_op_per_equation
<-
false
))
(
Arg
.
Unit
(
fun
_
->
global_opt
.
one_op_per_equation_set
<-
true
;
global_opt
.
one_op_per_equation
<-
false
))
[
"Keep nested calls (use with care: it breaks some programs with
"
;
[
"Keep nested calls (use with care: it breaks some programs with"
;
"some options combination)"
]
"some options combination)"
]
;
;
mkopt
opt
~
doc_level
:
Dev
mkopt
opt
~
doc_level
:
Dev
[
"-knpc"
;
"--keep-nested-predef-calls"
]
[
"-knpc"
;
"--keep-nested-predef-calls"
]
(
Arg
.
Unit
(
fun
_
->
global_opt
.
one_user_op_per_equation_set
<-
true
;
global_opt
.
one_user_op_per_equation
<-
false
))
(
Arg
.
Unit
(
fun
_
->
global_opt
.
one_user_op_per_equation_set
<-
true
;
global_opt
.
one_user_op_per_equation
<-
false
))
[
"Keep nested calls for predefined operators (use with care: it breaks some programs with
"
;
[
"Keep nested calls for predefined operators (use with care: it breaks some programs with"
;
"some options combination)"
]
"some options combination)"
]
;
;
mkopt
opt
~
doc_level
:
Dev
mkopt
opt
~
doc_level
:
Dev
...
@@ -371,7 +371,7 @@ let mkoptab (opt:t) : unit = (
...
@@ -371,7 +371,7 @@ let mkoptab (opt:t) : unit = (
mkopt
opt
~
doc_level
:
Advanced
mkopt
opt
~
doc_level
:
Advanced
[
"--when-on-ident"
]
[
"--when-on-ident"
]
(
Arg
.
Unit
(
fun
_
->
global_opt
.
when_on_ident
<-
true
))
(
Arg
.
Unit
(
fun
_
->
global_opt
.
when_on_ident
<-
true
))
[
"Invent ident names so that when only operates on idents (to be able
"
;
[
"Invent ident names so that when only operates on idents (to be able"
;
"to translate enums into ec/v4)"
]
"to translate enums into ec/v4)"
]
;
;
mkopt
opt
~
doc_level
:
Advanced
mkopt
opt
~
doc_level
:
Advanced
...
@@ -417,7 +417,7 @@ let mkoptab (opt:t) : unit = (
...
@@ -417,7 +417,7 @@ let mkoptab (opt:t) : unit = (
[
"-et"
;
"--expand-io-type"
]
[
"-et"
;
"--expand-io-type"
]
(
Arg
.
Unit
(
fun
_
->
opt
.
expand_io_type
<-
true
))
(
Arg
.
Unit
(
fun
_
->
opt
.
expand_io_type
<-
true
))
[
"Expand structured types of the main node (impact the rif output only)."
;
[
"Expand structured types of the main node (impact the rif output only)."
;
"Necessary to use lurette and rdbg in presence of lutin (that only
"
;
"Necessary to use lurette and rdbg in presence of lutin (that only"
;
"knows about basic the types int/bool/real)"
]
"knows about basic the types int/bool/real)"
]
;
;
mkopt
opt
~
doc_level
:
Advanced
mkopt
opt
~
doc_level
:
Advanced
...
@@ -441,7 +441,7 @@ let mkoptab (opt:t) : unit = (
...
@@ -441,7 +441,7 @@ let mkoptab (opt:t) : unit = (
mkopt
opt
~
doc_level
:
Advanced
mkopt
opt
~
doc_level
:
Advanced
[
"-rte"
;
"--runtime-error"
]
[
"-rte"
;
"--runtime-error"
]
(
Arg
.
String
(
fun
str
->
global_opt
.
rte
<-
Some
str
;
set_v4_options
opt
))
(
Arg
.
String
(
fun
str
->
global_opt
.
rte
<-
Some
str
;
set_v4_options
opt
))
[
"Generate kind2 contracts to check for runtime errors (force '-lv4')"
]
[
"
Experimental:
Generate kind2 contracts to check for runtime errors (force '-lv4')"
]
;
;
mkopt
opt
~
doc_level
:
Dev
mkopt
opt
~
doc_level
:
Dev
[
"-kcg"
;
"--generate-scade-lustre"
]
[
"-kcg"
;
"--generate-scade-lustre"
]
...
@@ -633,7 +633,7 @@ let mkoptab (opt:t) : unit = (
...
@@ -633,7 +633,7 @@ let mkoptab (opt:t) : unit = (
(
Arg
.
Unit
(
fun
()
->
(
Arg
.
Unit
(
fun
()
->
if
not
global_opt
.
one_op_per_equation_set
then
global_opt
.
one_op_per_equation
<-
true
;
if
not
global_opt
.
one_op_per_equation_set
then
global_opt
.
one_op_per_equation
<-
true
;
global_opt
.
gen_autotest
<-
true
))
global_opt
.
gen_autotest
<-
true
))
[
"Generate a Lutin Stimulator and a Lustre oracle to compare the
"
;
[
"Generate a Lutin Stimulator and a Lustre oracle to compare the"
;
"result of 2 Lustre compilers"
]
"result of 2 Lustre compilers"
]
;
;
(* misc debug flag *)
(* misc debug flag *)
...
...
This diff is collapsed.
Click to expand it.
test/lus2lic.sum
+
11
−
11
View file @
0d12b155
==> lus2lic0.sum <==
==> lus2lic0.sum <==
Test run by jahier on
Wed Nov 22 16:23
:11
Test run by jahier on
Fri Jan 19 10:44
:11
Native configuration is x86_64-pc-linux-gnu
Native configuration is x86_64-pc-linux-gnu
=== lus2lic0 tests ===
=== lus2lic0 tests ===
...
@@ -66,7 +66,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
...
@@ -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
XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
==> lus2lic1.sum <==
==> lus2lic1.sum <==
Test run by jahier on
Wed Nov 22 16:23
:13
Test run by jahier on
Fri Jan 19 10:44
:13
Native configuration is x86_64-pc-linux-gnu
Native configuration is x86_64-pc-linux-gnu
=== lus2lic1 tests ===
=== lus2lic1 tests ===
...
@@ -631,7 +631,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {}
...
@@ -631,7 +631,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 {}
PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en multipar.lus {}
==> lus2lic2.sum <==
==> lus2lic2.sum <==
Test run by jahier on
Wed Nov 22 16:31:14
Test run by jahier on
Fri Jan 19 10:50:58
Native configuration is x86_64-pc-linux-gnu
Native configuration is x86_64-pc-linux-gnu
=== lus2lic2 tests ===
=== lus2lic2 tests ===
...
@@ -1177,7 +1177,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en zzz2.lus {}
...
@@ -1177,7 +1177,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 {}
PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang zzz2.lus {}
==> lus2lic3.sum <==
==> lus2lic3.sum <==
Test run by jahier on
Wed Nov 22 16:39:30
Test run by jahier on
Fri Jan 19 10:57:57
Native configuration is x86_64-pc-linux-gnu
Native configuration is x86_64-pc-linux-gnu
=== lus2lic3 tests ===
=== lus2lic3 tests ===
...
@@ -1696,7 +1696,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
...
@@ -1696,7 +1696,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <==
==> lus2lic4.sum <==
Test run by jahier on
Wed Nov 22 16:41:03
Test run by jahier on
Fri Jan 19 10:59:36
Native configuration is x86_64-pc-linux-gnu
Native configuration is x86_64-pc-linux-gnu
=== lus2lic4 tests ===
=== lus2lic4 tests ===
...
@@ -2224,11 +2224,11 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang multipar.lus {}
...
@@ -2224,11 +2224,11 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang multipar.lus {}
===============================
===============================
# Total number of failures: 17
# Total number of failures: 17
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 2 seconds
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 2 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 4
81
seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 4
05
seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 49
6
seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 4
1
9 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 9
3
seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 9
9
seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in
78
seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in
64
seconds
* Ref time:
* Ref time:
3
93.11
user 10
6.70
system 1
9:09.76
elapsed 4
3
%CPU (0avgtext+0avgdata 99
572
maxresident)k
3
40.47
user 10
0.85
system 1
6:29.39
elapsed 4
4
%CPU (0avgtext+0avgdata 99
380
maxresident)k
3
2inputs+58
439
2outputs (
5
major+2095
9490
minor)pagefaults 0swaps
2
59048
inputs+58
587
2outputs (
1332
major+2095
8893
minor)pagefaults 0swaps
* Quick time (-j 4):
* Quick time (-j 4):
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment