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
038257f6
Commit
038257f6
authored
10 years ago
by
Erwan Jahier
Browse files
Options
Downloads
Patches
Plain Diff
Soc2c: raises assert false when slices are encountered
nb: unexpected failures 115->120
parent
617653ae
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/soc2c.ml
+18
-5
18 additions, 5 deletions
src/soc2c.ml
src/soc2cUtil.ml
+2
-3
2 additions, 3 deletions
src/soc2cUtil.ml
test/lus2lic.sum
+9
-11
9 additions, 11 deletions
test/lus2lic.sum
test/lus2lic.time
+1
-1
1 addition, 1 deletion
test/lus2lic.time
todo.org
+2
-3
2 additions, 3 deletions
todo.org
with
32 additions
and
23 deletions
src/soc2c.ml
+
18
−
5
View file @
038257f6
(* Time-stamp: <modified the 24/06/2014 (at 17:
1
4) by Erwan Jahier> *)
(* Time-stamp: <modified the 24/06/2014 (at 17:4
9
) by Erwan Jahier> *)
(* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *)
...
...
@@ -106,9 +106,12 @@ let (is_memory_less : Soc.t -> bool) = SocUtils.is_memory_less
let
string_of_var_expr
=
Soc2cUtil
.
string_of_var_expr
open
Soc
let
var_expr_is_not_a_slice
=
function
Slice
_
->
false
|
_
->
true
let
(
gao2c
:
Soc
.
tbl
->
'
a
soc_pp
->
Soc
.
gao
->
unit
)
=
fun
stbl
sp
gao
->
let
string_of_var_expr_list
vel
=
List
.
iter
(
fun
ve
->
assert
(
var_expr_is_not_a_slice
ve
))
vel
;
let
vel
=
List
.
map
(
string_of_var_expr
sp
.
soc
)
vel
in
String
.
concat
","
vel
in
...
...
@@ -135,9 +138,13 @@ let (gao2c : Soc.tbl -> 'a soc_pp -> Soc.gao -> unit) =
)
|
Call
(
vel_out
,
Assign
,
vel_in
)
->
(
let
gen_assign2
vi
vo
=
Soc2cUtil
.
gen_assign
(
Soc
.
data_type_of_var_expr
vi
)
(
string_of_var_expr
sp
.
soc
vi
)
(
string_of_var_expr
sp
.
soc
vo
)
(
Printf
.
sprintf
"sizeof(%s)"
(
string_of_var_expr
sp
.
soc
vo
))
match
vi
,
vo
with
|
Slice
_
,
_
->
assert
false
|
_
,
Slice
_
->
assert
false
|
_
,_
->
Soc2cUtil
.
gen_assign
(
Soc
.
data_type_of_var_expr
vi
)
(
string_of_var_expr
sp
.
soc
vi
)
(
string_of_var_expr
sp
.
soc
vo
)
(
Printf
.
sprintf
"sizeof(%s)"
(
string_of_var_expr
sp
.
soc
vo
))
in
let
l
=
List
.
map2
gen_assign2
vel_out
vel_in
in
String
.
concat
""
l
...
...
@@ -145,6 +152,8 @@ let (gao2c : Soc.tbl -> 'a soc_pp -> Soc.gao -> unit) =
|
Call
(
vel_out
,
Method
((
inst_name
,
sk
)
,
sname
)
,
vel_in
)
->
(
let
called_soc
=
Soc
.
SocMap
.
find
sk
stbl
in
let
ctx
=
Printf
.
sprintf
"ctx->%s"
(
id2s
inst_name
)
in
List
.
iter
(
fun
ve
->
assert
(
var_expr_is_not_a_slice
ve
))
vel_in
;
List
.
iter
(
fun
ve
->
assert
(
var_expr_is_not_a_slice
ve
))
vel_out
;
let
vel_in
=
List
.
map
(
string_of_var_expr
sp
.
soc
)
vel_in
in
let
vel_out
=
List
.
map
(
string_of_var_expr
sp
.
soc
)
vel_out
in
Soc2cUtil
.
gen_step_call
sp
.
soc
called_soc
vel_out
vel_in
ctx
sname
...
...
@@ -153,6 +162,8 @@ let (gao2c : Soc.tbl -> 'a soc_pp -> Soc.gao -> unit) =
|
Call
(
vel_out
,
Procedure
sk
,
vel_in
)
->
(
let
called_soc
=
Soc
.
SocMap
.
find
sk
stbl
in
let
ctx
=
get_ctx_name
called_soc
.
key
in
List
.
iter
(
fun
ve
->
assert
(
var_expr_is_not_a_slice
ve
))
vel_in
;
List
.
iter
(
fun
ve
->
assert
(
var_expr_is_not_a_slice
ve
))
vel_out
;
let
vel_in
=
List
.
map
(
string_of_var_expr
sp
.
soc
)
vel_in
in
let
vel_out
=
List
.
map
(
string_of_var_expr
sp
.
soc
)
vel_out
in
Soc2cUtil
.
gen_step_call
sp
.
soc
called_soc
vel_out
vel_in
ctx
"step"
""
...
...
@@ -223,7 +234,9 @@ let (soc2c: int -> out_channel -> out_channel -> Soc.tbl -> Soc.t -> unit) =
List
.
iter
(
gen_instance_init_call
sp
)
soc
.
instances
;
(
match
soc
.
key
with
(* set the parameter fields that have a default value (arrow,fby) *)
|
(
_
,_,
MemInit
(
ve
))
->
cfmt
"
\n
ctx->_memory = %s;"
(
string_of_var_expr
soc
ve
)
|
(
_
,_,
MemInit
(
ve
))
->
assert
(
var_expr_is_not_a_slice
ve
);
cfmt
"
\n
ctx->_memory = %s;"
(
string_of_var_expr
soc
ve
)
|
_
->
()
);
cfmt
"
...
...
This diff is collapsed.
Click to expand it.
src/soc2cUtil.ml
+
2
−
3
View file @
038257f6
(* Time-stamp: <modified the 24/06/2014 (at 17:
1
4) by Erwan Jahier> *)
(* Time-stamp: <modified the 24/06/2014 (at 17:4
0
) by Erwan Jahier> *)
(* exported *)
...
...
@@ -91,5 +91,4 @@ let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) =
Printf
.
sprintf
"ctx->%s"
(
id2s
id
)
|
Field
(
f
,
id
,_
)
->
Printf
.
sprintf
"%s.%s"
(
string_of_var_expr
soc
f
)
(
id2s
id
)
|
Index
(
f
,
index
,_
)
->
Printf
.
sprintf
"%s[%i]"
(
string_of_var_expr
soc
f
)
index
|
Slice
(
f
,
fi
,
la
,
st
,
wi
,
vt
)
->
Printf
.
sprintf
"%s[%i..%i step %i]; // XXX fixme!
\n
"
(
string_of_var_expr
soc
f
)
fi
la
st
|
Slice
(
f
,
fi
,
la
,
st
,
wi
,
vt
)
->
assert
false
(* should not occur *)
This diff is collapsed.
Click to expand it.
test/lus2lic.sum
+
9
−
11
View file @
038257f6
Test Run By jahier on Tue Jun 24 1
7:20:32
2014
Test Run By jahier on Tue Jun 24 1
8:01:59
2014
Native configuration is i686-pc-linux-gnu
=== lus2lic tests ===
...
...
@@ -431,7 +431,7 @@ PASS: ./lus2lic {-o /tmp/morel3.lic should_work/morel3.lus}
PASS: ./lus2lic {-ec -o /tmp/morel3.ec should_work/morel3.lus}
PASS: ./myec2c {-o /tmp/morel3.c /tmp/morel3.ec}
PASS: ../utils/test_lus2lic_no_node should_work/morel3.lus
PASS
: ./lus2lic {-2c should_work/morel3.lus -n morel3}
FAIL: Generate c code
: ./lus2lic {-2c should_work/morel3.lus -n morel3}
FAIL: Check that the generated C code compiles : gcc morel3_morel3.c morel3_morel3_loop.c
PASS: ./lus2lic {-o /tmp/fresh_name.lic should_work/fresh_name.lus}
PASS: ./lus2lic {-ec -o /tmp/fresh_name.ec should_work/fresh_name.lus}
...
...
@@ -563,7 +563,7 @@ PASS: ./lus2lic {-o /tmp/morel4.lic should_work/morel4.lus}
PASS: ./lus2lic {-ec -o /tmp/morel4.ec should_work/morel4.lus}
PASS: ./myec2c {-o /tmp/morel4.c /tmp/morel4.ec}
PASS: ../utils/test_lus2lic_no_node should_work/morel4.lus
PASS
: ./lus2lic {-2c should_work/morel4.lus -n morel4}
FAIL: Generate c code
: ./lus2lic {-2c should_work/morel4.lus -n morel4}
FAIL: Check that the generated C code compiles : gcc morel4_morel4.c morel4_morel4_loop.c
PASS: ./lus2lic {-o /tmp/trivial_array.lic should_work/trivial_array.lus}
FAIL: Generate ec code : ./lus2lic {-ec -o /tmp/trivial_array.ec should_work/trivial_array.lus}
...
...
@@ -782,7 +782,7 @@ PASS: ./lus2lic {-o /tmp/left.lic should_work/left.lus}
PASS: ./lus2lic {-ec -o /tmp/left.ec should_work/left.lus}
PASS: ./myec2c {-o /tmp/left.c /tmp/left.ec}
PASS: ../utils/test_lus2lic_no_node should_work/left.lus
PASS
: ./lus2lic {-2c should_work/left.lus -n left}
FAIL: Generate c code
: ./lus2lic {-2c should_work/left.lus -n left}
FAIL: Check that the generated C code compiles : gcc left_left.c left_left_loop.c
PASS: ./lus2lic {-o /tmp/ts04.lic should_work/ts04.lus}
PASS: ./lus2lic {-ec -o /tmp/ts04.ec should_work/ts04.lus}
...
...
@@ -808,7 +808,7 @@ PASS: ./lus2lic {-o /tmp/morel.lic should_work/morel.lus}
PASS: ./lus2lic {-ec -o /tmp/morel.ec should_work/morel.lus}
PASS: ./myec2c {-o /tmp/morel.c /tmp/morel.ec}
PASS: ../utils/test_lus2lic_no_node should_work/morel.lus
PASS
: ./lus2lic {-2c should_work/morel.lus -n morel}
FAIL: Generate c code
: ./lus2lic {-2c should_work/morel.lus -n morel}
FAIL: Check that the generated C code compiles : gcc morel_morel.c morel_morel_loop.c
PASS: ./lus2lic {-o /tmp/SOURIS.lic should_work/SOURIS.lus}
PASS: ./lus2lic {-ec -o /tmp/SOURIS.ec should_work/SOURIS.lus}
...
...
@@ -949,7 +949,7 @@ 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}
PASS: ../utils/test_lus2lic_no_node should_work/morel2.lus
PASS
: ./lus2lic {-2c should_work/morel2.lus -n morel2}
FAIL: Generate c code
: ./lus2lic {-2c should_work/morel2.lus -n morel2}
FAIL: Check that the generated C code compiles : gcc morel2_morel2.c morel2_morel2_loop.c
PASS: ./lus2lic {-o /tmp/minmax1.lic should_work/minmax1.lus}
PASS: ./lus2lic {-ec -o /tmp/minmax1.ec should_work/minmax1.lus}
...
...
@@ -1482,11 +1482,9 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
=== lus2lic Summary ===
# of expected passes 129
7
# of unexpected failures 1
15
# of expected passes 129
2
# of unexpected failures 1
20
# of unexpected successes 21
# of expected failures 37
testcase ./lus2lic.tests/non-reg.exp completed in 136 seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds
testcase ./lus2lic.tests/non-reg.exp completed in 136 seconds
testcase ./lus2lic.tests/non-reg.exp completed in 132 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 @
038257f6
testcase ./lus2lic.tests/non-reg.exp completed in 13
6
seconds
testcase ./lus2lic.tests/non-reg.exp completed in 13
2
seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds
This diff is collapsed.
Click to expand it.
todo.org
+
2
−
3
View file @
038257f6
...
...
@@ -60,8 +60,6 @@ http://www.di.ens.fr/~pouzet/bib/lctes12.pdf
6. file:test/should_work/morel3.lus lus2lic -2c should_work/morel3.lus -n morel3
7. file:test/should_work/ply03.lus lus2lic -2c should_work/ply03.lus -n ply03
8. file:test/should_work/xx.lus lus2lic -2c should_work/xx.lus -n xx
9. file:test/should_work/test.lus lus2lic -2c should_work/test.lus -n test
10. file:test/should_work/morel4.lus lus2lic -2c should_work/morel4.lus -n morel4
11. file:test/should_work/bad.lus lus2lic -2c should_work/bad.lus -n bad
12. file:test/should_work/mapinf.lus lus2lic -2c should_work/mapinf.lus -n mapinf
13. file:test/should_work/over2.lus lus2lic -2c should_work/over2.lus -n over2
...
...
@@ -82,7 +80,8 @@ http://www.di.ens.fr/~pouzet/bib/lctes12.pdf
28. file:test/should_work/overload.lus lus2lic -2c should_work/overload.lus -n overload
29. file:test/should_work/simple.lus lus2lic -2c should_work/simple.lus -n simple
type externe
10. file:test/should_work/morel4.lus lus2lic -2c should_work/morel4.lus -n morel4
slice en partie gauche
* Packages, modeles, etc.
...
...
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