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
c5a5d714
Commit
c5a5d714
authored
10 years ago
by
Erwan Jahier
Browse files
Options
Downloads
Patches
Plain Diff
Soc2c: add support for the other red/fold/fill/fillred iterators
nb: unexpected failures 187->175
parent
99cd84e4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/socPredef2c.ml
+12
-9
12 additions, 9 deletions
src/socPredef2c.ml
test/lus2lic.sum
+16
-16
16 additions, 16 deletions
test/lus2lic.sum
test/lus2lic.time
+1
-1
1 addition, 1 deletion
test/lus2lic.time
with
29 additions
and
26 deletions
src/socPredef2c.ml
+
12
−
9
View file @
c5a5d714
(* Time-stamp: <modified the 18/06/2014 (at 1
1:14
) by Erwan Jahier> *)
(* Time-stamp: <modified the 18/06/2014 (at 1
4:06
) by Erwan Jahier> *)
open
Data
open
Soc
...
...
@@ -191,27 +191,30 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) =
let
iter_inputs
,
iter_outputs
=
soc
.
profile
in
let
node_step
=
match
soc
.
step
with
[
step
]
->
step
.
name
|
_
->
assert
false
in
let
step_args
,
ctx
,
array_index
=
let
step_args
,
ctx
,
array_index
,
ctx_access
=
match
soc
.
instances
with
|
[]
->
(
let
ctx_access
=
Printf
.
sprintf
"%s."
(
get_ctx_name
soc
.
key
)
in
let
(
array_index
:
int
->
var
->
string
)
=
fun
i
(
vn
,
vt
)
->
Printf
.
sprintf
"%s
.
%s[%d]"
(
get_ctx_name
soc
.
key
)
vn
i
fun
i
(
vn
,
vt
)
->
Printf
.
sprintf
"%s%s[%d]"
ctx_access
vn
i
in
Array
.
make
n
""
,
Array
.
make
n
(
get_ctx_name
it_soc
.
key
)
,
array_index
array_index
,
ctx_access
)
|
_
->
let
inst_names
=
List
.
map
fst
soc
.
instances
in
let
inst_names
=
List
.
rev
inst_names
in
let
step_args
=
List
.
map
(
fun
sn
->
(
"&ctx->"
^
(
id2s
sn
)))
inst_names
in
let
ctx
=
List
.
map
(
fun
sn
->
(
"ctx->"
^
(
id2s
sn
)))
inst_names
in
let
ctx_access
=
Printf
.
sprintf
"ctx->"
in
let
(
array_index
:
int
->
var
->
string
)
=
fun
i
(
vn
,
vt
)
->
Printf
.
sprintf
"
ctx->
%s[%d]"
vn
i
fun
i
(
vn
,
vt
)
->
Printf
.
sprintf
"
%s
%s[%d]"
ctx_access
vn
i
in
Array
.
of_list
step_args
,
Array
.
of_list
ctx
,
array_index
array_index
,
ctx_access
in
let
buff
=
ref
""
in
for
i
=
0
to
n
-
1
do
...
...
@@ -221,7 +224,7 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) =
(
List
.
map
(
array_index
i
)
iter_inputs
,
List
.
map
(
array_index
i
)
iter_outputs
)
|
"fold"
|
"red"
|
"fill"
|
"fillred"
->
let
a_in
=
fst
(
List
.
hd
iter_inputs
)
in
let
a_in
=
ctx_access
^
(
fst
(
List
.
hd
iter_inputs
)
)
in
(
a_in
::
(
List
.
map
(
array_index
i
)
(
List
.
tl
iter_inputs
))
,
a_in
::
(
List
.
map
(
array_index
i
)
(
List
.
tl
iter_outputs
)))
|
_
->
assert
false
(* should not occur *)
...
...
@@ -233,8 +236,8 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) =
if
iterator
<>
"map"
then
(
let
type_in
=
snd
(
List
.
hd
iter_inputs
)
in
let
a_in
=
fst
(
List
.
hd
iter_inputs
)
in
let
a_out
=
fst
(
List
.
hd
iter_outputs
)
in
let
a_in
=
ctx_access
^
(
fst
(
List
.
hd
iter_inputs
)
)
in
let
a_out
=
ctx_access
^
(
fst
(
List
.
hd
iter_outputs
)
)
in
buff
:=
!
buff
^
(
Soc2cUtil
.
gen_assign
type_in
a_out
a_in
)
(* a_out=a_n *)
);
!
buff
...
...
This diff is collapsed.
Click to expand it.
test/lus2lic.sum
+
16
−
16
View file @
c5a5d714
Test Run By jahier on Wed Jun 18 1
1:15:34
2014
Test Run By jahier on Wed Jun 18 1
4:08:00
2014
Native configuration is i686-pc-linux-gnu
=== lus2lic tests ===
...
...
@@ -88,7 +88,7 @@ PASS: ./lus2lic {-ec -o /tmp/redIf.ec should_work/redIf.lus}
PASS: ./myec2c {-o /tmp/redIf.c /tmp/redIf.ec}
PASS: ../utils/test_lus2lic_no_node should_work/redIf.lus
PASS: ./lus2lic {-2c should_work/redIf.lus -n redIf}
FAIL: Check that the generated C code compiles
: gcc redIf_redIf.c redIf_redIf_loop.c
PASS
: gcc redIf_redIf.c redIf_redIf_loop.c
PASS: ./lus2lic {-o /tmp/t0.lic should_work/t0.lus}
PASS: ./lus2lic {-ec -o /tmp/t0.ec should_work/t0.lus}
PASS: ./myec2c {-o /tmp/t0.c /tmp/t0.ec}
...
...
@@ -159,7 +159,7 @@ PASS: ./lus2lic {-ec -o /tmp/deSimone.ec should_work/deSimone.lus}
PASS: ./myec2c {-o /tmp/deSimone.c /tmp/deSimone.ec}
PASS: ../utils/test_lus2lic_no_node should_work/deSimone.lus
PASS: ./lus2lic {-2c should_work/deSimone.lus -n deSimone}
FAIL: Check that the generated C code compiles
: gcc deSimone_deSimone.c deSimone_deSimone_loop.c
PASS
: gcc deSimone_deSimone.c deSimone_deSimone_loop.c
PASS: ./lus2lic {-o /tmp/bug2.lic should_work/bug2.lus}
PASS: ./lus2lic {-ec -o /tmp/bug2.ec should_work/bug2.lus}
PASS: ./myec2c {-o /tmp/bug2.c /tmp/bug2.ec}
...
...
@@ -177,7 +177,7 @@ PASS: ./lus2lic {-ec -o /tmp/yyy.ec should_work/yyy.lus}
PASS: ./myec2c {-o /tmp/yyy.c /tmp/yyy.ec}
PASS: ../utils/test_lus2lic_no_node should_work/yyy.lus
PASS: ./lus2lic {-2c should_work/yyy.lus -n yyy}
FAIL: Check that the generated C code compiles
: gcc yyy_yyy.c yyy_yyy_loop.c
PASS
: gcc yyy_yyy.c yyy_yyy_loop.c
PASS: ./lus2lic {-o /tmp/toolate.lic should_work/toolate.lus}
PASS: ./lus2lic {-ec -o /tmp/toolate.ec should_work/toolate.lus}
PASS: ./myec2c {-o /tmp/toolate.c /tmp/toolate.ec}
...
...
@@ -247,7 +247,7 @@ PASS: ./lus2lic {-ec -o /tmp/iter.ec should_work/iter.lus}
PASS: ./myec2c {-o /tmp/iter.c /tmp/iter.ec}
PASS: ../utils/test_lus2lic_no_node should_work/iter.lus
PASS: ./lus2lic {-2c should_work/iter.lus -n iter}
FAIL: Check that the generated C code compiles
: gcc iter_iter.c iter_iter_loop.c
PASS
: gcc iter_iter.c iter_iter_loop.c
PASS: ./lus2lic {-o /tmp/call05.lic should_work/call05.lus}
PASS: ./lus2lic {-ec -o /tmp/call05.ec should_work/call05.lus}
FAIL: Try ec2c on the result: ./myec2c {-o /tmp/call05.c /tmp/call05.ec}
...
...
@@ -540,7 +540,7 @@ PASS: ./lus2lic {-ec -o /tmp/calculs_max.ec should_work/calculs_max.lus}
PASS: ./myec2c {-o /tmp/calculs_max.c /tmp/calculs_max.ec}
PASS: ../utils/test_lus2lic_no_node should_work/calculs_max.lus
PASS: ./lus2lic {-2c should_work/calculs_max.lus -n calculs_max}
FAIL: Check that the generated C code compiles
: gcc calculs_max_calculs_max.c calculs_max_calculs_max_loop.c
PASS
: gcc calculs_max_calculs_max.c calculs_max_calculs_max_loop.c
PASS: ./lus2lic {-o /tmp/testCA.lic should_work/testCA.lus}
PASS: ./lus2lic {-ec -o /tmp/testCA.ec should_work/testCA.lus}
PASS: ./myec2c {-o /tmp/testCA.c /tmp/testCA.ec}
...
...
@@ -620,7 +620,7 @@ PASS: ./lus2lic {-ec -o /tmp/pipeline.ec should_work/pipeline.lus}
PASS: ./myec2c {-o /tmp/pipeline.c /tmp/pipeline.ec}
PASS: ../utils/test_lus2lic_no_node should_work/pipeline.lus
PASS: ./lus2lic {-2c should_work/pipeline.lus -n pipeline}
FAIL: Check that the generated C code compiles
: gcc pipeline_pipeline.c pipeline_pipeline_loop.c
PASS
: gcc pipeline_pipeline.c pipeline_pipeline_loop.c
PASS: ./lus2lic {-o /tmp/mapinf.lic should_work/mapinf.lus}
PASS: ./lus2lic {-ec -o /tmp/mapinf.ec should_work/mapinf.lus}
PASS: ./myec2c {-o /tmp/mapinf.c /tmp/mapinf.ec}
...
...
@@ -753,7 +753,7 @@ PASS: ./lus2lic {-ec -o /tmp/FillFollowedByRed.ec should_work/FillFollowedByRed.
PASS: ./myec2c {-o /tmp/FillFollowedByRed.c /tmp/FillFollowedByRed.ec}
PASS: ../utils/test_lus2lic_no_node should_work/FillFollowedByRed.lus
PASS: ./lus2lic {-2c should_work/FillFollowedByRed.lus -n FillFollowedByRed}
FAIL: Check that the generated C code compiles
: gcc FillFollowedByRed_FillFollowedByRed.c FillFollowedByRed_FillFollowedByRed_loop.c
PASS
: gcc FillFollowedByRed_FillFollowedByRed.c FillFollowedByRed_FillFollowedByRed_loop.c
PASS: ./lus2lic {-o /tmp/sample_time_change.lic should_work/sample_time_change.lus}
PASS: ./lus2lic {-ec -o /tmp/sample_time_change.ec should_work/sample_time_change.lus}
PASS: ./myec2c {-o /tmp/sample_time_change.c /tmp/sample_time_change.ec}
...
...
@@ -950,7 +950,7 @@ PASS: ./lus2lic {-ec -o /tmp/iterFibo.ec should_work/iterFibo.lus}
PASS: ./myec2c {-o /tmp/iterFibo.c /tmp/iterFibo.ec}
PASS: ../utils/test_lus2lic_no_node should_work/iterFibo.lus
PASS: ./lus2lic {-2c should_work/iterFibo.lus -n iterFibo}
FAIL: Check that the generated C code compiles
: gcc iterFibo_iterFibo.c iterFibo_iterFibo_loop.c
PASS
: gcc iterFibo_iterFibo.c iterFibo_iterFibo_loop.c
PASS: ./lus2lic {-o /tmp/morel2.lic should_work/morel2.lus}
PASS: ./lus2lic {-ec -o /tmp/morel2.ec should_work/morel2.lus}
PASS: ./myec2c {-o /tmp/morel2.c /tmp/morel2.ec}
...
...
@@ -995,7 +995,7 @@ PASS: ./lus2lic {-ec -o /tmp/moyenne.ec should_work/moyenne.lus}
PASS: ./myec2c {-o /tmp/moyenne.c /tmp/moyenne.ec}
PASS: ../utils/test_lus2lic_no_node should_work/moyenne.lus
PASS: ./lus2lic {-2c should_work/moyenne.lus -n moyenne}
FAIL: Check that the generated C code compiles
: gcc moyenne_moyenne.c moyenne_moyenne_loop.c
PASS
: gcc moyenne_moyenne.c moyenne_moyenne_loop.c
PASS: ./lus2lic {-o /tmp/activation1.lic should_work/activation1.lus}
PASS: ./lus2lic {-ec -o /tmp/activation1.ec should_work/activation1.lus}
PASS: ./myec2c {-o /tmp/activation1.c /tmp/activation1.ec}
...
...
@@ -1082,7 +1082,7 @@ PASS: ./lus2lic {-ec -o /tmp/rediter.ec should_work/rediter.lus}
PASS: ./myec2c {-o /tmp/rediter.c /tmp/rediter.ec}
PASS: ../utils/test_lus2lic_no_node should_work/rediter.lus
PASS: ./lus2lic {-2c should_work/rediter.lus -n rediter}
FAIL: Check that the generated C code compiles
: gcc rediter_rediter.c rediter_rediter_loop.c
PASS
: gcc rediter_rediter.c rediter_rediter_loop.c
PASS: ./lus2lic {-o /tmp/mapdeRed.lic should_work/mapdeRed.lus}
PASS: ./lus2lic {-ec -o /tmp/mapdeRed.ec should_work/mapdeRed.lus}
PASS: ./myec2c {-o /tmp/mapdeRed.c /tmp/mapdeRed.ec}
...
...
@@ -1175,7 +1175,7 @@ PASS: ./lus2lic {-ec -o /tmp/predef02.ec should_work/predef02.lus}
PASS: ./myec2c {-o /tmp/predef02.c /tmp/predef02.ec}
PASS: ../utils/test_lus2lic_no_node should_work/predef02.lus
PASS: ./lus2lic {-2c should_work/predef02.lus -n predef02}
FAIL: Check that the generated C code compiles
: gcc predef02_predef02.c predef02_predef02_loop.c
PASS
: gcc predef02_predef02.c predef02_predef02_loop.c
PASS: ./lus2lic {-o /tmp/toto.lic should_work/toto.lus}
PASS: ./lus2lic {-ec -o /tmp/toto.ec should_work/toto.lus}
PASS: ./myec2c {-o /tmp/toto.c /tmp/toto.ec}
...
...
@@ -1294,7 +1294,7 @@ PASS: ./lus2lic {-ec -o /tmp/iterate.ec should_work/iterate.lus}
PASS: ./myec2c {-o /tmp/iterate.c /tmp/iterate.ec}
PASS: ../utils/test_lus2lic_no_node should_work/iterate.lus
PASS: ./lus2lic {-2c should_work/iterate.lus -n iterate}
FAIL: Check that the generated C code compiles
: gcc iterate_iterate.c iterate_iterate_loop.c
PASS
: gcc iterate_iterate.c iterate_iterate_loop.c
PASS: ./lus2lic {-o /tmp/overload.lic should_work/overload.lus}
PASS: ./lus2lic {-ec -o /tmp/overload.ec should_work/overload.lus}
PASS: ./myec2c {-o /tmp/overload.c /tmp/overload.ec}
...
...
@@ -1479,9 +1479,9 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
=== lus2lic Summary ===
# of expected passes 12
22
# of unexpected failures 1
8
7
# of expected passes 12
34
# of unexpected failures 17
5
# of unexpected successes 21
# of expected failures 37
testcase ./lus2lic.tests/non-reg.exp completed in 1
35
seconds
testcase ./lus2lic.tests/non-reg.exp completed in 1
29
seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds
This diff is collapsed.
Click to expand it.
test/lus2lic.time
+
1
−
1
View file @
c5a5d714
testcase ./lus2lic.tests/non-reg.exp completed in 1
35
seconds
testcase ./lus2lic.tests/non-reg.exp completed in 1
29
seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds
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