From fffd1850a20c6e2ec2442d88c09d9ae85b9ad1e4 Mon Sep 17 00:00:00 2001 From: Erwan Jahier <jahier@imag.fr> Date: Fri, 13 Feb 2015 16:46:19 +0100 Subject: [PATCH] soc2c: fix a bug occuring when copying arrays with memcpy(). Indeed, in order to copy an array, I used to generate something like memcpy(out, in, sizeof(in)); but if 'out' and 'in' are arrays, and if 'in' is an argument of a function, sizeof() considers it as a pointer, not an array !!!! note that if 'in' is a local var, sizeof(in) works fine. To fix it, I use the type of the dest (instead of the id) as argument of sizeof. nb : The pb never occured before, as in the heap mode only the ctx is passed a args of step functions. --- src/lv6MainArgs.ml | 2 +- src/soc2cHeap.ml | 21 +++++++++-------- src/soc2cHeap.mli | 6 ++--- src/soc2cStack.ml | 37 +++++++++++++++++------------- src/soc2cStack.mli | 4 ++-- src/socPredef2cHeap.ml | 33 +++++++++++--------------- src/socPredef2cStack.ml | 31 +++++++++++-------------- test/lus2lic.sum | 24 +++++++++---------- test/lus2lic.time | 14 +++++------ test/should_work/ck7.lus | 2 +- test/should_work/ply03.lus | 2 +- test/should_work/trivial_array.lus | 2 +- 12 files changed, 87 insertions(+), 91 deletions(-) diff --git a/src/lv6MainArgs.ml b/src/lv6MainArgs.ml index 6357afa6..583b83fb 100644 --- a/src/lv6MainArgs.ml +++ b/src/lv6MainArgs.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 12/02/2015 (at 18:17) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/02/2015 (at 15:50) by Erwan Jahier> *) (* Le manager d'argument adapté de celui de lutin, plus joli N.B. solution un peu batarde : les options sont stockées, comme avant, dans Global, diff --git a/src/soc2cHeap.ml b/src/soc2cHeap.ml index 73d5287f..fc47832e 100644 --- a/src/soc2cHeap.ml +++ b/src/soc2cHeap.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 11/02/2015 (at 16:19) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/02/2015 (at 16:01) by Erwan Jahier> *) open Soc2cUtil open Soc2cIdent @@ -28,21 +28,22 @@ let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) = (* exported *) -let rec (gen_assign : Data.t -> string -> string -> string -> string) = - fun t vi vo size -> +let rec (gen_assign : Data.t -> string -> string -> string) = + fun t vi vo -> + let t_str = Soc2cUtil.data_type_to_c t "" in match t with - | Data.Alias(_,t) -> gen_assign t vi vo size + | Data.Alias(_,t) -> gen_assign t vi vo | Data.Enum _ | Data.Struct(_) (* should I rather use memcpy for struct? *) | Data.Bool | Data.Int | Data.Real -> Printf.sprintf " %s = %s;\n" vi vo | Data.Alpha(_) (* dead code ? *) | Data.Array(_) -> - let t_str = Soc2cIdent.type_to_short_string t in - Printf.sprintf " _assign_%s(%s, %s, sizeof(%s));\n" t_str vi vo vi + let t_str_short = Soc2cIdent.type_to_short_string t in + Printf.sprintf " _assign_%s(%s, %s, sizeof(%s));\n" t_str_short vi vo t_str | Data.Extern (id) -> - Printf.sprintf " _assign_%s(&%s, &%s, sizeof(%s));\n" (id2s id) vi vo vo + Printf.sprintf " _assign_%s(&%s, &%s, sizeof(%s));\n" (id2s id) vi vo t_str let (gen_assign_var_expr : Soc.t -> Soc.var_expr -> Soc.var_expr -> string) = fun soc vi vo -> @@ -52,7 +53,6 @@ fun soc vi vo -> | _,_ -> gen_assign (Soc.data_type_of_var_expr vi) (string_of_var_expr soc vi) (string_of_var_expr soc vo) - (Printf.sprintf "sizeof(%s)" (string_of_var_expr soc vo)) let (step_name : Soc.key -> string -> string) = @@ -133,7 +133,7 @@ let (gen_step_call : Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> let inputs = fst called_soc.profile in let l = try ( List.map2 (fun (name, t) ve -> - gen_assign t (Printf.sprintf "%s.%s" ctx name) ve (Printf.sprintf "sizeof(%s)" ve)) + gen_assign t (Printf.sprintf "%s.%s" ctx name) ve) inputs vel_in ) with _ -> assert false (* are all parameters necessarily used? *) in @@ -146,7 +146,8 @@ let (gen_step_call : Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> List.map2 (fun (name,t) ve -> let ve2 = Printf.sprintf "%s.%s" ctx name in - gen_assign t ve ve2 (Printf.sprintf "sizeof(%s)" ve2)) outputs vel_out + gen_assign t ve ve2) + outputs vel_out ) with _ -> assert false in (String.concat "" l) ^"\n" diff --git a/src/soc2cHeap.mli b/src/soc2cHeap.mli index 19f424a7..205e3cc9 100644 --- a/src/soc2cHeap.mli +++ b/src/soc2cHeap.mli @@ -1,11 +1,11 @@ -(* Time-stamp: <modified the 09/02/2015 (at 16:44) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/02/2015 (at 15:37) by Erwan Jahier> *) (** Gathers all entities (functions, types) that implement the heap-based C generator. *) -(* [gen_assign t vi vo size] generated the C code that assign vo to vi, +(* [gen_assign t vi vo] generated the C code that assign vo to vi, using memcpy or = depending on the type t *) -val gen_assign : Data.t -> string -> string -> string -> string +val gen_assign : Data.t -> string -> string -> string (* ditto *) val gen_assign_var_expr : Soc.t -> Soc.var_expr -> Soc.var_expr -> string diff --git a/src/soc2cStack.ml b/src/soc2cStack.ml index 09b62b5e..489bfb13 100644 --- a/src/soc2cStack.ml +++ b/src/soc2cStack.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 12/02/2015 (at 17:14) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/02/2015 (at 15:38) by Erwan Jahier> *) open Soc2cUtil open Soc2cIdent @@ -44,12 +44,12 @@ let rec (is_soc_output : Soc.var_expr -> Soc.t -> bool) = | Slice(ve,_,_,_,_,t) -> false (* is_soc_output ve soc *) let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) = - fun soc -> function + fun soc var -> match var with | Const("true", _) -> "_true" | Const("false", _) -> "_false" | Const(id, _) -> id2s id | Var ("_memory",_) -> (* Clutch! it's not an interface var... *) "ctx->_memory" - | Var (id,_) -> id2s id + | Var (id,t) -> id2s id | Field(f, id,_) -> if is_soc_output f soc then Printf.sprintf "%s->%s" (string_of_var_expr soc f) (id2s id) @@ -59,32 +59,37 @@ let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) = (* exported *) -let rec (gen_assign : Data.t -> string -> string -> string -> string) = - fun t vi vo size -> +let rec (gen_assign : Data.t -> string -> string -> string) = + fun t vi vo -> + let t_str = Soc2cUtil.data_type_to_c t "" in match t with - | Data.Alias(_,t) -> gen_assign t vi vo size + | Data.Alias(_,t) -> gen_assign t vi vo | Data.Enum _ | Data.Struct(_) (* should I rather use memcpy for struct? *) | Data.Bool | Data.Int | Data.Real -> Printf.sprintf " %s = %s;\n" vi vo | Data.Alpha(_) (* dead code ? *) | Data.Array(_) -> - let t_str = Soc2cIdent.type_to_short_string t in - Printf.sprintf " _assign_%s(%s, %s, sizeof(%s));\n" t_str vi vo vi + let t_str_short = Soc2cIdent.type_to_short_string t in + Printf.sprintf " _assign_%s(%s, %s, sizeof(%s));\n" t_str_short vi vo t_str | Data.Extern (id) -> - Printf.sprintf " _assign_%s(&%s, &%s, sizeof(%s));\n" (id2s id) vi vo vo + Printf.sprintf " _assign_%s(&%s, &%s, sizeof(%s));\n" (id2s id) vi vo t_str let (gen_assign_var_expr : Soc.t -> Soc.var_expr -> Soc.var_expr -> string) = -fun soc vi vo -> - match vi,vo with +fun soc vo vi -> + match vo,vi with | Slice _, _ | _, Slice _ -> assert false | _,_ -> - let left = string_of_var_expr soc vi in - let left = if is_soc_output vi soc && ve_not_an_array vi && ve_not_a_field vi - then "*"^left else left in - gen_assign (Soc.data_type_of_var_expr vi) left (string_of_var_expr soc vo) - (Printf.sprintf "sizeof(%s)" (string_of_var_expr soc vo)) + let left = string_of_var_expr soc vo in + let left = if is_soc_output vo soc && ve_not_an_array vo && ve_not_a_field vo + then "*"^left else left + in + let vi_str = string_of_var_expr soc vi in + let vi_str = + if is_soc_output vi soc && ve_not_an_array vi then "*"^vi_str else vi_str + in + gen_assign (Soc.data_type_of_var_expr vo) left vi_str let (step_name : Soc.key -> string -> string) = diff --git a/src/soc2cStack.mli b/src/soc2cStack.mli index 5027868e..f310673a 100644 --- a/src/soc2cStack.mli +++ b/src/soc2cStack.mli @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 12/02/2015 (at 17:14) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/02/2015 (at 15:38) by Erwan Jahier> *) (** Gathers all entities (functions, types) that implement the heap-based C generator. *) @@ -10,7 +10,7 @@ val is_soc_output : Soc.var_expr -> Soc.t -> bool (** [gen_assign t vi vo size] generated the C code that assign vo to vi, using memcpy or = depending on the type t *) -val gen_assign : Data.t -> string -> string -> string -> string +val gen_assign : Data.t -> string -> string -> string (** ditto *) val gen_assign_var_expr : Soc.t -> Soc.var_expr -> Soc.var_expr -> string diff --git a/src/socPredef2cHeap.ml b/src/socPredef2cHeap.ml index 0e379e6c..2bcbd65e 100644 --- a/src/socPredef2cHeap.ml +++ b/src/socPredef2cHeap.ml @@ -1,5 +1,5 @@ -(* Time-stamp: <modified the 06/02/2015 (at 16:09) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/02/2015 (at 16:09) by Erwan Jahier> *) open Data open Soc @@ -28,8 +28,7 @@ let (lustre_ite : Soc.key -> string) = (* Printf.sprintf" %s.z = (%s.c)? %s.xt : %s.xe;\n" ctx ctx ctx ctx *) Soc2cHeap.gen_assign t (Printf.sprintf "%s.z" ctx) (Printf.sprintf "(%s.c)? %s.xt : %s.xe" ctx ctx ctx) - (Printf.sprintf "sizeof(%s.z)" ctx) - + let (lustre_impl : Soc.key -> string) = fun sk -> let ctx = get_ctx_name sk in @@ -42,9 +41,7 @@ let (lustre_arrow : Soc.key -> string) = let x,y,z = "ctx->x", "ctx->y", "ctx->z" in let t = match sk with (_,_::t::_,_) -> t | _ -> assert false in let vo = Printf.sprintf"((ctx->_memory)? %s : %s)" x y in - let size = Printf.sprintf "sizeof(%s)" x in - (Soc2cHeap.gen_assign t z vo size) ^ - (" ctx->_memory = _false;\n") + (Soc2cHeap.gen_assign t z vo) ^ (" ctx->_memory = _false;\n") let (lustre_hat : Soc.key -> string) = fun (n,tl,si_opt) -> @@ -56,7 +53,7 @@ let (lustre_hat : Soc.key -> string) = let buff = ref "" in for j=0 to i-1 do buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j) - (Printf.sprintf "%s.x" ctx) (Printf.sprintf "sizeof(%s.x)" ctx)); + (Printf.sprintf "%s.x" ctx)); done; !buff @@ -70,8 +67,7 @@ let (lustre_array: Soc.key -> string) = let buff = ref "" in for j=0 to i-1 do buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j) - (Printf.sprintf "%s.x%d" ctx (j+1)) - (Printf.sprintf "sizeof(%s.x%d)" ctx (j+1))); + (Printf.sprintf "%s.x%d" ctx (j+1))); done; !buff @@ -84,18 +80,19 @@ let (lustre_concat: Soc.key -> string) = in let t1 = Printf.sprintf "%s.x" ctx and t2 = Printf.sprintf "%s.y" ctx - and t12 = Printf.sprintf "%s.z" ctx in - (Printf.sprintf " memcpy(&%s, &%s, sizeof(%s));\n" t12 t1 t1)^ - (Printf.sprintf " memcpy(&%s[%d], &%s, sizeof(%s));\n" t12 s1 t2 t2) + and t12 = Printf.sprintf "%s.z" ctx + and t1_type = Soc2cUtil.data_type_to_c (Data.Array(t,s1)) "" + and t2_type = Soc2cUtil.data_type_to_c (Data.Array(t,s2)) "" + in + (Printf.sprintf " memcpy(&%s, &%s, sizeof(%s));\n" t12 t1 t1_type)^ + (Printf.sprintf " memcpy(&%s[%d], &%s, sizeof(%s));\n" t12 s1 t2 t2_type) (* Both seems to work *) (* let buff = ref "" in *) (* for j=0 to s1-1 do *) -(* buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j) *) -(* (Printf.sprintf "%s.x[%d]" ctx j)); *) +(* buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j)); *) (* done; *) (* for j=s1 to s1+s2-1 do *) -(* buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j) *) -(* (Printf.sprintf "%s.y[%d]" ctx (j-s1))); *) +(* buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j)); *) (* done; *) (* !buff *) @@ -114,7 +111,6 @@ let (lustre_slice: Soc.key -> string) = if (i-b) mod step = 0 then ( buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.z[%d]" ctx !j) (Printf.sprintf "%s.x[%d]" ctx i) - (Printf.sprintf "sizeof(%s.x[%d])" ctx i) ); incr j); done; @@ -252,8 +248,7 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = let type_in = (snd (List.hd iter_inputs)) 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^(Soc2cHeap.gen_assign type_in a_out a_in - (Printf.sprintf "sizeof(%s)" a_in)) (* a_out=a_n *) + buff := !buff^(Soc2cHeap.gen_assign type_in a_out a_in) (* a_out=a_n *) ); !buff diff --git a/src/socPredef2cStack.ml b/src/socPredef2cStack.ml index b2d6a390..d3c2569a 100644 --- a/src/socPredef2cStack.ml +++ b/src/socPredef2cStack.ml @@ -1,5 +1,5 @@ -(* Time-stamp: <modified the 12/02/2015 (at 18:11) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/02/2015 (at 16:10) by Erwan Jahier> *) open Data open Soc @@ -25,7 +25,6 @@ let (lustre_ite : Soc.key -> string) = (* Printf.sprintf" %s.z = (%s.c)? %s.xt : %s.xe;\n" ctx ctx ctx ctx *) Soc2cStack.gen_assign t (Printf.sprintf "*z") (Printf.sprintf "(c)? xt : xe") - (Printf.sprintf "sizeof(*z)") let (lustre_impl : Soc.key -> string) = fun sk -> @@ -43,8 +42,7 @@ let (lustre_arrow : Soc.key -> string) = | _ -> "*z" in let vo = Printf.sprintf"((ctx->_memory)? %s : %s)" x y in - let size = Printf.sprintf "sizeof(%s)" x in - (Soc2cStack.gen_assign t z vo size) ^ + (Soc2cStack.gen_assign t z vo) ^ (" ctx->_memory = _false;\n") let (lustre_hat : Soc.key -> string) = @@ -56,7 +54,7 @@ let (lustre_hat : Soc.key -> string) = let buff = ref "" in for j=0 to i-1 do buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "z[%d]" j) - (Printf.sprintf "x") (Printf.sprintf "sizeof(x)")); + (Printf.sprintf "x")); done; !buff @@ -69,8 +67,7 @@ let (lustre_array: Soc.key -> string) = let buff = ref "" in for j=0 to i-1 do buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "z[%d]" j) - (Printf.sprintf "x%d" (j+1)) - (Printf.sprintf "sizeof(x%d)" (j+1))); + (Printf.sprintf "x%d" (j+1))); done; !buff @@ -82,18 +79,19 @@ let (lustre_concat: Soc.key -> string) = in let t1 = Printf.sprintf "x" and t2 = Printf.sprintf "y" - and t12 = Printf.sprintf "z" in - (Printf.sprintf " memcpy(%s, &%s, sizeof(%s));\n" t12 t1 t1)^ - (Printf.sprintf " memcpy(%s[%d], &%s, sizeof(%s));\n" t12 s1 t2 t2) + and t12 = Printf.sprintf "z" + and t1_type = Soc2cUtil.data_type_to_c (Data.Array(t,s1)) "" + and t2_type = Soc2cUtil.data_type_to_c (Data.Array(t,s2)) "" + in + (Printf.sprintf " memcpy(%s, &%s, sizeof(%s));\n" t12 t1 t1_type)^ + (Printf.sprintf " memcpy(%s[%d], &%s, sizeof(%s));\n" t12 s1 t2 t2_type) (* Both seems to work *) (* let buff = ref "" in *) (* for j=0 to s1-1 do *) -(* buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j) *) -(* (Printf.sprintf "%s.x[%d]" ctx j)); *) +(* buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j)); *) (* done; *) (* for j=s1 to s1+s2-1 do *) -(* buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j) *) -(* (Printf.sprintf "%s.y[%d]" ctx (j-s1))); *) +(* buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j)); *) (* done; *) (* !buff *) @@ -111,7 +109,6 @@ let (lustre_slice: Soc.key -> string) = if (i-b) mod step = 0 then ( buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "z[%d]" !j) (Printf.sprintf "x[%d]" i) - (Printf.sprintf "sizeof(x[%d])" i) ); incr j); done; @@ -264,8 +261,7 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = if Soc2cStack.is_soc_output (Var(o,t)) soc && not_an_array t then "*"^o else o in - buff := !buff^(Soc2cStack.gen_assign type_in a_out a_in - (Printf.sprintf "sizeof(%s)" a_in)) (* a_out=a_n *) + buff := !buff^(Soc2cStack.gen_assign type_in a_out a_in) (* a_out=a_n *) ); !buff @@ -311,7 +307,6 @@ let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) = (* exported *) let (get_boolred : Soc.t -> int -> int -> int -> string )= fun soc i j k -> - let ctx = get_ctx_name soc.key in let buff = ref "" in let add str = buff:=!buff^(str^"\n") in add " int cpt,i;"; diff --git a/test/lus2lic.sum b/test/lus2lic.sum index 902d54fc..4417d58c 100644 --- a/test/lus2lic.sum +++ b/test/lus2lic.sum @@ -1,5 +1,5 @@ ==> lus2lic0.sum <== -Test Run By jahier on Thu Feb 12 18:18:34 +Test Run By jahier on Fri Feb 13 16:11:32 Native configuration is x86_64-unknown-linux-gnu === lus2lic0 tests === @@ -63,7 +63,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 Thu Feb 12 18:18:28 +Test Run By jahier on Fri Feb 13 16:11:34 Native configuration is x86_64-unknown-linux-gnu === lus2lic1 tests === @@ -397,7 +397,7 @@ PASS: gcc -o multipar.exec multipar_multipar.c multipar_multipar_loop.c PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {} ==> lus2lic2.sum <== -Test Run By jahier on Thu Feb 12 18:18:30 +Test Run By jahier on Fri Feb 13 16:11:26 Native configuration is x86_64-unknown-linux-gnu === lus2lic2 tests === @@ -727,7 +727,7 @@ PASS: gcc -o zzz2.exec zzz2_zzz2.c zzz2_zzz2_loop.c PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {} ==> lus2lic3.sum <== -Test Run By jahier on Thu Feb 12 18:18:37 +Test Run By jahier on Fri Feb 13 16:11:30 Native configuration is x86_64-unknown-linux-gnu === lus2lic3 tests === @@ -1230,7 +1230,7 @@ PASS: ./myec2c {-o multipar.c multipar.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {} ==> lus2lic4.sum <== -Test Run By jahier on Thu Feb 12 18:18:32 +Test Run By jahier on Fri Feb 13 16:11:28 Native configuration is x86_64-unknown-linux-gnu === lus2lic4 tests === @@ -1726,12 +1726,12 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {} # of unexpected failures 3 =============================== # Total number of failures: 14 -lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 5 seconds -lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 37 seconds -lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 67 seconds -lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 39 seconds -lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 76 seconds +lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 7 seconds +lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 53 seconds +lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 77 seconds +lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 57 seconds +lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 90 seconds * Ref time: * Quick time (-j 4): -0.03user 0.02system 1:20.36elapsed 0%CPU (0avgtext+0avgdata 5132maxresident)k -160inputs+0outputs (0major+5556minor)pagefaults 0swaps +0.04user 0.01system 1:32.86elapsed 0%CPU (0avgtext+0avgdata 5080maxresident)k +160inputs+0outputs (0major+5541minor)pagefaults 0swaps diff --git a/test/lus2lic.time b/test/lus2lic.time index b8c48913..52f0b050 100644 --- a/test/lus2lic.time +++ b/test/lus2lic.time @@ -1,9 +1,9 @@ -lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 5 seconds -lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 37 seconds -lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 67 seconds -lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 39 seconds -lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 76 seconds +lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 7 seconds +lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 53 seconds +lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 77 seconds +lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 57 seconds +lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 90 seconds * Ref time: * Quick time (-j 4): -0.03user 0.02system 1:20.36elapsed 0%CPU (0avgtext+0avgdata 5132maxresident)k -160inputs+0outputs (0major+5556minor)pagefaults 0swaps +0.04user 0.01system 1:32.86elapsed 0%CPU (0avgtext+0avgdata 5080maxresident)k +160inputs+0outputs (0major+5541minor)pagefaults 0swaps diff --git a/test/should_work/ck7.lus b/test/should_work/ck7.lus index 7e2f3df5..cd0a839b 100644 --- a/test/should_work/ck7.lus +++ b/test/should_work/ck7.lus @@ -10,7 +10,7 @@ tel -node ck7_clk(a: bool; m,n:int) +function ck7_clk(a: bool; m,n:int) returns(q:int; r: int when a); let q = m+n; diff --git a/test/should_work/ply03.lus b/test/should_work/ply03.lus index 6c32f80f..a0ae05bc 100644 --- a/test/should_work/ply03.lus +++ b/test/should_work/ply03.lus @@ -1,5 +1,5 @@ -node ply03(x,y: int) returns (o: int^42); +function ply03(x,y: int) returns (o: int^42); let o = if (x < y) then 0^42 else map<<+,42>>(x^42, y^42); tel diff --git a/test/should_work/trivial_array.lus b/test/should_work/trivial_array.lus index fa47600c..e42e52fb 100644 --- a/test/should_work/trivial_array.lus +++ b/test/should_work/trivial_array.lus @@ -1,4 +1,4 @@ -node trivial_array(x:int^3) returns (y: int^3^4); +function trivial_array(x:int^3) returns (y: int^3^4); let y = [x]|[x]|[x]|[x]; tel -- GitLab