From 360a5c237ffd24aaae3d180f62ecf25cb539fb4d Mon Sep 17 00:00:00 2001 From: Erwan Jahier <jahier@imag.fr> Date: Thu, 12 Dec 2013 16:33:00 +0100 Subject: [PATCH] Make to use tail recursive calls in L2lsplit. More specifically, replace @ by rev_append and flatten+map by fold_left. On a file that has 11000 equations (normal.ec), I win a factor 4: 60s -> 15s --- Makefile | 7 ++-- _oasis | 3 ++ src/actionsDeps.ml | 6 ++-- src/compile.ml | 21 ++++++------ src/l2lSplit.ml | 25 +++++++++----- src/lic2soc.ml | 16 ++++----- src/lv6MainArgs.ml | 7 ++-- src/lv6version.ml | 4 +-- src/main.ml | 6 ++-- test/lus2lic.log.ref | 80 +++++++++++++++++--------------------------- test/lus2lic.sum | 8 +++-- test/lus2lic.time | 4 +-- 12 files changed, 93 insertions(+), 94 deletions(-) diff --git a/Makefile b/Makefile index 71b305e8..7c076e20 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,18 @@ # oasis entry points -build: setup.ml src/lv6version.ml +build: setup.data setup.ml src/lv6version.ml ocaml setup.ml -build + setup.ml:_oasis oasis setup +PROF=--enable-profile +PROF=--disable-profile setup.data:configure configure: setup.ml - ocaml setup.ml -configure --prefix $(LUSTREV6_PATH) --exec-prefix $(LUSTREV6_PATH)/$(HOSTTYPE) + ocaml setup.ml -configure $(PROF) --prefix $(LUSTREV6_PATH) --exec-prefix $(LUSTREV6_PATH)/$(HOSTTYPE) test: build cd test; make test diff --git a/_oasis b/_oasis index 5d16ff33..d0b7e73d 100644 --- a/_oasis +++ b/_oasis @@ -9,6 +9,7 @@ Synopsis: The Lustre V6 Verimag compiler Homepage: http://www-verimag.imag.fr/lustre-v6.html Description: The Lustre V6 Verimag compiler + Executable lus2lic Path: src BuildTools: ocamlbuild @@ -17,6 +18,8 @@ Executable lus2lic Install:true CompiledObject: native + + Library lus4ocaml Modules: Lus2licRun Path: src/ diff --git a/src/actionsDeps.ml b/src/actionsDeps.ml index c394aa3d..0d3d0250 100644 --- a/src/actionsDeps.ml +++ b/src/actionsDeps.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 11/12/2013 (at 17:49) by Erwan Jahier> *) +(** Time-stamp: <modified the 12/12/2013 (at 17:03) by Erwan Jahier> *) let dbg = (Verbose.get_flag "deps") @@ -89,11 +89,11 @@ let (concat: t -> t -> t) = (*********************************************************************************) (* exported *) -let (generate_deps_from_step_policy: +let (generate_deps_from_step_policy: Soc.precedence list -> (string * action) list -> t) = fun precedences actions -> let generate_deps_for_action: - (t -> string * string list -> t) = + (t -> string * string list -> t) = fun ad (action_name, actions_needed) -> let main_action = snd (List.find (fun (n, _) -> n = action_name) actions) in let deps = diff --git a/src/compile.ml b/src/compile.ml index b579f451..98399219 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 10/12/2013 (at 14:51) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/12/2013 (at 14:16) by Erwan Jahier> *) open Lxm open Lv6errors @@ -27,10 +27,10 @@ let (doit : Lv6MainArgs.t -> AstV6.pack_or_model list -> Ident.idref option -> L priorité dans l'ordre *) - info "Creating syntax tables...\n"; let lic_tab = LicTab.create syntax_tab in Verbose.exe ~level:2 (fun () -> AstTab.dump syntax_tab); + info "Compiling into lic...\n"; let lic_tab = match main_node with | None -> LicTab.compile_all lic_tab | Some main_node -> @@ -39,7 +39,7 @@ let (doit : Lv6MainArgs.t -> AstV6.pack_or_model list -> Ident.idref option -> L else LicTab.compile_node lic_tab main_node in - info "Compiling into lic...\n"; + info "Converting to lic_prg...\n"; let zelic = LicTab.to_lic_prg lic_tab in (* élimination polymorphisme surcharge *) info "Removing polymorphism...\n"; @@ -81,16 +81,17 @@ let (doit : Lv6MainArgs.t -> AstV6.pack_or_model list -> Ident.idref option -> L L2lCheckOutputs.doit zelic; info "Lic Compilation done!\n"; zelic + let test_lex ( lexbuf ) = ( let tk = ref (Lv6lexer.lexer lexbuf) in - while !tk <> Lv6parser.TK_EOF do - match (Lv6lexer.token_code !tk) with - ( co , lxm ) -> - Printf.printf "line %3d col %2d to %2d : %15s = \"%s\"\n" - (line lxm) (cstart lxm) (cend lxm) co (str lxm) ; - tk := (Lv6lexer.lexer lexbuf) - done + while !tk <> Lv6parser.TK_EOF do + match (Lv6lexer.token_code !tk) with + ( co , lxm ) -> + Printf.printf "line %3d col %2d to %2d : %15s = \"%s\"\n" + (line lxm) (cstart lxm) (cend lxm) co (str lxm) ; + tk := (Lv6lexer.lexer lexbuf) + done ) (* Retourne un AstV6.t *) diff --git a/src/l2lSplit.ml b/src/l2lSplit.ml index a840593d..3525ec57 100644 --- a/src/l2lSplit.ml +++ b/src/l2lSplit.ml @@ -11,6 +11,9 @@ open Lxm open Lic let dbg = (Verbose.get_flag "split") +let info msg = + let t = Sys.time() in + Verbose.exe ~flag:dbg (fun () -> Printf.eprintf "%4.4f: %s%!" t msg) (********************************************************************************) let new_var getid type_eff clock_eff = @@ -143,7 +146,7 @@ let (split_tuples:Lic.eq_info Lxm.srcflagged list -> Lic.eq_info Lxm.srcflagged else [eq] in - List.flatten (List.map split_one_eq eql) + List.fold_left (fun acc eq -> List.rev_append (split_one_eq eq) acc) [] eql (********************************************************************************) (* The functions below accumulate @@ -157,12 +160,13 @@ let rec (eq : LicPrg.id_generator -> Lic.eq_info Lxm.srcflagged -> split_acc) = let n_rhs, (neqs, nlocs) = split_val_exp false true getid rhs in { src = lxm_eq ; it = (lhs, n_rhs) }::neqs, nlocs -and (split_eq_acc : +and (split_eq_acc : LicPrg.id_generator -> split_acc -> Lic.eq_info srcflagged -> split_acc) = - fun getid (eqs, locs) equation -> + fun getid (eqs, locs) equation -> let (neqs, nlocs) = eq getid equation in - (split_tuples (eqs@neqs), locs@nlocs) - + let neqs = split_tuples neqs in + List.rev_append neqs eqs, List.rev_append nlocs locs + and (split_val_exp : bool -> bool -> LicPrg.id_generator -> Lic.val_exp -> Lic.val_exp * split_acc) = fun when_flag top_level getid ve -> @@ -308,8 +312,9 @@ and (split_val_exp_list : bool -> and split_node (getid: LicPrg.id_generator) (n: Lic.node_exp) : Lic.node_exp = Verbose.exe ~flag:dbg (fun () -> - Printf.printf "*** Splitting node %s\n" - (LicDump.string_of_node_key_iter n.node_key_eff)); + Printf.eprintf "*** Splitting node %s\n" + (LicDump.string_of_node_key_iter n.node_key_eff); + flush stderr); let res = match n.def_eff with | ExternLic | MetaOpLic @@ -319,6 +324,9 @@ and split_node (getid: LicPrg.id_generator) (n: Lic.node_exp) : Lic.node_exp = | BodyLic b -> let loc = match n.loclist_eff with None -> [] | Some l -> l in let (neqs, nv) = List.fold_left (split_eq_acc getid) ([], loc) b.eqs_eff in + info (Printf.sprintf "Split %i equations into %i ones\n" + (List.length b.eqs_eff)(List.length neqs)); + let asserts = List.map (fun x -> x.it) b.asserts_eff in let lxm_asserts = List.map (fun x -> x.src) b.asserts_eff in let nasserts,(neqs_asserts,nv_asserts) = @@ -353,8 +361,7 @@ let rec doit (inprg : LicPrg.t) : LicPrg.t = (** TRAITE LES NOEUDS : *) let rec do_node k (ne:Lic.node_exp) = (* On passe en parametre un constructeur de nouvelle variable locale *) - Verbose.exe ~flag:dbg (fun() -> Printf.printf "#DBG: split equations of '%s'\n" - (Lic.string_of_node_key k)); + info (Printf.sprintf "#DBG: split equations of '%s'\n" (Lic.string_of_node_key k)); let getid = LicPrg.fresh_var_id_generator inprg ne in let ne' = split_node getid ne in res := LicPrg.add_node k ne' !res diff --git a/src/lic2soc.ml b/src/lic2soc.ml index a1fe5472..c13eaf93 100644 --- a/src/lic2soc.ml +++ b/src/lic2soc.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 11/12/2013 (at 17:48) by Erwan Jahier> *) +(** Time-stamp: <modified the 13/12/2013 (at 10:45) by Erwan Jahier> *) open Lxm open Lic @@ -742,7 +742,7 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = (** Produit des soc de noeuds. *) and (soc_of_node: LicPrg.t -> Lic.node_exp -> Soc.tbl -> (ctx * Soc.t * Soc.tbl) option) = fun licprg node soc_tbl -> - info "Soc: soc_of_node...\n"; + info "Lic2soc.soc_of_node...\n"; let io_list = node.Lic.inlist_eff @ node.Lic.outlist_eff in let io_type = List.map (fun vi -> lic_to_data_type vi.var_type_eff) io_list in let soc_key = make_soc_key_of_node_exp node.Lic.node_key_eff None io_type in @@ -761,14 +761,14 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = b.eqs_eff in (* Construction des dépendances entre les expressions *) - info "Soc: computing dependencies...\n"; + info "Lic2soc.soc_of_node: computing dependencies...\n"; let all_deps = ActionsDeps.build_data_deps_from_actions lic_to_data_type deps actions in Verbose.exe ~flag:dbg (fun () -> print_string (ActionsDeps.to_string all_deps); flush stdout); let actions = - info "Soc: sorting actions...\n"; + info "Lic2soc.soc_of_node: sorting actions...\n"; try ActionsDeps.topo_sort actions all_deps with ActionsDeps.DependencyCycle(x,l) -> let l = List.map ActionsDeps.string_of_action_simple l in @@ -777,13 +777,13 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = "\n "^(String.concat "\n " l) in raise (Lv6errors.Global_error msg) - in + in let (locals: Soc.var list) = match node.Lic.loclist_eff with | None -> [] | Some l -> List.map (lic_to_soc_var) l in - info "Soc actions sorted. \n"; + info "Lic2soc.soc_of_node: actions sorted. \n"; let step = build_step lxm "step" node (locals @ ctx.locals) actions in let soc = { Soc.key = soc_key; @@ -839,13 +839,13 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = ) | ("condact"), [ ConstStaticArgLic("dflt",Tuple_const_eff vel);NodeStaticArgLic("oper",condact_node) - ] -> ( + ] -> ( let soc_tbl,soc = make_condact_soc node condact_node soc_key soc_tbl ctx lxm vel in Some(ctx, soc, soc_tbl) ) | ("condact"), [ ConstStaticArgLic("dflt",const); NodeStaticArgLic ("oper",condact_node) - ] -> ( + ] -> ( let soc_tbl,soc = make_condact_soc node condact_node soc_key soc_tbl ctx lxm [const] in Some(ctx, soc, soc_tbl) ) diff --git a/src/lv6MainArgs.ml b/src/lv6MainArgs.ml index 02f76035..13867d4b 100644 --- a/src/lv6MainArgs.ml +++ b/src/lv6MainArgs.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 10/12/2013 (at 14:54) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/12/2013 (at 11:46) 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, @@ -206,7 +206,8 @@ let mkoptab (opt:t) : unit = ( ; mkopt opt ["-exec"] - (Arg.Unit (fun _ -> opt.exec <- true)) + (Arg.Unit (fun _ -> + opt.exec <- true)) ["interpret the program using RIF conventions for I/O (experimental)."] ; mkopt opt @@ -323,7 +324,7 @@ let mkoptab (opt:t) : unit = ( *) mkopt opt ~hide:true ["-interface"] - (Arg.Unit (fun () -> opt.print_interface<-true; global_opt.one_op_per_equation <- false)) + (Arg.Unit (fun () -> opt.print_interface<-true)) ["Print the node interface"] ; mkopt opt ~hide:true diff --git a/src/lv6version.ml b/src/lv6version.ml index 09d1c5e6..7e66eecb 100644 --- a/src/lv6version.ml +++ b/src/lv6version.ml @@ -1,7 +1,7 @@ (** Automatically generated from Makefile *) let tool = "lus2lic" let branch = "(no" -let commit = "431" -let sha_1 = "2c1ac825431ef5e038b4292c014cad48cab491fc" +let commit = "433" +let sha_1 = "0b46db200d272357a11ce46ca7311d8a34f26a9f" let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")") let maintainer = "jahier@imag.fr" diff --git a/src/main.ml b/src/main.ml index e997ad5c..32dbfb8e 100644 --- a/src/main.ml +++ b/src/main.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 10/12/2013 (at 15:12) by Erwan Jahier> *) +(* Time-stamp: <modified the 13/12/2013 (at 14:13) by Erwan Jahier> *) open Verbose open AstV6 @@ -41,7 +41,8 @@ let (gen_rif_interface : LicPrg.t -> Ident.idref option -> Lv6MainArgs.t -> unit let main_node = Ident.to_idref name in let nk = (Lic.node_key_of_idref main_node) in if LicPrg.node_exists lic_prg nk then ( - output_string stdout ("WARNING: No main node is specified. I'll try with " ^ name ^"\n"); + output_string stdout ("WARNING: No main node is specified. I'll try with " + ^ name ^"\n"); flush stdout; let msk, zesoc = Lic2soc.f lic_prg nk in msk, zesoc, main_node @@ -196,6 +197,7 @@ let main () = ( let lic_prg = Compile.doit opt nsl main_node in if opt.print_interface then ( gen_rif_interface lic_prg main_node opt; + info "bye!"; exit 0 ); if opt.Lv6MainArgs.gen_autotest then diff --git a/test/lus2lic.log.ref b/test/lus2lic.log.ref index 33f98c7a..304b2bcc 100644 --- a/test/lus2lic.log.ref +++ b/test/lus2lic.log.ref @@ -1,4 +1,4 @@ -Test Run By jahier on Wed Dec 11 17:57:02 2013 +Test Run By jahier on Thu Dec 12 16:20:31 2013 Native configuration is i686-pc-linux-gnu === lus2lic tests === @@ -320,8 +320,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/dep.lus spawn ./lus2lic -o /tmp/ELMU.lic should_work/ELMU.lus PASS: ./lus2lic {-o /tmp/ELMU.lic should_work/ELMU.lus} @@ -441,8 +439,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/t0.lus spawn ./lus2lic -o /tmp/lucky.lic should_work/lucky.lus PASS: ./lus2lic {-o /tmp/lucky.lic should_work/lucky.lus} @@ -534,8 +530,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/titi.lus spawn ./lus2lic -o /tmp/cminus.lic should_work/cminus.lus PASS: ./lus2lic {-o /tmp/cminus.lic should_work/cminus.lus} @@ -689,8 +683,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/dependeur.lus spawn ./lus2lic -o /tmp/mappredef.lic should_work/mappredef.lus PASS: ./lus2lic {-o /tmp/mappredef.lic should_work/mappredef.lus} @@ -903,7 +895,9 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop okPASS: ../utils/test_lus2lic_no_node should_work/mm.lus +lurettetop ok ++ exit 0 +PASS: ../utils/test_lus2lic_no_node should_work/mm.lus spawn ./lus2lic -o /tmp/yyy.lic should_work/yyy.lus PASS: ./lus2lic {-o /tmp/yyy.lic should_work/yyy.lus} spawn ./lus2lic -ec -o /tmp/yyy.ec should_work/yyy.lus @@ -933,6 +927,7 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok ++ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/yyy.lus spawn ./lus2lic -o /tmp/toolate.lic should_work/toolate.lus PASS: ./lus2lic {-o /tmp/toolate.lic should_work/toolate.lus} @@ -1020,9 +1015,7 @@ The coverage file lurette.cov has been updated/generated break signal catched lurettetop: bye! -+ echo lurettetop ok -lurettetop ok -+ exit 0PASS: ../utils/test_lus2lic_no_node should_work/nc7.lus ++ echo lurettetop okPASS: ../utils/test_lus2lic_no_node should_work/nc7.lus spawn ./lus2lic -o /tmp/predefOp.lic should_work/predefOp.lus PASS: ./lus2lic {-o /tmp/predefOp.lic should_work/predefOp.lus} spawn ./lus2lic -ec -o /tmp/predefOp.ec should_work/predefOp.lus @@ -1332,6 +1325,8 @@ break signal catched lurettetop: bye! + echo lurettetop ok +lurettetop ok ++ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/node_caller1.lus spawn ./lus2lic -o /tmp/nc1.lic should_work/nc1.lus PASS: ./lus2lic {-o /tmp/nc1.lic should_work/nc1.lus} @@ -1361,8 +1356,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/nc1.lus spawn ./lus2lic -o /tmp/test_node_expand2.lic should_work/test_node_expand2.lus PASS: ./lus2lic {-o /tmp/test_node_expand2.lic should_work/test_node_expand2.lus} @@ -1543,7 +1536,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/cst.lus spawn ./lus2lic -o /tmp/minmax5_random.lic should_work/minmax5_random.lus PASS: ./lus2lic {-o /tmp/minmax5_random.lic should_work/minmax5_random.lus} @@ -1839,8 +1831,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/mm22.lus spawn ./lus2lic -o /tmp/is_stable.lic should_work/is_stable.lus PASS: ./lus2lic {-o /tmp/is_stable.lic should_work/is_stable.lus} @@ -2065,7 +2055,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/minmax3.lus spawn ./lus2lic -o /tmp/filter.lic should_work/filter.lus PASS: ./lus2lic {-o /tmp/filter.lic should_work/filter.lus} @@ -2077,8 +2066,11 @@ spawn ../utils/test_lus2lic_no_node should_work/filter.lus + ./lus2lic should_work/filter.lus -n filter --gen-autotest -np Error. A combinational cycle been detected in file "/home/jahier/lus2lic/test/should_work/filter.lus", line 5, col 5 to 10, token 'filter': v00 = (z.x) + v03 = (z.y) v00 = (z.x) + v04 = (v03.y) z.x.y = (v00.x) + ok = Lustre::lt:real -> real -> bool(v04, v06) + echo Error Error + exit 2 @@ -2267,7 +2259,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/minmax2.lus spawn ./lus2lic -o /tmp/plus.lic should_work/plus.lus PASS: ./lus2lic {-o /tmp/plus.lic should_work/plus.lus} @@ -2939,7 +2930,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/noeudsIndependants.lus spawn ./lus2lic -o /tmp/mouse.lic should_work/mouse.lus PASS: ./lus2lic {-o /tmp/mouse.lic should_work/mouse.lus} @@ -3001,8 +2991,7 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok -+ exit 0 -PASS: ../utils/test_lus2lic_no_node should_work/param_node3.lus ++ PASS: ../utils/test_lus2lic_no_node should_work/param_node3.lus spawn ./lus2lic -o /tmp/pipeline.lic should_work/pipeline.lus PASS: ./lus2lic {-o /tmp/pipeline.lic should_work/pipeline.lus} spawn ./lus2lic -ec -o /tmp/pipeline.ec should_work/pipeline.lus @@ -3479,8 +3468,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/nc5.lus spawn ./lus2lic -o /tmp/call.lic should_work/call.lus PASS: ./lus2lic {-o /tmp/call.lic should_work/call.lus} @@ -3674,8 +3661,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/test_const.lus spawn ./lus2lic -o /tmp/when_tuple.lic should_work/when_tuple.lus PASS: ./lus2lic {-o /tmp/when_tuple.lic should_work/when_tuple.lus} @@ -4397,8 +4382,7 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok -+ exit 0 -PASS: ../utils/test_lus2lic_no_node should_work/exclusion.lus ++ PASS: ../utils/test_lus2lic_no_node should_work/exclusion.lus spawn ./lus2lic -o /tmp/ply01.lic should_work/ply01.lus PASS: ./lus2lic {-o /tmp/ply01.lic should_work/ply01.lus} spawn ./lus2lic -ec -o /tmp/ply01.ec should_work/ply01.lus @@ -4470,10 +4454,9 @@ PASS: ./myec2c {-o /tmp/activation2.c /tmp/activation2.ec} spawn ../utils/test_lus2lic_no_node should_work/activation2.lus + ./lus2lic should_work/activation2.lus -n activation2 --gen-autotest -np Error. A combinational cycle been detected in file "/home/jahier/lus2lic/test/should_work/activation2.lus", line 11, col 5 to 15, token 'activation2': - v07 = activation2::up4.step(scie) + v07 = activation2::up1.step(scie) scie = Lustre::arrow:int -> int -> int(0, v11) - v07 = activation2::up4.step(scie) - Lustre::pre1.set(scie) + v07 = activation2::up1.step(scie) v09 = Lustre::if:bool -> int -> int -> int(go_up, v07, v08) v11 = Lustre::if:bool -> int -> int -> int(evt, v09, v10) + echo Error @@ -4509,6 +4492,7 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok ++ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/type_decl.lus spawn ./lus2lic -o /tmp/import1.lic should_work/import1.lus PASS: ./lus2lic {-o /tmp/import1.lic should_work/import1.lus} @@ -4614,9 +4598,7 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 -PASS: ../utils/test_lus2lic_no_node should_work/notTwo.lus +lurettetop okPASS: ../utils/test_lus2lic_no_node should_work/notTwo.lus spawn ./lus2lic -o /tmp/stopwatch.lic should_work/stopwatch.lus PASS: ./lus2lic {-o /tmp/stopwatch.lic should_work/stopwatch.lus} spawn ./lus2lic -ec -o /tmp/stopwatch.ec should_work/stopwatch.lus @@ -4887,7 +4869,8 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok -+ exit 0PASS: ../utils/test_lus2lic_no_node should_work/mouse3.lus ++ exit 0 +PASS: ../utils/test_lus2lic_no_node should_work/mouse3.lus spawn ./lus2lic -o /tmp/ex.lic should_work/ex.lus PASS: ./lus2lic {-o /tmp/ex.lic should_work/ex.lus} spawn ./lus2lic -ec -o /tmp/ex.ec should_work/ex.lus @@ -4947,8 +4930,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/xxx.lus spawn ./lus2lic -o /tmp/moyenne.lic should_work/moyenne.lus PASS: ./lus2lic {-o /tmp/moyenne.lic should_work/moyenne.lus} @@ -4990,10 +4971,9 @@ PASS: ./myec2c {-o /tmp/activation1.c /tmp/activation1.ec} spawn ../utils/test_lus2lic_no_node should_work/activation1.lus + ./lus2lic should_work/activation1.lus -n activation1 --gen-autotest -np Error. A combinational cycle been detected in file "/home/jahier/lus2lic/test/should_work/activation1.lus", line 11, col 5 to 15, token 'activation1': - v07 = activation1::up4.step(scie) + v07 = activation1::up1.step(scie) v10 = Lustre::arrow:int -> int -> int(0, v09) - v07 = activation1::up4.step(scie) - Lustre::pre1.set(scie) + v07 = activation1::up1.step(scie) scie = Lustre::if:bool -> int -> int -> int(reset, 0, v10) v09 = Lustre::if:bool -> int -> int -> int(go_up, v07, v08) + echo Error @@ -5329,7 +5309,7 @@ spawn ./myec2c -o /tmp/asservi.c /tmp/asservi.ec PASS: ./myec2c {-o /tmp/asservi.c /tmp/asservi.ec} spawn ../utils/test_lus2lic_no_node should_work/asservi.lus + ./lus2lic should_work/asservi.lus -n asservi --gen-autotest -np -*** The soc of asservi::sin is not defined. FINISH ME! +*** The soc of asservi::make_pend is not defined. FINISH ME! Extern node not yet supported, sorry *** oops: lus2lic internal error @@ -5663,7 +5643,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/ts01.lus spawn ./lus2lic -o /tmp/_N_uu.lic should_work/_N_uu.lus PASS: ./lus2lic {-o /tmp/_N_uu.lic should_work/_N_uu.lus} @@ -6593,8 +6572,6 @@ break signal catched lurettetop: bye! + echo lurettetop ok -lurettetop ok -+ exit 0 PASS: ../utils/test_lus2lic_no_node should_work/count.lus spawn ./lus2lic -o /tmp/ck2.lic should_work/ck2.lus PASS: ./lus2lic {-o /tmp/ck2.lic should_work/ck2.lus} @@ -7299,9 +7276,12 @@ spawn ../utils/test_lus2lic_no_node should_fail/semantics/deploop.lus + ./lus2lic should_fail/semantics/deploop.lus -n deploop --gen-autotest -np Error. A combinational cycle been detected in file "/home/jahier/lus2lic/test/should_fail/semantics/deploop.lus", line 6, col 5 to 11, token 'deploop': v00 = (z.y) + v05 = (z.y) v00 = (z.y) + v06 = (v05.y) v01 = (v00.y) z.x.x = Lustre::arrow:real -> real -> real(0., v01) + ok = Lustre::lt:real -> real -> bool(v06, v08) + echo Error Error + exit 2 @@ -7367,12 +7347,12 @@ XPASS: Test bad programs (semantics): test_lus2lic_no_node should_fail/semantics spawn ../utils/test_lus2lic_no_node should_fail/semantics/sincos.lus + ./lus2lic should_fail/semantics/sincos.lus -n sincos --gen-autotest -np Error. A combinational cycle been detected in file "/home/jahier/lus2lic/test/should_fail/semantics/sincos.lus", line 2, col 5 to 10, token 'sincos': - v01 = Lustre::uminus:real -> real(sin) - v02 = sincos::integrator2.step(v01, 0.1, 1.0) + v00 = sincos::integrator2.step(cos, 0.1, 0.0) + v02 = sincos::integrator1.step(v01, 0.1, 1.0) v01 = Lustre::uminus:real -> real(sin) cos = Lustre::times:real -> real -> real(omega, v02) sin = Lustre::times:real -> real -> real(omega, v00) - v00 = sincos::integrator1.step(cos, 0.1, 0.0) + v00 = sincos::integrator2.step(cos, 0.1, 0.0) + echo Error Error + exit 2 @@ -7685,7 +7665,7 @@ lurettetop: bye! error + exit 2 XPASS: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/eq1.lus -testcase ./lus2lic.tests/non-reg.exp completed in 99 seconds +testcase ./lus2lic.tests/non-reg.exp completed in 96 seconds Running ./lus2lic.tests/progression.exp ... spawn ./lus2lic -o /tmp/when_not.out should_work/broken/when_not.lus PASS: ./lus2lic { -o /tmp/when_not.out should_work/broken/when_not.lus} @@ -7730,4 +7710,4 @@ testcase ./lus2lic.tests/progression.exp completed in 0 seconds # of unexpected failures 76 # of unexpected successes 21 # of expected failures 37 -runtest completed at Wed Dec 11 17:58:41 2013 +runtest completed at Thu Dec 12 16:22:07 2013 diff --git a/test/lus2lic.sum b/test/lus2lic.sum index e565b5d6..94b071a7 100644 --- a/test/lus2lic.sum +++ b/test/lus2lic.sum @@ -1,4 +1,4 @@ -Test Run By jahier on Wed Dec 11 17:57:02 2013 +Test Run By jahier on Wed Jan 22 14:16:58 2014 Native configuration is i686-pc-linux-gnu === lus2lic tests === @@ -1028,5 +1028,7 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman # of unexpected failures 76 # of unexpected successes 21 # of expected failures 37 -testcase ./lus2lic.tests/non-reg.exp completed in 99 seconds -testcase ./lus2lic.tests/progression.exp completed in 0 seconds +testcase ./lus2lic.tests/non-reg.exp completed in 101 seconds +testcase ./lus2lic.tests/progression.exp completed in 1 seconds +testcase ./lus2lic.tests/non-reg.exp completed in 101 seconds +testcase ./lus2lic.tests/progression.exp completed in 1 seconds diff --git a/test/lus2lic.time b/test/lus2lic.time index 914fd56d..75775f10 100644 --- a/test/lus2lic.time +++ b/test/lus2lic.time @@ -1,2 +1,2 @@ -testcase ./lus2lic.tests/non-reg.exp completed in 99 seconds -testcase ./lus2lic.tests/progression.exp completed in 0 seconds +testcase ./lus2lic.tests/non-reg.exp completed in 101 seconds +testcase ./lus2lic.tests/progression.exp completed in 1 seconds -- GitLab