Skip to content
Snippets Groups Projects
Commit 26416abd authored by Erwan Jahier's avatar Erwan Jahier
Browse files

SocExec : Fix a bug affecting iterators on nodes with memory

parent ecc8a594
No related branches found
No related tags found
No related merge requests found
(* Time-stamp: <modified the 10/06/2014 (at 10:47) by Erwan Jahier> *) (* Time-stamp: <modified the 16/06/2014 (at 11:48) by Erwan Jahier> *)
open Soc open Soc
open Data open Data
...@@ -114,10 +114,11 @@ let rec (soc_step : Soc.step_method -> Soc.tbl -> Soc.t -> SocExecValue.ctx ...@@ -114,10 +114,11 @@ let rec (soc_step : Soc.step_method -> Soc.tbl -> Soc.t -> SocExecValue.ctx
| _ -> assert false (* should not occur *) | _ -> assert false (* should not occur *)
in in
rctx := do_step inst_name.(i) node_step !rctx soc_tbl node_soc vel_in vel_out; rctx := do_step inst_name.(i) node_step !rctx soc_tbl node_soc vel_in vel_out;
rctx := { !rctx with s = sadd !rctx.s ("$first_step"::!rctx.cpath) (B false) };
rctx := { !rctx with cpath = List.tl !rctx.cpath }; rctx := { !rctx with cpath = List.tl !rctx.cpath };
done; done;
if iter <> "map" then ( if iter <> "map" then (
let a_in = Var (List.hd iter_inputs) in let a_in = Var (List.hd iter_inputs) in
let a_out = Var (List.hd iter_outputs) in let a_out = Var (List.hd iter_outputs) in
rctx := assign_expr !rctx a_in a_out); (* a_out=a_n *) rctx := assign_expr !rctx a_in a_out); (* a_out=a_n *)
!rctx; !rctx;
...@@ -147,7 +148,9 @@ and (do_gao : Lxm.t -> Soc.tbl -> SocExecValue.ctx -> gao -> SocExecValue.ctx) ...@@ -147,7 +148,9 @@ and (do_gao : Lxm.t -> Soc.tbl -> SocExecValue.ctx -> gao -> SocExecValue.ctx)
let soc = SocUtils.find lxm sk soc_tbl in let soc = SocUtils.find lxm sk soc_tbl in
let step = match soc.step with [step] -> step | _ -> assert false in let step = match soc.step with [step] -> step | _ -> assert false in
let ctx = do_step proc_name step ctx soc_tbl soc vel_in vel_out in let ctx = do_step proc_name step ctx soc_tbl soc vel_in vel_out in
{ ctx with cpath = path_saved } { ctx with
cpath = path_saved
}
) )
| Call(vel_out, Method((inst_name,sk),step_name), vel_in) -> ( | Call(vel_out, Method((inst_name,sk),step_name), vel_in) -> (
let path_saved = ctx.cpath in let path_saved = ctx.cpath in
...@@ -157,9 +160,7 @@ and (do_gao : Lxm.t -> Soc.tbl -> SocExecValue.ctx -> gao -> SocExecValue.ctx) ...@@ -157,9 +160,7 @@ and (do_gao : Lxm.t -> Soc.tbl -> SocExecValue.ctx -> gao -> SocExecValue.ctx)
with Not_found -> assert false with Not_found -> assert false
in in
let ctx = do_step inst_name step ctx soc_tbl soc vel_in vel_out in let ctx = do_step inst_name step ctx soc_tbl soc vel_in vel_out in
let ctx = { s = sadd ctx.s ("$first_step"::ctx.cpath) (B false); let ctx = { ctx with cpath = path_saved } in
cpath = path_saved }
in
ctx ctx
) )
and (do_step : Ident.t -> step_method -> SocExecValue.ctx -> Soc.tbl -> Soc.t -> and (do_step : Ident.t -> step_method -> SocExecValue.ctx -> Soc.tbl -> Soc.t ->
...@@ -171,6 +172,7 @@ and (do_step : Ident.t -> step_method -> SocExecValue.ctx -> Soc.tbl -> Soc.t -> ...@@ -171,6 +172,7 @@ and (do_step : Ident.t -> step_method -> SocExecValue.ctx -> Soc.tbl -> Soc.t ->
let new_s = substitute_args_and_params vel_in step_in_vars ctx in let new_s = substitute_args_and_params vel_in step_in_vars ctx in
let ctx = soc_step step soc_tbl soc { ctx with s=new_s } in let ctx = soc_step step soc_tbl soc { ctx with s=new_s } in
let s_out = substitute_params_and_args step_out_vars vel_out ctx in let s_out = substitute_params_and_args step_out_vars vel_out ctx in
let s_out = sadd s_out ("$first_step"::ctx.cpath) (B false) in
{ ctx with s = s_out } { ctx with s = s_out }
(* get the step params from its soc params *) (* get the step params from its soc params *)
......
Test Run By jahier on Fri Jun 13 17:01:22 2014 Test Run By jahier on Mon Jun 16 16:08:25 2014
Native configuration is i686-pc-linux-gnu Native configuration is i686-pc-linux-gnu
=== lus2lic tests === === lus2lic tests ===
...@@ -157,7 +157,7 @@ FAIL: Generate c code : ./lus2lic {-2c should_work/call06.lus -n call06} ...@@ -157,7 +157,7 @@ FAIL: Generate c code : ./lus2lic {-2c should_work/call06.lus -n call06}
PASS: ./lus2lic {-o /tmp/deSimone.lic should_work/deSimone.lus} PASS: ./lus2lic {-o /tmp/deSimone.lic should_work/deSimone.lus}
PASS: ./lus2lic {-ec -o /tmp/deSimone.ec should_work/deSimone.lus} PASS: ./lus2lic {-ec -o /tmp/deSimone.ec should_work/deSimone.lus}
PASS: ./myec2c {-o /tmp/deSimone.c /tmp/deSimone.ec} PASS: ./myec2c {-o /tmp/deSimone.c /tmp/deSimone.ec}
FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/deSimone.lus PASS: ../utils/test_lus2lic_no_node should_work/deSimone.lus
PASS: ./lus2lic {-2c should_work/deSimone.lus -n deSimone} 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 FAIL: Check that the generated C code compiles : gcc deSimone_deSimone.c deSimone_deSimone_loop.c
PASS: ./lus2lic {-o /tmp/bug2.lic should_work/bug2.lus} PASS: ./lus2lic {-o /tmp/bug2.lic should_work/bug2.lus}
...@@ -280,7 +280,7 @@ PASS: gcc test_node_expand2_test_node_expand2.c test_node_expand2_test_node_expa ...@@ -280,7 +280,7 @@ PASS: gcc test_node_expand2_test_node_expand2.c test_node_expand2_test_node_expa
PASS: ./lus2lic {-o /tmp/test.lic should_work/test.lus} PASS: ./lus2lic {-o /tmp/test.lic should_work/test.lus}
PASS: ./lus2lic {-ec -o /tmp/test.ec should_work/test.lus} PASS: ./lus2lic {-ec -o /tmp/test.ec should_work/test.lus}
PASS: ./myec2c {-o /tmp/test.c /tmp/test.ec} PASS: ./myec2c {-o /tmp/test.c /tmp/test.ec}
FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/test.lus PASS: ../utils/test_lus2lic_no_node should_work/test.lus
PASS: ./lus2lic {-2c should_work/test.lus -n test} PASS: ./lus2lic {-2c should_work/test.lus -n test}
PASS: gcc test_test.c test_test_loop.c PASS: gcc test_test.c test_test_loop.c
PASS: ./lus2lic {-o /tmp/FALLING_EDGE.lic should_work/FALLING_EDGE.lus} PASS: ./lus2lic {-o /tmp/FALLING_EDGE.lic should_work/FALLING_EDGE.lus}
...@@ -618,7 +618,7 @@ PASS: gcc param_node3_param_node3.c param_node3_param_node3_loop.c ...@@ -618,7 +618,7 @@ PASS: gcc param_node3_param_node3.c param_node3_param_node3_loop.c
PASS: ./lus2lic {-o /tmp/pipeline.lic should_work/pipeline.lus} PASS: ./lus2lic {-o /tmp/pipeline.lic should_work/pipeline.lus}
PASS: ./lus2lic {-ec -o /tmp/pipeline.ec should_work/pipeline.lus} PASS: ./lus2lic {-ec -o /tmp/pipeline.ec should_work/pipeline.lus}
PASS: ./myec2c {-o /tmp/pipeline.c /tmp/pipeline.ec} PASS: ./myec2c {-o /tmp/pipeline.c /tmp/pipeline.ec}
FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/pipeline.lus PASS: ../utils/test_lus2lic_no_node should_work/pipeline.lus
PASS: ./lus2lic {-2c should_work/pipeline.lus -n pipeline} 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 FAIL: Check that the generated C code compiles : gcc pipeline_pipeline.c pipeline_pipeline_loop.c
PASS: ./lus2lic {-o /tmp/mapinf.lic should_work/mapinf.lus} PASS: ./lus2lic {-o /tmp/mapinf.lic should_work/mapinf.lus}
...@@ -1479,9 +1479,9 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman ...@@ -1479,9 +1479,9 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
=== lus2lic Summary === === lus2lic Summary ===
# of expected passes 1211 # of expected passes 1214
# of unexpected failures 198 # of unexpected failures 195
# of unexpected successes 21 # of unexpected successes 21
# of expected failures 37 # of expected failures 37
testcase ./lus2lic.tests/non-reg.exp completed in 118 seconds testcase ./lus2lic.tests/non-reg.exp completed in 133 seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds
testcase ./lus2lic.tests/non-reg.exp completed in 118 seconds testcase ./lus2lic.tests/non-reg.exp completed in 133 seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment