diff --git a/bin/lv6/main.ml b/bin/lv6/main.ml index f51c055e1bdd8b24ae481280ad07f0c542ef854b..0e0a0f62d93eff0281f695e7d514b8dd524b4c60 100644 --- a/bin/lv6/main.ml +++ b/bin/lv6/main.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 08/06/2023 (at 11:12) by Erwan Jahier> *) +(* Time-stamp: <modified the 04/06/2024 (at 09:17) by Erwan Jahier> *) open AstV6 open Lxm @@ -68,8 +68,8 @@ let (gen_rif_interface : LicPrg.t -> Lv6Id.idref option -> Lv6MainArgs.t -> unit let idref = Lv6Id.idref_of_string str in (idref.Lv6Id.id_id) in - let invars = SocVar.expand_profile true false invars in - let outvars = SocVar.expand_profile true false outvars in + let invars = SocVar.expand_profile true SocVar.PP invars in + let outvars = SocVar.expand_profile true SocVar.PP outvars in let invars_str = List.map (fun (n,t) -> n^":"^(my_type_to_string t)) invars in let outvars_str = List.map (fun (n,t) -> n^":"^(my_type_to_string t)) outvars in output_string opt.oc ("#inputs "^ (String.concat " " invars_str) ^"\n"); @@ -128,8 +128,8 @@ let (gen_autotest_files : LicPrg.t -> Lv6Id.idref option -> Lv6MainArgs.t -> uni in let soc = try SocUtils.find (Lxm.dummy "") msk zesoc with Not_found -> assert false in let invars,outvars=soc.Soc.profile in - let invars = SocVar.expand_profile false false invars in - let outvars = SocVar.expand_profile true false outvars in + let invars = SocVar.expand_profile false SocVar.PP invars in + let outvars = SocVar.expand_profile true SocVar.PP outvars in let invars_str = List.map (fun (n,t) -> n^":"^(my_type_to_string true t)) invars in let outvars_str = List.map (fun (n,t) -> n^":"^(my_type_to_string false t)) outvars in let name = main_node.Lv6Id.id_id in diff --git a/lib/action.ml b/lib/action.ml index b3a20f49a3078c8fba991150bf2fac97340a5b6a..cdb2460b4553e3883a52c490d12050206253b8bb 100644 --- a/lib/action.ml +++ b/lib/action.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 29/08/2019 (at 14:55) by Erwan Jahier> *) +(** Time-stamp: <modified the 14/06/2024 (at 14:10) by Erwan Jahier> *) (* exported *) type rhs = Soc.var_expr list @@ -8,7 +8,7 @@ type t = Lic.clock * rhs * lhs * Soc.atomic_operation * Lxm.t (* exported *) -let to_string_msg: (t -> string) = +let to_string_msg: (t -> string) = fun (c, i, o, p, _) -> (* Version surchargée de Soc.string_of_operation pour afficher les "=" *) let string_of_operation = function @@ -23,17 +23,17 @@ let to_string_msg: (t -> string) = (string_of_params o) (string_of_operation p) (string_of_params i) (Lic.string_of_clock c) -let to_string: (t -> string) = +let to_string: (t -> string) = fun (_c, i, o, p,_) -> (* Version surchargée de SocUtils.string_of_operation : l'objectif est d'afficher, en cas de cycle combinatoire, un message d'erreur qui parle le plus possible - à l'utilisateur qui a programmé en V6... Pour cela le mieux (je pense) est + à l'utilisateur qui a programmé en V6... Pour cela le mieux (je pense) est simplement de rendre la variable sur laquelle porte le cycle *) let string_of_operation = function | Soc.Assign -> "" - | Soc.Method((n, _sk),_sname) -> n - | Soc.Procedure(name,_,_) -> name + | Soc.Method((n, _sk),_sname,_) -> n + | Soc.Procedure((name,_,_),_) -> name in let string_of_params p = String.concat ", " (List.map SocUtils.string_of_filter p) in diff --git a/lib/ast2lic.ml b/lib/ast2lic.ml index 2276ad38343167efd92d6e3d3bdd1eff47bfeac7..73f0105212af5f262281de51248a8e8a7b9c0acd 100644 --- a/lib/ast2lic.ml +++ b/lib/ast2lic.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 29/08/2019 (at 15:28) by Erwan Jahier> *) +(* Time-stamp: <modified the 15/04/2024 (at 11:56) by Erwan Jahier> *) open Lxm @@ -28,21 +28,21 @@ let rec (of_type: IdSolver.t -> AstCore.type_exp -> Lic.type_) = try let sz = EvalConst.eval_array_size env szexp in Array_type_eff (elt_teff, sz) - with EvalConst.EvalArray_error msg -> + with EvalConst.EvalArray_error msg -> let lxm = AstCore.lxm_of_val_exp szexp in raise (Compile_error(lxm, "can't eval type: "^msg)) let (_add_pack_name : IdSolver.t -> Lxm.t -> Lv6Id.idref -> Lv6Id.idref) = - fun id_solver lxm cc -> + fun id_solver lxm cc -> try match Lv6Id.pack_of_idref cc with | Some _ -> cc | None -> let id = Lv6Id.of_idref false cc in - let pn = - AstTabSymbol.find_pack_of_const id_solver.global_symbols id lxm + let pn = + AstTabSymbol.find_pack_of_const id_solver.global_symbols id lxm in Lv6Id.make_idref pn id with _ -> cc (* raise en error? *) @@ -61,31 +61,31 @@ let (of_clock : IdSolver.t -> AstCore.var_info -> Lic.id_clock)= (******************************************************************************) (* Checks that the left part has the same type as the right one. *) -and (type_check_equation: IdSolver.t -> Lxm.t -> Lic.left list -> +and (type_check_equation: IdSolver.t -> Lxm.t -> Lic.left list -> Lic.val_exp -> unit) = - fun id_solver lxm lpl_eff ve_eff -> + fun id_solver lxm lpl_eff ve_eff -> let lpl_teff = List.map Lic.type_of_left lpl_eff in let ve_eff, right_part = EvalType.f id_solver ve_eff in if (List.length lpl_teff <> List.length right_part) then - raise (Compile_error(lxm, - "tuple size error: \n*** the tuple size is\n***\t"^ + raise (Compile_error(lxm, + "tuple size error: \n*** the tuple size is\n***\t"^ (string_of_int (List.length lpl_teff)) ^ - " for the left-hand-side, and \n***\t" ^ + " for the left-hand-side, and \n***\t" ^ (string_of_int (List.length right_part)) ^ " for the right-hand-side (in " ^ (String.concat - "," + "," (List.map (LicDump.string_of_leff false) lpl_eff)) ^ " = " ^ - (LicDump.string_of_val_exp_eff false ve_eff) ^ ")\n" + (LicDump.string_of_val_exp_eff false ve_eff) ^ ")\n" )) else List.iter2 - (fun le re -> + (fun le re -> if le <> re then - let msg = "type mismatch: \n***\t'" - ^ (Lic.string_of_type le) ^ - "' (left-hand-side) \n*** is not compatible with \n***\t'" + let msg = "type mismatch: \n***\t'" + ^ (Lic.string_of_type le) ^ + "' (left-hand-side) \n*** is not compatible with \n***\t'" ^ (Lic.string_of_type re) ^ "' (right-hand-side)" in raise (Compile_error(lxm, msg)) @@ -94,7 +94,7 @@ and (type_check_equation: IdSolver.t -> Lxm.t -> Lic.left list -> right_part (* Checks that the left part has the same clock as the right one. *) -and (clock_check_equation:IdSolver.t -> Lxm.t -> UnifyClock.subst -> +and (clock_check_equation:IdSolver.t -> Lxm.t -> UnifyClock.subst -> Lic.left list -> Lic.id_clock list -> Lic.val_exp -> Lic.val_exp) = fun _id_solver _lxm s lpl_eff right_part_clks ve_eff -> let lxms = List.map Lic.lxm_of_left lpl_eff in @@ -102,20 +102,20 @@ and (clock_check_equation:IdSolver.t -> Lxm.t -> UnifyClock.subst -> ve_eff (******************************************************************************) -(* +(* ICI : BEQUILLE(S) on fait un lookup dans la table des operateurs -pour rechercher leurs (éventuels) parametres statiques : +pour rechercher leurs (éventuels) parametres statiques : TRAITER LES MACROS PREDEF : - ici, on juste besoin de fabriquer les arguments statiques effectifs à partir des arguments donnés et des args attendus. -- on cherche pas à faire rentrer dans le moule, on délègue +- on cherche pas à faire rentrer dans le moule, on délègue -- 2015/07 -> probleme des node avec param statiques identifies par pack::node +- 2015/07 -> probleme des node avec param statiques identifies par pack::node c'etait pas prevu du tout ... rajout du champs "all_srcs" dans le id solver qui premet de retrouver - n'importe quelle info source (un peu extreme comme solution ...) + n'importe quelle info source (un peu extreme comme solution ...) *) (* pour abstraire la nature des params statiques *) @@ -124,7 +124,7 @@ type abstract_static_param = | ASP_type of Lv6Id.t | ASP_node of Lv6Id.t -let do_abstract_static_param x = +let do_abstract_static_param x = match x.it with | StaticParamType id -> ASP_type id | StaticParamConst (id,_) -> ASP_const id @@ -137,7 +137,7 @@ let get_abstract_static_params (lxm: Lxm.t) (idref: Lv6Id.idref) : abstract_static_param list = - + Lv6Verbose.exe ~flag:dbg (fun () -> Printf.fprintf stderr "#DBG: Ast2lic.get_abstract_static %s\n" (Lv6Id.raw_string_of_idref idref) @@ -145,6 +145,7 @@ let get_abstract_static_params match (idref.id_pack, idref.id_id) with | (Some "Lustre", "map") | (Some "Lustre", "red") + | (Some "Lustre", "fold") | (Some "Lustre", "fill") | (Some "Lustre", "fillred") -> [ ASP_node "oper"; ASP_const "size" ] | (Some "Lustre", "boolred") -> [ ASP_const "min"; ASP_const "max"; ASP_const "size"] @@ -172,18 +173,18 @@ let get_abstract_static_params (* can occur for static node parameters, which cannot themselves have static parameters. A better solution ougth to be to add node static parameters in the AstTabSymbol.t - however (in Lazycompiler.node_check_do most probably). - + however (in Lazycompiler.node_check_do most probably). + OUI MAIS GROS BUG : qu'est-ce-qui se passe si si le 'static node parameter' porte le meme nom qu'un noeud existant dans AstTabSymbol ??? - + C'est clairement pas la bonne méthode ... Voir + bas ... - + *) (* [] *) - ) + ) (* exported *) @@ -205,12 +206,13 @@ let rec of_node | (None, "red") | (None, "fill") | (None, "fillred") + | (None, "fold") | (None, "boolred") | (None, "condact") -> {idref with id_pack = Some "Lustre"} | _ -> idref in (* BUG des param statique node avec le meme nom - qu'un node template global : + qu'un node template global : pis-aller : si static_args = [], on a peut-etre affaire à un static param node, donc on appelle directement id_solver.id2node et c'est lui @@ -231,17 +233,17 @@ let rec of_node let static_params = get_abstract_static_params id_solver.all_srcs id_solver.global_symbols lxm idref in - let sp_l = List.length static_params + let sp_l = List.length static_params and sa_l = List.length static_args in if (sp_l <> sa_l) then - let msg = "Bad number of (static) arguments: " ^ - (string_of_int sp_l) ^ " expected, and " ^ + let msg = "Bad number of (static) arguments: " ^ + (string_of_int sp_l) ^ " expected, and " ^ (string_of_int sa_l) ^ " provided." in raise (Compile_error(lxm, msg)) else - List.map2 (check_static_arg id_solver) - static_params + List.map2 (check_static_arg id_solver) + static_params static_args in let res = id_solver.id2node idref static_args_eff lxm in @@ -255,13 +257,13 @@ let rec of_node and check_static_arg (node_id_solver: IdSolver.t) - (asp: abstract_static_param) - (sa: AstCore.static_arg srcflagged) + (asp: abstract_static_param) + (sa: AstCore.static_arg srcflagged) : Lic.static_arg = ( (* 1ere passe : on utilise expected juste pour résoudre la nature, - on "compile" les args + on "compile" les args *) let nature_error nat = let msg = Printf.sprintf "Bad static argument nature, a %s was expected" nat in @@ -311,7 +313,7 @@ and check_static_arg (* exported *) and (of_eq: IdSolver.t -> AstCore.eq_info srcflagged -> Lic.eq_info srcflagged) = - fun id_solver eq_info -> + fun id_solver eq_info -> let (lpl, ve) = eq_info.it in let lpl_eff = List.map (translate_left_part id_solver) lpl in let exp_clks = List.map Lic.clock_of_left lpl_eff in @@ -325,9 +327,9 @@ and (of_eq: IdSolver.t -> AstCore.eq_info srcflagged -> Lic.eq_info srcflagged) and (translate_left_part : IdSolver.t -> AstCore.left_part -> Lic.left) = - fun id_solver lp_top -> + fun id_solver lp_top -> match lp_top with - | LeftVar id -> + | LeftVar id -> let vi_eff = id_solver.id2var id.it id.src in LeftVarLic (vi_eff, id.src) | LeftField (lp, id) -> ( @@ -358,9 +360,9 @@ and (translate_left_part : IdSolver.t -> AstCore.left_part -> Lic.left) = | LeftSlice (lp, sif) -> ( let lp_eff = translate_left_part id_solver lp in let teff = Lic.type_of_left lp_eff in - match teff with + match teff with | Abstract_type_eff(_,Array_type_eff(teff_elt, _size)) - | Array_type_eff(teff_elt, _size) -> + | Array_type_eff(teff_elt, _size) -> let sieff = translate_slice_info id_solver sif.it sif.src in let size_slice = sieff.se_width in let teff_slice = Array_type_eff(teff_elt, size_slice) in @@ -370,14 +372,14 @@ and (translate_left_part : IdSolver.t -> AstCore.left_part -> Lic.left) = (* Translate and performs the checks *) -and (translate_val_exp_check : IdSolver.t -> Lic.clock list -> UnifyClock.subst -> +and (translate_val_exp_check : IdSolver.t -> Lic.clock list -> UnifyClock.subst -> AstCore.val_exp -> Lic.val_exp * Lic.id_clock list * UnifyClock.subst) = fun id_solver exp_clks s ve -> let s,vef = translate_val_exp id_solver s ve in let lxm = AstCore.lxm_of_val_exp ve in let lxms = List.map (fun _ -> lxm) exp_clks in (* let vef, tl = EvalType.f id_solver vef in *) - EvalClock.f id_solver s vef lxms exp_clks + EvalClock.f id_solver s vef lxms exp_clks and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp @@ -386,19 +388,19 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp (match ve with | CallByPos({it=WITH_n(c,e1,e2);_}, Oper vel) -> assert (vel=[]); - if EvalConst.f id_solver c = [ Bool_const_eff true ] - then translate_val_exp id_solver s e1 + if EvalConst.f id_solver c = [ Bool_const_eff true ] + then translate_val_exp id_solver s e1 else translate_val_exp id_solver s e2 - | _ -> + | _ -> let s, vef_core, lxm = match ve with - | Merge_n(ve, cl) -> + | Merge_n(ve, cl) -> let lxm_ve = ve.src in let ve = ve.it in let s,ve = translate_val_exp id_solver s ve in let s, cl = List.fold_left - (fun (s,cl) (id,ve) -> + (fun (s,cl) (id,ve) -> let s, ve = translate_val_exp id_solver s ve in let const = id_solver.id2const id.it id.src in s,(flagit const id.src, ve)::cl @@ -418,8 +420,8 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp s, Lic.Merge(ve, [case_true; case_false]), lxm_ve | CallByName(by_name_op, field_list) -> - let s,fl = List.fold_left - (fun (s,fl) f -> + let s,fl = List.fold_left + (fun (s,fl) f -> let s,f = translate_field id_solver s f in s,f::fl ) @@ -428,17 +430,17 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp in let fl = List.rev fl in let s, by_name_op = translate_by_name_op id_solver by_name_op s in - s, + s, (CallByNameLic(by_name_op, fl)), by_name_op.src | CallByPos(by_pos_op, Oper vel) -> - let s, vel_eff = - List.fold_left - (fun (s,vel) ve -> + let s, vel_eff = + List.fold_left + (fun (s,vel) ve -> let s, ve = translate_val_exp id_solver s ve in s,ve::vel ) - (s,[]) vel + (s,[]) vel in let vel_eff = List.rev vel_eff in let lxm = by_pos_op.src in @@ -446,7 +448,7 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp let mk_by_pos_op by_pos_op_eff = CallByPosLic(flagit by_pos_op_eff lxm, vel_eff) in - let mk_nary_pos_op by_pos_op_eff = + let mk_nary_pos_op by_pos_op_eff = (* For nor and diese: internally, nor and diese takes an array of val_exp, to make it easier the translation into boolred. @@ -458,7 +460,7 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp ve_typ = [Array_type_eff(List.hd (List.hd vel_eff).ve_typ, List.length vel_eff)]; ve_clk = (List.hd vel_eff).ve_clk; - ve_src = lxm + ve_src = lxm } in CallByPosLic(flagit by_pos_op_eff lxm, [array_val_exp]) @@ -480,7 +482,7 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp Lic.PREDEF_CALL (flagit (AstPredef.op_to_long DIESE_n,[]) lxm)) | Predef_n(op) -> s, mk_by_pos_op( Lic.PREDEF_CALL (flagit (AstPredef.op_to_long op.it,[]) op.src)) - | CALL_n node_exp_f -> + | CALL_n node_exp_f -> let neff = of_node id_solver node_exp_f in let ceff = Lic.CALL (flagit neff.node_key_eff node_exp_f.src) in Lv6Verbose.exe ~flag:dbg (fun () -> @@ -507,11 +509,11 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp | FBY_n -> (* XXX temporary crutch: translate "e1 fby e2" into "e2 -> pre(e2)" *) (match vel_eff with - | [e1;e2] -> + | [e1;e2] -> let ve_pre = CallByPosLic(flagit Lic.PRE lxm, [e2]) in let ve_pre = { e2 with ve_core=ve_pre } in let lxm = Lxm.override_name "->" lxm in - s,CallByPosLic(flagit Lic.ARROW lxm, [e1;ve_pre]) + s,CallByPosLic(flagit Lic.ARROW lxm, [e1;ve_pre]) | _ -> assert false ) (* | FBY_n -> s, mk_by_pos_op Lic.FBY *) @@ -522,7 +524,7 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp s, mk_by_pos_op (Lic.STRUCT_ACCESS (fid)) | WHEN_n Base -> s, mk_by_pos_op (Lic.WHEN BaseLic) - | WHEN_n (NamedClock { it = (cc,c) ; src = lxm }) -> + | WHEN_n (NamedClock { it = (cc,c) ; src = lxm }) -> let var_info = id_solver.id2var c lxm in let _, clk = var_info.var_clock_eff in let ct = var_info.var_type_eff in @@ -538,8 +540,8 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp | HAT_n -> ( match vel with - | [_exp; ve_size] -> - let size_const_eff = EvalConst.f id_solver ve_size in + | [_exp; ve_size] -> + let size_const_eff = EvalConst.f id_solver ve_size in (match size_const_eff with | [Int_const_eff sz] -> s, mk_by_pos_op (Lic.HAT(int_of_string sz)) | _ -> assert false) @@ -551,10 +553,10 @@ and (translate_val_exp : IdSolver.t -> UnifyClock.subst -> AstCore.val_exp let vef = { ve_core=vef_core; ve_typ=[]; ve_clk = []; ve_src = lxm } in let vef, _tl = EvalType.f id_solver vef in s,vef - ) + ) -and translate_by_name_op id_solver op s = +and translate_by_name_op id_solver op s = let to_long idref = match Lv6Id.pack_of_idref idref with | None -> (* If no pack name is provided, we lookup it in the symbol table *) @@ -567,33 +569,33 @@ and translate_by_name_op id_solver op s = match op.it with | STRUCT_anonymous_n -> s, STRUCT_anonymous | STRUCT_n idref -> s, STRUCT (to_long idref) - | STRUCT_WITH_n (idref1, idref2) -> + | STRUCT_WITH_n (idref1, idref2) -> s, STRUCT_with (to_long idref1, idref2.id_id) in s, flagit nop op.src -and translate_field id_solver s (id, ve) = +and translate_field id_solver s (id, ve) = let s, ve = translate_val_exp id_solver s ve in s, (id, ve) -(* XXX autre nom, autre module ? +(* XXX autre nom, autre module ? node_of_static_arg : appelé QUAND ON SAIT qu'un sarg doit etre un NODE const_of_static_arg : appelé QUAND ON SAIT qu'un sarg doit etre une CONST -> sert pour les macros predefs ca fait partie de la definition des iterateurs d'une certaine maniere... - -> créer 2 modules, Iterator + IteratorSemantics + -> créer 2 modules, Iterator + IteratorSemantics *) -and _const_of_static_arg id_solver const_or_const_ident lxm = +and _const_of_static_arg id_solver const_or_const_ident lxm = match const_or_const_ident with | StaticArgConst(c) -> ( match EvalConst.f id_solver c with | [x] -> x - | xl -> + | xl -> (* EvalConst.f ne fabrique PAS de tuple, on le fait ici *) Tuple_const_eff xl ) - | StaticArgLv6Id(id) -> id_solver.id2const id lxm + | StaticArgLv6Id(id) -> id_solver.id2const id lxm | StaticArgType _ | StaticArgNode _ -> raise (Compile_error(lxm, "a constant was expected")) @@ -601,9 +603,9 @@ and _const_of_static_arg id_solver const_or_const_ident lxm = and _node_of_static_arg id_solver node_or_node_ident lxm = match node_or_node_ident with - | StaticArgLv6Id(id) -> + | StaticArgLv6Id(id) -> let sargs = [] in (* it is an alias: no static arg *) - id_solver.id2node id sargs lxm + id_solver.id2node id sargs lxm | StaticArgNode(CALL_n ne) -> of_node id_solver ne | StaticArgNode(Predef_n (op)) -> @@ -611,10 +613,10 @@ and _node_of_static_arg id_solver node_or_node_ident lxm = | StaticArgNode(_) -> assert false - | StaticArgType _ + | StaticArgType _ | StaticArgConst _ -> raise (Compile_error(lxm, "a node was expected")) -and (translate_slice_info : IdSolver.t -> AstCore.slice_info -> +and (translate_slice_info : IdSolver.t -> AstCore.slice_info -> Lxm.t -> Lic.slice_info) = fun id_solver si lxm -> EvalConst.eval_array_slice id_solver si lxm @@ -622,7 +624,7 @@ and (translate_slice_info : IdSolver.t -> AstCore.slice_info -> (**********************************************************************************) (* exported *) -let (of_assertion : IdSolver.t -> AstCore.val_exp Lxm.srcflagged -> +let (of_assertion : IdSolver.t -> AstCore.val_exp Lxm.srcflagged -> Lic.val_exp Lxm.srcflagged) = fun id_solver vef -> let s = UnifyClock.empty_subst in @@ -631,10 +633,10 @@ let (of_assertion : IdSolver.t -> AstCore.val_exp Lxm.srcflagged -> (* Check that the assert is a bool. *) let val_exp_eff, evaled_exp = EvalType.f id_solver val_exp_eff in List.iter - (fun ve -> + (fun ve -> if ve <> Bool_type_eff then - let msg = "type mismatch: \n\tthe content of the assertion is of type " - ^ (Lic.string_of_type ve) + let msg = "type mismatch: \n\tthe content of the assertion is of type " + ^ (Lic.string_of_type ve) ^ " whereas it shoud be a Boolean\n" in raise (Compile_error(vef.src, msg)) @@ -643,21 +645,21 @@ let (of_assertion : IdSolver.t -> AstCore.val_exp Lxm.srcflagged -> (* type is ok *) (* Clock check the assertion*) - let _, clock_eff_list, _s = + let _, clock_eff_list, _s = EvalClock.f id_solver s val_exp_eff [vef.src] [BaseLic] in match clock_eff_list with - | [_id, BaseLic] + | [_id, BaseLic] | [_id, On(_,BaseLic)] | [_id, ClockVar _] -> Lxm.flagit val_exp_eff vef.src - | [_id, ce] -> + | [_id, ce] -> let msg = "clock error: assert should be on the base clock, "^ "but it is on "^ (LicDump.string_of_clock2 ce) ^ "\n" in raise (Compile_error(vef.src, msg)) | _ -> assert false - + (******************************************************************************) (******************************************************************************) diff --git a/lib/l2lExpandMetaOp.ml b/lib/l2lExpandMetaOp.ml index 63d33e2048996f87ce7ce513197ad4e2e547b1bc..dab0009f1b4a4de8587c04811a1246fee9b924de 100644 --- a/lib/l2lExpandMetaOp.ml +++ b/lib/l2lExpandMetaOp.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 05/05/2022 (at 08:40) by Erwan Jahier> *) +(** Time-stamp: <modified the 15/04/2024 (at 11:54) by Erwan Jahier> *) open Lxm open Lic @@ -6,20 +6,20 @@ open Lic let dbg = (Lv6Verbose.get_flag "ei") (* pack useful info into a single struct *) -type local_ctx = { +type local_ctx = { node : Lic.node_exp; prg : LicPrg.t; } (********************************************************************************) (* stuff to create fresh var names. *) -let new_var str _lctx type_eff clock_eff = - let id = Lv6Id.of_string (FreshName.local_var (str)) in +let new_var str _lctx type_eff clock_eff = + let id = Lv6Id.of_string (FreshName.local_var (str)) in let var = - { + { var_name_eff = id; var_nature_eff = AstCore.VarLocal; - var_number_eff = -1; (* this field is used only for i/o. + var_number_eff = -1; (* this field is used only for i/o. Should i rather put something sensible there ? *) var_type_eff = type_eff; var_clock_eff = id, clock_eff; @@ -29,16 +29,16 @@ let new_var str _lctx type_eff clock_eff = (********************************************************************************) (* A small util function followed by a quick unit test. *) -let rec fill i size = if i >= size then [] else (i)::(fill (i+1) size) +let rec fill i size = if i >= size then [] else (i)::(fill (i+1) size) let _ = assert (fill 0 5 = [0;1;2;3;4]) - -let rec (list_map3: + +let rec (list_map3: ('a -> 'b -> 'c -> 'd) -> 'a list -> 'b list -> 'c list -> 'd list) = fun f l1 l2 l3 -> match (l1, l2, l3) with | ([], [], []) -> [] | (e1::t1, e2::t2, e3::t3) -> (f e1 e2 e3)::(list_map3 f t1 t2 t3) - | _ -> (* should not occur *) + | _ -> (* should not occur *) print_string "*** list_map3 called with lists of different size.\n"; flush stdout; assert false @@ -49,81 +49,81 @@ let rec (list_map3: let lxm = Lxm.dummy "no_source" let (val_exp_of_var_info : Lxm.t -> Lic.var_info -> Lic.val_exp) = - fun lxm vi -> - { - ve_core = CallByPosLic({src=lxm;it=Lic.VAR_REF vi.var_name_eff}, []); + fun lxm vi -> + { + ve_core = CallByPosLic({src=lxm;it=Lic.VAR_REF vi.var_name_eff}, []); ve_typ = [vi.var_type_eff]; ve_clk = [snd vi.var_clock_eff]; ve_src = lxm } let (val_exp_of_ident : Lxm.t -> string -> Lic.type_ -> Lic.clock -> Lic.val_exp) = - fun lxm id t clk -> - { - ve_clk = [clk]; - ve_typ = [t]; + fun lxm id t clk -> + { + ve_clk = [clk]; + ve_typ = [t]; ve_core = CallByPosLic({it=Lic.VAR_REF id;src=lxm},[]); ve_src = lxm } let (val_exp_of_int : Lxm.t -> string -> Lic.clock -> Lic.val_exp) = - fun lxm i clk -> - { - ve_clk = [clk]; - ve_typ = [Int_type_eff]; + fun lxm i clk -> + { + ve_clk = [clk]; + ve_typ = [Int_type_eff]; ve_core = CallByPosLic({it= CONST(Int_const_eff i);src=lxm},[]); ve_src = lxm } let (val_exp_of_const : Lic.const -> Lic.val_exp) = - fun c -> + fun c -> let _,ve = UnifyClock.const_to_val_eff lxm true UnifyClock.empty_subst c in ve let (add_when : Lic.clock -> Lic.val_exp -> Lic.val_exp) = - fun clk ve -> - { ve with - ve_clk = List.map (fun _ -> clk) ve.ve_clk; + fun clk ve -> + { ve with + ve_clk = List.map (fun _ -> clk) ve.ve_clk; ve_core = CallByPosLic({it= WHEN clk;src=lxm},[ve]); } (* [add_current ve clk out_cl] return the expression current(ve when clk) *) let (add_current : Lic.val_exp -> Lic.clock -> Lic.clock list -> Lic.val_exp) = - fun ve clk out_cl -> + fun ve clk out_cl -> match clk with | On((cc,cv,_),sclk) -> let lxm = ve.ve_src in let clk_exp = val_exp_of_ident lxm cv Bool_type_eff sclk in { ve with - ve_clk = out_cl; + ve_clk = out_cl; ve_core = CallByPosLic({it= CURRENT(Some cc);src=lxm},[clk_exp;ve]) } | _ -> assert false (* SNO *) - + let rec (elt_type_of_array : Lic.type_ -> Lic.type_) = function | Array_type_eff(t, _) -> t | Abstract_type_eff(_,t) -> elt_type_of_array t - | _ -> assert false + | _ -> assert false let (array_var_to_val_exp : Lxm.t -> int -> var_info -> val_exp) = - fun lxm i vi -> + fun lxm i vi -> (* vi holds x of type array and returns x.[i] *) let t_elt = elt_type_of_array vi.var_type_eff in let op_flg = {src = lxm ; it = ARRAY_ACCES(i)} in - { - ve_core = CallByPosLic(op_flg, [val_exp_of_var_info lxm vi]); + { + ve_core = CallByPosLic(op_flg, [val_exp_of_var_info lxm vi]); ve_typ = [t_elt]; ve_clk = [snd vi.var_clock_eff]; ve_src = lxm } -let (node_to_val_exp : Lxm.t -> Lic.node_key -> Lic.type_ list -> Lic.clock list -> +let (node_to_val_exp : Lxm.t -> Lic.node_key -> Lic.type_ list -> Lic.clock list -> val_exp list -> val_exp) = - fun lxm nk tl cl vel -> + fun lxm nk tl cl vel -> let nk = { src = lxm ; it = nk } in let core = CallByPosLic( { src = lxm ; it = CALL nk }, vel) in { @@ -131,7 +131,7 @@ let (node_to_val_exp : Lxm.t -> Lic.node_key -> Lic.type_ list -> Lic.clock list ve_typ = tl; ve_core = core; ve_src = lxm - } + } let (binop_to_val_exp : Lxm.t -> Lv6Id.t -> val_exp -> val_exp -> val_exp) = fun lxm op ve1 ve2 -> let op = { it = PREDEF_CALL({src=lxm;it=("Lustre",op),[]}) ; src = lxm } in @@ -149,7 +149,7 @@ let (binop_to_val_exp_bool : Lxm.t -> Lv6Id.t -> val_exp -> val_exp -> val_exp) ve_typ = [Bool_type_eff]; ve_core = CallByPosLic(op, [ve1; ve2]); ve_src = lxm - + } let (fby_to_val_exp : Lxm.t -> val_exp -> val_exp -> val_exp) = fun lxm ve1 ve2 -> @@ -173,14 +173,14 @@ let (ite_to_val_exp : Lxm.t -> val_exp -> val_exp -> val_exp -> val_exp) = fun lxm ve1 ve2 ve3 -> let ite_op = { it = PREDEF_CALL({src=lxm;it=("Lustre","if"),[]}); src = lxm } in { - ve_clk = ve2.ve_clk; + ve_clk = ve2.ve_clk; ve_typ = ve2.ve_typ; ve_core = CallByPosLic(ite_op, [ve1; ve2; ve3]) ; ve_src = lxm - } + } let (array_var_to_left : int -> var_info -> Lic.left) = - fun i vi -> + fun i vi -> let lp = LeftVarLic(vi,lxm) in let t_elt = elt_type_of_array vi.var_type_eff in LeftArrayLic(lp,i,t_elt) @@ -189,18 +189,18 @@ let (array_var_to_left : int -> var_info -> Lic.left) = let (create_fillred_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_info list) = fun lctx sargs -> - (* Given + (* Given - a node n of type : tau * tau_1 * ... * tau_n -> tau * teta_1 * ... * teta_l - a integer c - - the fillred expression has the profile: + + the fillred expression has the profile: tau * tau_1^c * ... * tau_n^c -> tau * teta_1^c * ... * teta_l^c *) let iter_node,c = match List.sort compare sargs with | [ConstStaticArgLic(_,Int_const_eff(c));NodeStaticArgLic(_,_node_key)] | [ConstStaticArgLic(_,Int_const_eff(c));TypeStaticArgLic(_); NodeStaticArgLic(_,_node_key)] - -> + -> _node_key,c | _ -> assert false in @@ -208,7 +208,7 @@ let (create_fillred_body: local_ctx -> Lic.static_arg list -> let iter_node = Lxm.flagit iter_node lxm in (* Hence: - node(acc_in:tau; X1:tau_1^c ; ... ; Xn:tau_n^c) + node(acc_in:tau; X1:tau_1^c ; ... ; Xn:tau_n^c) returns (acc_out:tau; Y1:teta_1^c; ... ; Yl:teta_l^c) = fillred<<n,c>>; *) assert (lctx.node.Lic.inlist_eff <> []); @@ -219,25 +219,25 @@ let (create_fillred_body: local_ctx -> Lic.static_arg list -> let (x1_xn : var_info list) = List.tl lctx.node.Lic.outlist_eff in (* can be defined like this: - node(acc_in:tau; X1:tau_1^c ; ... ; Xn:tau_n^c) + node(acc_in:tau; X1:tau_1^c ; ... ; Xn:tau_n^c) returns (acc_out:tau; Y1 : teta1^c; ... ; Yl: teta_l^c) = var acc_1, ..., acc_c-2 : tau; - let - + let + acc_1, Y1[0], ... ,Yl[0] = n(acc_in,X1[0], ... ,Xk[0]); acc_2, Y1[1], ... ,Yl[1] = n(acc_1, X1[1], ... ,Xk[1]); - ... + ... acc_i+1, Y1[i], ... ,Yl[i] = n(acc_i,X1[i], ... ,Xk[i]); ... acc_out, Y1[c-1], ... ,Yl[c-1] = n(acc_c-1,X1[c-1], ... ,Xk[c-1]); - - « for all i = 0, ..., c-1 » + + « for all i = 0, ..., c-1 » acc_i+1, Y1[i], ... ,Yl[i] = n(acc_i,X1[i], ... ,Xk[i]) tel *) let c = int_of_string c in - let index_list = fill 0 c in + let index_list = fill 0 c in (* Building this list "acc_left_list" as [acc_1, ..., acc_c-2, acc_out] *) let type_exp,clock_exp = acc_in.var_type_eff, snd acc_in.var_clock_eff in let (acc_vars : var_info list) = @@ -258,7 +258,7 @@ let (create_fillred_body: local_ctx -> Lic.static_arg list -> So now we build those equations ; acc_1, Y1[0], ... ,Yl[0] = n(acc_in,X1[0], ... ,Xk[0]); acc_2, Y1[1], ... ,Yl[1] = n(acc_1, X1[1], ... ,Xk[1]); - ... + ... acc_i+1, Y1[i], ... ,Yl[i] = n(acc_i,X1[i], ... ,Xk[i]); ... acc_out, Y1[c-1], ... ,Yl[c-1] = n(acc_c-1,X1[c-1], ... ,Xk[c-1]); @@ -273,13 +273,13 @@ let (create_fillred_body: local_ctx -> Lic.static_arg list -> List.map (array_var_to_left i) x1_xn in let lhs = acc_left::yi_k in - let cl = + let cl = List.map (fun l -> snd (Lic.var_info_of_left l).var_clock_eff) lhs in let rhs = { ve_typ = List.map Lic.type_of_left lhs; ve_clk = cl; - ve_core = + ve_core = if AstPredef.is_a_predef_op (snd(fst iter_node.it)) then CallByPosLic({src=lxm;it=(Lic.PREDEF_CALL iter_node)}, args) else @@ -288,7 +288,7 @@ let (create_fillred_body: local_ctx -> Lic.static_arg list -> } in let eq = { src = lxm ; it = (lhs, rhs) } in - eq + eq ) index_list acc_left_list @@ -301,11 +301,11 @@ let (create_map_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_in (* Given - a node n of type: tau_1 * ... * tau_n -> teta_1 * ... * teta_l - and an integer c - + The profile of map<<node,c>> is: tau_1^c * ... * tau_n^c -> teta_1^c * ... * teta_l^c and - + Y1, ... ,Yl = map<<node; c>>(X1,...,Xk) <=> for all i = 0, ..., c-1; (Y1[i], ... ,Yl[i]) = N(X_1[i], ... ,X_k[i]) @@ -314,7 +314,7 @@ let (create_map_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_in | [ConstStaticArgLic(_,Int_const_eff(c)) ; NodeStaticArgLic(_,node_key)] | [ConstStaticArgLic(_,Int_const_eff(c)) ; TypeStaticArgLic(_); NodeStaticArgLic(_,node_key)] - -> + -> node_key,c | _ -> assert false in @@ -322,7 +322,7 @@ let (create_map_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_in let (y1_yl : var_info list) = lctx.node.Lic.inlist_eff in let (x1_xn : var_info list) = lctx.node.Lic.outlist_eff in let c = int_of_string c in - let index_list = fill 0 c in + let index_list = fill 0 c in let neqs = List.map (fun i -> @@ -348,7 +348,7 @@ let (create_map_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_in } in let eq = { src = lxm ; it = (lhs, rhs) } in - eq + eq ) index_list in @@ -359,12 +359,12 @@ let (create_boolred_body: local_ctx -> int -> int -> int -> Lic.node_body * var_ fun lctx i j k -> (* Given - 3 integers i, j, k boolred<<i,j,k>> has the profile: bool^n -> bool and is defined by - node toto = boolred<<i,j,k>>(tab); + node toto = boolred<<i,j,k>>(tab); <=> node toto(tab:bool^n) returns (res:bool); - var + var cpt:int; - let + let cpt = (if tab[0] then 1 else 0) + ... + (if tab[k-1] then 1 else 0); res = i <= cpt && cpt <= j; tel @@ -372,11 +372,11 @@ let (create_boolred_body: local_ctx -> int -> int -> int -> Lic.node_body * var_ assert(0 <= i && i <= j && j <= k && k>0); let lxm = lctx.node.Lic.lxm in let (tab_vi : var_info) = match lctx.node.Lic.inlist_eff with - | [vi] -> vi + | [vi] -> vi | _ -> assert false in let (res_vi : var_info) = match lctx.node.Lic.outlist_eff with - | [vi] -> vi + | [vi] -> vi | _ -> assert false in let (cpt_vi : var_info) = new_var "cpt" lctx Int_type_eff BaseLic in @@ -403,16 +403,16 @@ let (create_boolred_body: local_ctx -> int -> int -> int -> Lic.node_body * var_ let i_inf_cpt = binop_to_val_exp_bool lxm "lte" i_eff cpt_eff in let cpt_inf_j = binop_to_val_exp_bool lxm "lte" cpt_eff j_eff in binop_to_val_exp lxm "and" i_inf_cpt cpt_inf_j - in + in let cpt_eq = { src = lxm ; it = ([cpt_left], cpt_rigth) } in let res_eq = { src = lxm ; it = ([res_left], res_rigth) } in - { - asserts_eff = []; - eqs_eff = [cpt_eq; res_eq] + { + asserts_eff = []; + eqs_eff = [cpt_eq; res_eq] }, [cpt_vi] let rec (replace_base : Lic.clock -> Lic.clock -> Lic.clock) = - fun ck1 ck2 -> + fun ck1 ck2 -> match ck2 with | BaseLic -> ck1 | On(x,sck) -> On(x,replace_base sck ck2) @@ -436,20 +436,20 @@ let (create_condact_body: local_ctx -> Lic.static_arg list -> Lic.node_body * va -> node_key,c | _ -> assert false in - let cond_exp, inputs = + let cond_exp, inputs = match List.map (val_exp_of_var_info lxm) lctx.node.Lic.inlist_eff with [] -> assert false | x::t -> x,t - in + in let outputs_clk = List.map (fun var -> snd var.var_clock_eff) lctx.node.Lic.outlist_eff in let left = List.map (fun x -> LeftVarLic (x,lxm)) lctx.node.Lic.outlist_eff in - let node_out_type_list = - List.map (fun x -> x.Lic.var_type_eff) lctx.node.Lic.outlist_eff + let node_out_type_list = + List.map (fun x -> x.Lic.var_type_eff) lctx.node.Lic.outlist_eff in let true_cc = ("Lustre","true") in let i0 = List.hd lctx.node.Lic.inlist_eff in let i0_clk = Lic.On((true_cc, i0.var_name_eff,Bool_type_eff), snd i0.var_clock_eff) in - let inputs_when_i0 = List.map (add_when i0_clk) inputs in + let inputs_when_i0 = List.map (add_when i0_clk) inputs in let outputs_clk_when_i0 = (* replace baseLic by i0_clk *) List.map (replace_base i0_clk) outputs_clk in @@ -458,8 +458,8 @@ let (create_condact_body: local_ctx -> Lic.static_arg list -> Lic.node_body * va in let then_exp = add_current then_exp i0_clk outputs_clk in let const_exp = val_exp_of_const c in - let out_exp = match lctx.node.Lic.outlist_eff with - [o] -> val_exp_of_var_info lxm o + let out_exp = match lctx.node.Lic.outlist_eff with + [o] -> val_exp_of_var_info lxm o | _ -> tuple_to_val_exp lxm (List.map (val_exp_of_var_info lxm) lctx.node.Lic.outlist_eff) in @@ -477,41 +477,41 @@ let (create_merge_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_ let (create_meta_op_body: local_ctx -> Lic.node_key -> Lic.node_body * var_info list) = fun lctx (nk,sargs) -> match nk with - | "Lustre", "fill" - | "Lustre", "red" + | "Lustre", "fold" + | "Lustre", "fill" + | "Lustre", "red" | "Lustre", "fillred" -> create_fillred_body lctx sargs | "Lustre", "map" -> create_map_body lctx sargs | "Lustre", "boolred" -> ( let (i,j,k) = - match sargs with + match sargs with | [ConstStaticArgLic(_, Int_const_eff i); ConstStaticArgLic(_, Int_const_eff j); ConstStaticArgLic(_, Int_const_eff k) - ] -> + ] -> (ios i,ios j,ios k) | _ -> assert false in - create_boolred_body lctx i j k + create_boolred_body lctx i j k ) | "Lustre", "diese" -> ( (* a diese is a particular kind of boolred: #(A,...,an) = boolred(0,1,n)([a1,...,an]) *) let n = List.length lctx.node.Lic.inlist_eff in - create_boolred_body lctx 0 1 n + create_boolred_body lctx 0 1 n ) | "Lustre", "nor" -> ( (* a nor is a particular kind of boolred too: nor(A,...,an) = boolred(0,0,n)([a1,...,an]) *) let n = List.length lctx.node.Lic.inlist_eff in - create_boolred_body lctx 0 0 n + create_boolred_body lctx 0 0 n ) | "Lustre", "condact" -> create_condact_body lctx sargs | "Lustre", "merge" -> create_merge_body lctx sargs | _,_ -> assert false - let rec (node : local_ctx -> Lic.node_exp -> bool -> Lic.node_exp) = fun lctx n only_boolred -> let sonk = Lic.string_of_node_key in @@ -522,26 +522,26 @@ let rec (node : local_ctx -> Lic.node_exp -> bool -> Lic.node_exp) = if only_boolred && (fst n.node_key_eff) <> ("Lustre", "boolred") then n else let nk = n.node_key_eff in let nbody, nlocs = create_meta_op_body lctx nk in - { n with + { n with def_eff = BodyLic nbody; loclist_eff = Some nlocs; } - | ExternLic + | ExternLic | AbstractLic None -> n | AbstractLic (Some pn) -> { n with def_eff = AbstractLic (Some (node lctx pn only_boolred)) } | BodyLic _b -> n - + (* exported *) let (doit : LicPrg.t -> LicPrg.t) = - fun inprg -> + fun inprg -> let outprg = LicPrg.empty in (* types and constants do not change *) let outprg = LicPrg.fold_types LicPrg.add_type inprg outprg in let outprg = LicPrg.fold_consts LicPrg.add_const inprg outprg in (* transform nodes *) - let (do_node : Lic.node_key -> Lic.node_exp -> LicPrg.t -> LicPrg.t) = - fun nk ne outprg -> + let (do_node : Lic.node_key -> Lic.node_exp -> LicPrg.t -> LicPrg.t) = + fun nk ne outprg -> let lctx = { node = ne; prg = inprg; @@ -555,14 +555,14 @@ let (doit : LicPrg.t -> LicPrg.t) = (* exported *) let (doit_boolred : LicPrg.t -> LicPrg.t) = - fun inprg -> + fun inprg -> let outprg = LicPrg.empty in (* types and constants do not change *) let outprg = LicPrg.fold_types LicPrg.add_type inprg outprg in let outprg = LicPrg.fold_consts LicPrg.add_const inprg outprg in (* transform nodes *) - let (do_node : Lic.node_key -> Lic.node_exp -> LicPrg.t -> LicPrg.t) = - fun nk ne outprg -> + let (do_node : Lic.node_key -> Lic.node_exp -> LicPrg.t -> LicPrg.t) = + fun nk ne outprg -> let lctx = { node = ne; prg = inprg; diff --git a/lib/lic2soc.ml b/lib/lic2soc.ml index 80ce889bf74bed252c671964506ed59b914bca28..b577f593d927e7e669038d6df1d10e1431e6aed4 100644 --- a/lib/lic2soc.ml +++ b/lib/lic2soc.ml @@ -1,7 +1,7 @@ -(** Time-stamp: <modified the 21/03/2022 (at 14:12) by Erwan Jahier> *) +(** Time-stamp: <modified the 17/06/2024 (at 14:28) by Erwan Jahier> *) (* XXX ce module est mal écrit. A reprendre. (R1) *) - + open Lxm open Lic @@ -11,14 +11,15 @@ type action = Action.t (* Raised when a soc that haven't been translated yet is used in another soc during the translation *) -exception Undef_soc of Soc.key * Lxm.t * Lic.by_pos_op * Data.t list * Soc.var_expr option +exception Undef_soc of Soc.key * Lxm.t * Lic.by_pos_op * Data.t list * Soc.var_expr option (*********************************************************************************) (** Informations liées au contexte de traduction. *) type ctx = { prg : LicPrg.t; last_temp_var : int; - last_mem : int; + last_mem : int; (* to count instances number *) + last_task : int; (* to count tasks number *) locals : Soc.var list; } @@ -28,12 +29,13 @@ let create_context: (LicPrg.t -> ctx) = prg = prg; last_temp_var = 0; last_mem = 0; + last_task = 0; locals = []; } exception Polymorphic -let rec lic_to_data_type: (Lic.type_ -> Data.t) = +let rec lic_to_data_type: (Lic.type_ -> Data.t) = function | Lic.Bool_type_eff -> Data.Bool | Lic.Int_type_eff -> Data.Int @@ -54,9 +56,9 @@ let rec lic_to_data_type: (Lic.type_ -> Data.t) = (* Data.Alias(Lv6Id.string_of_long false id,lic_to_data_type t) *) | Lic.TypeVar Lic.Any -> Data.Alpha 0 - | Lic.TypeVar Lic.AnyNum -> + | Lic.TypeVar Lic.AnyNum -> (* For some reasons, L2lRmPoly did not manage to resolve all the overloeding. - In that case, we stop. + In that case, we stop. nb : i raise an exception here because I've got no Lxm.t to use to display a nice error message. If ever Polymorphic is raised @@ -71,20 +73,20 @@ let rec lic_to_data_type: (Lic.type_ -> Data.t) = On veut éviter de créer des variables temporaires portant le même nom que celles définies par l'utilisateur. Donc on renomme simplement celles de - l'utilisateur, c'est le plus simple. + l'utilisateur, c'est le plus simple. XXX obselete ? Mieux vaudrait utiliser le meme mechanisme que celui utilisé -actuellement lors des l2l*.ml +actuellement lors des l2l*.ml ??? *) - (* R1: je vire le "_" parce que ca m'emmerde ce truc. + (* R1: je vire le "_" parce que ca m'emmerde ce truc. On verra plus tard les clash de nom... bon, des clashs de nom, y'en a pas trop, mais avec les mots clefs C, si ! ex: si un noeud a une variable qui s'appelle "long"... -*) +*) let user_var_prefix = "" let rename_user_var: (string -> string) = fun s -> @@ -92,7 +94,7 @@ let rename_user_var: (string -> string) = fun s -> let suffix = "" in prefix ^ s ^ suffix -let is_predefined_const: string -> Lic.type_ option = +let is_predefined_const: string -> Lic.type_ option = function | "true" | "false" -> Some Lic.Bool_type_eff | _ -> None @@ -118,18 +120,18 @@ let rec (lic2soc_const : Lic.const -> Soc.var_expr list) = lic_to_data_type teff)] | Abstract_const_eff (s, teff,_,_) -> [Soc.Const(Lv6Id.string_of_long false s, lic_to_data_type teff)] - | Enum_const_eff (s, teff) -> + | Enum_const_eff (s, teff) -> let ll = match teff with Enum_type_eff(_,ll) -> ll | _ -> assert false in [Soc.Const(enum_to_string s ll, lic_to_data_type teff)] | Struct_const_eff (_fl, _teff) -> assert false (* todo *) | Array_const_eff (_ct, _teff) -> assert false (* todo *) | Tuple_const_eff cl -> List.flatten (List.map lic2soc_const cl) -(* Returns Some(thing) if val_exp is a leaf (a var or a constant) +(* Returns Some(thing) if val_exp is a leaf (a var or a constant) XXX c'est pas tres clair le role de cette fonction. Expliquer ! *) -let rec get_leaf: (LicPrg.t -> Lic.val_exp -> Soc.var_expr list option) = +let rec get_leaf: (LicPrg.t -> Lic.val_exp -> Soc.var_expr list option) = fun licprg val_exp -> let v = val_exp.Lic.ve_core in let type_ = val_exp.Lic.ve_typ in @@ -138,7 +140,7 @@ let rec get_leaf: (LicPrg.t -> Lic.val_exp -> Soc.var_expr list option) = | Lic.Merge(_c_flg, _cl) -> None | Lic.CallByPosLic (by_pos_op_flg, val_exp_list) -> ( match by_pos_op_flg.it with - | Lic.VAR_REF name -> + | Lic.VAR_REF name -> let type_ = (List.hd type_) in let translation = match is_predefined_const name with @@ -150,7 +152,7 @@ let rec get_leaf: (LicPrg.t -> Lic.val_exp -> Soc.var_expr list option) = (match LicPrg.find_const licprg l with | Some c -> Some(lic2soc_const c) | None -> assert false - ) + ) ) | Lic.CONST c -> Some(lic2soc_const c) | Lic.STRUCT_ACCESS(field) -> ( @@ -181,8 +183,8 @@ let rec get_leaf: (LicPrg.t -> Lic.val_exp -> Soc.var_expr list option) = Some (List.flatten (List.map del_some var_values)) ) | Lic.ARRAY_SLICE _si -> ( - (* XXX is it a good idea to explode slices? - let id, t, i = match val_exp_list with + (* XXX is it a good idea to explode slices? + let id, t, i = match val_exp_list with | [{Lic.ve_core=Lic.CallByPosLic({it=Lic.VAR_REF id},[]); Lic.ve_typ=[Array_type_eff(t,i)] }] -> id, t, i @@ -191,7 +193,7 @@ let rec get_leaf: (LicPrg.t -> Lic.val_exp -> Soc.var_expr list option) = let t_soc = lic_to_data_type t in let type_elt_ref,type_ref = t_soc, Data.Array(t_soc,i) in let index_list = slice_info_to_index_list si in - let exploded_array = + let exploded_array = (* val_exp is a var ident (t) of type array; we want to gen the list t[i1], ...,t[in], where the index are specified by the slice *) List.map @@ -205,7 +207,7 @@ let rec get_leaf: (LicPrg.t -> Lic.val_exp -> Soc.var_expr list option) = | Lic.PREDEF_CALL _ | Lic.CALL _ | Lic.PRE - | Lic.ARRAY + | Lic.ARRAY | Lic.HAT _ | Lic.ARROW | Lic.FBY @@ -213,10 +215,10 @@ let rec get_leaf: (LicPrg.t -> Lic.val_exp -> Soc.var_expr list option) = | Lic.WHEN(_) | Lic.CONCAT -> None - ) + ) (* Traduction d'une partie gauche d'équation en filtre d'accès soc. *) -let rec filter_of_left_part: (LicPrg.t -> Lic.left -> Soc.var_expr list) = - fun licprg lp -> +let rec filter_of_left_part: (LicPrg.t -> Lic.left -> Soc.var_expr list) = + fun licprg lp -> match lp with | Lic.LeftVarLic (vi, _lxm) -> ( [Soc.Var (rename_user_var vi.Lic.var_name_eff, @@ -232,13 +234,13 @@ let rec filter_of_left_part: (LicPrg.t -> Lic.left -> Soc.var_expr list) = ) | Lic.LeftSliceLic(lp,si,t) -> ( let lpl = filter_of_left_part licprg lp in - List.map (fun lp -> Soc.Slice(lp, si.se_first, si.se_last, si.se_step, + List.map (fun lp -> Soc.Slice(lp, si.se_first, si.se_last, si.se_step, si.se_width, lic_to_data_type t)) lpl ) (*********************************************************************************) -let build_step: Lxm.t -> string -> Lic.node_exp -> Soc.var list -> Soc.gao list -> +let build_step: Lxm.t -> string -> Lic.node_exp -> Soc.var list -> Soc.gao list -> Soc.step_method = fun lxm name node locals gaol -> (* Converti les entrées/sorties d'un noeud en index @@ -250,7 +252,7 @@ let build_step: Lxm.t -> string -> Lic.node_exp -> Soc.var list -> Soc.gao list Soc.name = name; Soc.lxm = lxm; Soc.idx_ins = convert_node_interface node.Lic.inlist_eff; - Soc.idx_outs = convert_node_interface node.Lic.outlist_eff; + Soc.idx_outs = convert_node_interface node.Lic.outlist_eff; Soc.impl = Soc.Gaol (locals, gaol) } @@ -265,39 +267,39 @@ let build_extern_step: Lxm.t -> string -> Lic.node_exp -> Soc.step_method = Soc.name = name; Soc.lxm = lxm; Soc.idx_ins = convert_node_interface node.Lic.inlist_eff; - Soc.idx_outs = convert_node_interface node.Lic.outlist_eff; + Soc.idx_outs = convert_node_interface node.Lic.outlist_eff; Soc.impl = Soc.Extern (* Soc.impl = Soc.Gaol ([], []) *) } let (lic_val_exp_to_soc_var : LicPrg.t -> Lic.val_exp Lxm.srcflagged -> - Lxm.t * Soc.var) = + Lxm.t * Soc.var) = fun prg ve -> match get_leaf prg ve.it with | Some [Soc.Var v] -> ve.src, v | Some _ -> assert false | None -> failwith ("Should be a var: "^(LicDump.string_of_val_exp_eff false ve.it)) - -let (lic_to_soc_var : Lic.var_info -> Soc.var) = - fun vi -> + +let (lic_to_soc_var : Lic.var_info -> Soc.var) = + fun vi -> vi.Lic.var_name_eff, lic_to_data_type vi.Lic.var_type_eff let soc_profile_of_node: Lic.node_exp -> Soc.var list * Soc.var list = fun n -> let inputs = List.map lic_to_soc_var n.Lic.inlist_eff in let outputs = List.map lic_to_soc_var n.Lic.outlist_eff in - inputs, outputs + inputs, outputs let (make_soc_key_of_node_key : Lic.node_key -> Lic.slice_info option -> Data.t list -> Soc.key) = fun nk si_opt vl -> let key_opt = (match si_opt with - | None -> Soc.Nomore + | None -> Soc.Nomore | Some si -> Soc.Slic(si.Lic.se_first,si.Lic.se_last,si.Lic.se_step)) in - let key_opt = + let key_opt = if (snd (fst nk)) = "condact" then ( assert (key_opt=Soc.Nomore); Soc.MemInit(Soc.Const("_true", Data.Bool)) (* the first step flag *) @@ -309,7 +311,7 @@ let (make_soc_key_of_node_key : let (soc_key_of_node_exp : Lic.node_exp -> Soc.key) = - fun n -> + fun n -> let svi,svo = soc_profile_of_node n in let (id,tl,key_opt) = make_soc_key_of_node_key n.node_key_eff None (List.map snd (svi@svo)) @@ -329,9 +331,9 @@ let rec (val_exp_to_filter: LicPrg.t -> Lic.val_exp -> Soc.var_expr list) = | WHEN(_) -> (* ignore it. A good idea? Such when should only appear for const *) List.flatten (List.map (val_exp_to_filter licprg) val_exp_list) - | TUPLE -> + | TUPLE -> List.flatten (List.map (val_exp_to_filter licprg) val_exp_list) - | VAR_REF name -> + | VAR_REF name -> let type_ = (List.hd type_) in let translation = match is_predefined_const name with @@ -344,7 +346,7 @@ let rec (val_exp_to_filter: LicPrg.t -> Lic.val_exp -> Soc.var_expr list) = | Some c -> let by_pos_op_flg = { by_pos_op_flg with it = CONST c } in val_exp_to_filter licprg - ({ val_exp with Lic.ve_core = CallByPosLic (by_pos_op_flg, [])} ) + ({ val_exp with Lic.ve_core = CallByPosLic (by_pos_op_flg, [])} ) | None -> assert false ) ) @@ -370,7 +372,7 @@ let rec (val_exp_to_filter: LicPrg.t -> Lic.val_exp -> Soc.var_expr list) = in [Soc.Index(filter_expr, i, type_)] ) - | PREDEF_CALL _ + | PREDEF_CALL _ | CALL _ | PRE | ARROW @@ -379,9 +381,9 @@ let rec (val_exp_to_filter: LicPrg.t -> Lic.val_exp -> Soc.var_expr list) = | CONCAT | HAT _ | ARRAY - | ARRAY_SLICE _ -> + | ARRAY_SLICE _ -> let lxm = by_pos_op_flg.src in - let msg = (Lxm.details lxm) ^ + let msg = (Lxm.details lxm) ^ ": only one operator per equation is allowed ("^ (LicDump.string_of_val_exp_eff false val_exp)^").\n" in @@ -396,7 +398,7 @@ and (const_to_filter : Lic.const -> Soc.var_expr list) = | (Enum_const_eff (str, type_)) -> [Soc.Const(Lv6Id.string_of_long false str, lic_to_data_type type_)] | (Array_const_eff (cl, _type_)) -> - let vell = + let vell = List.map (fun c -> let vel = const_to_filter c in vel @@ -422,7 +424,7 @@ let rec (is_a_sub_clock : Lic.clock -> Lic.clock -> bool) = | On(_,ck1), On(_,_) -> ck1 = ck2 || is_a_sub_clock ck1 ck2 | ClockVar _, _ -> assert false | _, ClockVar _ -> assert false - + (* We can have 2 different definitions for the clock of an expression. It can be the clock of its output, which is useful to @@ -444,16 +446,16 @@ let (clock_of_expr : Lic.val_exp -> Lic.clock) = let clks = List.map (fun arg -> arg.ve_clk) args in let clks = List.flatten clks in assert(clks<>[]); - List.fold_left - (fun ck1 ck2 -> + List.fold_left + (fun ck1 ck2 -> if is_a_sub_clock ck1 ck2 then ck2 else (assert (is_a_sub_clock ck2 ck1); ck1) - ) + ) (List.hd clks) (List.tl clks) | ve -> (* if the expression is not a node call, its clock is the clock of its output *) - (match ve.ve_clk with + (match ve.ve_clk with | clk::_ -> clk (* no multiclock tuple for the time being *) | [] -> assert false) @@ -461,53 +463,79 @@ let (clock_of_expr : Lic.val_exp -> Lic.clock) = (* type instance_init = Soc.instance * action list (* instance + son initialisation *) *) (** Créé une opération à partir d'un nom de méthode d'un composant. *) -let soc_step_to_operation: - Soc.ident -> Soc.t -> Soc.instance option -> Soc.atomic_operation = - fun name comp -> function - | None -> Soc.Procedure (comp.Soc.key) - | Some (i) -> Soc.Method(i,name) - -let (action_of_step : Lxm.t -> Soc.t -> Lic.clock -> Soc.var_expr list -> - Soc.var_expr list -> Soc.instance option -> Soc.step_method -> action) = - fun lxm c clk il ol mem step -> +let soc_step_to_operation: + Soc.ident -> Soc.t -> Soc.instance option -> Soc.task option -> Soc.atomic_operation = + fun name comp i_opt t_opt -> + match i_opt with + | None -> Soc.Procedure (comp.Soc.key, t_opt) + | Some (i) -> Soc.Method(i,name, t_opt) + +let (action_of_step : Lxm.t -> Soc.t -> Lic.clock -> Soc.var_expr list -> + Soc.var_expr list -> Soc.instance option -> Soc.task option -> Soc.step_method -> action) = + fun lxm c clk il ol mem task step -> let inputs = SocUtils.filter_step_params step.Soc.idx_ins il in let outputs = SocUtils.filter_step_params step.Soc.idx_outs ol in - let call_action = soc_step_to_operation step.Soc.name c mem in + let call_action = soc_step_to_operation step.Soc.name c mem task in (clk, inputs, outputs, call_action, lxm) -(** Créé un nouveau nom pour une instance. *) -let create_new_instance_name: (Soc.key -> ctx -> ctx * string) = fun (soc_name,_,_) ctx -> - let prefix = soc_name in - let suffix = "" in - let make id = Format.sprintf "%s%d%s" prefix id suffix in - let new_ctx = {ctx with last_mem = ctx.last_mem + 1 } in - new_ctx, make new_ctx.last_mem - - (** Créé une nouvelle instance pour être utilisée dans un composant. +(*********************************************************************************) - Pendant la traduction d'un opérateur, on s'apercoit que cet - opérateur dispose d'une (ou plusieur) mémoire. Il faut donc - qu'on créé une instance de ce composant. *) -let create_instance_from_soc: (ctx -> Soc.t -> ctx * Soc.instance) = - fun ctx c -> - let ctx, inst_name = create_new_instance_name c.Soc.key ctx in - ctx, (inst_name, c.Soc.key) +(* if the soc has memories (a pre, or node with memory), do create an instance -(* if the soc has memories (a pre, or node with memory), do create an instance *) -let (make_instance : +ctx is modified as it tracks instances number +*) +let (make_instance : Lxm.t -> Lic.clock -> ctx -> Soc.t -> ctx * Soc.instance option) = - fun _lxm _clk ctx soc -> - match soc.Soc.instances with - | [] -> ( - match soc.Soc.memory with - | Soc.No_mem -> ctx, None - | _ -> (* pre/fby/arrow/condact + extern *) - let ctx, m = create_instance_from_soc ctx soc in - ctx, Some(m) - ) - | _ -> (* the soc has sub-soc with memory *) + fun _lxm _clk ctx soc -> + let create_new_instance_name: (Soc.key -> ctx -> ctx * string) = fun (soc_name,_,_) ctx -> + let prefix = soc_name in + let suffix = "" in + let make id = Format.sprintf "%s%d%s" prefix id suffix in + let new_ctx = {ctx with last_mem = ctx.last_mem + 1 } in + new_ctx, make new_ctx.last_mem + in + (* Crée une nouvelle instance pour être utilisée dans un composant. + + Pendant la traduction d'un opérateur, on s'apercoit que cet + opérateur dispose d'une (ou plusieur) mémoire. Il faut donc + qu'on créé une instance de ce composant. *) + let create_instance_from_soc: (ctx -> Soc.t -> ctx * Soc.instance) = + fun ctx c -> + let ctx, inst_name = create_new_instance_name c.Soc.key ctx in + ctx, (inst_name, c.Soc.key) + in + match soc.Soc.instances, soc.Soc.tasks with + | [], [] -> ( + match soc.Soc.memory with + | Soc.No_mem -> ctx, None + | _ -> (* pre/fby/arrow/condact + extern *) let ctx, m = create_instance_from_soc ctx soc in ctx, Some(m) + ) + | _, _ -> (* the soc has sub-soc with memory or with task *) + let ctx, m = create_instance_from_soc ctx soc in + ctx, Some(m) + +(* Very similar to make_instance *) +let (make_task : + Lxm.t -> Lic.clock -> ctx -> Soc.t -> ctx * Soc.task option) = + fun _lxm _clk ctx soc -> + let create_new_task_name: (Soc.key -> ctx -> ctx * string) = fun (soc_name,_,_) ctx -> + let prefix = soc_name in + let suffix = "" in + let make id = Format.sprintf "%s%d%s" prefix id suffix in + let new_ctx = {ctx with last_task = ctx.last_task + 1 } in + new_ctx, make new_ctx.last_task + in + let create_task_from_soc: (ctx -> Soc.t -> ctx * Soc.task) = + fun ctx c -> + let ctx, task_name = create_new_task_name c.Soc.key ctx in + ctx, (task_name, c.Soc.key) + in + let ctx, m = create_task_from_soc ctx soc in + ctx, Some(m) + + (*********************************************************************************) (** actions_of_expression_acc translates an expression and an @@ -517,24 +545,25 @@ let (make_instance : It also augments the 3rd element of the 5-tuple that holds a list of Soc.var_expr ; this list is meant to be used by the recursive calls only - (i.e., not by actions_of_expression) + (i.e., not by actions_of_expression) *) -type e2a_acc = - ctx +type e2a_acc = + ctx * action list (* collected when iterating on equations *) * Soc.var_expr list (* an accumutor, but local for actions_of_expression_acc *) * Soc.instance list (* collected when iterating on equations *) + * Soc.task list (* Ditto *) * ActionsDeps.t (* Ditto *) let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl -> - Lic.clock -> Soc.var_expr list -> e2a_acc -> Lic.val_exp -> e2a_acc) = - fun _lxm soc_tbl clk lpl acc expr -> - let (ctx, al, iol, ml, deps) = acc in + Lic.clock -> Soc.var_expr list -> bool -> e2a_acc -> Lic.val_exp -> e2a_acc) = + fun _lxm soc_tbl clk lpl is_task acc expr -> + let (ctx, al, iol, ml, tl, deps) = acc in match get_leaf ctx.prg expr with - | Some names -> + | Some names -> (* expr est déjà une feuille (un ident ou une constante), RAF. *) let action = clk, names, lpl, Soc.Assign, expr.ve_src in - (ctx, action::al, iol@names, ml, deps) + (ctx, action::al, iol@names, ml, tl, deps) | None -> ( let v = expr.Lic.ve_core in match v with @@ -547,31 +576,31 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl -> let filter = match filter with [x] -> x | _ -> assert false in Soc.Field(filter, field, lic_to_data_type ftype) in - let actions = + let actions = List.map - (fun (fn, fv) -> + (fun (fn, fv) -> let ft = fv.ve_typ in let nfv = val_exp_to_filter ctx.prg fv in (clk, nfv, [filter_to_field lpl fn.it ft], Soc.Assign, fn.src) ) fl in - ctx, List.rev_append actions al, iol, ml, deps + ctx, List.rev_append actions al, iol, ml, tl, deps ) | Merge(mclk, cl) -> ( (* Merge (like when) does not generate any soc, but states when - expressions are executed. + expressions are executed. Here, we split Lic.Merge into several actions. Hopefully, the test opening optimisation stage would be able to - reconstruct this merge into a proper Soc.Case. + reconstruct this merge into a proper Soc.Case. *) let clk_type = List.hd mclk.ve_typ in let clkclk = List.hd mclk.ve_clk in let clk_id = match mclk with | { ve_core= CallByPosLic({it=VAR_REF id;_},[]) ;_} -> id | _ -> assert false - in + in let acc = List.fold_left (fun acc (cc_flg,ve) -> let cc_long = match cc_flg.it with @@ -579,16 +608,17 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl -> | Bool_const_eff false -> "Lustre", "false" | Enum_const_eff(long,_) -> long | _ -> assert false - in + in let (clk:Lic.clock) = On((cc_long, clk_id, clk_type),clkclk) in - let ctx, actions, _, mems, deps = acc in - let ctx, actions2, inputs, mems2, deps2 = - actions_of_expression cc_flg.src soc_tbl ctx clk lpl ve + let ctx, actions, _, mems, tasks, deps = acc in + let ctx, actions2, inputs, mems2, tasks2, deps2 = + actions_of_expression cc_flg.src soc_tbl ctx clk lpl false ve in let mems = mems@mems2 in + let tasks = tasks@tasks2 in let deps = ActionsDeps.concat deps deps2 in let actions = actions@actions2 in - ctx, actions, inputs, mems, deps + ctx, actions, inputs, mems, tasks, deps ) acc cl @@ -600,11 +630,11 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl -> | Lic.WHEN ck -> ( (* 'when' does not generate any soc, but it states when expressions are executed . *) - let ctx, actions, inputs, mems, deps = + let ctx, actions, inputs, mems, tasks, deps = actions_of_expression_list by_pos_op_flg.src soc_tbl clk - lpl acc val_exp_list + lpl false acc val_exp_list in - let ctx, outputs, actions_reclocked = + let ctx, outputs, actions_reclocked = match actions with | [] -> (* val_exp is a leaf x. *) let lxm = by_pos_op_flg.src in @@ -614,13 +644,13 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl -> la nouvelle horloge issue du `when`. *) List.map (fun (_, i,o,op,lxm) -> ck,i,o,op,lxm) actions in - ctx, actions_reclocked, outputs, mems, deps + ctx, actions_reclocked, outputs, mems, tasks, deps ) | Lic.VAR_REF _ | Lic.CONST_REF _ | Lic.CONST _ | Lic.ARRAY_ACCES _ | Lic.STRUCT_ACCESS _ | Lic.TUPLE -> assert false (* should not occur: handled via get_leaf *) | CURRENT _ - | Lic.ARRAY_SLICE _ + | Lic.ARRAY_SLICE _ | CALL _ | PREDEF_CALL _ | HAT _ | ARRAY | PRE | ARROW | FBY | CONCAT -> ( (* retreive the soc of "expr" in soc_tbl *) @@ -631,7 +661,7 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl -> in let res_type = List.map lic_to_data_type expr.ve_typ in (* let (get_exp_type : Soc.var_expr list -> Data.t list) = - fun vl -> + fun vl -> let tl = List.map Soc.data_type_of_var_expr vl in tl let res_type = get_exp_type lpl in *) @@ -640,7 +670,7 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl -> Lic.ARRAY_SLICE si -> Some si | _ -> None in (* XXX Béquille en attendant mieux *) - let (node_key_of_pos_op : Lic.by_pos_op -> Lic.node_key) = fun op -> + let (node_key_of_pos_op : Lic.by_pos_op -> Lic.node_key) = fun op -> match op with | PRE -> ("","Lustre::pre"),[] | ARROW -> ("","Lustre::arrow" ),[] @@ -653,19 +683,19 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl -> | CALL n | PREDEF_CALL n -> n.it | _ -> assert false in - let node_key = node_key_of_pos_op by_pos_op_flg.it in + let node_key = node_key_of_pos_op by_pos_op_flg.it in let sk = make_soc_key_of_node_key node_key si_opt full_profile in let (sk_name, sk_prof,_) = sk in - let sk,fby_init_opt = - match by_pos_op_flg.it with - | Lic.FBY -> + let sk,fby_init_opt = + match by_pos_op_flg.it with + | Lic.FBY -> let init = val_exp_to_filter ctx.prg (List.hd val_exp_list) in let init = List.hd init in (sk_name, sk_prof, Soc.MemInit init), Some init - | Lic.ARROW -> + | Lic.ARROW -> let init = Soc.Const("_true", Data.Bool) in (sk_name, sk_prof, Soc.MemInit init), Some init - | Lic.CURRENT (Some cc) -> + | Lic.CURRENT (Some cc) -> (sk_name, sk_prof, Soc.Curr(cc)), None | _ -> sk, None in @@ -674,21 +704,28 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl -> Lv6Verbose.exe ~flag:dbg (fun () -> print_string msg; flush stdout); raise (Undef_soc (sk, lxm,by_pos_op_flg.it,args_types,fby_init_opt)) in - make_e2a_elt by_pos_op_flg.src clk lpl acc val_exp_list soc + make_e2a_elt by_pos_op_flg.src clk lpl acc val_exp_list is_task soc ) ) ) -and (make_e2a_elt: Lxm.t -> Lic.clock -> Soc.var_expr list -> e2a_acc -> - Lic.val_exp list -> Soc.t -> e2a_acc) = - fun lxm clk lpl acc val_exp_list soc -> - (* Update the acc with the actions made of the soc call: +and (make_e2a_elt: Lxm.t -> Lic.clock -> Soc.var_expr list -> e2a_acc -> + Lic.val_exp list -> bool -> Soc.t -> e2a_acc) = + fun lxm clk lpl acc val_exp_list is_task soc -> + (* Update the acc with the actions made of the soc call: « lpl = soc(val_exp_list) » on clk *) - let (ctx, al, iol, ml, deps) = acc in + let (ctx, al, iol, ml, tl, deps) = acc in let inputs = List.flatten (List.map (val_exp_to_filter ctx.prg) val_exp_list) in - let ctx, mem_opt = make_instance lxm clk ctx soc in + let ctx, mem_opt, task_opt = + if is_task then + let ctx, task_opt = make_task lxm clk ctx soc in + ctx, None, task_opt + else + let ctx, mem_opt = make_instance lxm clk ctx soc in + ctx, mem_opt, None + in let actions = - let m2act = action_of_step lxm soc clk inputs lpl mem_opt in + let m2act = action_of_step lxm soc clk inputs lpl mem_opt task_opt in List.map m2act soc.Soc.step in let actions = al @ actions in @@ -701,57 +738,72 @@ and (make_e2a_elt: Lxm.t -> Lic.clock -> Soc.var_expr list -> e2a_acc -> in let dependances = ActionsDeps.concat deps dependances in let ml = match mem_opt with Some m -> m::ml | None -> ml in - (ctx, actions, iol, ml, dependances) + let tl = match task_opt with Some t -> t::tl | None -> tl in + (ctx, actions, iol, ml, tl, dependances) (** Traduction d'une liste d'expressions. *) -and (actions_of_expression_list: Lxm.t -> Soc.tbl -> Lic.clock -> Soc.var_expr list -> - e2a_acc -> Lic.val_exp list -> e2a_acc) = - fun lxm soc_tbl clk lpl expr_list acc -> - List.fold_left (actions_of_expression_acc lxm soc_tbl clk lpl) expr_list acc +and (actions_of_expression_list: Lxm.t -> Soc.tbl -> Lic.clock -> Soc.var_expr list -> + bool -> e2a_acc -> Lic.val_exp list -> e2a_acc) = + fun lxm soc_tbl clk lpl is_task expr_list acc -> + List.fold_left (actions_of_expression_acc lxm soc_tbl clk lpl is_task) expr_list acc and (actions_of_expression : Lxm.t -> Soc.tbl -> ctx -> Lic.clock -> Soc.var_expr list -> - Lic.val_exp -> e2a_acc) = - fun lxm soc_tbl ctx clk lpl expr -> - let acc0 = (ctx, [], [], [], ActionsDeps.empty) in - actions_of_expression_acc lxm soc_tbl clk lpl acc0 expr + bool -> Lic.val_exp -> e2a_acc) = + fun lxm soc_tbl ctx clk lpl is_task expr -> + let acc0 = (ctx, [], [], [], [], ActionsDeps.empty) in + actions_of_expression_acc lxm soc_tbl clk lpl is_task acc0 expr + - (*********************************************************************************) + +let (is_a_task : Lxm.t -> bool) = + fun lxm -> + let rec f pl = + match pl with + | [] -> false + | Pragma("MT",_)::_ -> true + | Pragma(_,_)::pl -> f pl + in + f (Lxm.pragma lxm) + + (** Translates an equation into one or several actions. - - Generated dependencies are merged by the caller. + + Generated dependencies are merged by the caller. *) -let (actions_of_equation: Lxm.t -> Soc.tbl -> ctx -> Lic.eq_info -> - ctx * action list * Soc.instance list * ActionsDeps.t) = +let (actions_of_equation: Lxm.t -> Soc.tbl -> ctx -> Lic.eq_info -> + ctx * action list * Soc.instance list * Soc.task list * ActionsDeps.t) = fun lxm soc_tbl ctx (left_part, right_part) -> - let clk = clock_of_expr right_part in + let clk = clock_of_expr right_part in let left_loc = List.map (filter_of_left_part ctx.prg) left_part in let left_loc = List.flatten left_loc in - let ctx, actions, _, instances, deps = - actions_of_expression lxm soc_tbl ctx clk left_loc right_part + let is_task = is_a_task lxm in + let ctx, actions, _, instances, tasks, deps = + actions_of_expression lxm soc_tbl ctx clk left_loc is_task right_part in - ctx, actions, instances, deps - + (* let tasks = if not is_task then tasks else xxx:: tasks in *) + ctx, actions, instances, tasks, deps + (*********************************************************************************) open Soc let profile_info = Lv6Verbose.profile_info -let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = +let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = fun prog mnk -> let rec (process_node : Lic.node_key -> Soc.tbl -> Soc.key * Soc.tbl) = - fun nk soc_tbl -> + fun nk soc_tbl -> profile_info ("Lic2soc.process_node "^(Lic.string_of_node_key nk)^"\n"); - let node = + let node = match LicPrg.find_node prog nk with - | None -> + | None -> prerr_string ( "*** "^ (LicDump.string_of_node_key_rec false false nk) ^ " not defined (as lic).\n" ^ - "*** Defined nodes are:"^ + "*** Defined nodes are:"^ (String.concat - ",\n" + ",\n" (List.map (fun (nk,_) -> "\""^LicDump.string_of_node_key_rec false false nk ^"\"") (LicPrg.list_nodes prog))) @@ -760,11 +812,11 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = | Some node_exp -> node_exp in let sk = soc_key_of_node_exp node in - let soc_tbl = + let soc_tbl = if SocMap.mem sk soc_tbl then soc_tbl else try (match LicPrg.find_node prog nk with - | None -> assert false + | None -> assert false | Some node_def -> (match soc_of_node prog node_def soc_tbl with | Some(_,soc,soc_tbl) -> SocUtils.add sk soc soc_tbl @@ -775,11 +827,11 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = ) ) with - | Undef_soc (_sk,_lxm,Lic.CALL { it = nk2 ;_}, _types,_) -> + | Undef_soc (_sk,_lxm,Lic.CALL { it = nk2 ;_}, _types,_) -> (* Il manque une dépendance, on essaie de la - traduire puis de retraduire le noeud courant. + traduire puis de retraduire le noeud courant. ZZZ ca part facilement en vrille ici si une erreur - a été faite en amont... + a été faite en amont... *) let soc_tbl = snd (process_node nk2 soc_tbl) in snd (process_node nk soc_tbl) @@ -798,8 +850,8 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = let soc_tbl = SocUtils.add soc.key soc soc_tbl in snd (process_node nk soc_tbl) ) - | Polymorphic -> - let msg = (Lxm.details node.lxm) ^ + | Polymorphic -> + let msg = (Lxm.details node.lxm) ^ ": cannot infer the type of this polymorphic node."^ " Please be more specific.\n" in @@ -811,15 +863,15 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = and make_condact_soc node condact_node soc_key soc_tbl ctx lxm vel = let nsk, soc_tbl = process_node condact_node soc_tbl in let nsoc = SocUtils.find lxm nsk soc_tbl in - let nsoc_step = match nsoc.step with [s] -> s + let nsoc_step = match nsoc.step with [s] -> s | _ -> assert false (* hmm. Iterating on a pre will not work. XXX fixme ! *) in - let _ctx,inst = + let _ctx,inst = match make_instance lxm Lic.BaseLic ctx nsoc with | ctx,Some inst -> ctx,[inst] | ctx,None -> ctx,[] in - let soc_key = + let soc_key = let x,y,_=soc_key in x,y, Soc.MemInit(Soc.Const("_true", Data.Bool)) (* the first step flag *) in @@ -828,6 +880,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = Soc.profile = soc_profile_of_node node; Soc.clock_profile = []; Soc.instances = inst ; + Soc.tasks = [] ; Soc.step = [ { name = "step"; @@ -840,8 +893,8 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = Soc.memory = Soc.Mem Data.Bool; (* to hold the first step flag *) Soc.precedences = []; Soc.assertions = [ (* something to do? *)]; - } - in + } + in soc_tbl, soc (* Produit des soc de noeuds. *) @@ -850,7 +903,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = fun licprg node soc_tbl -> profile_info ("Lic2soc.soc_of_node "^ (Lic.string_of_node_key node.node_key_eff)^"\n"); - let io_list = node.Lic.inlist_eff @ node.Lic.outlist_eff in + 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_key node.Lic.node_key_eff None io_type in let lxm = node.Lic.lxm in @@ -858,15 +911,17 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = let (soc_of_body: Lic.node_body -> Soc.tbl -> (ctx * Soc.t * Soc.tbl) option) = fun b soc_tbl -> profile_info " Lic2soc.soc_of_node: computing actions...\n"; - let ctx, actions, instances, deps = + let ctx, actions, instances, tasks, deps = (* on itere sur la liste des équations *) List.fold_left - (fun (c, a, i, d) eq -> - let nc, na, ni, nd = actions_of_equation eq.src soc_tbl c eq.it in - nc, List.rev_append na a, List.rev_append ni i, + (fun (c, a, i, t, d) eq -> + let nc, na, ni, nt, nd = actions_of_equation eq.src soc_tbl c eq.it in + nc, List.rev_append na a, + List.rev_append ni i, + List.rev_append nt t, (ActionsDeps.concat nd d) ) - (ctx, [], [], ActionsDeps.empty) + (ctx, [], [], [], ActionsDeps.empty) b.eqs_eff in (* Construction des dépendances entre les expressions *) @@ -879,12 +934,12 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = profile_info " SortActions.f: sorting actions...\n"; let gaol = SortActions.f actions all_deps lxm in - + profile_info " Lic2soc.soc_of_node: actions sorted. \n"; let (locals: Soc.var list) = match node.Lic.loclist_eff with | None -> [] - | Some l -> List.map (lic_to_soc_var) l + | Some l -> List.map (lic_to_soc_var) l in let step = build_step lxm "step" node (locals @ ctx.locals) gaol in let soc = { @@ -892,6 +947,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = Soc.profile = soc_profile_of_node node; Soc.clock_profile = []; Soc.instances = instances ; + Soc.tasks = tasks; Soc.step = [step]; Soc.memory = Soc.No_mem; Soc.precedences = []; @@ -901,7 +957,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = is inhibited in L2Lsplit *) else List.map (lic_val_exp_to_soc_var licprg) b.asserts_eff; - } + } in Some(ctx, soc, soc_tbl) in @@ -910,7 +966,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = profile_info "Lic2soc.soc_of_metaop...\n"; match snd (fst nk), List.sort compare (snd nk) with | ("map"|"red"|"fill"|"fillred"|"fold"),[ - ConstStaticArgLic(_,Int_const_eff(c)); NodeStaticArgLic(_,iter_node)] + ConstStaticArgLic(_,Int_const_eff(c)); NodeStaticArgLic(_,iter_node)] | ("map"|"red"|"fill"|"fillred"|"fold"),[ ConstStaticArgLic(_,Int_const_eff(c)); TypeStaticArgLic(_); NodeStaticArgLic(_,iter_node)] -> ( (*red, fill, fillred, map *) @@ -933,6 +989,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = Soc.profile = soc_profile_of_node node; Soc.clock_profile = []; Soc.instances = instances ; + Soc.tasks = [] ; Soc.step = [ { name = "step"; @@ -945,7 +1002,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = Soc.memory = Soc.No_mem; Soc.precedences = []; Soc.assertions = []; - } + } in Some(ctx, soc, soc_tbl) @@ -966,10 +1023,10 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = make_condact_soc node condact_node soc_key soc_tbl ctx lxm [const] in Some(ctx, soc, soc_tbl) ) - | _e -> - match (nk) with - | ("Lustre","boolred"), [ConstStaticArgLic(_,Int_const_eff(i)); - ConstStaticArgLic(_,Int_const_eff(j)); + | _e -> + match (nk) with + | ("Lustre","boolred"), [ConstStaticArgLic(_,Int_const_eff(i)); + ConstStaticArgLic(_,Int_const_eff(j)); ConstStaticArgLic(_,Int_const_eff(k)) ] -> ( let i,j,k = int_of_string i, int_of_string j, int_of_string k in let soc = { @@ -977,6 +1034,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = Soc.profile = soc_profile_of_node node; Soc.clock_profile = []; Soc.instances = [] ; + Soc.tasks = [] ; Soc.step = [ { name = "step"; @@ -989,7 +1047,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = Soc.memory = Soc.No_mem; Soc.precedences = []; Soc.assertions = []; - } + } in Some(ctx, soc, soc_tbl) ) @@ -997,10 +1055,10 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = in let (soc_of_extern: Lic.node_exp -> Soc.tbl -> (ctx * Soc.t * Soc.tbl) option) = fun node soc_tbl -> - try + try let soc = SocPredef.of_soc_key lxm soc_key in Some(ctx, soc, soc_tbl) - with _ -> + with _ -> (* This extern node is not a predef *) let step = build_extern_step lxm "step" node in let soc = { @@ -1008,12 +1066,13 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = Soc.profile = soc_profile_of_node node; Soc.clock_profile = []; Soc.instances = [] ; + Soc.tasks = [] ; Soc.step = [step]; Soc.memory = - if node.Lic.has_mem_eff then Soc.Mem_hidden else Soc.No_mem; + if node.Lic.has_mem_eff then Soc.Mem_hidden else Soc.No_mem; Soc.precedences = []; Soc.assertions = []; - } + } in Some(ctx, soc, soc_tbl) in diff --git a/lib/licDump.ml b/lib/licDump.ml index da86b84db4b50ab8159d5352f5f78092205ea3cc..2cf957db3c82a47767a0a7a31151d26490b384ff 100644 --- a/lib/licDump.ml +++ b/lib/licDump.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 06/03/2024 (at 17:05) by Erwan Jahier> *) +(* Time-stamp: <modified the 30/05/2024 (at 08:49) by Erwan Jahier> *) (* This module is used both for @@ -311,7 +311,7 @@ and string_of_node_key_rec forprint (no_prefix:bool) (nkey: node_key) = if global_opt.kcg then ((* recursive nodes have been unfold *) (*assert (List.mem ik ["map"]);*) (* not yet working : - - cas des noeuds itérés prédéfinis + - cas des noeuds itérés prédéfinis - il genere des alias des noeuds que scade ne comprend pas *) let rec get_node sl = @@ -453,13 +453,18 @@ and (string_of_by_pos_op_eff: fun forprint posop vel -> let sov ve = string_of_val_exp_eff forprint ve in let tuple vel = (String.concat ", " (List.map (string_of_val_exp_eff forprint) vel)) in - let add_par_if_need str = (* use it with care, it'a not always legal to do that *) + let add_par_if_needed str = (* use it with care, it'a not always legal to do that *) let lg = String.length str in if lg = 0 then str else if str.[0] <> '(' && str.[lg-1] <> ')' then "("^str^")" else str in + let tuple_add_par vel = + match vel with + | [ve] -> "(" ^ string_of_val_exp_eff forprint ve^ ")" + | _ -> "(" ^ (tuple vel) ^ ")" + in let tuple_par vel = match vel with | [ve] -> string_of_val_exp_eff forprint ve @@ -483,11 +488,11 @@ and (string_of_by_pos_op_eff: ("#" ^ (dump_array_no_square ve1)) *) (* do later *) else - ("#" ^ (tuple_par [ve1])) + ("#" ^ (add_par_if_needed (tuple_par [ve1]))) | CALL ({it=("Lustre","nor"),[];_}), [ve1] | PREDEF_CALL ({it=("Lustre","nor"),[];_}), [ve1] -> - (("nor") ^ (tuple_par [ve1])) + (("nor") ^ (add_par_if_needed (tuple_par [ve1]))) | CALL ({it=("Lustre","if"),[];_}), [ve1; ve2; ve3] | PREDEF_CALL ({it=("Lustre","if"),[];_}), [ve1; ve2; ve3] -> @@ -501,17 +506,24 @@ and (string_of_by_pos_op_eff: if AstPredef.is_a_predef_op (snd(fst op.it)) then let op_str = snd (fst op.it) in let op_short_str,rte = match global_opt.rte, op_str with - | Some _, ("plus"|"slash"|"minus"|"uminus"|"times"|"iplus" - |"islash"|"iminus"|"iuminus"|"itimes"|"mod" + | Some t, ("plus"|"slash"|"minus"|"uminus"|"times" + |"iplus"|"islash"|"iminus"|"iuminus"|"itimes" + |"mod" |"div") -> ( try let ve = List.hd vel in (match ve.ve_typ with + | Real_type_eff::_ + | Int_type_eff::_ -> "rte_" ^ op_str ^"_"^t, true | (External_type_eff(_,mint))::_ -> "rte_" ^ op_str ^"_"^mint, true + | [] -> assert false | _ -> assert false (* SNO *) ) - with _ -> assert false (* SNO *) + with e -> + (* op2string (AstPredef.string_to_op op_str), false *) + Printf.printf "Error: operator '%s' not supported with -rte\n%s\n%!" op_str (Printexc.to_string e); + assert false (* SNO *) ) | _,_ -> op2string (AstPredef.string_to_op op_str), false in @@ -528,7 +540,7 @@ and (string_of_by_pos_op_eff: (op_short_str ^ (match op_str with | "true" | "false" -> tuple vel - | _ -> tuple_par vel + | _ -> tuple_add_par vel ) ) else @@ -536,7 +548,7 @@ and (string_of_by_pos_op_eff: let nk = op.it in let vel_str = tuple_par vel in assert(vel_str<>""); (* SNO *) - let vel_str_par = add_par_if_need vel_str in + let vel_str_par = add_par_if_needed vel_str in if global_opt.lv4 || global_opt.inline_iterator then let node_str = string_of_node_key_rec forprint global_opt.no_prefix nk in if rte && machine_int node_str then @@ -549,7 +561,7 @@ and (string_of_by_pos_op_eff: | CONST_REF idl, _ -> dump_long forprint idl | VAR_REF id, _ -> id - | PRE, _ -> "pre " ^ (tuple_par vel) + | PRE, _ -> "pre " ^ (tuple_add_par vel) | ARROW, [ve1; ve2] -> (* if global_opt.kcg then ( "fby(" ^ (if is_a_tuple ve2 then tuple_par [ve2] else string_of_val_exp_eff forprint ve2) @@ -567,7 +579,7 @@ and (string_of_by_pos_op_eff: if global_opt.lv4 then (if is_a_tuple ve1 then tuple_par [ve1] else string_of_val_exp_eff forprint ve1) ^ " -> pre " ^ - (if is_a_tuple ve1 then tuple_par [ve2] else string_of_val_exp_eff forprint ve2) + (if is_a_tuple ve1 then tuple_add_par [ve2] else string_of_val_exp_eff forprint ve2) else if global_opt.kcg then ( "fby(" ^ @@ -587,7 +599,7 @@ and (string_of_by_pos_op_eff: | CURRENT Some _,_ -> (* transform to merge in kcg mode *) if global_opt.kcg then assert false else - "current " ^ tuple_par (if global_opt.ec then List.tl vel else vel) + "current" ^ tuple_add_par (List.tl vel) | CURRENT None,_ -> "current " ^ tuple_par vel | TUPLE,_ -> (tuple vel) | CONCAT, [ve1; ve2] -> @@ -667,7 +679,7 @@ and string_of_val_exp_eff forprint ve = string_of_val_exp_eff_core forprint ve.v and string_of_val_exp_eff_core forprint ve_core = match ve_core with | CallByPosLic (by_pos_op_eff, vel) -> - (* ICI : on pourrait afficher en commentaire l'éventuel type_matches ? *) + (* ICI : on pourrait afficher en commentaire l'éventuel type_matches ? *) (string_of_by_pos_op_eff forprint by_pos_op_eff vel) | Merge (ve, [({it=Bool_const_eff true ;_}, ct); ({it=Bool_const_eff false;_}, cf)]) @@ -877,7 +889,7 @@ and node_of_node_exp_eff is_main_node forprint (neff: Lic.node_exp): string = | ExternLic -> ";\n" ^ pragma | MetaOpLic -> ( - (* on écrit juste un alias *) + (* on écrit juste un alias *) " = " ^(string_of_node_key_def forprint neff.node_key_eff)^ ";\n" ^ pragma ) | AbstractLic _ -> "; \n" ^ pragma @@ -958,10 +970,15 @@ and string_of_clock (ck : Lic.clock) = (* | ClockVar i -> "_clock_var_" ^ (string_of_int i) *) and op2string op = - (* Une verrue pour être compatible avec les outils qui mangent du ec... *) - if global_opt.ec && op = AstPredef.INT2REAL_n then "real" else - if global_opt.ec && op = AstPredef.REAL2INT_n then "int" else - AstPredef.op2string op + (* Une verrue pour être compatible avec les outils qui mangent du ec... *) + let real2int, int2real = + if global_opt.ec || global_opt.lv4 then "int", "real" + else "Lustre::int", "Lustre::real" + in + match op with + | AstPredef.INT2REAL_n -> int2real + | AstPredef.REAL2INT_n -> real2int + | _ -> AstPredef.op2string op (*--------------------------------------------------------------------- Formatage standard des erreurs de compil @@ -971,7 +988,7 @@ let node_error_string _lxm nkey = ( ) (*--------------------------------------------------------------------- -Message d'erreur (associé à un lexeme) sur stderr +Message d'erreur (associé à un lexeme) sur stderr ----------------------------------------------------------------------*) let print_compile_node_error nkey lxm msg = ( Printf.eprintf "%s\n" (node_error_string lxm nkey); diff --git a/lib/licMetaOp.ml b/lib/licMetaOp.ml index 52da36cf0fe1d1590a79b59cbe01521172b5e79e..f0b151e485bb7804ebc751f75f062ad77f41b957 100644 --- a/lib/licMetaOp.ml +++ b/lib/licMetaOp.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 29/08/2019 (at 16:16) by Erwan Jahier> *) +(* Time-stamp: <modified the 15/04/2024 (at 11:58) by Erwan Jahier> *) (* *) @@ -26,23 +26,24 @@ let get_node_and_int_const (lxm: Lxm.t) (sargs: Lic.static_arg list) raise (Compile_error(lxm, msg)) (* transforme en array une variable *) -let var_to_array (c:int) (vi: Lic.var_info) : Lic.var_info = +let var_to_array (c:int) (vi: Lic.var_info) : Lic.var_info = { vi with var_type_eff = Array_type_eff(vi.var_type_eff,c) } (* -On a éventuellement besoin du node_exp des args +On a éventuellement besoin du node_exp des args *) let rec do_node (nk2nd: Lic.node_key -> Lic.node_exp) (nk: Lic.node_key) (lxm: Lxm.t) : (Lic.node_exp) = - let (pk,id) = fst nk in + let (pk,id) = fst nk in match (pk, id) with | ("Lustre", "map") -> do_map nk2nd nk lxm | ("Lustre", "red") | ("Lustre", "fill") + | ("Lustre", "fold") | ("Lustre", "fillred") -> do_fillred nk2nd nk lxm | ("Lustre", "boolred") -> do_boolred nk2nd nk lxm | ("Lustre", "condact") -> do_condact nk2nd nk lxm @@ -51,10 +52,10 @@ let rec do_node (*-------------------------------------------------------------------- MAP ---------------------------------------------------------------------- - Given : + Given : - A node n of type: a_1 * ... * a_n -> b_1 * ... * b_k - A (int) const c - Gen a node of type : a_1^c * ... * a_n^c -> b_1^c * ... * b_k^c + Gen a node of type : a_1^c * ... * a_n^c -> b_1^c * ... * b_k^c --------------------------------------------------------------------*) and do_map nk2nd nk lxm = let sargs = snd nk in @@ -68,17 +69,17 @@ and do_map nk2nd nk lxm = outlist_eff = List.map (var_to_array c) outs; loclist_eff = None; def_eff = MetaOpLic; - has_mem_eff = nd.has_mem_eff; - is_safe_eff = nd.is_safe_eff; + has_mem_eff = nd.has_mem_eff; + is_safe_eff = nd.is_safe_eff; lxm = lxm; } (*-------------------------------------------------------------------- FILLRED ---------------------------------------------------------------------- - Given : + Given : - A node : aa * a_1 * ... * a_n -> aa * b_1 * ... * b_k - An int c - Gen a node : aa * a_1^c * ... * a_n^c -> aa * b_1^c * ... * b_k^c + Gen a node : aa * a_1^c * ... * a_n^c -> aa * b_1^c * ... * b_k^c --------------------------------------------------------------------*) and do_fillred nk2nd nk lxm = let sargs = snd nk in @@ -99,24 +100,24 @@ and do_fillred nk2nd nk lxm = (LicDump.string_of_type_eff false t2) in raise (Compile_error(lxm, msg)) - else + else { node_key_eff = nk; inlist_eff = ins'; outlist_eff = outs'; loclist_eff = None; def_eff = MetaOpLic; - has_mem_eff = nd.has_mem_eff; - is_safe_eff = nd.is_safe_eff; + has_mem_eff = nd.has_mem_eff; + is_safe_eff = nd.is_safe_eff; lxm = lxm; } (*-------------------------------------------------------------------- CONDACT ---------------------------------------------------------------------- - Given : + Given : - A node n of type: a_1 * ... * a_n -> b_1 * ... * b_k - A (tuple) const: b_1 * ... * b_k - Gen a node of type : bool * a_1 * ... * a_n -> b_1 * ... * b_k + Gen a node of type : bool * a_1 * ... * a_n -> b_1 * ... * b_k ---------------------------------------------------------------------*) (* nb : @@ -138,7 +139,7 @@ tel is it a good idea? *) and (do_condact : (Lic.node_key -> Lic.node_exp) -> node_key -> Lxm.t -> Lic.node_exp) = -fun nk2nd nk lxm -> +fun nk2nd nk lxm -> try let sargs = snd nk in let np, dflt = @@ -155,7 +156,7 @@ fun nk2nd nk lxm -> let out_types = List.map (fun x -> x.var_type_eff) outlist in let matches = try UnifyType.is_matched out_types dflt_types - with UnifyType.Match_failed msg -> + with UnifyType.Match_failed msg -> raise (Compile_error(lxm, "in condact default output "^msg)) in let out_types = Lic.apply_type_matches matches out_types in @@ -175,8 +176,8 @@ fun nk2nd nk lxm -> outlist_eff = outs; loclist_eff = None; def_eff = MetaOpLic; - has_mem_eff = ne.has_mem_eff; - is_safe_eff = ne.is_safe_eff; + has_mem_eff = ne.has_mem_eff; + is_safe_eff = ne.is_safe_eff; lxm = lxm; } with @@ -186,9 +187,9 @@ fun nk2nd nk lxm -> (*-------------------------------------------------------------------- BOOLRED ---------------------------------------------------------------------- - Given - - 3 integer constant i, j, k - + Given + - 3 integer constant i, j, k + returns the profile bool^k -> bool ---------------------------------------------------------------------*) and do_boolred _nk2nd nk lxm = @@ -214,4 +215,3 @@ and do_boolred _nk2nd nk lxm = is_safe_eff = true; lxm = lxm; } - diff --git a/lib/lv6MainArgs.ml b/lib/lv6MainArgs.ml index 8a820f341bfc619acd22bfc3381479bf3b9d3e50..2407fd601c407df0a2389f32e04fa8a13181bce0 100644 --- a/lib/lv6MainArgs.ml +++ b/lib/lv6MainArgs.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 26/02/2024 (at 16:24) by Erwan Jahier> *) +(* Time-stamp: <modified the 18/06/2024 (at 16:19) 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, @@ -11,7 +11,8 @@ let tool_name = Lv6version.tool let usage_msg = "usage: "^tool_name^" [options] <file> | "^tool_name^" -help" type enum_mode = AsInt | AsBool (* finishme *) | AsConst | AsEnum -type io_transmit_mode = Stack | Heap | HeapStack +type io_transmit_mode = Args | Ctx | CtxArgs + type schedul_mode = Simple | Sort | Reorder type t = { @@ -74,7 +75,7 @@ type global_opt = { mutable soc2c_inline_loops : bool; mutable soc2c_global_ctx : bool; mutable soc2c_dro : bool; - mutable multi_core : bool; + mutable multi_task : bool; mutable gen_wcet : bool; mutable io_transmit_mode : io_transmit_mode; mutable schedul_mode : schedul_mode; @@ -91,8 +92,8 @@ let (global_opt:global_opt) = ec = false; one_op_per_equation = true; one_op_per_equation_set = false; - one_user_op_per_equation = true; - one_user_op_per_equation_set = false; + one_user_op_per_equation = true; (* if you change that, change the nonreg test too!*) + one_user_op_per_equation_set = false; (* ditto *) inline_iterator = false; when_on_ident = false; no_when_not = false; @@ -107,9 +108,9 @@ let (global_opt:global_opt) = soc2c_inline_loops = false; soc2c_global_ctx = false; soc2c_dro = false; - multi_core = false; + multi_task = false; gen_wcet = false; - io_transmit_mode = Stack; + io_transmit_mode = Args; schedul_mode = Simple; assert_in_contract = false; } @@ -342,7 +343,7 @@ let mkoptab (opt:t) : unit = ( ["Try to execute the generated C files (force -cc)."] ; mkopt opt - ["-rif"] + ["-rif";"--rif"] (Arg.Unit(function () -> opt.rif <- true)) ["Behave as a rif input file (meaningless without -exec)"] ; @@ -353,17 +354,15 @@ let mkoptab (opt:t) : unit = ( "from ocaml with the current set of arguments (with Lv6Run.make)"] ; - mkopt opt ~doc_level:Dev + mkopt opt ~doc_level:Advanced ["-knc"; "--keep-nested-calls"] (Arg.Unit (fun _ -> global_opt.one_op_per_equation_set <- true; global_opt.one_op_per_equation <- false)) - ["Keep nested calls (use with care: it breaks some programs with"; - "some options combination)"] + ["Keep nested calls. Useful when generating Lustre code, but incompatible -exec or -2c"] ; - mkopt opt ~doc_level:Dev + mkopt opt ~doc_level:Advanced ["-knpc"; "--keep-nested-predef-calls"] (Arg.Unit (fun _ -> global_opt.one_user_op_per_equation_set <- true; global_opt.one_user_op_per_equation <- false)) - ["Keep nested calls for predefined operators (use with care: it breaks some programs with"; - "some options combination)"] + ["Keep nested calls for predefined operators. Useful when generating Lustre code, but incompatible -exec or -2c"] ; mkopt opt ~doc_level:Dev ["-rnc"; "--remove-nested-calls"] @@ -415,7 +414,7 @@ let mkoptab (opt:t) : unit = ( global_opt.inline_iterator <- true (* an iterator is a kind of node *))) ["Expand all node calls in the main node"] ; - mkopt opt + mkopt opt ~doc_level:Advanced ["-et"; "--expand-io-type"] (Arg.Unit (fun _ -> opt.expand_io_type <- true)) ["Expand structured types of the main node (impact the rif output only)."; @@ -438,12 +437,12 @@ let mkoptab (opt:t) : unit = ( mkopt opt ~doc_level:Advanced ["-lv4"; "--lustre-v4"] (Arg.Unit (fun _ -> set_v4_options opt)) - ["deprecated: generate Lustre V4 code (force '-ei -ee -esa')"] + ["Generate Lustre V4 code (force '-ei -ee -esa')"] ; mkopt opt ~doc_level:Advanced ["-rte"; "--runtime-error"] (Arg.String (fun str -> global_opt.rte <- Some str; set_v4_options opt)) - ["Experimental: Generate kind2 contracts to check for runtime errors (force '-lv4')"] + ["<string> Experimental: Generate kind2 contracts to check for runtime errors (force '-lv4')"] ; mkopt opt ~doc_level:Dev ["-kcg"; "--generate-scade-lustre"] @@ -492,7 +491,7 @@ let mkoptab (opt:t) : unit = ( mkopt opt ~doc_level:Advanced ["-dro";"--2c-dro"] (Arg.Unit (fun () -> global_opt.soc2c_dro <- true; set_c_options opt; - global_opt.io_transmit_mode <- Heap)) + global_opt.io_transmit_mode <- Ctx)) ["Generate a .dro file (for luciole)"] ; mkopt opt ~doc_level:Advanced @@ -515,7 +514,7 @@ let mkoptab (opt:t) : unit = ( ["-vl"] ~arg:" <int>" (Arg.Int(function i -> Lv6Verbose.set i)) - ["Set the verbose level"] + ["<int> Set the verbose level"] ; mkopt opt ["-h";"-help";"--help"] @@ -561,27 +560,27 @@ let mkoptab (opt:t) : unit = ( ["Generate a main file for computing the wcet (force -2c -2cgc)"] ; mkopt opt ~doc_level:Dev - ["-2cmc";"--2c-multi-core"] + ["-2cmc";"--2c-multi-core";"-2cmt";"--2c-multi-task"] (Arg.Unit (fun () -> set_c_options opt; - global_opt.multi_core <- true;)) + global_opt.multi_task <- true;)) ["Generate a yaml file required for multi-core code generation"] ; - mkopt opt ~doc_level:Dev - ["-2cs";"--2c-stack"] - (Arg.Unit (fun () -> set_c_options opt; global_opt.io_transmit_mode <- Stack)) - ["Transmit Soc I/O as params of the step functions (force -2c)"] + mkopt opt ~doc_level:Advanced + ["-2c-ioa";"--2c-io-in-args"] + (Arg.Unit (fun () -> set_c_options opt; global_opt.io_transmit_mode <- Args)) + ["Transmit Soc I/O as params of the step functions (the default, force -2c)"] ; - mkopt opt ~doc_level:Dev - ["-2ch";"--2c-heap"] - (Arg.Unit (fun () -> set_c_options opt; global_opt.io_transmit_mode <- Heap)) - ["Transmit Soc I/O via a ctx structure in the heap (force -2c)"] + mkopt opt ~doc_level:Advanced + ["-2c-ioc";"--2c-io-in-ctx"] + (Arg.Unit (fun () -> set_c_options opt; global_opt.io_transmit_mode <- Ctx)) + ["Transmit Soc I/O via a ctx structure (force -2c)"] ; mkopt opt ~doc_level:Dev - ["-2chs";"--2c-heap-and-stack"] - (Arg.Unit (fun () -> set_c_options opt; global_opt.io_transmit_mode <- HeapStack)) - ["Transmit soc memoryless I/O via the stack, and the heap otherwise (force -2c)"] + ["-2c-ioac";"--2c-io-in-args-and-ctx"] + (Arg.Unit (fun () -> set_c_options opt; global_opt.io_transmit_mode <- CtxArgs)) + ["Transmit soc memoryless I/O via params, and via ctx otherwise (force -2c)"] ; mkopt opt ~doc_level:Dev @@ -628,7 +627,7 @@ let mkoptab (opt:t) : unit = ( mkopt opt ~doc_level:Advanced ["--precision"] (Arg.Int (fun i -> opt.precision <- Some i)) - ["Number of digits after ther dot used to print floats in -exec mode"] + ["<int> Number of digits after ther dot used to print floats in -exec mode"] ; mkopt opt ~doc_level:Dev ["--nonreg-test"] @@ -664,6 +663,16 @@ let first_line b = ( let current = ref 0;; + +let check_options_compatibility opt = + if (opt.gen_c || opt.exec) + && ((not global_opt.one_op_per_equation) || (not global_opt.one_user_op_per_equation)) then ( + Printf.fprintf stderr "Incompatible options: the -knc and -knpc options are meant to be used for generating +Lustre code, not to be executed (and are thus incompatible with -exec and -2c)\n"; + exit 2 + ) + + (* La ``méthode'' principale *) let parse argv = ( let opt = make_opt() in @@ -681,6 +690,7 @@ let parse argv = ( ) opt.others ); + check_options_compatibility opt; opt.infiles <- (List.rev opt.others); if opt.main_node = "" && (opt.gen_c || opt.exec || opt.gen_lic ) diff --git a/lib/lv6MainArgs.mli b/lib/lv6MainArgs.mli index a4403351b0f8d8884775ed02e640c0cf72a94683..4d050e8bc045d9c6eb1f2197ed586770e58fa114 100644 --- a/lib/lv6MainArgs.mli +++ b/lib/lv6MainArgs.mli @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 26/02/2024 (at 15:55) by Erwan Jahier> *) +(* Time-stamp: <modified the 18/06/2024 (at 16:19) by Erwan Jahier> *) type enum_mode = AsInt (* translate enums into int (for rif-friendlyness *) @@ -8,14 +8,13 @@ type enum_mode = (* koketeri, vu qu'on continu à ranger concetement - les options dans des var. globales ! (cf Global + les options dans des var. globales ! (cf Global) *) type io_transmit_mode = - | Stack (* All I/O are are passed as arguments of the step functions *) - | Heap (* All I/O are in a ctx structure; ctx of memoryless soc are global *) - | HeapStack (* I/O of memoryful soc are in a ctx structure; memoryless soc uses step arg *) -(* *) + | Args (* All I/O are are passed as arguments of the step functions *) + | Ctx (* All I/O are in a ctx structure *) + | CtxArgs (* I/O of memoryful soc are in a ctx structure; memoryless soc uses step arg *) type schedul_mode = Simple | Sort | Reorder @@ -79,7 +78,7 @@ type global_opt = { mutable soc2c_inline_loops : bool; mutable soc2c_global_ctx : bool; mutable soc2c_dro : bool; - mutable multi_core : bool; + mutable multi_task : bool; mutable gen_wcet : bool; mutable io_transmit_mode : io_transmit_mode; mutable schedul_mode : schedul_mode; diff --git a/lib/lv6Run.ml b/lib/lv6Run.ml index f66b5b72366a9e1b52959fd63072ade871dab37a..b708cb40a76be22214746014f8dde58287fa69a1 100644 --- a/lib/lv6Run.ml +++ b/lib/lv6Run.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 25/01/2023 (at 17:41) by Erwan Jahier> *) +(* Time-stamp: <modified the 04/06/2024 (at 09:16) by Erwan Jahier> *) (*----------------------------------------------------------------------- ** Copyright (C) - Verimag. *) @@ -40,8 +40,8 @@ let make_do argv opt = let soc_inputs,soc_outputs = soc.profile in let soc_inputs,soc_outputs = if opt.Lv6MainArgs.expand_io_type then - (SocVar.expand_profile true false (fst soc.profile)), - (SocVar.expand_profile true false (snd soc.profile)) + (SocVar.expand_profile true SocVar.PP (fst soc.profile)), + (SocVar.expand_profile true SocVar.PP (snd soc.profile)) else soc_inputs,soc_outputs in diff --git a/lib/lv6lexer.mll b/lib/lv6lexer.mll index b94d4012fd89a984fb218fccbc3e9cef7fc82e05..71cd0642610ae6db51e68f6da8f945ec985f9821 100644 --- a/lib/lv6lexer.mll +++ b/lib/lv6lexer.mll @@ -10,12 +10,13 @@ open Lv6parser exception Lexical_error of string * Lxm.t let handle_lexical_error fn lexbuf = ( - let lxm = Lxm.make (lexbuf ) in - try - fn lexbuf - with Lexical_error(msg, _) -> - raise(Lexical_error(msg, lxm)) + let lxm = Lxm.make lexbuf in + try fn lexbuf + with Lexical_error(msg, _) -> + raise(Lexical_error(msg, lxm)) ) + + let unget_lexbuf lb = lb.Lexing.lex_curr_pos <- lb.Lexing.lex_curr_pos - 1 @@ -174,7 +175,7 @@ rule lexer = parse { TK_EOF } (* saute les blancs *) (* saute les blancs *) - | [' ' '\013' '\009' '\012'] + + | [' ' '\013' '\009' '\012'] + { lexer lexbuf } (* retour à la ligne *) | '\n' @@ -183,13 +184,13 @@ rule lexer = parse lexer lexbuf } (* Une nouvelle syntaxe pour les pragmas sur plusieurs lignes. - C'est Lxm.make_ml_pragma qui fait le job via des regexp. *) - | "(*@" _* "*)" - { - let lxm = Lxm.make_ml_pragma lexbuf in - TK_ML_PRAGMA (lxm) - } + | "(*@" + { + let str = handle_lexical_error (parse_ml_pragma "") lexbuf in + TK_ML_PRAGMA (Lxm.dummy str) + } + (* commentaire parenthésé *) | "(*" { @@ -291,6 +292,22 @@ rule lexer = parse } | _ { TK_ERROR ( Lxm.make lexbuf ) } +and parse_ml_pragma acc = parse + "*)" + { acc } + | "\n" + { + Lxm.new_line ( lexbuf ); + parse_ml_pragma (acc^ (Lexing.lexeme lexbuf)) lexbuf + } + | eof + { + raise(Lexical_error("unterminated multi-line pragma", + Lxm.dummy "unterminated multi-line pragma")) + } + | _ + { parse_ml_pragma (acc^ (Lexing.lexeme lexbuf)) lexbuf } + and comment_par = parse "*)" { } diff --git a/lib/lv6parser.mly b/lib/lv6parser.mly index fbdf2e455d442d9cc4b83f818a2d78302aed0bf4..aed95bcd90b791cd5a866af80b0c32c9d25f6716 100644 --- a/lib/lv6parser.mly +++ b/lib/lv6parser.mly @@ -793,8 +793,8 @@ EquationList: Equation ; Equation: TK_ASSERT Expression TK_SEMICOL { ( [ {src = $1; it = $2} ] , [] ) } - | Left TK_EQ Expression TK_SEMICOL - { ( [] , [ {src = $2; it = ($1, $3) } ] ) } + | Left TK_EQ Pragma Expression Pragma TK_SEMICOL + { ( [] , [ {src = add_pragma $2 ($3@$5); it = ($1, $4) } ] ) } ; diff --git a/lib/lxm.ml b/lib/lxm.ml index d842556c2f4b21d87d9376df3cdfdd095ad22fd6..9401e92ff0feea7a8677bc81f606c11e1e5929b4 100644 --- a/lib/lxm.ml +++ b/lib/lxm.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 22/11/2023 (at 17:01) by Erwan Jahier> *) +(* Time-stamp: <modified the 11/06/2024 (at 12:03) by Erwan Jahier> *) (** Common to lus2lic and lic2loc *) @@ -108,19 +108,16 @@ let make_string ( lexbuf ) = fix_line_number_in_string lxm._str; { lxm with _str = String.sub lxm._str 1 ((String.length lxm._str)-2) } -let make_ml_pragma ( lexbuf ) = - let lxm = make lexbuf in - fix_line_number_in_string lxm._str; - { lxm with _str = String.sub lxm._str 3 ((String.length lxm._str)-5) } - let get_pragma_info str = try let i0 = Str.search_forward (Str.regexp "[_a-zA-Z]+") str 0 in (* search for the first ident start *) let i1 = Str.search_forward (Str.regexp "[^_a-zA-Z]") str i0 in (* search for the first ident end *) - String.sub str i0 (i1-i0), String.sub str (i1+1) (String.length str -i1-1) + let l,r = String.sub str i0 (i1-i0), String.sub str (i1+1) (String.length str -i1-1) in + (* Printf.printf "DBG pragma parsing: \n-'%s'\n-'%s'\n%!" l r; *) + l,r with _ -> - failwith (Printf.sprintf "Error when parsing pragma '%s': wrong multi-lines pragma syntax. It should be: + failwith (Printf.sprintf "Error when parsing pragma '%s': wrong multi-lines pragma syntax. It should be: (*@<pragma_label> <pragma_value> *) diff --git a/lib/lxm.mli b/lib/lxm.mli index d99cd2b9fdf6983e719a668515325eb8cd6fbd66..97f08550bb67f3e0ac0e679a526856fc4ba12404 100644 --- a/lib/lxm.mli +++ b/lib/lxm.mli @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 15/11/2023 (at 16:38) by Erwan Jahier> *) +(* Time-stamp: <modified the 11/06/2024 (at 12:03) by Erwan Jahier> *) (** Lexemes *) @@ -36,8 +36,6 @@ val new_line : Lexing.lexbuf -> unit (* remove the quotes from the string *) val make_string: Lexing.lexbuf -> t -val make_ml_pragma: Lexing.lexbuf -> t - val add_pragma : t -> pragma list -> t val get_pragma_label : t -> string diff --git a/lib/soc.ml b/lib/soc.ml index 139243d096898c62193eedf9b8c222d96199c457..bbe3fadde42b55bd17f78b9b4c09f89be6dd9ff8 100644 --- a/lib/soc.ml +++ b/lib/soc.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 16/05/2022 (at 21:42) by Erwan Jahier> *) +(* Time-stamp: <modified the 17/06/2024 (at 11:20) by Erwan Jahier> *) (** Synchronous Object Components @@ -8,7 +8,7 @@ *) (** ident are just strings because: - - it's more ocamldebug-friendly + - it's more ocamldebug-friendly - Name clashing issues ougth to have been fixed before *) type ident = string @@ -29,25 +29,28 @@ type key_opt = | MemInit of var_expr (* for fby *) | Curr of Lv6Id.long (* clock constructor for current *) -type key = +type key = ident * Data.t list * (* I/O type list *) key_opt type instance = ident * key +type task = ident * key (* for the multi-task mode *) +type is_task = bool (* true if run in a task *) let (data_type_of_var_expr : var_expr -> Data.t) = function | Var(_,vt) | Const(_,vt) | Field(_, _,vt) - | Index(_,_,vt) + | Index(_,_,vt) | Slice(_,_,_,_,_,vt) -> vt type atomic_operation = | Assign (* Wire *) - | Method of instance * ident (* node step call ; the ident is the step name *) - | Procedure of key (* memoryless method made explicit (a good idea?) *) + | Method of instance * ident * task option (* node step call ; the ident is the step name *) + | Procedure of key * task option (* memoryless method made explicit (a good idea?) *) + (* Guarded Atomic Operation *) type gao = @@ -57,10 +60,10 @@ type gao = (** nb: Iterator and Boolred are removed with lv6 --expand-iterators *) type step_impl = - | Predef + | Predef | Gaol of var list * gao list (* local vars + body *) | Iterator of string * key * int (* iterator, iterated soc key, size *) - | Boolred of int * int * int + | Boolred of int * int * int | Condact of key * var_expr list (* condact-ed node, default constants *) | Extern @@ -72,30 +75,31 @@ type step_method = { impl : step_impl; } -type precedence = ident * ident list +type precedence = ident * ident list (* Partial order over step members. Maps a step method name with the list of step methods that should be called _before_. - + nb : steps in step are already ordered ; this partial order can be useful to find another (better) total order w.r.t. test opening. *) -type memory = +type memory = | No_mem - | Mem of Data.t + | Mem of Data.t | Mem_hidden (* for extern nodes *) -type t = { +type t = { key : key; profile : var list * var list; clock_profile : (var * (var * Lv6Id.long)) list; (* associate to (profile) var a clock, if not on base *) - step : step_method list; (* the order in the list is a valid w.r.t. + step : step_method list; (* the order in the list is a valid w.r.t. the partial order defined in precedences *) precedences : precedence list; (* partial order over step methods *) instances : instance list; - memory : memory; + tasks : task list; + memory : memory; (* Do this soc have a memory (pre, fby) + its type *) assertions: (Lxm.t * var) list; } @@ -110,13 +114,3 @@ module SocMap = Map.Make( type tbl = t SocMap.t (* cf SocUtils *) - - -let cpt = ref 0 -let (make: key -> instance) = - fun sk -> - let (id,_,_) = sk in - let instance = Printf.sprintf "%s%03d" id !cpt in - incr cpt; - instance,sk - diff --git a/lib/soc2c.ml b/lib/soc2c.ml index 0ce28a42e95ae0ecf38032ae561c1e74f759113b..f51a58dbc0a2b4bb67d63212f6716ec21a44912c 100644 --- a/lib/soc2c.ml +++ b/lib/soc2c.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 25/01/2023 (at 22:42) by Erwan Jahier> *) +(* Time-stamp: <modified the 18/06/2024 (at 16:19) by Erwan Jahier> *) (* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *) @@ -61,6 +61,8 @@ type 'a soc_pp = { soc: Soc.t } +(* a shortcut *) +let io_transmit_mode () = Lv6MainArgs.global_opt.Lv6MainArgs.io_transmit_mode let (string_of_soc_key : Soc.key -> string) = Soc2cIdent.get_soc_name @@ -75,57 +77,77 @@ 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 rec gao2str gao = - match gao with - | Case(id, id_gao_l,_) -> ( - let to_case_str (v,gaol) = - let gaol_str = (List.map gao2str gaol) in - let gaol_block = String.concat "" gaol_str in - (id2s v), gaol_block - in - let cases = List.map to_case_str id_gao_l in - let ctx_opt = - let il,ol = sp.soc.profile in - if List.mem_assoc id il || List.mem_assoc id ol then - (if SocUtils.ctx_is_global sp.soc - then Soc2cUtil.ML_IO sp.soc.key - else Soc2cUtil.M_IO) - else Soc2cUtil.Local - in - let str = Soc2cUtil.gen_c_switch (Soc2cDep.ctx_var ctx_opt sp.soc id) cases in - str - ) - | Call(vel_out, Assign, vel_in,_) -> ( - let l = List.map2 (Soc2cDep.gen_assign_var_expr sp.soc) vel_out vel_in in - String.concat "" l - ) - | Call(vel_out, Method((inst_name,sk),sname), vel_in,lxm) -> ( - let called_soc = SocUtils.find lxm sk stbl in - let _, get_index = Soc2cInstances.to_array (sp.soc).instances in - let index = get_index (inst_name,sk) in - let step_arg = Printf.sprintf "ctx->%s_tab[%d]" (get_ctx_name sk) index in - let ctx = step_arg in - let step_arg = "&"^step_arg 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; - Soc2cDep.gen_step_call sp.soc called_soc vel_out vel_in ctx sname step_arg - ) - | Call(vel_out, Procedure sk, vel_in, lxm) -> ( - let called_soc = SocUtils.find lxm sk stbl in - let ctx = get_ctx_name called_soc.key in - (try - 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; - with _ -> - print_string - "*** Error. Slices in left part not yet supported in the C code generator, sorry\n"; - flush stdout; - raise Delete_C_files - ); - Soc2cDep.gen_step_call sp.soc called_soc vel_out vel_in ctx "step" "" - ) - in - sp.cput (gao2str gao) + let rec gao2str gao = + match gao with + | Case(id, id_gao_l,_) -> ( + let to_case_str (v,gaol) = + let gaol_str = (List.map gao2str gaol) in + let gaol_block = String.concat "" gaol_str in + (id2s v), gaol_block + in + let cases = List.map to_case_str id_gao_l in + let ctx_opt = + let il,ol = sp.soc.profile in + if List.mem_assoc id il || List.mem_assoc id ol then Soc2cUtil.M_IO + else Soc2cUtil.Local + in + let str = Soc2cUtil.gen_c_switch (Soc2cDep.ctx_var ctx_opt sp.soc id) cases in + str + ) + | Call(vel_out, Assign, vel_in,_) -> ( + let l = List.map2 (Soc2cDep.gen_assign_var_expr sp.soc) vel_out vel_in in + String.concat "" l + ) + | Call(vel_out, Method((inst_name,sk),sname, task_opt), vel_in,lxm) -> ( + let called_soc = SocUtils.find lxm sk stbl in + let step_arg = + match task_opt with + | Some (task_name, sk) -> + let _, get_index = Soc2cInstances.to_array sp.soc.tasks in + let index = get_index (task_name,sk) in + Printf.sprintf "_ctx->%s_TASK_tab[%d]" (get_base_name sk) index + | None -> + let _, get_index = Soc2cInstances.to_array sp.soc.instances in + let index = get_index (inst_name,sk) in + Printf.sprintf "_ctx->%s_tab[%d]" (get_ctx_name sk) index + in + let ctx = step_arg in + let step_arg = "&"^step_arg 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; + Soc2cDep.gen_step_call sp.soc called_soc (task_opt <> None) vel_out vel_in ctx sname step_arg + ) + | Call(vel_out, Procedure (sk, task_opt), vel_in, lxm) -> ( + let called_soc = SocUtils.find lxm sk stbl in + let ctx, step_arg = + if + io_transmit_mode () = Args + then + get_ctx_name called_soc.key, "" + else + (match task_opt with + | None -> + "_ctx->"^ (get_ctx_name called_soc.key), ("&_ctx->"^(get_ctx_name sk)) + | Some (task_name, sk) -> + let _, get_index = Soc2cInstances.to_array sp.soc.tasks in + let index = get_index (task_name,sk) in + let ctx = Printf.sprintf "_ctx->%s_TASK_tab[%d]" (get_base_name sk) index in + ctx, "&"^ctx + ) + in + (try + 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; + with _ -> + print_string + "*** Error. Slices in left part not yet supported in the C code generator, sorry\n"; + flush stdout; + raise Delete_C_files + ); + Soc2cDep.gen_step_call sp.soc called_soc (task_opt <> None) vel_out vel_in ctx "step" step_arg + ) + in + sp.cput (gao2str gao) let (step2c : Soc.tbl -> 'a soc_pp -> Soc.step_method -> unit) = fun stbl sp sm -> @@ -210,17 +232,19 @@ let (step2c : Soc.tbl -> 'a soc_pp -> Soc.step_method -> unit) = sp.cput (sprintf "\n} // End of %s\n\n" sname) ) -let (gen_instance_init_call : 'a soc_pp -> Soc.key * int -> unit) = +let max_loop = 4 (* threshold for using for loops instead of unrolling *) + +let (_gen_task_reset_call : 'a soc_pp -> Soc.key * int -> unit) = fun sp (key,i) -> - let ctx_name = get_ctx_name key in - if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_inline_loops || i<4 then + let ctx_name = (get_base_name key) ^ "_TASK" in + if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_inline_loops || i<max_loop then for k=0 to i-1 do - sp.cfmt "\n %s_reset(&ctx->%s_tab[%d]);" ctx_name ctx_name k + sp.cfmt "\n %s_tab[%d] = %s_init();" ctx_name k ctx_name; done else ( - sp.cput (Printf.sprintf " for (_i=0 ; _i<%d ; _i+=1){" i); - sp.cput (Printf.sprintf "\n %s_reset(&ctx->%s_tab[_i]);" ctx_name ctx_name); - sp.cput "\n }" + sp.cput (Printf.sprintf "\n for (_i=0 ; _i<%d ; _i+=1){" i); + sp.cput (Printf.sprintf "\n %s_reset(&_ctx->%s_tab[_i]);" ctx_name ctx_name); + sp.cput "\n }" ) module KeySet = Set.Make(struct type t = Soc.key let compare = compare end) @@ -246,8 +270,8 @@ let (get_used_soc : Soc.t -> KeySet.t) = List.fold_left (fun acc (_,gaol) -> List.fold_left get_soc_of_gao acc gaol) acc l | Call(_,Assign,_,_) -> acc - | Call(_,Method((_,sk),_),_,_) - | Call(_,Procedure sk,_,_) -> KeySet.add sk acc + | Call(_,Method((_,sk),_,_),_,_) + | Call(_,Procedure (sk,_),_,_) -> KeySet.add sk acc in let get_soc_of_step acc sm = match sm.impl with @@ -264,16 +288,16 @@ let one_file() = Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_one_file - creates c and h file(s) - updates/returns the list of created C files *) let (soc2c : int -> out_channel -> out_channel -> Soc.tbl -> Soc.key -> - string list -> Soc.t -> string list) = + string list -> Soc.t -> string list) = fun pass hfile_main_oc cfile_main_oc stbl msoc_key cfiles_acc soc -> if inlined_soc soc.key then cfiles_acc (* don't generate code if inlined *) else let ctx_name = get_ctx_name soc.key in - let ctx_name_type = ctx_name^"_type" in + (* let ctx_name_type = ctx_name^"_type" in *) if pass=1 then ( - (* Only for ctx of memoryless nodes + main node *) - if SocUtils.ctx_is_global soc then - Printf.ksprintf (fun t -> output_string cfile_main_oc t) "static %s %s;\n" ctx_name_type ctx_name; - cfiles_acc + (* Only for ctx of memoryless nodes + main node + if SocUtils.ctx_is_global soc then + Printf.ksprintf (fun t -> output_string cfile_main_oc t) "static %s %s;\n" ctx_name_type ctx_name; *) + cfiles_acc ) else ( let dir = Lv6MainArgs.global_opt.Lv6MainArgs.dir in let base0 = (string_of_soc_key soc.key) in @@ -314,38 +338,109 @@ let (soc2c : int -> out_channel -> out_channel -> Soc.tbl -> Soc.key -> if msoc_key <> soc.key then hfmt "#include \"%s.h\"\n" (string_of_soc_key msoc_key) ); - (* main_hfmt "/* Soc2cDep.typedef_of_soc XXX */ \n%s\n" "" ; *) (* (Soc2cDep.typedef_of_soc soc); *) if SocUtils.is_memory_less soc then () else ( cfmt "// Memory initialisation for %s\n" ctx_name; - hfmt "void %s_reset(%s_type* ctx);\n" ctx_name ctx_name; - cfmt "void %s_reset(%s_type* ctx){" ctx_name ctx_name; + hfmt "void %s_reset(%s_type* _ctx);\n" ctx_name ctx_name; + cfmt "void %s_reset(%s_type* _ctx){\n" ctx_name ctx_name; (* Call the reset_ctx functions of the soc instances *) - if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_inline_loops - then () else if soc.instances <> [] then sp.cput "\n int _i;\n"; - List.iter (gen_instance_init_call sp) - (fst (Soc2cInstances.to_array soc.instances)); + + let declare_i = ref false in + let (gen_instance_reset_call : string -> Soc.key * int -> string) = + fun acc (key,i) -> + let ctx_name = get_ctx_name key in + let res = ref acc in + if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_inline_loops || i<max_loop then + for k=0 to i-1 do + res := !res ^(Printf.sprintf "\n %s_reset(&_ctx->%s_tab[%d]);" ctx_name ctx_name k); + done + else ( + declare_i := true; + res := !res ^ (Printf.sprintf "\n for (_i=0 ; _i<%d ; _i+=1){" i); + res := !res ^ (Printf.sprintf "\n %s_reset(&_ctx->%s_tab[_i]);" ctx_name ctx_name); + res := !res ^ "\n };\n"; + ); + !res + in + let (gen_task_reset_call : string -> Soc.key * int -> string) = + fun acc (key,i) -> + let ctx_name = (get_base_name key) ^ "_TASK" in + let res = ref acc in + if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_inline_loops || i<max_loop then ( + for k=0 to i-1 do + res := !res ^ (Printf.sprintf "\n %s_reset(&_ctx->%s_tab[%d]);" ctx_name ctx_name k); + done; + ) + else ( + declare_i := true; + res := !res ^(Printf.sprintf "\n for (_i=0 ; _i<%d ; _i+=1){" i); + res := !res ^(Printf.sprintf "\n %s_reset(&_ctx->%s_tab[_i]);" ctx_name ctx_name); + res := !res ^"\n }"; + ); + !res + in + let body = List.fold_left gen_task_reset_call "" (fst (Soc2cInstances.to_array soc.tasks)) in + let body = List.fold_left gen_instance_reset_call body (fst (Soc2cInstances.to_array soc.instances)) in + if !declare_i then sp.cput " int _i;\n"; + sp.cput body; (match soc.key with (* set the parameter fields that have a default value (arrow,fby) *) | (_,_,MemInit (ve)) -> - assert(var_expr_is_not_a_slice ve); - cfmt " ctx->_memory = %s;" (string_of_var_expr soc ve) + assert(var_expr_is_not_a_slice ve); + cfmt " _ctx->_memory = %s;" (string_of_var_expr soc ve) | _ -> () ); cfmt "\n}\n"; - if - SocUtils.is_memory_less soc - then () (*no ctx at all in this case ! *) + (* end of %s_reset() definition *) + + (* Defining %s_init() *) + if Lv6MainArgs.global_opt.Lv6MainArgs.multi_task then ( + let (gen_task_call : 'a soc_pp -> Soc.key * int -> unit) = + fun sp (key,i) -> + let task_name = (get_base_name key) ^ "_TASK" in + if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_inline_loops || i<max_loop then + for k=0 to i-1 do + (* ctx->D_TASK_tab[0] = D_TASK_init(); *) + + sp.cput (Printf.sprintf "\n _ctx->%s_tab[%d] = %s_init();" task_name k task_name) + done + else ( + sp.cput "\n int _i;\n"; + sp.cput (Printf.sprintf " for (_i=0 ; _i<%d ; _i+=1){" i); + sp.cput (Printf.sprintf "\n _ctx->%s_tab[_i] = %s_init();" task_name task_name); + sp.cput "\n }" + ) + in + let (gen_instance_call : 'a soc_pp -> Soc.key * int -> unit) = + fun sp (key,i) -> + let inst_name = (get_base_name key) ^ "_ctx" in + if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_inline_loops || i<max_loop then + for k=0 to i-1 do + sp.cput (Printf.sprintf "\n %s_init(&_ctx->%s_tab[%d]);" inst_name inst_name k) + done + else ( + sp.cput "\n int _i;\n"; + sp.cput (Printf.sprintf " for (_i=0 ; _i<%d ; _i+=1){" i); + sp.cput (Printf.sprintf "\n %s_init(&_ctx->%s_tab[_i]);" inst_name inst_name); + sp.cput "\n }" + ) + in + cfmt "void %s_init(%s_type* _ctx){" ctx_name ctx_name; + List.iter (gen_task_call sp) (fst (Soc2cInstances.to_array soc.tasks)); + List.iter (gen_instance_call sp) (fst (Soc2cInstances.to_array soc.instances)); + hfmt "void %s_init(%s_type* _ctx);\n" ctx_name ctx_name; + cfmt "\n}\n"; + ) else if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_global_ctx then ( cfmt "\n// Initialisation of the internal structure of %s\n" ctx_name; - hfmt "void %s_init(%s_type* ctx);\n" ctx_name ctx_name; - cfmt "void %s_init(%s_type* ctx){" ctx_name ctx_name; + hfmt "void %s_init(%s_type* _ctx);\n" ctx_name ctx_name; + cfmt "void %s_init(%s_type* _ctx){" ctx_name ctx_name; cfmt " - // ctx->client_data = cdata; - %s_reset(ctx); + // _ctx->client_data = cdata; + %s_reset(_ctx); } " ctx_name ) @@ -356,10 +451,10 @@ let (soc2c : int -> out_channel -> out_channel -> Soc.tbl -> Soc.key -> cfmt "%s_type* %s_new_ctx(){" ctx_name ctx_name; cfmt " - %s_type* ctx = (%s_type*)calloc(1, sizeof(%s_type)); - // ctx->client_data = cdata; - %s_reset(ctx); - return ctx; + %s_type* _ctx = (%s_type*)calloc(1, sizeof(%s_type)); + // _ctx->client_data = cdata; + %s_reset(_ctx); + return _ctx; } " ctx_name ctx_name ctx_name ctx_name) ); @@ -374,7 +469,7 @@ let (soc2c : int -> out_channel -> out_channel -> Soc.tbl -> Soc.key -> flush stderr ); cfiles_acc - ) + ) (****************************************************************************) @@ -433,53 +528,71 @@ let (typedef_all : LicPrg.t -> Soc.tbl -> Soc.t -> string) = fun _licprg soc_tbl main_soc -> (* We need to print the ctx typedef in a good order (w.r.t. typedef dependencies). To do that, we traverse - the tree of soc instances which root is the main soc. - *) + the tree of soc instances which root is the main_soc. + *) (* Soc with memory can be used several times; hence we mark via this set the ones that have already been visited. *) - let visited = KeySet.empty in let rec (soc_with_mem : string * KeySet.t -> Soc.t -> string * KeySet.t) = (* recursively traverse the soc dependancies to define the typedef in the good order (i.e., define before use) *) fun (acc,visited) soc -> - if KeySet.mem soc.key visited then (acc,visited) else - let visited = KeySet.add soc.key visited in - let acc,visited = - List.fold_left - (fun (acc,visited) (_iname, sk) -> - let soc = SocUtils.find_no_exc sk soc_tbl in - soc_with_mem (acc,visited) soc - ) - (acc,visited) soc.instances - in - let acc = acc ^( - (* if one_file() || soc.key = main_soc.key then *) - Soc2cDep.typedef_of_soc soc - (* else *) - (* (Printf.sprintf "#include \"%s.h\"\n" (string_of_soc_key soc.key)) *) - ) - in - - acc,visited + if KeySet.mem soc.key visited then (acc,visited) else + let visited = KeySet.add soc.key visited in + let acc,visited = + List.fold_left + (fun (acc,visited) (_iname, sk) -> + let soc = SocUtils.find_no_exc sk soc_tbl in + soc_with_mem (acc,visited) soc + ) + (acc,visited) (soc.instances @ soc.tasks) + in + let acc = + if soc.instances = [] && soc.tasks = [] && soc.memory = No_mem then + acc + else + acc ^(fst (Soc2cDep.typedef_of_soc soc)) + in + acc,visited in let soc_ctx_typedef_with_mem = if SocUtils.ctx_is_global main_soc then "" else - fst (soc_with_mem ("",visited) main_soc) + fst (soc_with_mem ("", KeySet.empty) main_soc) + in + (* Soc without memory can be used several times too; and they also + needs to be defined (in C) in the right order *) + let rec (soc_without_mem: string * KeySet.t -> Soc.t list -> string * KeySet.t) = + fun (acc,visited) socs -> + match socs with + | [] -> acc,visited + | soc::tail -> + if KeySet.mem soc.key visited then + soc_without_mem (acc,visited) tail + else + let visited = KeySet.add soc.key visited in + let soc_str, soc_dep = Soc2cDep.typedef_of_soc soc in + let soc_dep = List.map (fun sk -> SocUtils.find_no_exc sk soc_tbl) soc_dep in + + let acc,visited = soc_without_mem (acc,visited) soc_dep in + let acc = + if soc.instances <> [] || soc.memory <> No_mem then acc else + acc ^ soc_str + in + let acc,visited = soc_without_mem (acc,visited) tail in + acc,visited in - (* Then we still have to print memoryless soc that can not appear - as a soc instance let soc_ctx_typedef_without_mem = let socs = Soc.SocMap.bindings soc_tbl in let socs = snd (List.split socs) in - let memless_soc_to_string acc soc = - if SocUtils.is_memory_less soc then acc^(Soc2cDep.typedef_of_soc soc) else acc - in - List.fold_left memless_soc_to_string "" socs + fst (soc_without_mem ("", KeySet.empty) socs) in + + + + "// Memoryless soc ctx typedef \n"^soc_ctx_typedef_without_mem ^ -*) + "// Memoryfull soc ctx typedef \n"^soc_ctx_typedef_with_mem @@ -570,64 +683,76 @@ let (gen_memoryless_ctx : Soc.tbl -> string) = if acc = "" then "" else Printf.sprintf "\n// Allocation of memoryless ctx\n%s" acc -(* a shortcut *) -let io_transmit_mode () = Lv6MainArgs.global_opt.Lv6MainArgs.io_transmit_mode (****************************************************************************) let gen_main_loop_body inputs outputs soc ctx = if not Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_global_ctx then + let to_c_decl (n,t) = ((Soc2cUtil.data_type_to_c t n)^ ";\n ") in + let inputs_t = List.map to_c_decl inputs in + let outputs_t = List.map to_c_decl outputs in + let inputs_decl = Printf.sprintf "\n %s" (String.concat "" inputs_t) in + let outputs_decl = Printf.sprintf "%s" (String.concat "" outputs_t) in + let ctx_decl = if SocUtils.is_memory_less soc then "" else + " "^ctx^"_type* _ctx = "^ ctx^"_new_ctx(NULL);\n" + (* ctx^"_type "^ctx^";\n " ^ ctx^"_type* _ctx = &"^ctx^";\n " *) + in + (match io_transmit_mode () with - | Lv6MainArgs.Stack -> - let to_c_decl (n,t) = ((Soc2cUtil.data_type_to_c t n)^ ";\n ") in - let inputs_t = List.map to_c_decl inputs in - let outputs_t = List.map to_c_decl outputs in - let inputs_decl = Printf.sprintf "\n %s" (String.concat "" inputs_t) in - let outputs_decl = Printf.sprintf "%s" (String.concat "" outputs_t) in - let ctx_decl = if SocUtils.is_memory_less soc then "" else - " "^ctx^"_type* ctx = "^ ctx^"_new_ctx(NULL);\n" - in - inputs_decl ^ outputs_decl ^ ctx_decl - | Lv6MainArgs.Heap -> (" -/* Context allocation */ -" ^ (if SocUtils.is_memory_less soc then ctx^"_type* ctx = &"^ctx^";\n" - else ctx^"_type* ctx = "^ ctx^"_new_ctx(NULL);") - ) - | Lv6MainArgs.HeapStack -> (" -/* Context allocation */ -" ^ (if SocUtils.is_memory_less soc then ctx^"" - else ctx^"_type* ctx ;\n"^ ctx^"_reset(ctx);") - ) + | Lv6MainArgs.Args -> + inputs_decl ^ outputs_decl ^ ctx_decl + | Lv6MainArgs.Ctx -> ( + " +/* Context allocation (--2c-io-in-ctx mode) */ + " ^ (if Lv6MainArgs.global_opt.Lv6MainArgs.multi_task then + Printf.sprintf " + %s_type ctx_struct; + %s_type* _ctx = &ctx_struct; + %s_init(_ctx); + %s_reset(_ctx);" ctx ctx ctx ctx + else if SocUtils.is_memory_less soc then + ctx^"_type "^ctx^";\n " ^ + ctx^"_type* _ctx = &"^ctx^";\n " + else + ctx^"_type* _ctx = "^ ctx^"_new_ctx(NULL);" + ) + ) + | Lv6MainArgs.CtxArgs -> ( + inputs_decl ^ outputs_decl ^" +/* Context allocation (--2c-io-in-args-and-ctx mode) */ + " ^ (if SocUtils.is_memory_less soc then ctx^"" + else ctx^"_type* _ctx ;\n"^ ctx^"_reset(_ctx);") + ) ) else (match io_transmit_mode () with - | Lv6MainArgs.Stack -> - let to_c_decl (n,t) = ((Soc2cUtil.data_type_to_c t n)^ ";\n ") in - let inputs_t = List.map to_c_decl inputs in - let outputs_t = List.map to_c_decl outputs in - let inputs_decl = Printf.sprintf "\n %s" (String.concat "" inputs_t) in - let outputs_decl = Printf.sprintf "%s" (String.concat "" outputs_t) in - let ctx_decl = if SocUtils.is_memory_less soc then "" else - ctx^"_type ctx_struct;\n "^ - ctx^"_type* ctx = &ctx_struct;\n "^ - ctx^"_init(ctx);" - in - inputs_decl ^ outputs_decl ^ ctx_decl - | Lv6MainArgs.Heap -> (" -/* Context allocation */ + | Lv6MainArgs.Args -> + let to_c_decl (n,t) = ((Soc2cUtil.data_type_to_c t n)^ ";\n ") in + let inputs_t = List.map to_c_decl inputs in + let outputs_t = List.map to_c_decl outputs in + let inputs_decl = Printf.sprintf "\n %s" (String.concat "" inputs_t) in + let outputs_decl = Printf.sprintf "%s" (String.concat "" outputs_t) in + let ctx_decl = if SocUtils.is_memory_less soc then "" else + ctx^"_type _ctx_struct;\n "^ + ctx^"_type* _ctx = &_ctx_struct;\n "^ + ctx^"_init(_ctx);" + in + inputs_decl ^ outputs_decl ^ ctx_decl + | Lv6MainArgs.Ctx -> (" +/* Context allocation (--2c-io-in-ctx --2c-global-ctx mode ) */ " ^ (if SocUtils.is_memory_less soc then - ctx^"_type* ctx = &"^ctx^";\n" + ctx^"_type* _ctx = &"^ctx^";\n" else ( - ctx^"_type ctx_struct; - "^ctx^"_type* ctx = & ctx_struct; - "^ctx^"_init(ctx); + ctx^"_type _ctx_struct; + "^ctx^"_type* _ctx = & _ctx_struct; + "^ctx^"_init(_ctx); ") ) - ) - | Lv6MainArgs.HeapStack -> (" -/* Context allocation */ + ) + | Lv6MainArgs.CtxArgs -> (" +/* Context allocation (--2c-io-in-args-and-ctx --2c-global-ctx mode) */ " ^ (if SocUtils.is_memory_less soc then ctx^"" - else ctx^"_type* ctx ;\n"^ ctx^"_reset(ctx);") - ) + else ctx^"_type* _ctx ;\n"^ ctx^"_reset(_ctx);") + ) ) (****************************************************************************) @@ -647,19 +772,30 @@ let (gen_main_wcet_file : Soc.t -> string -> Soc.tbl -> unit) = #include \""^base0 ^".h\" int main(){" ^ (gen_main_loop_body inputs outputs soc ctx)); (match io_transmit_mode () with - | Lv6MainArgs.Stack -> - let i = fst (List.split inputs) in + | Lv6MainArgs.Args -> + let i = fst (List.split inputs) in + let o = List.map (fun (n,t) -> match t with Data.Array(_,_) -> n | _ ->"&"^n) outputs in + let io = String.concat "," (i@o) in + let io = if SocUtils.is_memory_less soc then io else if io = "" then "_ctx" else io^",_ctx" in + putc (" " ^ step^"("^io^"); + return 0; +} +" + ); + | Lv6MainArgs.CtxArgs -> + let i = fst (List.split inputs) in let o = List.map (fun (n,t) -> match t with Data.Array(_,_) -> n | _ ->"&"^n) outputs in let io = String.concat "," (i@o) in - let io = if SocUtils.is_memory_less soc then io else if io = "" then "ctx" else io^",ctx" in + let io = if io = "" then "_ctx" else io^",_ctx" in putc (" " ^ step^"("^io^"); return 0; } " ); - | Lv6MainArgs.HeapStack -> assert false - | Lv6MainArgs.Heap -> - let io = if SocUtils.is_memory_less soc then "" else "ctx" in + | Lv6MainArgs.Ctx -> + let io = + (* if SocUtils.is_memory_less soc then "" else *) + "_ctx" in putc (" " ^ step^"("^io^"); return 0; } @@ -681,10 +817,10 @@ let (gen_loop_file : string -> LicPrg.t -> Soc.t -> string -> let ctx = get_ctx_name soc.key in let step = Soc2cDep.step_name soc.key "step" in let inputs,outputs = soc.profile in - let inputs_io = SocVar.expand_profile true false inputs in - let outputs_io = SocVar.expand_profile true false outputs in - let inputs_exp = SocVar.expand_profile true true inputs in - let outputs_exp= SocVar.expand_profile true true outputs in + let inputs_io = SocVar.expand_profile true SocVar.PP inputs in + let outputs_io = SocVar.expand_profile true SocVar.PP outputs in + let inputs_exp = SocVar.expand_profile true SocVar.C inputs in + let outputs_exp= SocVar.expand_profile true SocVar.C outputs in let c_outputs_t = String.concat "," (List.map (fun (id,t) -> Soc2cUtil.type_to_string t id) outputs_io) in let outputs_list = String.concat "," (List.map (fun (id,_) -> id ) outputs_io) in let inputs_fmt = List.map (fun (_,t) -> type_to_format_string t) inputs_io in @@ -714,117 +850,117 @@ let (gen_loop_file : string -> LicPrg.t -> Soc.t -> string -> void _read_pragma("^ ( if SocUtils.is_memory_less soc then "" else - ctx^"_type* ctx," - ) ^ "char b[]) { + ctx^"_type* _ctx," + ) ^ "char _b[]) { - if (!strcmp(b,\"#quit\")) exit(0); - if (!strcmp(b,\"#q\")) exit(0);"^ + if (!strcmp(_b,\"#quit\")) exit(0); + if (!strcmp(_b,\"#q\")) exit(0);"^ (if SocUtils.is_memory_less soc then "" else " - if (!strcmp(b,\"#reset\")) "^ctx^"_reset(ctx); + if (!strcmp(_b,\"#reset\")) "^ctx^"_reset(_ctx); ")^" } char* _get_string("^( if SocUtils.is_memory_less soc then "" else - ctx^"_type* ctx," - ) ^"char* n){ - static char b[10] = \"dummy\"; - return b; + ctx^"_type* _ctx," + ) ^"char* _n){ + static char _b[10] = \"dummy\"; + return _b; } /* Standard Input procedures **************/ _boolean _get_bool("^( if SocUtils.is_memory_less soc then "" else - ctx^"_type* ctx," - ) ^"char* n){ - char b[512]; - char c; - _boolean r = 0; - int s = 1; + ctx^"_type* _ctx," + ) ^"char* _n){ + char _b[512]; + char _c; + _boolean _r = 0; + int _s = 1; do { if(ISATTY) { - if((s != 1)||(r == -1)) printf(\"\\a\"); - // printf(\"%s (1,t,T/0,f,F) ? \", n); + if((_s != 1)||(_r == -1)) printf(\"\\a\"); + // printf(\"%s (1,t,T/0,f,F) ? \", _n); } - if(scanf(\"%s\", b)==EOF) exit(0); - r = -1; - c=b[0]; - if(c == 'q') exit(0); - if(c == '#') _read_pragma("^ - (if SocUtils.is_memory_less soc then "" else "ctx,")^"b); - if((c == '0') || (c == 'f') || (c == 'F')) r = 0; - if((c == '1') || (c == 't') || (c == 'T')) r = 1; - } while((s != 1) || (r == -1)); - return r; + if(scanf(\"%s\", _b)==EOF) exit(0); + _r = -1; + _c=_b[0]; + if(_c == 'q') exit(0); + if(_c == '#') _read_pragma("^ + (if SocUtils.is_memory_less soc then "" else "_ctx,")^"_b); + if((_c == '0') || (_c == 'f') || (_c == 'F')) _r = 0; + if((_c == '1') || (_c == 't') || (_c == 'T')) _r = 1; + } while((_s != 1) || (_r == -1)); + return _r; } _integer _get_int("^( if SocUtils.is_memory_less soc then "" else - ctx^"_type* ctx," - ) ^"char* n){ - char b[512]; - _integer r; - int s = 1; + ctx^"_type* _ctx," + ) ^"char* _n){ + char _b[512]; + _integer _r; + int _s = 1; do { if(ISATTY) { - if(s != 1) printf(\"\\a\"); - //printf(\"%s (integer) ? \", n); + if(_s != 1) printf(\"\\a\"); + //printf(\"%s (integer) ? \", _n); } - if(scanf(\"%s\", b)==EOF) exit(0); - if(*b == 'q') exit(0); - if(*b == '#') { + if(scanf(\"%s\", _b)==EOF) exit(0); + if(*_b == 'q') exit(0); + if(*_b == '#') { _read_pragma("^ - (if SocUtils.is_memory_less soc then "" else "ctx,")^"b); + (if SocUtils.is_memory_less soc then "" else "_ctx,")^"_b); } else { - s = sscanf(b, \"%d\", &r); + _s = sscanf(_b, \"%d\", &_r); } - } while(s != 1); - return r; + } while(_s != 1); + return _r; } #define REALFORMAT ((sizeof(_real)==8)?\"%lf\":\"%f\") _real _get_real("^( if SocUtils.is_memory_less soc then "" else - ctx^"_type* ctx," - ) ^"char* n){ - char b[512]; - _real r; - int s = 1; + ctx^"_type* _ctx," + ) ^"char* _n){ + char _b[512]; + _real _r; + int _s = 1; do { if(ISATTY) { - if(s != 1) printf(\"\\a\"); - //printf(\"%s (real) ? \", n); + if(_s != 1) printf(\"\\a\"); + //printf(\"%s (real) ? \", _n); } - if(scanf(\"%s\", b)==EOF) exit(0); - if(*b == 'q') exit(0); - if(*b == '#') { + if(scanf(\"%s\", _b)==EOF) exit(0); + if(*_b == 'q') exit(0); + if(*_b == '#') { _read_pragma("^ - (if SocUtils.is_memory_less soc then "" else "ctx,")^"b); + (if SocUtils.is_memory_less soc then "" else "_ctx,")^"_b); } else { - s = sscanf(b, REALFORMAT, &r); + _s = sscanf(_b, REALFORMAT, &_r); } - } while(s != 1); - return r; + } while(_s != 1); + return _r; } /* Standard Output procedures **************/ -void _put_bottom(char* n){ - if(ISATTY) printf(\"%s = \", n); +void _put_bottom(char* _n){ + if(ISATTY) printf(\"%s = \", _n); printf(\"%s \", BB); if(ISATTY) printf(\"\\n\"); } -void _put_bool(char* n, _boolean _V){ - if(ISATTY) printf(\"%s = \", n); +void _put_bool(char* _n, _boolean _V){ + if(ISATTY) printf(\"%s = \", _n); printf(\"%s \", (_V)? TT : FF); if(ISATTY) printf(\"\\n\"); } -void _put_int(char* n, _integer _V){ - if(ISATTY) printf(\"%s = \", n); +void _put_int(char* _n, _integer _V){ + if(ISATTY) printf(\"%s = \", _n); printf(\"%d \", _V); if(ISATTY) printf(\"\\n\"); } -void _put_real(char* n, _real _V){ - if(ISATTY) printf(\"%s = \", n); +void _put_real(char* _n, _real _V){ + if(ISATTY) printf(\"%s = \", _n); printf(\"%f \", _V); if(ISATTY) printf(\"\\n\"); } -void _put_string(char* n, char* _V){ - if(ISATTY) printf(\"%s = \", n); +void _put_string(char* _n, char* _V){ + if(ISATTY) printf(\"%s = \", _n); printf(\"%s \", _V); if(ISATTY) printf(\"\\n\"); } @@ -841,8 +977,8 @@ void _put_string(char* n, char* _V){ /* I/O functions for the main loop **********************/ void get_inputs ("^ - (if SocUtils.is_memory_less soc then "" else (ctx^"_type* ctx"^ - (if inputs = [] then "" else "," ))) ^ + (if SocUtils.is_memory_less soc then "" else (ctx^"_type* _ctx"^ + (if inputs = [] then "" else "," ))) ^ (String.concat "," (List.map (fun (id,t) -> @@ -860,10 +996,12 @@ void get_inputs ("^ and set this string to something like "if (clk_id)" *) let str = - let ctx_opt = if SocUtils.is_memory_less soc then "" else "ctx," in - if io_transmit_mode () = Lv6MainArgs.Stack + let ctx_opt = + if SocUtils.is_memory_less soc then "" else + "_ctx," in + if io_transmit_mode () = Lv6MainArgs.Args then Printf.sprintf " %s %s = _get_%s(%s\"%s\");\n" clk (pointer_of_ident id) t ctx_opt id - else Printf.sprintf " %s ctx->%s = _get_%s(%s\"%s\");\n" clk id t ctx_opt id + else Printf.sprintf " %s %s = _get_%s(%s\"%s\");\n" clk (pointer_of_ident id) t ctx_opt id in putc_ri str ) @@ -914,13 +1052,13 @@ void get_inputs ("^ (if SocUtils.is_memory_less soc then "" else (ctx^"_type*"^ (if inputs = [] then "" else "," ))) ^ - (String.concat "," - (List.map - (fun (_id,t) -> - match t with - | Array (_, _) -> Soc2cUtil.type_to_string t "" - | _ -> Soc2cUtil.type_to_string t ("*") ) - inputs) + (String.concat "," + (List.map + (fun (_id,t) -> + match t with + | Array (_, _) -> Soc2cUtil.type_to_string t "" + | _ -> Soc2cUtil.type_to_string t ("*") ) + inputs) )^");\n"); let c_outputs_profile = String.concat "," (List.map (fun (_,t) -> Soc2cUtil.type_to_string t "") outputs_io) in puth_ri ("void print_outputs ("^c_outputs_profile^");\n"); @@ -930,6 +1068,23 @@ void get_inputs ("^ "); + let in_to_str io = + String.concat "," (List.map (fun (id,t) -> + match t with + | Array(_,_) -> + if io_transmit_mode () = Lv6MainArgs.Args then id else " _ctx->"^id + | _ -> + if io_transmit_mode () = Lv6MainArgs.Args then " &"^id else " &_ctx->"^id) + io) + in + let out_to_str io = + String.concat "," (List.map (fun (id,t) -> + match t with + | Array(_,_) -> + if io_transmit_mode () = Lv6MainArgs.Args then id else " _ctx->"^id + | _ -> if io_transmit_mode () = Lv6MainArgs.Args then " "^id else " _ctx->"^id) + io) + in putc (" /* Main procedure *************************/ int main(){ @@ -946,15 +1101,11 @@ int main(){ ++_s; get_inputs("^(if SocUtils.is_memory_less soc then "" else - (if inputs = [] then "ctx" else "ctx," )) ^ - (String.concat "," (List.map (fun (id,t) -> - match t with - | Array(_,_) -> id - | _ -> " &"^id) - inputs)) + (if inputs = [] then "_ctx" else "_ctx," )) ^ + (in_to_str inputs) ^"); "); - if io_transmit_mode () = Lv6MainArgs.Stack + if io_transmit_mode () = Lv6MainArgs.Args then let i = fst (List.split inputs) in let o = List.map @@ -962,8 +1113,9 @@ int main(){ outputs in let io = String.concat "," (i@o) in - let io = if SocUtils.is_memory_less soc then io - else if io = "" then "ctx" else io^",ctx" + let io = + if SocUtils.is_memory_less soc then io else + if io = "" then "_ctx" else io^",_ctx" in putc (" " ^ step^"("^io^"); print_outputs("^(String.concat "," (List.map fst (outputs_exp)))^"); @@ -973,11 +1125,13 @@ int main(){ (inputs_exp@outputs_exp)))^ "); }" - ) else ( - putc (" " ^ step^"(ctx); - // printf(\"" ^ (String.concat " " inputs_fmt)^ " #outs " ^ + ) + else ( + putc (" " ^ step^"(_ctx); + print_outputs("^(out_to_str outputs_exp)^"); + //printf(\"" ^ (String.concat " " inputs_fmt)^ " #outs " ^ (String.concat " " outputs_fmt)^ "\\n\"," ^ - (String.concat "," (List.map (fun (id,_) -> "ctx->"^id ) + (String.concat "," (List.map (fun (id,_) -> "_ctx->"^id ) (inputs_exp@outputs_exp)))^ "); }" @@ -995,10 +1149,10 @@ let (gen_loop_file4ogensim : Soc.t -> string -> out_channel -> Soc.tbl -> unit) let ctx = get_ctx_name soc.key in let step = Soc2cDep.step_name soc.key "step" in let inputs,outputs = soc.profile in - let inputs_io = SocVar.expand_profile true false inputs in - let outputs_io = SocVar.expand_profile true false outputs in - let inputs_exp = SocVar.expand_profile true true inputs in - let outputs_exp= SocVar.expand_profile true true outputs in + let inputs_io = SocVar.expand_profile true SocVar.PP inputs in + let outputs_io = SocVar.expand_profile true SocVar.PP outputs in + let inputs_exp = SocVar.expand_profile true SocVar.C inputs in + let outputs_exp= SocVar.expand_profile true SocVar.C outputs in let base0 = Filename.basename base in let define_define i (var_name,_) = putc (Printf.sprintf "#define _%s\t 0xe%07X\n" var_name ((i+1)*8)); @@ -1030,12 +1184,14 @@ let (gen_loop_file4ogensim : Soc.t -> string -> out_channel -> Soc.tbl -> unit) ) inputs_exp inputs_io; - assert (io_transmit_mode () = Lv6MainArgs.Stack); + assert (io_transmit_mode () = Lv6MainArgs.Args); let i = fst (List.split inputs) in let o = List.map (fun (n,t) -> match t with Data.Array(_,_) -> n | _ ->"&"^n) outputs in let io = String.concat "," (i@o) in - let io = if SocUtils.is_memory_less soc then io else if io = "" then "ctx" else io^",ctx" in + let io = + (* if SocUtils.is_memory_less soc then io else *) + if io = "" then "_ctx" else io^",_ctx" in putc (" " ^ step^"("^io^"); // now write the output to the memory which will be output to Lurette @@ -1125,6 +1281,7 @@ typedef float _float; puth "\n#include <stdlib.h>"; puth "\n#include <string.h>\n"; puth "#include \"lustre_consts.h\""; + if Lv6MainArgs.global_opt.Lv6MainArgs.multi_task then puth "\n#include \"para.h\"\n"; output_string och (" // User typedef @@ -1145,7 +1302,7 @@ typedef float _float; gen_loop_file loopfile licprg main_soc base ocl ocl_readinput_c ocl_readinput_h stbl in if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_dro then () else - if Lv6MainArgs.global_opt.Lv6MainArgs.multi_core then ( + if Lv6MainArgs.global_opt.Lv6MainArgs.multi_task then ( Soc2yaml.f msoc stbl base; gen_loop_files () ) else if Lv6MainArgs.global_opt.Lv6MainArgs.gen_wcet then ( @@ -1158,13 +1315,10 @@ typedef float _float; putc (Printf.sprintf "#include \"%s\"\n" hfile0); (* putc (Soc2cExtern.cpy_declaration licprg); *) putc (Soc2cExtern.const_declaration licprg); - let cfiles_acc = - if io_transmit_mode () = Lv6MainArgs.Heap then ( + let _cfiles_acc = + if io_transmit_mode () = Lv6MainArgs.Ctx then ( if socs = [] then [] else ( - putc "/////////////////////////////////////////////////\n"; - putc "//// Static allocation of memoryless soc ctx\n"; let cfiles_acc = List.fold_left (soc2c 1 och occ stbl msoc) cfiles_acc socs in - putc "/////////////////////////////////////////////////\n"; cfiles_acc ); ) else cfiles_acc @@ -1175,10 +1329,10 @@ typedef float _float; let cfiles_acc = List.fold_left (soc2c 2 och occ stbl msoc) cfiles_acc socs in let inputs,outputs = main_soc.profile in - let inputs_exp = SocVar.expand_profile true true inputs in - let outputs_exp= SocVar.expand_profile true true outputs in - let inputs_exp2 = SocVar.expand_profile true false inputs in - let outputs_exp2= SocVar.expand_profile true false outputs in + let inputs_exp = SocVar.expand_profile true SocVar.C inputs in + let outputs_exp= SocVar.expand_profile true SocVar.C outputs in + let inputs_exp2 = SocVar.expand_profile true SocVar.PP inputs in + let outputs_exp2= SocVar.expand_profile true SocVar.PP outputs in let name = get_base_name main_soc.key in if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_dro then ( cfmt "///////// dro stuff diff --git a/lib/soc2cDep.ml b/lib/soc2cDep.ml index 54862e01914e27d1f2f3daaa1dc52646e78069e5..1d06434c9d59706d87c45ba1b5ec12f1869ec274 100644 --- a/lib/soc2cDep.ml +++ b/lib/soc2cDep.ml @@ -1,77 +1,74 @@ -(* Time-stamp: <modified the 06/02/2015 (at 10:52) by Erwan Jahier> *) +(* Time-stamp: <modified the 14/06/2024 (at 15:50) by Erwan Jahier> *) open Lv6MainArgs -let gen_assign_var_expr x = - match global_opt.io_transmit_mode with - | Heap -> Soc2cHeap.gen_assign_var_expr x - | HeapStack -> Soc2cHeap.gen_assign_var_expr x - | Stack -> Soc2cStack.gen_assign_var_expr x +let gen_assign_var_expr x = + match global_opt.io_transmit_mode with + | Ctx -> Soc2cIoCtx.gen_assign_var_expr x + | CtxArgs -> Soc2cIoCtx.gen_assign_var_expr x + | Args -> Soc2cIoArgs.gen_assign_var_expr x -let step_name x = - match global_opt.io_transmit_mode with - | Heap -> Soc2cHeap.step_name x - | HeapStack -> Soc2cHeap.step_name x - | Stack -> Soc2cStack.step_name x +let step_name x = + match global_opt.io_transmit_mode with + | Ctx -> Soc2cIoCtx.step_name x + | CtxArgs -> Soc2cIoCtx.step_name x + | Args -> Soc2cIoArgs.step_name x let get_step_prototype x y = - match global_opt.io_transmit_mode with - | Heap -> Soc2cHeap.get_step_prototype x y - | HeapStack -> Soc2cHeap.get_step_prototype x y - | Stack -> Soc2cStack.get_step_prototype x y + match global_opt.io_transmit_mode with + | Ctx -> Soc2cIoCtx.get_step_prototype x y + | CtxArgs -> Soc2cIoCtx.get_step_prototype x y + | Args -> Soc2cIoArgs.get_step_prototype x y -let string_of_var_expr x = - match global_opt.io_transmit_mode with - | Heap -> Soc2cHeap.string_of_var_expr x - | HeapStack -> Soc2cHeap.string_of_var_expr x - | Stack -> Soc2cStack.string_of_var_expr x +let string_of_var_expr x = + match global_opt.io_transmit_mode with + | Ctx -> Soc2cIoCtx.string_of_var_expr x + | CtxArgs -> Soc2cIoCtx.string_of_var_expr x + | Args -> Soc2cIoArgs.string_of_var_expr x -let ctx_var x = - match global_opt.io_transmit_mode with - | Heap -> Soc2cHeap.ctx_var x - | HeapStack -> Soc2cHeap.ctx_var x - | Stack -> Soc2cStack.ctx_var x +let ctx_var x = + match global_opt.io_transmit_mode with + | Ctx -> Soc2cIoCtx.ctx_var x + | CtxArgs -> Soc2cIoCtx.ctx_var x + | Args -> Soc2cIoArgs.ctx_var x -let gen_step_call x = - match global_opt.io_transmit_mode with - | Heap -> Soc2cHeap.gen_step_call x - | HeapStack -> Soc2cHeap.gen_step_call x - | Stack -> Soc2cStack.gen_step_call x +let gen_step_call x y para = + match global_opt.io_transmit_mode with + | Ctx -> Soc2cIoCtx.gen_step_call x y para + | CtxArgs -> Soc2cIoCtx.gen_step_call x y para + | Args -> Soc2cIoArgs.gen_step_call x y -let inlined_soc x = - match global_opt.io_transmit_mode with - | Heap -> Soc2cHeap.inlined_soc x - | HeapStack -> Soc2cHeap.inlined_soc x - | Stack -> Soc2cStack.inlined_soc x - -let typedef_of_soc x = - match global_opt.io_transmit_mode with - | Heap -> Soc2cHeap.typedef_of_soc x - | HeapStack -> Soc2cHeap.typedef_of_soc x - | Stack -> Soc2cStack.typedef_of_soc x - - -let get_predef_op x = - match global_opt.io_transmit_mode with - | Heap -> SocPredef2cHeap.get_predef_op x - | HeapStack -> SocPredef2cHeap.get_predef_op x - | Stack -> SocPredef2cStack.get_predef_op x -let get_iterator x = - match global_opt.io_transmit_mode with - | Heap -> SocPredef2cHeap.get_iterator x - | HeapStack -> SocPredef2cHeap.get_iterator x - | Stack -> SocPredef2cStack.get_iterator x -let get_condact x = - match global_opt.io_transmit_mode with - | Heap -> SocPredef2cHeap.get_condact x - | HeapStack -> SocPredef2cHeap.get_condact x - | Stack -> SocPredef2cStack.get_condact x -let get_boolred x = - match global_opt.io_transmit_mode with - | Heap -> SocPredef2cHeap.get_boolred x - | HeapStack -> SocPredef2cHeap.get_boolred x - | Stack -> SocPredef2cStack.get_boolred x +let inlined_soc x = + match global_opt.io_transmit_mode with + | Ctx -> Soc2cIoCtx.inlined_soc x + | CtxArgs -> Soc2cIoCtx.inlined_soc x + | Args -> Soc2cIoArgs.inlined_soc x +let typedef_of_soc x = + match global_opt.io_transmit_mode with + | Ctx -> Soc2cIoCtx.typedef_of_soc x + | CtxArgs -> Soc2cIoCtx.typedef_of_soc x + | Args -> Soc2cIoArgs.typedef_of_soc x, [] +let get_predef_op x = + match global_opt.io_transmit_mode with + | Ctx -> SocPredef2cIoCtx.get_predef_op x + | CtxArgs -> SocPredef2cIoCtx.get_predef_op x + | Args -> SocPredef2cIoArgs.get_predef_op x +let get_iterator x = + match global_opt.io_transmit_mode with + | Ctx -> SocPredef2cIoCtx.get_iterator x + | CtxArgs -> SocPredef2cIoCtx.get_iterator x + | Args -> SocPredef2cIoArgs.get_iterator x +let get_condact x = + match global_opt.io_transmit_mode with + | Ctx -> SocPredef2cIoCtx.get_condact x + | CtxArgs -> SocPredef2cIoCtx.get_condact x + | Args -> SocPredef2cIoArgs.get_condact x +let get_boolred x = + match global_opt.io_transmit_mode with + | Ctx -> SocPredef2cIoCtx.get_boolred x + | CtxArgs -> SocPredef2cIoCtx.get_boolred x + | Args -> SocPredef2cIoArgs.get_boolred x diff --git a/lib/soc2cDep.mli b/lib/soc2cDep.mli index a2637d9904c30a2fab7b3cd267ec7af4b96a7d47..92b3b1a5ad19990e970c589b28ff5b8f70855c14 100644 --- a/lib/soc2cDep.mli +++ b/lib/soc2cDep.mli @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 26/06/2017 (at 16:39) by Erwan Jahier> *) +(* Time-stamp: <modified the 14/06/2024 (at 15:50) by Erwan Jahier> *) (** Choose between the various C code generators (heap-based, Stack @@ -15,10 +15,10 @@ val gen_assign_var_expr : Soc.t -> Soc.var_expr -> Soc.var_expr -> string val step_name : Soc.key -> string -> string (* returns the step declaration (to put in the .h) and step header - (to put in the .c) + (to put in the .c) For instance , something like: - "void step(ctx_type, int, int, int* );", - "void step(ctx_type ctx, int x, int y,int* z){", + "void step(ctx_type, int, int, int* );", + "void step(ctx_type ctx, int x, int y,int* z){", *) val get_step_prototype : Soc.step_method -> Soc.t -> string * string * string @@ -28,7 +28,7 @@ val string_of_var_expr: Soc.t -> Soc.var_expr -> string (* [ctx_var vk id] *) val ctx_var : Soc2cUtil.var_kind -> Soc.t -> Lv6Id.t -> string - + (* [gen_step_call soc called_soc vel_out vel_in ctx sname step_arg] Generates the C code that performs the call to a step method of [called_soc] from [soc]. @@ -38,7 +38,7 @@ val ctx_var : Soc2cUtil.var_kind -> Soc.t -> Lv6Id.t -> string - [step_arg] is a string holding the arg of the step (empty for proc call) *) -val gen_step_call : Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> +val gen_step_call : Soc.t -> Soc.t -> bool -> Soc.var_expr list -> Soc.var_expr list -> string -> string -> string -> string (* should this soc be inlined? (depends on Lv6MainArgs.global_opt) *) val inlined_soc : Soc.key -> bool @@ -51,11 +51,10 @@ val get_iterator : Soc.t -> string -> Soc.t -> int -> string (** Returns the C code implementing a condact *) -val get_condact : Soc.t -> Soc.t -> Soc.var_expr list -> string +val get_condact : Soc.t -> Soc.t -> Soc.var_expr list -> string (** Returns the C code implementing a boolred *) -val get_boolred : Soc.t -> int -> int -> int -> string - -val typedef_of_soc : Soc.t -> string +val get_boolred : Soc.t -> int -> int -> int -> string +val typedef_of_soc : Soc.t -> string * Soc.key list diff --git a/lib/soc2cHeap.ml b/lib/soc2cHeap.ml deleted file mode 100644 index 16ccd9bb327f084b65f80335c87626fa6d6325bf..0000000000000000000000000000000000000000 --- a/lib/soc2cHeap.ml +++ /dev/null @@ -1,208 +0,0 @@ -(* Time-stamp: <modified the 06/03/2020 (at 13:34) by Erwan Jahier> *) - -open Soc2cUtil -open Soc2cIdent -open Soc - - -let (mem_interface : Soc.t -> string -> bool) = - fun soc id -> - let ins,outs = soc.profile in - List.mem_assoc id ins || List.mem_assoc id outs - -let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) = - fun soc -> function - | Const("true", _) -> "_true" - | Const("false", _) -> "_false" - | Const(id, _) -> id2s id - | Var ("_memory",_) -> (* Clutch! it's not an interface var... *) "ctx->_memory" - | Var (id,_) -> - if not (mem_interface soc id) then id2s id - else if SocUtils.is_memory_less soc then - Printf.sprintf "%s.%s" (get_ctx_name soc.key) (id2s id) - else - 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) -> assert false (* should not occur *) - - -(* exported *) -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 - | 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.String - | Data.Array(_) -> - 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 t_str - -let (gen_assign_var_expr : Soc.t -> Soc.var_expr -> Soc.var_expr -> string) = -fun soc vi vo -> - match vi,vo with - | Slice _, _ -> assert false - | _, Slice _ -> assert false - | _,_ -> - gen_assign (Soc.data_type_of_var_expr vi) - (string_of_var_expr soc vi) (string_of_var_expr soc vo) - - -let (step_name : Soc.key -> string -> string) = - fun sk sm -> - let str = Printf.sprintf "%s_%s" (Soc2cIdent.get_soc_name sk) sm in - id2s str - -let (ctx_var : var_kind -> Soc.t -> Lv6Id.t -> string) = - fun opt _soc id -> - match opt with - | ML_IO sk -> Printf.sprintf "%s_ctx.%s" (Soc2cIdent.get_soc_name sk) (id2s id) - | M_IO -> Printf.sprintf "ctx->%s" (id2s id) - | Local -> Printf.sprintf "%s" (id2s id) - - -let (list_split : 'a list -> int -> 'a list * 'a list) = - fun l s -> - let rec aux s l acc = - match s,l with - | 0, _ -> List.rev acc,l - | _, x::l -> aux (s-1) l (x::acc) - | _, [] -> assert false - in - aux s l [] - -let _ = assert (list_split [1;2;3;4;5;6] 3 = ([1;2;3],[4;5;6])) - -let (inline_soc : - Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> string option) = - fun soc called_soc vel_out vel_in -> - let called_soc_name,_,_ = called_soc.key in - match called_soc_name with - (* those soc are inlined. Currently we only inline ite because - of its polymorphism. Maybe simple arith operators - (+-,*,/,etc.) should be inlined too. *) - | "Lustre::if" -> - let c,vel_in= match vel_in with [] -> assert false | c::l -> c,l in - let s = (List.length vel_out) in - let vel_in_t, vel_in_e = list_split vel_in s in - let lt = List.map2 (gen_assign_var_expr soc) vel_out vel_in_t in - let le = List.map2 (gen_assign_var_expr soc) vel_out vel_in_e in - let str = " if ("^(string_of_var_expr soc c) ^ " == _true) {\n "^ - (String.concat " " lt)^ " } else {\n "^ - (String.concat " " le)^ " }\n" - in - Some str - | _ -> - try - if - Lv6MainArgs.global_opt.Lv6MainArgs.gen_c_inline_predef - && Soc2cPredef.is_call_supported called_soc.key - then - let vel_in = List.map (string_of_var_expr soc) vel_in in - let vel_out = List.map (string_of_var_expr soc) vel_out in - Some (Soc2cPredef.gen_call called_soc.key soc vel_out vel_in) - else - None - with Not_found -> -(* Printf.eprintf "won't inline %s\n" called_soc_name; *) - None -(* exported *) -let (inlined_soc : Soc.key -> bool) = - fun key -> - let soc_name,_,_ = key in - soc_name = "Lustre::if" || Soc2cPredef.is_call_supported key - - -(* exported *) -let (gen_step_call : Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> - string -> string -> string -> string) = - fun soc called_soc vel_out vel_in ctx sname step_arg -> - match inline_soc soc called_soc vel_out vel_in with - | Some str -> str - | None -> - let vel_in = List.map (string_of_var_expr soc) vel_in in - let vel_out = List.map (string_of_var_expr soc) vel_out in - let si_str = - if vel_in = [] then "" (* occurs for pre *) else - 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) - inputs vel_in - ) with _ -> assert false (* are all parameters necessarily used? *) - in - (String.concat "" l) - in - let so_str = - if vel_out = [] then "" (* occurs for pre *) else - let outputs = snd called_soc.profile in - let l = try ( - List.map2 - (fun (name,t) ve -> - let ve2 = Printf.sprintf "%s.%s" ctx name in - gen_assign t ve ve2) - outputs vel_out - ) with _ -> assert false - in - (String.concat "" l) ^"\n" - in - let str = Printf.sprintf " %s(%s); \n" - (step_name called_soc.key sname) step_arg in - (si_str ^ str ^ so_str) - -(* exported *) -let (typedef_of_soc : Soc.t -> string) = - fun soc -> - if inlined_soc soc.key then "" (* don't generate code if inlined *) else - let ctx_name = get_ctx_name soc.key in - let ctx_name_type = ctx_name^"_type" in - let il,ol = soc.profile in - let str = Printf.sprintf "/* %s */\ntypedef struct {\n /*INPUTS*/\n" ctx_name in - let str = List.fold_left (fun acc v -> acc^ (string_of_flow_decl v)) str il in - let str = str ^ " /*OUTPUTS*/\n" in - let str = List.fold_left (fun acc v -> acc^ (string_of_flow_decl v)) str ol in - let str = str ^ - (match soc.memory with - | No_mem -> "" - | Mem t -> - Printf.sprintf " /*Memory cell*/\n %s ;\n" - (id2s (Soc2cUtil.data_type_to_c t "_memory")) - | Mem_hidden -> "" - ) - in - let str = str ^ (if soc.instances <> [] then " /*INSTANCES*/\n" else "") in - let il, _get_index = Soc2cInstances.to_array soc.instances in - let string_of_instance (sk,i) = - let n = get_ctx_name sk in - Printf.sprintf " %s_type %s_tab[%d];\n" n n i - in - let str = List.fold_left (fun acc inst -> acc^(string_of_instance inst)) str il in - let str = Printf.sprintf "%s} %s;\n\n" str ctx_name_type in - str - -let (get_step_prototype : Soc.step_method -> Soc.t -> string * string * string) = - fun sm soc -> - let sname = step_name soc.key sm.name in - let ctx = if SocUtils.is_memory_less soc then "" else - Printf.sprintf "%s_type* ctx" (get_ctx_name soc.key) - in - let ctx_decl = if SocUtils.is_memory_less soc then "" else - Printf.sprintf "%s_type*" (get_ctx_name soc.key) - in - let inputs, _ = soc.Soc.profile in - let ctype = match inputs with - | (_,t)::_ -> - Printf.sprintf "sizeof(%s)" (Soc2cUtil.data_type_to_c t "") - | [] -> "" (* soc without intputs won't need this output *) - in - Printf.sprintf "void %s(%s);\n" sname ctx_decl, - Printf.sprintf "void %s(%s){\n" sname ctx, - ctype diff --git a/lib/soc2cIdent.ml b/lib/soc2cIdent.ml index 63f2714a1e5321f81a5773bf38f6f72144641aa2..151f2ba5e2ff66468d83afa131a07c08764daaa4 100644 --- a/lib/soc2cIdent.ml +++ b/lib/soc2cIdent.ml @@ -1,16 +1,16 @@ -(* Time-stamp: <modified the 12/03/2020 (at 09:30) by Erwan Jahier> *) +(* Time-stamp: <modified the 17/06/2024 (at 15:34) by Erwan Jahier> *) let colcol = Str.regexp "::" let prime = Str.regexp "'" let id2s id = (* XXX Refuser les noms de module à la con plutot *) let str = match Str.split colcol id with - | ["Lustre";"true"] -> "_true" (* a good idea to do that here ? *) + | ["Lustre";"true"] -> "_true" (* a good idea to do that here ? *) | ["Lustre";"false"] -> "_false" - | ["true"] -> "_true" (* a good idea to do that here ? *) + | ["true"] -> "_true" (* a good idea to do that here ? *) | ["false"] -> "_false" | [s] -> s - | [m;s] -> if Lv6MainArgs.global_opt.Lv6MainArgs.no_prefix then s else m^"_"^s + | [m;s] -> if Lv6MainArgs.global_opt.Lv6MainArgs.no_prefix then s else m^"_"^s | _ -> id in let str = Str.global_replace colcol "_" str in @@ -19,18 +19,18 @@ let id2s id = (* XXX Refuser les noms de module à la con plutot *) let long2s l = id2s (Lv6Id.string_of_long false l) -let rec (type_to_short_string : Data.t -> string) = - fun v -> +let rec (type_to_short_string : Data.t -> string) = + fun v -> let str = match v with | Data.String -> "s" | Data.Bool -> "b" | Data.Int -> "i" | Data.Real-> "r" - | Data.Extern s -> id2s s - | Data.Enum (_s, _sl) -> "e" (* s *) + | Data.Extern s -> id2s s + | Data.Enum (_s, _sl) -> "e" (* s *) | Data.Struct (sid,_) -> id2s sid - | Data.Array (ty, sz) -> Printf.sprintf "%sp%d" (type_to_short_string ty) sz + | Data.Array (ty, sz) -> Printf.sprintf "%sp%d" (type_to_short_string ty) sz | Data.Alias(n,_) -> n | Data.Alpha nb -> (* On génère des "types" à la Caml : 'a, 'b, 'c, etc. *) @@ -54,22 +54,22 @@ let rec (type_to_short_string : Data.t -> string) = "Data.t list * key_opt" *) -let (key_table: (Soc.ident, (Data.t list * Soc.key_opt, int) Hashtbl.t) Hashtbl.t) = +let (key_table: (Soc.ident, (Data.t list * Soc.key_opt, int) Hashtbl.t) Hashtbl.t) = Hashtbl.create 10 let (get_base_name : Soc.key -> string) = - fun (id,l,opt) -> + fun (id,l,opt) -> let id = id2s id in - let suff = - try + let suff = + try let inner_tbl = Hashtbl.find key_table id in - (try + (try let cpt = Hashtbl.find inner_tbl (l,opt) in let str = if cpt = 1 then "" else ("_"^(string_of_int cpt)) in str with Not_found -> (* The first time (l,opt) is encountered for id *) - let cpt = 1+Hashtbl.length inner_tbl in + let cpt = 1+Hashtbl.length inner_tbl in let str = "_"^(string_of_int cpt) in Hashtbl.add inner_tbl (l,opt) cpt; str @@ -84,18 +84,18 @@ let (get_base_name : Soc.key -> string) = id ^ suff (* unit tests *) -let _ = +let _ = assert (get_base_name ("x", [Data.Int], Soc.Nomore) = "x"); assert (get_base_name ("x", [Data.Int], Soc.Nomore) = "x"); assert (get_base_name ("x", [Data.Bool], Soc.Nomore) = "x_2"); assert (get_base_name ("x", [Data.Int], Soc.Nomore) = "x"); assert (get_base_name ("x", [Data.Real], Soc.Nomore) = "x_3"); assert (get_base_name ("x", [Data.Bool], Soc.Nomore) = "x_2"); - Hashtbl.clear key_table; + Hashtbl.clear key_table; () let (get_ctx_name : Soc.key -> string) = - fun sk -> (get_base_name sk) ^ "_ctx" + fun sk -> (get_base_name sk) ^ "_ctx" (* This function is injective *) let (get_soc_name : Soc.key -> string) = diff --git a/lib/soc2cInstances.ml b/lib/soc2cInstances.ml index 287e0b91bd11a092f3833ed8769c41db3d94bfba..416437e323dbdd5ccc7007cb4460b7865e8b2779 100644 --- a/lib/soc2cInstances.ml +++ b/lib/soc2cInstances.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 18/03/2016 (at 10:35) by Erwan Jahier> *) +(* Time-stamp: <modified the 17/06/2024 (at 11:45) by Erwan Jahier> *) module SocKey = struct @@ -8,30 +8,30 @@ end module SkMap = Map.Make(SocKey) -(* List.nth^-1 *) +(* The inverse of List.nth *) let (get_pos : 'a -> 'a list -> int) = fun x l -> let rec aux c = function | [] -> assert false (* SNO *) | y::tail -> if x = y then c else aux (c+1) tail - in + in let pos = aux 0 l in assert (List.nth l pos = x); pos -(** gathers instances of the same soc into an array *) open Soc (* exported *) -let find k t = try SkMap.find k t with Not_found -> +let find k t = try SkMap.find k t with Not_found -> Printf.printf "*** SNO: %s not found in %s\n" (Std.dump k) (Std.dump t); flush stdout; assert false +(** groups instances of the same soc into different arrays *) let to_array : ((ident * Soc.key) list -> (Soc.key * int) list * (ident * Soc.key -> int)) = - fun l -> + fun l -> let rec aux tab = function | [] -> tab | (id,key)::tail -> @@ -39,17 +39,15 @@ let to_array : let idl = find key tab in let tab = SkMap.add key (id::idl) tab in aux tab tail - else + else let tab = SkMap.add key [id] tab in aux tab tail in let tab = aux SkMap.empty l in let il = SkMap.fold (fun sk idl acc -> (sk, List.length idl)::acc) tab [] in - let inst_to_index (id,sk) = + let inst_to_index (id,sk) = let idl = find sk tab in let i = get_pos id (List.rev idl) in i - in - il, inst_to_index - - + in + il, inst_to_index diff --git a/lib/soc2cInstances.mli b/lib/soc2cInstances.mli index d35e51dbca99388bfc732d0b01e915208bd916ba..66d75631cabd0cc12aa2fc6008e77979325f5e71 100644 --- a/lib/soc2cInstances.mli +++ b/lib/soc2cInstances.mli @@ -1,14 +1,14 @@ -(* Time-stamp: <modified the 18/03/2016 (at 10:35) by Erwan Jahier> *) +(* Time-stamp: <modified the 17/06/2024 (at 11:43) by Erwan Jahier> *) (** Each soc has a list of soc instances, made of an (unique) ident - and a Soc.key. + and a Soc.key. In order to be able to iterate on such instances at the C level - (e.g., with a for loop), instances are stored into arrays. + (e.g., with a for loop), instances are stored into arrays. The to_array function helps to do that, by gathering instances of the same soc. - + More precisely from a list of soc instances l, this function returns : @@ -17,9 +17,9 @@ - a function that maps each instance ident to its position in the array where it is stored + +nb: It also works for dealing with tasks *) -val to_array : (Soc.ident * Soc.key) list -> +val to_array : (Soc.ident * Soc.key) list -> (Soc.key * int) list * (Soc.ident * Soc.key -> int) - -(* XXX the 2nd looks unused. rm ? *) diff --git a/lib/soc2cStack.ml b/lib/soc2cIoArgs.ml similarity index 83% rename from lib/soc2cStack.ml rename to lib/soc2cIoArgs.ml index 85fefe0cda3836642f416fa1482973ea2c979798..ebad73a1c47671da7fdd7fbb2564284750077a79 100644 --- a/lib/soc2cStack.ml +++ b/lib/soc2cIoArgs.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 06/03/2020 (at 13:36) by Erwan Jahier> *) +(* Time-stamp: <modified the 04/06/2024 (at 08:58) by Erwan Jahier> *) open Soc2cUtil open Soc2cIdent @@ -7,113 +7,113 @@ open Soc let (mem_interface_out : Soc.t -> string -> bool) = - fun soc id -> + fun soc id -> let _,outs = soc.profile in List.mem_assoc id outs -let (not_an_array : Data.t -> bool) = function +let (not_an_array : Data.t -> bool) = function | Data.Array(_,_) -> false | _ -> true let (ve_not_an_array : Soc.var_expr -> bool) = - fun v -> + fun v -> match v with - | Var(_,t) - | Const(_,t) - | Field(_,_,t) - | Index(_,_,t) -> not_an_array t + | Var(_,t) + | Const(_,t) + | Field(_,_,t) + | Index(_,_,t) -> not_an_array t | Slice(_,_,_,_,_,_) -> false let (ve_not_a_field : Soc.var_expr -> bool) = - fun v -> + fun v -> match v with - | Var(_,_) - | Const(_,_) - | Index(_,_,_) + | Var(_,_) + | Const(_,_) + | Index(_,_,_) | Slice(_,_,_,_,_,_) -> true | Field(_,_,_t) -> false (* exported : returns true if v is an output of soc *) let rec (is_soc_output : Soc.var_expr -> Soc.t -> bool) = - fun v soc -> + fun v soc -> match v with | Var(n,t) -> List.mem (n,t) (snd soc.profile) | Const(_) -> false - | Index(ve,_,_t) + | Index(ve,_,_t) | Field(ve,_,_t) | Slice(ve,_,_,_,_,_t) -> is_soc_output ve soc - + let (is_soc_output_and_not_a_struct : Soc.var_expr -> Soc.t -> bool) = - fun v soc -> + fun v soc -> match v with | Var(n,t) -> List.mem (n,t) (snd soc.profile) | Const(_) -> false - | Index(_ve,_,_t) + | Index(_ve,_,_t) | Field(_ve,_,_t) | Slice(_ve,_,_,_,_,_t) -> false (* is_soc_output_and_not_a_struct ve soc *) -let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) = +let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) = 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 ("_memory",_) -> (* Clutch! it's not an interface var... *) "_ctx->_memory" | Var (id,_t) -> id2s id - | Field(f, id,_) -> + | Field(f, id,_) -> if is_soc_output_and_not_a_struct f soc - then Printf.sprintf "%s->%s" (string_of_var_expr soc f) (id2s id) - else Printf.sprintf "%s.%s" (string_of_var_expr soc f) (id2s id) + then Printf.sprintf "%s->%s" (string_of_var_expr soc f) (id2s id) + else 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) -> assert false (* should not occur *) -(* exported *) +(* exported *) let rec (gen_assign : Data.t -> string -> string -> string) = - fun t vi vo -> + 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 - | Data.Enum _ + | 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.String - | Data.Array(_) -> + | Data.Alpha(_) (* dead code ? *) + | Data.String + | Data.Array(_) -> 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) -> + | Data.Extern (id) -> 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 vo vi -> +fun soc vo vi -> match vo,vi with | Slice _, _ | _, Slice _ -> assert false - | _,_ -> + | _,_ -> let left = string_of_var_expr soc vo in let left = if is_soc_output_and_not_a_struct vo soc && ve_not_an_array vo && ve_not_a_field vo - then "*"^left else left + then "*"^left else left in let vi_str = string_of_var_expr soc vi in - let vi_str = + let vi_str = if is_soc_output_and_not_a_struct 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 + gen_assign (Soc.data_type_of_var_expr vo) left vi_str let (step_name : Soc.key -> string -> string) = - fun sk sm -> + fun sk sm -> let str = Printf.sprintf "%s_%s" (Soc2cIdent.get_soc_name sk) sm in (* Printf.printf " XXX step_name(%s)=%s\n" (SocUtils.string_of_soc_key sk) str; *) (* flush stdout; *) (id2s str) let (ctx_var : var_kind -> Soc.t -> Lv6Id.t -> string) = - fun _opt soc id -> - if mem_interface_out soc id then + fun _opt soc id -> + if mem_interface_out soc id then Printf.sprintf "*%s" (id2s id) - else + else Printf.sprintf "%s" (id2s id) let (list_split : 'a list -> int -> 'a list * 'a list) = @@ -123,15 +123,15 @@ let (list_split : 'a list -> int -> 'a list * 'a list) = | 0, _ -> List.rev acc,l | _, x::l -> aux (s-1) l (x::acc) | _, [] -> assert false - in + in aux s l [] let _ = assert (list_split [1;2;3;4;5;6] 3 = ([1;2;3],[4;5;6])) let (inline_soc: Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> string option) = - fun soc called_soc vel_out vel_in -> - let called_soc_name,_,_ = called_soc.key in + fun soc called_soc vel_out vel_in -> + let called_soc_name,_,_ = called_soc.key in match called_soc_name with (* those soc are inlined. Currently we only inline ite because of its polymorphism. Simple arith operators (+,-,*,/,etc.) @@ -151,32 +151,32 @@ let (inline_soc: Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> | _ -> try - if - Lv6MainArgs.global_opt.Lv6MainArgs.gen_c_inline_predef - && Soc2cPredef.is_call_supported called_soc.key + if + Lv6MainArgs.global_opt.Lv6MainArgs.gen_c_inline_predef + && Soc2cPredef.is_call_supported called_soc.key then let vel_in_str = List.map (string_of_var_expr soc) vel_in in let vel_in = List.map2 - (fun v s -> if is_soc_output_and_not_a_struct v soc && ve_not_an_array v + (fun v s -> if is_soc_output_and_not_a_struct v soc && ve_not_an_array v then "*"^s else s) vel_in vel_in_str in let vel_out_str = List.map (string_of_var_expr soc) vel_out in let vel_out = List.map2 - (fun v s -> if is_soc_output_and_not_a_struct v soc && ve_not_an_array v + (fun v s -> if is_soc_output_and_not_a_struct v soc && ve_not_an_array v then "*"^s else s) vel_out vel_out_str in Some (Soc2cPredef.gen_call called_soc.key soc vel_out vel_in) - else + else None - with Not_found -> + with Not_found -> (* Printf.eprintf "won't inline %s\n" called_soc_name; *) None -(* exported *) +(* exported *) let (inlined_soc : Soc.key -> bool) = fun key -> let soc_name,_,_ = key in - soc_name = "Lustre::if" || Soc2cPredef.is_call_supported key + soc_name = "Lustre::if" || Soc2cPredef.is_call_supported key (* exported *) @@ -188,16 +188,16 @@ let (gen_step_call : Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> | None -> let vel_in_str = List.map (string_of_var_expr soc) vel_in in let vel_in = - List.map2 (fun v s -> if is_soc_output_and_not_a_struct v soc && ve_not_an_array v + List.map2 (fun v s -> if is_soc_output_and_not_a_struct v soc && ve_not_an_array v then "*"^s else s) vel_in vel_in_str in let vel_out_str = List.map (string_of_var_expr soc) vel_out in let vel_out = - List.map2 - (fun v s -> + List.map2 + (fun v s -> if (not (is_soc_output_and_not_a_struct v soc) && ve_not_an_array v ) - then "&"^s - else s) + then "&"^s + else s) vel_out vel_out_str in let step_arg = if step_arg = "" then [] else [step_arg] in @@ -205,25 +205,25 @@ let (gen_step_call : Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> let str = Printf.sprintf " %s(%s); \n" (step_name called_soc.key sname) step_arg in str -(* exported *) +(* exported *) let (typedef_of_soc : Soc.t -> string) = - fun soc -> + fun soc -> if inlined_soc soc.key then "" (* don't generate code if inlined *) else - if SocUtils.is_memory_less soc then "" else + if SocUtils.is_memory_less soc then "" else let ctx_name = get_ctx_name soc.key in - let ctx_name_type = ctx_name^"_type" in + let ctx_name_type = ctx_name^"_type" in let str = Printf.sprintf "/* %s */\ntypedef struct {\n" ctx_name in let str = str ^ (match soc.memory with | No_mem -> "" - | Mem t -> Printf.sprintf " /*Memory cell*/\n %s ;\n" + | Mem t -> Printf.sprintf " /*Memory cell*/\n %s ;\n" (id2s (Soc2cUtil.data_type_to_c t "_memory")) | Mem_hidden -> "" ) in let str = str ^ (if soc.instances <> [] then " /*INSTANCES*/\n" else "") in let il, _get_index = Soc2cInstances.to_array soc.instances in - let string_of_instance (sk,i) = + let string_of_instance (sk,i) = let n = get_ctx_name sk in Printf.sprintf " %s_type %s_tab[%d];\n" n n i in @@ -232,26 +232,26 @@ let (typedef_of_soc : Soc.t -> string) = str (* exported *) -(* for soc of type (int * int -> int), it generates something like +(* for soc of type (int * int -> int), it generates something like "void step(int, int, int*, soc_ctx_type* );", "void step(int x, int y, int* res, soc_ctx_type* ctx){" -*) +*) let (get_step_prototype : Soc.step_method -> Soc.t -> string * string * string) = fun sm soc -> let sname = step_name soc.key sm.name in let inputs, outputs = soc.Soc.profile in let inputs = SocUtils.filter_step_params sm.Soc.idx_ins inputs in let outputs = SocUtils.filter_step_params sm.Soc.idx_outs outputs in - let to_param_decl is_an_output (_id,dt) = + let to_param_decl is_an_output (_id,dt) = match is_an_output, dt with - | true, Data.Array(_,_) -> Soc2cUtil.data_type_to_c dt "" ^"/*out*/" + | true, Data.Array(_,_) -> Soc2cUtil.data_type_to_c dt "" ^"/*out*/" (* arrays are already pointers... *) | false, _ -> Soc2cUtil.data_type_to_c dt "" | true, _ -> Soc2cUtil.data_type_to_c dt "*" in - let to_param out (id,dt) = + let to_param out (id,dt) = match out, dt with | true, Data.Array(_,_) -> Soc2cUtil.data_type_to_c dt id ^"/*out*/" | false, _ -> Soc2cUtil.data_type_to_c dt id @@ -264,7 +264,7 @@ let (get_step_prototype : Soc.step_method -> Soc.t -> string * string * string) let params = String.concat "," (in_params@out_params) in let params_decl = String.concat "," (in_params_decl@out_params_decl) in let ctype = match inputs with - | (_,t)::_ -> + | (_,t)::_ -> Printf.sprintf "sizeof(%s)" (Soc2cUtil.data_type_to_c t "") | [] -> "" (* soc without intputs won't need this output *) in @@ -272,8 +272,8 @@ let (get_step_prototype : Soc.step_method -> Soc.t -> string * string * string) Printf.sprintf "void %s(%s);\n" sname params_decl, Printf.sprintf "void %s(%s){\n" sname params, ctype - else - let ctx = Printf.sprintf "%s_type* ctx" (get_ctx_name soc.key) in + else + let ctx = Printf.sprintf "%s_type* _ctx" (get_ctx_name soc.key) in let ctx_decl = Printf.sprintf "%s_type*" (get_ctx_name soc.key) in Printf.sprintf "void %s(%s,%s);\n" sname params_decl ctx_decl, Printf.sprintf "void %s(%s,%s){" sname params ctx, diff --git a/lib/soc2cStack.mli b/lib/soc2cIoArgs.mli similarity index 100% rename from lib/soc2cStack.mli rename to lib/soc2cIoArgs.mli diff --git a/lib/soc2cIoCtx.ml b/lib/soc2cIoCtx.ml new file mode 100644 index 0000000000000000000000000000000000000000..1282d6589ff47f6e69023e4dc4140c12ea924ff3 --- /dev/null +++ b/lib/soc2cIoCtx.ml @@ -0,0 +1,275 @@ +(* Time-stamp: <modified the 18/06/2024 (at 15:15) by Erwan Jahier> *) + +open Soc2cUtil +open Soc2cIdent +open Soc + + +let (mem_interface : Soc.t -> string -> bool) = + fun soc id -> + let ins,outs = soc.profile in + List.mem_assoc id ins || List.mem_assoc id outs + +let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) = + fun soc -> function + | Const("true", _) -> "_true" + | Const("false", _) -> "_false" + | Const(id, _) -> id2s id + | Var ("_memory",_) -> (* Clutch! it's not an interface var... *) "_ctx->_memory" + | Var (id,_) -> + if not (mem_interface soc id) then id2s id + else + (* if SocUtils.is_memory_less soc then *) + (* Printf.sprintf "%s.%s" (get_ctx_name soc.key) (id2s id) *) + (* else *) + 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) -> assert false (* should not occur *) + + +(* exported *) +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 + | 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.String + | Data.Array(_) -> + 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 t_str + +let (gen_assign_var_expr : Soc.t -> Soc.var_expr -> Soc.var_expr -> string) = +fun soc vi vo -> + match vi,vo with + | Slice _, _ -> assert false + | _, Slice _ -> assert false + | _,_ -> + gen_assign (Soc.data_type_of_var_expr vi) + (string_of_var_expr soc vi) (string_of_var_expr soc vo) + + +let (step_name : Soc.key -> string -> string) = + fun sk sm -> + let str = Printf.sprintf "%s_%s" (Soc2cIdent.get_soc_name sk) sm in + id2s str + +let (ctx_var : var_kind -> Soc.t -> Lv6Id.t -> string) = + fun opt _soc id -> + match opt with + | M_IO -> Printf.sprintf "_ctx->%s" (id2s id) + | Local -> Printf.sprintf "%s" (id2s id) + + +let (list_split : 'a list -> int -> 'a list * 'a list) = + fun l s -> + let rec aux s l acc = + match s,l with + | 0, _ -> List.rev acc,l + | _, x::l -> aux (s-1) l (x::acc) + | _, [] -> assert false + in + aux s l [] + +let _ = assert (list_split [1;2;3;4;5;6] 3 = ([1;2;3],[4;5;6])) + +let (inline_soc : + Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> string option) = + fun soc called_soc vel_out vel_in -> + let called_soc_name,_,_ = called_soc.key in + match called_soc_name with + (* those soc are inlined. Currently we only inline ite because + of its polymorphism. Maybe simple arith operators + (+-,*,/,etc.) should be inlined too. *) + | "Lustre::if" -> + let c,vel_in= match vel_in with [] -> assert false | c::l -> c,l in + let s = (List.length vel_out) in + let vel_in_t, vel_in_e = list_split vel_in s in + let lt = List.map2 (gen_assign_var_expr soc) vel_out vel_in_t in + let le = List.map2 (gen_assign_var_expr soc) vel_out vel_in_e in + let str = " if ("^(string_of_var_expr soc c) ^ " == _true) {\n "^ + (String.concat " " lt)^ " } else {\n "^ + (String.concat " " le)^ " }\n" + in + Some str + | _ -> + try + if + Lv6MainArgs.global_opt.Lv6MainArgs.gen_c_inline_predef + && Soc2cPredef.is_call_supported called_soc.key + then + let vel_in = List.map (string_of_var_expr soc) vel_in in + let vel_out = List.map (string_of_var_expr soc) vel_out in + Some (Soc2cPredef.gen_call called_soc.key soc vel_out vel_in) + else + None + with Not_found -> +(* Printf.eprintf "won't inline %s\n" called_soc_name; *) + None +(* exported *) +let (inlined_soc : Soc.key -> bool) = + fun key -> + let soc_name,_,_ = key in + soc_name = "Lustre::if" || Soc2cPredef.is_call_supported key + + +(* exported *) +let (gen_step_call : Soc.t -> Soc.t -> bool -> Soc.var_expr list -> Soc.var_expr list -> + string -> string -> string -> string) = + fun soc called_soc para vel_out vel_in ctx sname step_arg -> + match inline_soc soc called_soc vel_out vel_in with + | Some str -> str + | None -> + let vel_in = List.map (string_of_var_expr soc) vel_in in + let vel_out = List.map (string_of_var_expr soc) vel_out in + let soc_name = get_base_name called_soc.key in + let set_inputs_str = + if vel_in = [] then "" (* occurs for pre *) else + let inputs = fst called_soc.profile in + let outputs = snd called_soc.profile in + let l = try ( + if para then + (List.map2 (fun (name, _t) ve -> + Printf.sprintf " %s_TASK_setin_%s(%s, %s);\n" soc_name name ctx ve + ) + inputs vel_in) + @ + [Printf.sprintf " %s_TASK_START(%s);\n" soc_name ctx] + else + List.map2 (fun (name, t) ve -> + gen_assign t (Printf.sprintf "%s.%s" ctx name) ve) + inputs vel_in + ) with _ -> ( + Printf.printf "E: bad number of arguments:\n- %s\n- %s\n\n- %s\n- %s\n%!" + (String.concat "," (List.split inputs |> fst)) + (String.concat "," vel_in) + (String.concat "," (List.split outputs |> fst)) + (String.concat "," vel_out); + assert false (* are all parameters necessarily used? *) + ) + in + (String.concat "" l) + in + let get_output_str = + if vel_out = [] then "" (* occurs for pre *) else + let outputs = snd called_soc.profile in + let l = try ( + if para then + Printf.sprintf " %s_TASK_JOIN(%s);\n" soc_name ctx:: + (List.map2 + (fun (name,_t) ve -> + Printf.sprintf " %s_TASK_getout_%s(%s, &%s);\n" soc_name name ctx ve + ) + outputs vel_out) + else + (List.map2 + (fun (name,t) ve -> + let ve2 = Printf.sprintf "%s.%s" ctx name in + gen_assign t ve ve2) + outputs vel_out) + ) with _ -> assert false + in + (String.concat "" l) ^"\n" + in + let call_step_str = (if para then "//" else " ") ^ Printf.sprintf " %s(%s);\n" + (step_name called_soc.key sname) step_arg in + (set_inputs_str ^ call_step_str ^get_output_str) + + +let (get_procedures: Soc.t -> Soc.key list) = + fun soc -> + let rec of_gao = function + | Case (_, id_gaol_l, _) -> + id_gaol_l |> List.map (fun (_, gaol) -> List.map of_gao gaol) |> List.flatten |> List.flatten + | Call (_, Procedure (k, None), _,_) -> + if not Lv6MainArgs.global_opt.Lv6MainArgs.gen_c_inline_predef || not (Soc2cPredef.is_call_supported k) then + [k] + else + [] + | Call (_, _, _,_) -> [] + in + soc.step |> List.map (fun sm -> match sm.impl with + | Gaol (_, gaol) -> List.map of_gao gaol |> List.flatten + | Iterator(_, sk,_) + | Condact(sk,_) -> [sk] + | _ -> [] + ) + |> List.flatten + |> Mypervasives.list_rm_dup + |> List.filter (fun sk -> not (inlined_soc sk)) + +(* exported *) +let (typedef_of_soc : Soc.t -> string * Soc.key list) = + fun soc -> + (* Printf.printf "typedef_of_soc: %s \n%!" (soc.key |> fun (id,_,_) -> id); *) + + if inlined_soc soc.key then "",[] (* don't generate code if inlined *) else + let ctx_name = get_ctx_name soc.key in + let ctx_name_type = ctx_name^"_type" in + let il,ol = soc.profile in + let str = Printf.sprintf "/* %s */\ntypedef struct {\n /*INPUTS*/\n" ctx_name in + let str = List.fold_left (fun acc v -> acc^ (string_of_flow_decl v)) str il in + let str = str ^ " /*OUTPUTS*/\n" in + let str = List.fold_left (fun acc v -> acc^ (string_of_flow_decl v)) str ol in + let str = str ^ + (match soc.memory with + | No_mem -> "" + | Mem t -> + Printf.sprintf " /*Memory cell*/\n %s ;\n" + (id2s (Soc2cUtil.data_type_to_c t "_memory")) + | Mem_hidden -> "" + ) + in + let str = str ^ (if soc.instances <> [] then " /*INSTANCES*/\n" else "") in + let il, _get_index = Soc2cInstances.to_array soc.instances in + let string_of_instance (sk,i) = + let n = get_ctx_name sk in + Printf.sprintf " %s_type %s_tab[%d];\n" n n i + in + let str = List.fold_left (fun acc inst -> acc^(string_of_instance inst)) str il in + let procedures = get_procedures soc in + let str = str ^ (if procedures <> [] then + " /*PROCEDURES*/\n " ^ + (String.concat "\n " + (List.map (fun k -> (get_ctx_name k) ^ "_type "^ (get_ctx_name k)^";") procedures + )) ^"\n" + else "") + in + let str = str ^ (if soc.tasks <> [] then " /*TASKS*/\n" else "") in + let il, _get_index = Soc2cInstances.to_array soc.tasks in + let string_of_task (sk,i) = + let n_task = Printf.sprintf "%s_TASK" (get_base_name sk) in + Printf.sprintf " %s_type %s_tab[%d];\n" n_task n_task i + in + let str = List.fold_left (fun acc inst -> acc^(string_of_task inst)) str il in + + + let str = Printf.sprintf "%s} %s;\n\n" str ctx_name_type in + str, procedures + +let (get_step_prototype : Soc.step_method -> Soc.t -> string * string * string) = + fun sm soc -> + let sname = step_name soc.key sm.name in + let ctx = + Printf.sprintf "%s_type* _ctx" (get_ctx_name soc.key) + in + let ctx_decl = + Printf.sprintf "%s_type*" (get_ctx_name soc.key) + in + let inputs, _ = soc.Soc.profile in + let ctype = match inputs with + | (_,t)::_ -> + Printf.sprintf "sizeof(%s)" (Soc2cUtil.data_type_to_c t "") + | [] -> "" (* soc without intputs won't need this output *) + in + Printf.sprintf "void %s(%s);\n" sname ctx_decl, + Printf.sprintf "void %s(%s){\n" sname ctx, + ctype diff --git a/lib/soc2cHeap.mli b/lib/soc2cIoCtx.mli similarity index 83% rename from lib/soc2cHeap.mli rename to lib/soc2cIoCtx.mli index 53a6d726caaec328bfa44f36d7245e8bb9adcd89..83cc8142be3f9117d1b04f62b4607cb29ae00d7c 100644 --- a/lib/soc2cHeap.mli +++ b/lib/soc2cIoCtx.mli @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 26/06/2017 (at 16:41) by Erwan Jahier> *) +(* Time-stamp: <modified the 14/06/2024 (at 16:18) by Erwan Jahier> *) (** Gathers all entities (functions, types) that implement the heap-based C generator. *) @@ -20,7 +20,7 @@ val string_of_var_expr: Soc.t -> Soc.var_expr -> string (* [ctx_var vk id] *) val ctx_var : Soc2cUtil.var_kind -> Soc.t -> Lv6Id.t -> string - + (* [gen_step_call soc called_soc vel_out vel_in ctx sname step_arg] Generates the C code that performs the call to a step method of [called_soc] from [soc]. @@ -30,9 +30,10 @@ val ctx_var : Soc2cUtil.var_kind -> Soc.t -> Lv6Id.t -> string - [step_arg] is a string holding the arg of the step (empty for proc call) *) -val gen_step_call : Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list -> +val gen_step_call : Soc.t -> Soc.t -> bool -> Soc.var_expr list -> Soc.var_expr list -> string -> string -> string -> string (* should this soc be inlined? (depends on Lv6MainArgs.global_opt) *) val inlined_soc : Soc.key -> bool -val typedef_of_soc : Soc.t -> string +(* also returns the socs it depends on *) +val typedef_of_soc : Soc.t -> string * Soc.key list diff --git a/lib/soc2cPredef.ml b/lib/soc2cPredef.ml index 7565cb73ee11cbdc1dbee6023580be69f8835ac5..6b1d848a3bc069c3c51dfa575cc6b92630101415 100644 --- a/lib/soc2cPredef.ml +++ b/lib/soc2cPredef.ml @@ -1,11 +1,11 @@ -(* Time-stamp: <modified the 29/08/2019 (at 17:05) by Erwan Jahier> *) +(* Time-stamp: <modified the 03/06/2024 (at 15:55) by Erwan Jahier> *) -(* A local exception used to check if a predef is supported. +(* A local exception used to check if a predef is supported. The idea is that when gen_call_do is called with empty lists, it means that it is called to check if the predef is supported. This (ugly but local) trick is to avoid to duplicate the match - done in gen_call_do + done in gen_call_do *) exception Is_supported @@ -45,16 +45,23 @@ let stdbin_eq_struct is_eq (_op,tl,_) ll rl = | ([],[]) -> raise Is_supported | _ -> assert false -let stduna op ll rl = +let stduna op ll rl = match (ll,rl) with | ([l], [r]) -> Printf.sprintf " %s = %s %s;\n" l op r | ([],[]) -> raise Is_supported | _ -> assert false -let stdimpl ll rl = +let stdimpl ll rl = match (ll,rl) with | ([l], [r1;r2]) -> Printf.sprintf "%s = !%s | %s;\n" l r1 r2 | ([],[]) -> raise Is_supported + | _ -> assert false + +(* dead code? *) +let stdbin_ite ll rl = + match (ll,rl) with + | ([l], [c; r1;r2]) -> Printf.sprintf "%s = if(%s) !%s else %s;\n" l c r1 r2 + | ([],[]) -> raise Is_supported | _ -> assert false @@ -72,10 +79,10 @@ let (gen_call_do : Soc.key -> string list -> string list -> string) = | "Lustre::ruminus",_,_ -> lstduna "-" | "Lustre::not",_,_ -> lstduna "!" - | "Lustre::mod",_,_ -> lstdbin "%" - | "Lustre::plus",_,_ -> lstdbin "+" - | "Lustre::iplus",_,_ -> lstdbin "+" - | "Lustre::rplus",_,_ -> lstdbin "+" + | "Lustre::mod",_,_ -> lstdbin "%" + | "Lustre::plus",_,_ -> lstdbin "+" + | "Lustre::iplus",_,_ -> lstdbin "+" + | "Lustre::rplus",_,_ -> lstdbin "+" | "Lustre::times",_,_ -> lstdbin "*" | "Lustre::itimes",_,_ -> lstdbin "*" | "Lustre::rtimes",_,_ -> lstdbin "*" @@ -111,7 +118,7 @@ let (gen_call_do : Soc.key -> string list -> string list -> string) = | "Lustre::impl",_,_ -> lstdimpl () | (("Lustre::eq"|"Lustre::equal"),(Data.Array _)::_,_) -> - stdbin_eq_array true sk vel_in vel_out + stdbin_eq_array true sk vel_in vel_out | (("Lustre::neq"|"Lustre::diff"),(Data.Array _)::_,_) -> stdbin_eq_array false sk vel_in vel_out | (("Lustre::eq"|"Lustre::equal"),(Data.Struct _)::_,_)-> @@ -124,16 +131,18 @@ let (gen_call_do : Soc.key -> string list -> string list -> string) = | "Lustre::neq",_,_ -> lstdbin "!=" | "Lustre::diff",_,_ -> lstdbin "!=" + | "Lustre::if",_,_ -> stdbin_ite vel_in vel_out + | _ -> raise Not_found let (gen_call : Soc.key -> Soc.t -> string list -> string list -> string) = - fun sk _soc vel_in vel_out -> + fun sk _soc vel_in vel_out -> assert ((vel_in,vel_out) <> ([],[])); gen_call_do sk vel_in vel_out let (is_call_supported : Soc.key -> bool) = - fun sk -> + fun sk -> try ignore (gen_call_do sk [] []); assert false (* sno *) - with + with | Is_supported -> true - | Not_found -> false + | Not_found -> false diff --git a/lib/soc2cUtil.ml b/lib/soc2cUtil.ml index a9a890213556c0ab6acba17cd257625aa19571ec..802aee324dfa960fcf7183c8da94f9331fc97ebb 100644 --- a/lib/soc2cUtil.ml +++ b/lib/soc2cUtil.ml @@ -1,25 +1,24 @@ -(* Time-stamp: <modified the 06/03/2020 (at 13:35) by Erwan Jahier> *) +(* Time-stamp: <modified the 14/06/2024 (at 14:09) by Erwan Jahier> *) open Soc2cIdent open Data type var_kind = (* XXX poor names: fixme! *) - | ML_IO of Soc.key (* For memoryless soc in Heap mode *) | M_IO (* *) | Local (* for soc local variables *) -let (type_to_string : Data.t -> string -> string) = - fun v n -> - (* in order to print arrays of arrays type size in the good order, +let (type_to_string : Data.t -> string -> string) = + fun v n -> + (* in order to print arrays of arrays type size in the good order, we accumulate the array size when v of of type array, and we print it otherwise (finish). *) let rec finish acc str = match acc with |[] -> str - | s::ts -> Printf.sprintf "%s[%d]" (finish ts str) s - in + | s::ts -> Printf.sprintf "%s[%d]" (finish ts str) s + in let rec aux acc v n = match v with | Bool -> finish acc ("_boolean "^n) @@ -30,18 +29,18 @@ let (type_to_string : Data.t -> string -> string) = | Enum (s, _sl) -> finish acc (id2s s ^" "^n) | Struct (sid,_) -> finish acc ((id2s sid)^" "^n) | Array (ty, sz) -> aux (sz::acc) ty n - | Alpha nb -> finish acc ("alpha_"^(string_of_int nb)^" "^n) + | Alpha nb -> finish acc ("alpha_"^(string_of_int nb)^" "^n) | Alias(a,_) -> finish acc (a^" "^n) in aux [] v n -let string_of_flow_decl (id, t) = - Printf.sprintf " %s;\n" (type_to_string t (id2s id)) +let string_of_flow_decl (id, t) = + Printf.sprintf " %s;\n" (type_to_string t (id2s id)) open Soc -let string_of_flow_decl_w7annot gaol (id, t) = +let string_of_flow_decl_w7annot gaol (id, t) = let decl = string_of_flow_decl (id, t) in let get_pre_var inst = let rec aux gaol = @@ -59,12 +58,12 @@ let string_of_flow_decl_w7annot gaol (id, t) = | Some x -> Some x | None -> aux rest ) - | Call(_, Method((inst2,("Lustre::pre",_,_)),"set"),outs,_) -> + | Call(_, Method((inst2,("Lustre::pre",_,_)),"set",_),outs,_) -> if inst2 = inst then let output_list = List.map SocUtils.lustre_string_of_var_expr outs in let id2 = String.concat "," output_list in Some id2 - else + else aux rest | _ -> aux rest @@ -81,59 +80,59 @@ let string_of_flow_decl_w7annot gaol (id, t) = let input_list = List.map SocUtils.lustre_string_of_var_expr ins in match ao, input_list with | Assign,_ -> None - | Procedure ("Lustre::ruminus",_,_), [a] -> Some (Printf.sprintf "-%s" a) - | Procedure ("Lustre::iuminus",_,_), [a] -> Some (Printf.sprintf "-%s" a) - | Procedure ("Lustre::uminus",_,_), [a] -> Some (Printf.sprintf "-%s" a) - | Procedure ("Lustre::not",_,_), [a] -> Some (Printf.sprintf "not(%s)" a) - | Procedure ("Lustre::real2int",_,_), [a] -> Some (Printf.sprintf "real2int(%s)" a) - | Procedure ("Lustre::int2real",_,_), [a] -> Some (Printf.sprintf "int2real(%s)" a) - | Procedure ("Lustre::mod",_,_), [a;b] -> Some (Printf.sprintf "%s mod %s" a b) - | Procedure ("Lustre::iplus" ,_,_), [a;b] -> Some (Printf.sprintf "%s+%s" a b) - | Procedure ("Lustre::rplus" ,_,_), [a;b] -> Some (Printf.sprintf "%s+%s" a b) - | Procedure ("Lustre::plus" ,_,_), [a;b] -> Some (Printf.sprintf "%s+%s" a b) - | Procedure ("Lustre::times",_,_), [a;b] -> Some (Printf.sprintf "%s*%s" a b) - | Procedure ("Lustre::itimes",_,_), [a;b] -> Some (Printf.sprintf "%s*%s" a b) - | Procedure ("Lustre::rtimes",_,_), [a;b] -> Some (Printf.sprintf "%s*%s" a b) - | Procedure ("Lustre::slash",_,_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) - | Procedure ("Lustre::islash",_,_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) - | Procedure ("Lustre::rslash",_,_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) - | Procedure ("Lustre::div",_,_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) - | Procedure ("Lustre::idiv",_,_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) - | Procedure ("Lustre::rdiv",_,_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) - | Procedure ("Lustre::minus",_,_), [a;b] -> Some (Printf.sprintf "%s-%s" a b) - | Procedure ("Lustre::iminus",_,_), [a;b] -> Some (Printf.sprintf "%s-%s" a b) - | Procedure ("Lustre::rminus",_,_), [a;b] -> Some (Printf.sprintf "%s-%s" a b) - | Procedure ("Lustre::lt" ,_,_), [a;b] -> Some (Printf.sprintf "%s<%s" a b) - | Procedure ("Lustre::gt" ,_,_), [a;b] -> Some (Printf.sprintf "%s>%s" a b) - | Procedure ("Lustre::lte",_,_), [a;b] -> Some (Printf.sprintf "%s<=%s" a b) - | Procedure ("Lustre::gte",_,_), [a;b] -> Some (Printf.sprintf "%s>=%s" a b) - | Procedure ("Lustre::ilt" ,_,_), [a;b] -> Some (Printf.sprintf "%s<%s" a b) - | Procedure ("Lustre::igt" ,_,_), [a;b] -> Some (Printf.sprintf "%s>%s" a b) - | Procedure ("Lustre::ilte",_,_), [a;b] -> Some (Printf.sprintf "%s<=%s" a b) - | Procedure ("Lustre::igte",_,_), [a;b] -> Some (Printf.sprintf "%s>=%s" a b) - | Procedure ("Lustre::rlt" ,_,_), [a;b] -> Some (Printf.sprintf "%s<%s" a b) - | Procedure ("Lustre::rgt" ,_,_), [a;b] -> Some (Printf.sprintf "%s>%s" a b) - | Procedure ("Lustre::rlte",_,_), [a;b] -> Some (Printf.sprintf "%s<=%s" a b) - | Procedure ("Lustre::rgte",_,_), [a;b] -> Some (Printf.sprintf "%s>=%s" a b) - | Procedure ("Lustre::impl",_,_), [a;b] -> Some (Printf.sprintf "%s=>%s" a b) - | Procedure ("Lustre::xor",_,_), [a;b] -> Some (Printf.sprintf "%s xor %s" a b) - | Procedure ("Lustre::neq",_,_), [a;b] -> Some (Printf.sprintf "not(%s=%s)" a b) - | Procedure ("Lustre::eq",_,_), [a;b] -> Some (Printf.sprintf "%s=%s" a b) - | Procedure ("Lustre::or",_,_), [a;b] -> Some (Printf.sprintf "%s or %s" a b) - | Procedure ("Lustre::and",_,_), [a;b] -> Some (Printf.sprintf "%s and %s" a b) - | Procedure ("Lustre::if",_,_),[c;t;e] -> + | Procedure (("Lustre::ruminus",_,_),_), [a] -> Some (Printf.sprintf "-%s" a) + | Procedure (("Lustre::iuminus",_,_),_), [a] -> Some (Printf.sprintf "-%s" a) + | Procedure (("Lustre::uminus",_,_),_), [a] -> Some (Printf.sprintf "-%s" a) + | Procedure (("Lustre::not",_,_),_), [a] -> Some (Printf.sprintf "not(%s)" a) + | Procedure (("Lustre::real2int",_,_),_), [a] -> Some (Printf.sprintf "real2int(%s)" a) + | Procedure (("Lustre::int2real",_,_),_), [a] -> Some (Printf.sprintf "int2real(%s)" a) + | Procedure (("Lustre::mod",_,_),_), [a;b] -> Some (Printf.sprintf "%s mod %s" a b) + | Procedure (("Lustre::iplus" ,_,_),_), [a;b] -> Some (Printf.sprintf "%s+%s" a b) + | Procedure (("Lustre::rplus" ,_,_),_), [a;b] -> Some (Printf.sprintf "%s+%s" a b) + | Procedure (("Lustre::plus" ,_,_),_), [a;b] -> Some (Printf.sprintf "%s+%s" a b) + | Procedure (("Lustre::times",_,_),_), [a;b] -> Some (Printf.sprintf "%s*%s" a b) + | Procedure (("Lustre::itimes",_,_),_), [a;b] -> Some (Printf.sprintf "%s*%s" a b) + | Procedure (("Lustre::rtimes",_,_),_), [a;b] -> Some (Printf.sprintf "%s*%s" a b) + | Procedure (("Lustre::slash",_,_),_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) + | Procedure (("Lustre::islash",_,_),_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) + | Procedure (("Lustre::rslash",_,_),_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) + | Procedure (("Lustre::div",_,_),_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) + | Procedure (("Lustre::idiv",_,_),_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) + | Procedure (("Lustre::rdiv",_,_),_), [a;b] -> Some (Printf.sprintf "%s/%s" a b) + | Procedure (("Lustre::minus",_,_),_), [a;b] -> Some (Printf.sprintf "%s-%s" a b) + | Procedure (("Lustre::iminus",_,_),_), [a;b] -> Some (Printf.sprintf "%s-%s" a b) + | Procedure (("Lustre::rminus",_,_),_), [a;b] -> Some (Printf.sprintf "%s-%s" a b) + | Procedure (("Lustre::lt" ,_,_),_), [a;b] -> Some (Printf.sprintf "%s<%s" a b) + | Procedure (("Lustre::gt" ,_,_),_), [a;b] -> Some (Printf.sprintf "%s>%s" a b) + | Procedure (("Lustre::lte",_,_),_), [a;b] -> Some (Printf.sprintf "%s<=%s" a b) + | Procedure (("Lustre::gte",_,_),_), [a;b] -> Some (Printf.sprintf "%s>=%s" a b) + | Procedure (("Lustre::ilt" ,_,_),_), [a;b] -> Some (Printf.sprintf "%s<%s" a b) + | Procedure (("Lustre::igt" ,_,_),_), [a;b] -> Some (Printf.sprintf "%s>%s" a b) + | Procedure (("Lustre::ilte",_,_),_), [a;b] -> Some (Printf.sprintf "%s<=%s" a b) + | Procedure (("Lustre::igte",_,_),_), [a;b] -> Some (Printf.sprintf "%s>=%s" a b) + | Procedure (("Lustre::rlt" ,_,_),_), [a;b] -> Some (Printf.sprintf "%s<%s" a b) + | Procedure (("Lustre::rgt" ,_,_),_), [a;b] -> Some (Printf.sprintf "%s>%s" a b) + | Procedure (("Lustre::rlte",_,_),_), [a;b] -> Some (Printf.sprintf "%s<=%s" a b) + | Procedure (("Lustre::rgte",_,_),_), [a;b] -> Some (Printf.sprintf "%s>=%s" a b) + | Procedure (("Lustre::impl",_,_),_), [a;b] -> Some (Printf.sprintf "%s=>%s" a b) + | Procedure (("Lustre::xor",_,_),_), [a;b] -> Some (Printf.sprintf "%s xor %s" a b) + | Procedure (("Lustre::neq",_,_),_), [a;b] -> Some (Printf.sprintf "not(%s=%s)" a b) + | Procedure (("Lustre::eq",_,_),_), [a;b] -> Some (Printf.sprintf "%s=%s" a b) + | Procedure (("Lustre::or",_,_),_), [a;b] -> Some (Printf.sprintf "%s or %s" a b) + | Procedure (("Lustre::and",_,_),_), [a;b] -> Some (Printf.sprintf "%s and %s" a b) + | Procedure (("Lustre::if",_,_),_),[c;t;e] -> Some (Printf.sprintf "if %s then %s else %s" c t e) - - | Method((_,("Lustre::arrow",_,_)),_), [a;b] -> Some (Printf.sprintf "%s -> %s" a b) - | Method((_,("Lustre::current",_,_)),_), [_;b] -> + + | Method((_,("Lustre::arrow",_,_)),_,_), [a;b] -> Some (Printf.sprintf "%s -> %s" a b) + | Method((_,("Lustre::current",_,_)),_,_), [_;b] -> Some (Printf.sprintf "current(%s)" b) - - | Method((inst,("Lustre::pre",_,_)),"get"),_ -> + + | Method((inst,("Lustre::pre",_,_)),"get",_),_ -> let id = get_pre_var inst in Some (Printf.sprintf "pre(%s)" id) - - | Method((_,(id,_,_)),_),_ - | Procedure(id,_,_),_ -> + + | Method((_,(id,_,_)),_,_),_ + | Procedure((id,_,_),_),_ -> let inputs = String.concat "," input_list in let id = if String.length id > 8 && String.sub id 0 8 = "Lustre::" then String.sub id 8 ((String.length id) - 8) else id @@ -151,23 +150,23 @@ let string_of_flow_decl_w7annot gaol (id, t) = match get_def id gaol, cv with | None,_ -> None | Some res, "true" -> (* XXX: non !*) - Some ("("^res ^ ") when " ^ id2) + Some ("("^res ^ ") when " ^ id2) | Some res, "false" -> - Some ("("^res ^ ") when not " ^ id2) - | Some res, _ -> - Some (Printf.sprintf "(%s) when %s(%s)" res id2 cv) + Some ("("^res ^ ") when not " ^ id2) + | Some res, _ -> + Some (Printf.sprintf "(%s) when %s(%s)" res id2 cv) ) | Some x -> Some x in List.fold_left f None l | Call([Var(v,_)],Assign,[Var(v2,_)],_) -> if v = id then Some (Printf.sprintf "%s=%s" v v2) else None - | Call(_::_,Assign,_ins,_) -> + | Call(_::_,Assign,_ins,_) -> (* Printf.printf " no def found for %s (tuple assign)\n" id;flush stdout; *) None | Call([Var(v,_)],ao,ins,_) -> if v = id then string_of_atomic_operation ao ins else None - | Call([_],_,_,_) -> None (* can something be done here? *) + | Call([_],_,_,_) -> None (* can something be done here? *) | Call([],_,_,_) -> None (* and here? *) | _ -> None and get_def id gaol = @@ -183,7 +182,7 @@ let string_of_flow_decl_w7annot gaol (id, t) = | None -> (* Printf.printf " no def found for %s\n" id;flush stdout; *) decl - | Some expr -> + | Some expr -> Printf.sprintf "%s /* @@ -191,17 +190,17 @@ LUSDEF:%s %s LUSEND */ -" +" decl id expr let (data_type_to_c: Data.t -> string -> string) = - fun v n -> + fun v n -> let rec finish acc str = match acc with |[] -> str | s::ts -> Printf.sprintf "%s[%d]" (finish ts str) s - in + in let rec aux acc v n = match v with | Bool -> finish acc ("_boolean "^n) @@ -212,21 +211,21 @@ let (data_type_to_c: Data.t -> string -> string) = | Enum (s, _sl) -> finish acc (id2s s ^" "^n) | Struct (sid,_) -> finish acc ((id2s sid)^" "^n) | Array (ty, sz) -> aux (sz::acc) ty n - | Alpha nb -> finish acc ("alpha_"^(string_of_int nb)^" "^n) + | Alpha nb -> finish acc ("alpha_"^(string_of_int nb)^" "^n) | Alias(a,_) -> finish acc (a^" "^n) in aux [] v n let (lic_type_to_c: Lic.type_ -> string -> string) = - fun t n -> + fun t n -> match t with | Lic.Struct_type_eff (_name, fl) -> - let field_to_c (id,(tf,_opt)) = - Printf.sprintf "\n %s;" (data_type_to_c (Lic2soc.lic_to_data_type tf) (id2s id)) + let field_to_c (id,(tf,_opt)) = + Printf.sprintf "\n %s;" (data_type_to_c (Lic2soc.lic_to_data_type tf) (id2s id)) in - ((Printf.sprintf "struct { %s\n }" - (String.concat "" (List.map field_to_c fl)))^ " " ^ n) - | Lic.Enum_type_eff (_name, _l) -> "_integer"^ " " ^ n + ((Printf.sprintf "struct { %s\n }" + (String.concat "" (List.map field_to_c fl)))^ " " ^ n) + | Lic.Enum_type_eff (_name, _l) -> "_integer"^ " " ^ n | _ -> type_to_string (Lic2soc.lic_to_data_type t) n @@ -238,26 +237,26 @@ let (_lic_type_to_c_old: Lic.type_ -> string -> string) = | Lic.External_type_eff (name) -> (long2s name)^ " " ^ n | Lic.Abstract_type_eff (_name, t) -> lic_type_to_c t n | Lic.Enum_type_eff (_name, _l) -> "_integer"^ " " ^ n - | Lic.Array_type_eff (ty, sz) -> + | Lic.Array_type_eff (ty, sz) -> Printf.sprintf "%s %s[%d]" (lic_type_to_c ty "") n sz | Lic.Struct_type_eff (name, fl) -> - let field_to_c (id,(tf,_opt)) = + let field_to_c (id,(tf,_opt)) = Printf.sprintf " %s %s;\n" (lic_type_to_c tf "") (id2s id) in - (Printf.sprintf "struct %s { %s }" - (long2s name) + (Printf.sprintf "struct %s { %s }" + (long2s name) (String.concat "" (List.map field_to_c fl)))^ " " ^ n | Lic.TypeVar Lic.Any -> assert false | Lic.TypeVar Lic.AnyNum -> assert false (* exported *) -let (gen_c_switch : string -> (string * string) list -> string) = +let (gen_c_switch : string -> (string * string) list -> string) = fun cond_var cases -> if Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_no_switch then let l = List.map (fun (v,code) -> - Printf.sprintf " if (%s == %s) {\n%s\n } else {\n" cond_var v code) + Printf.sprintf " if (%s == %s) {\n%s\n } else {\n" cond_var v code) cases in let switch = String.concat "" l in @@ -269,5 +268,3 @@ let (gen_c_switch : string -> (string * string) list -> string) = in let cases = String.concat "" case_list in Printf.sprintf " switch (%s){\n%s}\n" cond_var cases - - diff --git a/lib/soc2cUtil.mli b/lib/soc2cUtil.mli index ce227ba32d99112368a15e4a4f545d1e6f091a2d..ace0bef623b368093ea6ee558b8e7e31c0b9abf2 100644 --- a/lib/soc2cUtil.mli +++ b/lib/soc2cUtil.mli @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 13/09/2016 (at 16:42) by Erwan Jahier> *) +(* Time-stamp: <modified the 05/06/2024 (at 11:08) by Erwan Jahier> *) (** *) @@ -11,12 +11,11 @@ val string_of_flow_decl : string * Data.t -> string val string_of_flow_decl_w7annot : Soc.gao list -> string * Data.t -> string type var_kind = (* XXX poor names: fixme! *) - | ML_IO of Soc.key (* for idents that are part of a MemoryLess soc interface *) - | M_IO (* for idents that are part of a soc interface with Memories*) + | M_IO (* for idents that are part of a soc interface *) | Local (* for soc local variables *) -(** Dependending on Lv6MainArgs.global.soc2_no_switch +(** Dependending on Lv6MainArgs.global.soc2_no_switch [gen_c_switch "c" ["case1","stmt1" ; "case2","stmt2" ; ... ] returns diff --git a/lib/socExec.ml b/lib/socExec.ml index 7e404e508b97f7b02b5ca13be7db794fd5baaf2b..f9e15329c7c01f7fb6c4d046afaa60630473af23 100644 --- a/lib/socExec.ml +++ b/lib/socExec.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 18/09/2019 (at 11:19) by Erwan Jahier> *) +(* Time-stamp: <modified the 14/06/2024 (at 14:11) by Erwan Jahier> *) open Soc open Data @@ -9,20 +9,20 @@ let profile_info = Lv6Verbose.profile_info let (assign_expr : ctx -> var_expr -> var_expr -> ctx) = fun ctx ve_in ve_out -> (* ve_out := ve_in (in ctx) *) - Lv6Verbose.exe ~flag:dbg + Lv6Verbose.exe ~flag:dbg (fun () -> print_string ("\nAssigning "^(SocUtils.string_of_filter ve_out) ^ " to " ^(SocUtils.string_of_filter ve_in) ^ "\n"); flush stdout); { ctx with s = let v = SocExecValue.get_value ctx ve_in in - sadd_partial ctx.s ve_out ctx.cpath v + sadd_partial ctx.s ve_out ctx.cpath v } (* [array_index i v] returns the var_expr v[i] *) let (array_index : int -> var -> var_expr) = - fun i (vn,vt) -> - let vt_elt = + fun i (vn,vt) -> + let vt_elt = match vt with | Array(vt_elt,_) -> vt_elt | _ -> assert false @@ -34,7 +34,7 @@ let rec (soc_step : Soc.step_method -> Soc.tbl -> Soc.t -> SocExecValue.ctx fun step soc_tbl soc ctx -> profile_info ("SocExec.soc_step \n"); let soc_name,_,_ = soc.key in - let ctx = + let ctx = match step.impl with | Extern -> print_string ( @@ -43,7 +43,7 @@ let rec (soc_step : Soc.step_method -> Soc.tbl -> Soc.t -> SocExecValue.ctx ); exit 2 | Predef -> ( - try + try let ctx = SocExecEvalPredef.get soc.key ctx in ctx with Not_found -> (* Not a predef op *) print_string ( @@ -99,18 +99,18 @@ let rec (soc_step : Soc.step_method -> Soc.tbl -> Soc.t -> SocExecValue.ctx (assert (List.length dft_cst = List.length vel_out); List.fold_left2 assign_expr ctx dft_cst vel_out) else - (* We are not on the first step of node_soc; hence we do nothing - and the output will keep their previous value. *) + (* We are not on the first step of node_soc; hence we do nothing + and the output will keep their previous value. *) ctx in let ctx = { ctx with s = sadd ctx.s ("_memory"::ctx.cpath) (B false) } in ctx ) - | Iterator(iter, node_sk, n) -> + | Iterator(iter, node_sk, n) -> let node_soc = SocUtils.find step.lxm node_sk soc_tbl in let node_step = match node_soc.step with [step] -> step | _ -> assert false in let iter_inputs,iter_outputs = soc.profile in - let (proc_name,_,_) = node_soc.key in + let (proc_name,_,_) = node_soc.key in let inst_name = match soc.instances with | [] -> Array.make n proc_name @@ -140,7 +140,7 @@ let rec (soc_step : Soc.step_method -> Soc.tbl -> Soc.t -> SocExecValue.ctx f (i+1) ctx in let ctx = f 0 ctx in - let ctx = + let ctx = if iter <> "map" then let a_in = Var (List.hd iter_inputs) in let a_out = Var (List.hd iter_outputs) in @@ -156,7 +156,7 @@ and (do_gao : Lxm.t -> Soc.tbl -> SocExecValue.ctx -> gao -> SocExecValue.ctx) = fun _lxm soc_tbl ctx gao -> match gao with | Case(id, id_gao_l,lxm) -> ( - try + try let id_val = get_enum id ctx in let gaol = List.assoc id_val id_gao_l in let ctx = List.fold_left (do_gao lxm soc_tbl) ctx gaol in @@ -164,24 +164,24 @@ and (do_gao : Lxm.t -> Soc.tbl -> SocExecValue.ctx -> gao -> SocExecValue.ctx) = with Not_found -> ctx ) | Call(vel_out, Assign, vel_in,_lxm) -> ( - let ctx = + let ctx = assert (List.length vel_in = List.length vel_out); List.fold_left2 assign_expr ctx vel_in vel_out in ctx ) - | Call(vel_out, Procedure sk, vel_in,lxm) -> ( + | Call(vel_out, Procedure (sk,_), vel_in,lxm) -> ( let (proc_name,_,_) = sk in let path_saved = ctx.cpath in let ctx = { ctx with cpath = proc_name::ctx.cpath } in let soc = SocUtils.find lxm sk soc_tbl 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 - { ctx with - cpath = path_saved - } + { ctx with + cpath = path_saved + } ) - | Call(vel_out, Method((inst_name,sk),step_name), vel_in,lxm) -> ( + | Call(vel_out, Method((inst_name,sk),step_name,_), vel_in,lxm) -> ( let path_saved = ctx.cpath in let ctx = { ctx with cpath = inst_name::ctx.cpath } in let soc = SocUtils.find lxm sk soc_tbl in @@ -192,12 +192,12 @@ and (do_gao : Lxm.t -> Soc.tbl -> SocExecValue.ctx -> gao -> SocExecValue.ctx) = let ctx = { ctx with cpath = path_saved } in ctx ) -and (do_step : Lv6Id.t -> step_method -> SocExecValue.ctx -> Soc.tbl -> Soc.t -> +and (do_step : Lv6Id.t -> step_method -> SocExecValue.ctx -> Soc.tbl -> Soc.t -> var_expr list -> var_expr list -> SocExecValue.ctx) = - fun name step ctx soc_tbl soc vel_in vel_out -> + fun name step ctx soc_tbl soc vel_in vel_out -> profile_info ("SocExec.do_step "^name^"\n"); let soc_in_vars, soc_out_vars = soc.profile in - let step_in_vars = filter_params soc soc_in_vars step.idx_ins in + let step_in_vars = filter_params soc soc_in_vars step.idx_ins in let step_out_vars = filter_params soc soc_out_vars step.idx_outs 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 @@ -207,14 +207,14 @@ and (do_step : Lv6Id.t -> step_method -> SocExecValue.ctx -> Soc.tbl -> Soc.t -> (* get the step params from its soc params *) and (filter_params : Soc.t -> Soc.var list -> int list -> Soc.var list) = fun _soc el il -> - let local_nth i l = - try List.nth l i - with _ -> + let local_nth i l = + try List.nth l i + with _ -> print_string ( - "\n*** Cannot get the " ^ (string_of_int (i+1)) ^ + "\n*** Cannot get the " ^ (string_of_int (i+1)) ^ "the element of a list of size " ^ (string_of_int (List.length l))^"\n"); flush stdout; - assert false + assert false in let res = List.map (fun i -> local_nth i el) il in res @@ -223,15 +223,15 @@ and (filter_params : Soc.t -> Soc.var list -> int list -> Soc.var list) = (* [add_data_subst vtnl data_s s] add the data_s to s; *) let (add_data_subst : var list -> Data.subst list -> SocExecValue.substs -> SocExecValue.substs) = - fun vntl_i s ctx_s -> + fun vntl_i s ctx_s -> let s = SocVar.unexpand_profile s vntl_i in List.fold_left (fun acc (id,v) -> sadd acc [id] v) ctx_s s let (read_soc_input : Lv6MainArgs.t -> var list -> Data.vntl -> out_channel -> substs -> substs) = - fun opt vntl_i exp_vntl_i_str oc ctx_s -> + fun opt vntl_i exp_vntl_i_str oc ctx_s -> let s:Data.subst list = - RifIO.read ~debug:(Lv6Verbose.level()>0) stdin + RifIO.read ~debug:(Lv6Verbose.level()>0) stdin (if opt.Lv6MainArgs.rif then None else Some oc) exp_vntl_i_str in add_data_subst vntl_i s ctx_s @@ -279,15 +279,15 @@ let (f : Lv6MainArgs.t -> Soc.tbl -> Soc.key -> unit) = fun opt soc_tbl sk -> let soc = try SocMap.find sk soc_tbl with Not_found -> assert false in let ctx = SocExecValue.create_ctx soc_tbl soc in - let exp_vntl_i = SocVar.expand_profile true false (fst soc.profile) in - let exp_vntl_o = SocVar.expand_profile true false (snd soc.profile) in - let oc = + let exp_vntl_i = SocVar.expand_profile true SocVar.PP (fst soc.profile) in + let exp_vntl_o = SocVar.expand_profile true SocVar.PP (snd soc.profile) in + let oc = if opt.Lv6MainArgs.outfile = "" then stdout else let rif_file = - try (Filename.chop_extension opt.Lv6MainArgs.outfile) ^ ".rif" + try (Filename.chop_extension opt.Lv6MainArgs.outfile) ^ ".rif" with _ -> opt.Lv6MainArgs.outfile ^ ".rif" in - open_out rif_file + open_out rif_file in Lv6util.entete oc "#" ""; RifIO.write_interface oc exp_vntl_i exp_vntl_o None None; @@ -296,6 +296,5 @@ let (f : Lv6MainArgs.t -> Soc.tbl -> Soc.key -> unit) = loop_step opt soc_tbl (fst soc.profile) exp_vntl_i exp_vntl_o ctx exp_vntl_i exp_vntl_o soc ctx 1 oc with RifIO.Bye -> close_out oc - -(**************************************************************************************) +(**************************************************************************************) diff --git a/lib/socExecDbg.ml b/lib/socExecDbg.ml index 763e22f7dc561649071d623e95a3727ca1032e81..4111a8b631e47c1e779112df8c51ce466d62e284 100644 --- a/lib/socExecDbg.ml +++ b/lib/socExecDbg.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 16/03/2020 (at 11:37) by Erwan Jahier> *) +(* Time-stamp: <modified the 14/06/2024 (at 14:09) by Erwan Jahier> *) open Soc open Data open SocExecValue @@ -11,7 +11,7 @@ let (do_step : Soc.tbl -> Soc.t -> SocExecValue.ctx -> SocExecValue.ctx) = ctx (****************************************************************************) -(* XXX duplication of SocExec ! +(* XXX duplication of SocExec ! Maybe this code below, that is more general, is as (in)efficient ? @@ -22,7 +22,7 @@ let profile_info = Lv6Verbose.profile_info let (assign_expr : SocExecValue.ctx -> var_expr -> var_expr -> SocExecValue.ctx) = fun ctx ve_in ve_out -> (* ve_out := ve_in (in ctx) *) Lv6Verbose.exe - ~flag:dbg + ~flag:dbg (fun () -> print_string ("\nAssigning "^(SocUtils.string_of_filter ve_out) ^ " to " ^(SocUtils.string_of_filter ve_in) ^ "... "); @@ -40,9 +40,9 @@ let make_simple_sinfo lxm name is os = Some(fun () -> let atom = { - RdbgEvent.str = name; - RdbgEvent.file = Lxm.file lxm ; - RdbgEvent.line = Lxm.line lxm ,Lxm.line lxm ; + RdbgEvent.str = name; + RdbgEvent.file = Lxm.file lxm ; + RdbgEvent.line = Lxm.line lxm ,Lxm.line lxm ; RdbgEvent.char = Lxm.cstart lxm, Lxm.cend lxm; RdbgEvent.stack = None; } @@ -50,23 +50,23 @@ let make_simple_sinfo lxm name is os = { RdbgEvent.expr = Expr.Var (Lxm.str lxm); RdbgEvent.atoms = [atom]; - RdbgEvent.more = None; + RdbgEvent.more = None; RdbgEvent.in_subst = is ; RdbgEvent.out_subst = os ; } ) - + let make_sinfo lxm name_opt ectx in_subst out_subst = (* if l <= 0 then None else *) Some(fun () -> let atom = { - RdbgEvent.str = (match name_opt with Some n -> n | None -> Lxm.str lxm); + RdbgEvent.str = (match name_opt with Some n -> n | None -> Lxm.str lxm); (* RdbgEvent.str = (Lxm.str lxm); *) - RdbgEvent.file = Lxm.file lxm ; - RdbgEvent.line = Lxm.line lxm ,Lxm.line lxm ; + RdbgEvent.file = Lxm.file lxm ; + RdbgEvent.line = Lxm.line lxm ,Lxm.line lxm ; RdbgEvent.char = Lxm.cstart lxm, Lxm.cend lxm; - RdbgEvent.stack = + RdbgEvent.stack = match ectx.RdbgEvent.sinfo with | None -> None | Some si -> Some (List.hd ((si()).RdbgEvent.atoms)); @@ -87,12 +87,12 @@ let sinfo_subst arg var = | Field (_,_,t) | Index (_,_,t) | Slice (_,_,_,_,_,t) -> (SocUtils.string_of_filter arg, t), var - - + + let (assign_expr_dbg : Lxm.t -> SocExecValue.ctx -> var_expr -> var_expr -> RdbgEvent.t -> (RdbgEvent.t -> SocExecValue.ctx -> RdbgEvent.t) -> RdbgEvent.t) = fun lxm ctx ve_in ve_out ectx cont -> (* ve_out := ve_in (in ctx) *) - let val_ve_in = SocExecValue.get_value ctx ve_in in + let val_ve_in = SocExecValue.get_value ctx ve_in in let res = { ctx with s = @@ -114,7 +114,7 @@ let (assign_expr_dbg : Lxm.t -> SocExecValue.ctx -> var_expr -> var_expr -> Rdbg [sinfo_subst ve_out ("lhs", t)] in let cont2 local_ectx val_ctx = - let (datal:Data.subst list) = [("rhs",val_ve_in);("lhs",val_ve_in)] in + let (datal:Data.subst list) = [("rhs",val_ve_in);("lhs",val_ve_in)] in let nectx = RdbgEvent.incr_event_nb local_ectx in let nectx = RdbgEvent.decr_event_depth nectx in { ectx with @@ -124,7 +124,7 @@ let (assign_expr_dbg : Lxm.t -> SocExecValue.ctx -> var_expr -> var_expr -> Rdbg RdbgEvent.inputs = [("rhs", t)]; RdbgEvent.outputs = ["lhs", t]; RdbgEvent.locals = []; - + RdbgEvent.step = ectx.RdbgEvent.step; RdbgEvent.nb = local_ectx.RdbgEvent.nb; RdbgEvent.depth = ectx.RdbgEvent.depth; @@ -135,7 +135,7 @@ let (assign_expr_dbg : Lxm.t -> SocExecValue.ctx -> var_expr -> var_expr -> Rdbg RdbgEvent.reset = ectx.RdbgEvent.reset; } in - { ectx with + { ectx with RdbgEvent.kind = RdbgEvent.Call; RdbgEvent.name = "Assign"; RdbgEvent.lang = "lustre"; @@ -188,7 +188,7 @@ let (gen_access_events : let sinfo = make_simple_sinfo lxm short_id [v_in,v_in] [v_out,v_out] in let val_ctx0 = { val_ctx with cpath = (List.tl val_ctx.cpath) } in let val_v_in = SocExecValue.get_value val_ctx0 ve in - let (data:Data.subst list) = [ fst v_in, val_v_in] in + let (data:Data.subst list) = [ fst v_in, val_v_in] in let cont2 local_ectx val_ctx = let nectx = RdbgEvent.incr_event_nb local_ectx in let nectx = { nectx with RdbgEvent.sinfo = initial_sinfo } in @@ -215,7 +215,7 @@ let (gen_access_events : RdbgEvent.next = (fun () -> cont nectx val_ctx); RdbgEvent.terminate = ectx.RdbgEvent.terminate; RdbgEvent.reset = ectx.RdbgEvent.reset; - } + } in { ectx with RdbgEvent.step = ectx.RdbgEvent.step; @@ -232,7 +232,7 @@ let (gen_access_events : RdbgEvent.next = (fun () -> cont2 ectx val_ctx); RdbgEvent.terminate = ectx.RdbgEvent.terminate; RdbgEvent.reset = ectx.RdbgEvent.reset; - } + } let rec (gen_access_events_list : Lxm.t -> var_expr list -> RdbgEvent.t -> SocExecValue.ctx -> @@ -244,8 +244,8 @@ let rec (gen_access_events_list : | ve_in::tail -> let cont ectx val_ctx = gen_access_events lxm ve_in ectx val_ctx cont in gen_access_events_list lxm tail ectx val_ctx cont - - + + let rec (soc_step : Lxm.t -> Soc.step_method -> Soc.tbl -> Soc.t -> RdbgEvent.t -> SocExecValue.ctx -> (RdbgEvent.t -> SocExecValue.ctx -> RdbgEvent.t) -> RdbgEvent.t) = @@ -253,7 +253,7 @@ let rec (soc_step : Lxm.t -> Soc.step_method -> Soc.tbl -> Soc.t -> profile_info ("SocExecDbg.soc_step \n"); let soc_name,_,_ = soc.key in let lxm = step.lxm in - let event = + let event = match step.impl with | Extern -> print_string ( @@ -262,16 +262,16 @@ let rec (soc_step : Lxm.t -> Soc.step_method -> Soc.tbl -> Soc.t -> ); exit 2 | Predef -> ( - try + try let val_ctx = SocExecEvalPredef.get soc.key val_ctx in - cont ectx val_ctx + cont ectx val_ctx with Not_found -> (* Not a predef op *) print_string ( "*** internal error in "^soc_name^". Is it defined in SocExecEvalPredef?\n"); flush stdout; assert false ) | Gaol(_vl,gaol) -> do_gaol soc_tbl ectx gaol val_ctx cont - + | Boolred(i,j,k) -> ( (* XXX mettre ce code dans socPredef ? (ou socMetaopPredef)*) let inputs, outputs = soc.profile in @@ -308,7 +308,7 @@ let rec (soc_step : Lxm.t -> Soc.step_method -> Soc.tbl -> Soc.t -> in let cont ectx val_ctx = let val_ctx = - { + { cpath=path_saved; s = sadd val_ctx.s ("_memory"::val_ctx.cpath) (B false) } @@ -316,7 +316,7 @@ let rec (soc_step : Lxm.t -> Soc.step_method -> Soc.tbl -> Soc.t -> cont ectx val_ctx in do_soc_step lxm None node_step val_ctx soc_tbl node_soc - vel_in vel_out ectx cont + vel_in vel_out ectx cont ) else ( let first_step = Var ("_memory",Bool) in let val_ctx = { val_ctx with cpath=path_saved } in @@ -329,7 +329,7 @@ let rec (soc_step : Lxm.t -> Soc.step_method -> Soc.tbl -> Soc.t -> List.fold_left2 assign_expr val_ctx dft_cst vel_out) (* XXX use assign_expr_dbg *) else - (* We are not on the first step of node_soc; hence we do nothing + (* We are not on the first step of node_soc; hence we do nothing and the output will keep their previous value. *) val_ctx in @@ -343,7 +343,7 @@ let rec (soc_step : Lxm.t -> Soc.step_method -> Soc.tbl -> Soc.t -> let node_soc = SocUtils.find lxm node_sk soc_tbl in let node_step = match node_soc.step with [step] -> step | _ -> assert false in let iter_inputs,iter_outputs = soc.profile in - let (proc_name,_,_) = node_soc.key in + let (proc_name,_,_) = node_soc.key in let inst_name = match soc.instances with | [] -> Array.make n proc_name @@ -364,13 +364,13 @@ let rec (soc_step : Lxm.t -> Soc.step_method -> Soc.tbl -> Soc.t -> let a_in = (List.hd iter_inputs) in let a_in_i, a_in_ip1 = if n = 1 then (* array of size 1 *) - Var (a_in), Var (List.hd iter_outputs) - else - if i = 0 then - Var (a_in), Var (add_i 1 a_in) - else + Var (a_in), Var (List.hd iter_outputs) + else + if i = 0 then + Var (a_in), Var (add_i 1 a_in) + else if i = n-1 then - Var (add_i i a_in), Var (List.hd iter_outputs) + Var (add_i i a_in), Var (List.hd iter_outputs) else Var (add_i i a_in), Var (add_i (i+1) a_in) in @@ -409,19 +409,19 @@ and (do_gaol : Soc.tbl -> RdbgEvent.t -> gao list -> SocExecValue.ctx -> and (do_gao : Soc.tbl -> RdbgEvent.t -> gao -> SocExecValue.ctx -> (RdbgEvent.t -> SocExecValue.ctx -> RdbgEvent.t) -> RdbgEvent.t) = - fun soc_tbl ectx gao val_ctx cont -> + fun soc_tbl ectx gao val_ctx cont -> match gao with | Case(id, id_gao_l,lxm) -> ( - try + try let id_val = get_enum id val_ctx in let gaol = List.assoc id_val id_gao_l in (* do_gaol soc_tbl ectx gaol val_ctx cont *) - - let v = Data.E(id_val, SocUtils.get_rank id_val id_gao_l) in + + let v = Data.E(id_val, SocUtils.get_rank id_val id_gao_l) in let t = Enum(id,List.map fst id_gao_l) in let clk_var = Var(id,t) in let (datal:Data.subst list) = ["clock", v] in - + let clock = ("clock", t) in let n = ectx.RdbgEvent.nb in let ectx = { ectx with @@ -443,7 +443,7 @@ and (do_gao : Soc.tbl -> RdbgEvent.t -> gao -> SocExecValue.ctx -> RdbgEvent.inputs = [clock]; RdbgEvent.outputs = []; RdbgEvent.locals = []; - + RdbgEvent.step = ectx.RdbgEvent.step; RdbgEvent.nb = local_ectx.RdbgEvent.nb; RdbgEvent.depth = ectx.RdbgEvent.depth+1; @@ -452,9 +452,9 @@ and (do_gao : Soc.tbl -> RdbgEvent.t -> gao -> SocExecValue.ctx -> RdbgEvent.next = (fun () -> cont nectx val_ctx); RdbgEvent.terminate = ectx.RdbgEvent.terminate; RdbgEvent.reset = ectx.RdbgEvent.reset; - } + } in - { ectx with + { ectx with RdbgEvent.kind = RdbgEvent.Call; RdbgEvent.name = "when"; RdbgEvent.lang = "lustre"; @@ -468,21 +468,21 @@ and (do_gao : Soc.tbl -> RdbgEvent.t -> gao -> SocExecValue.ctx -> RdbgEvent.nb = n; RdbgEvent.data = datal; RdbgEvent.next = (fun () -> do_gaol soc_tbl ectx gaol val_ctx cont2); - } + } + - - with Not_found -> cont ectx val_ctx + with Not_found -> cont ectx val_ctx ) | Call(vel_out, Assign, vel_in, lxm) -> ( assert (List.length vel_in = List.length vel_out); (* - let val_ctx = + let val_ctx = assert (List.length vel_in = List.length vel_out); List.fold_left2 assign_expr val_ctx vel_in vel_out in cont ectx val_ctx *) - let fcont = + let fcont = List.fold_left2 (fun acc_cont ve_in ve_out -> let ncont ectx val_ctx = @@ -491,11 +491,11 @@ and (do_gao : Soc.tbl -> RdbgEvent.t -> gao -> SocExecValue.ctx -> ) cont vel_in - vel_out + vel_out in - fcont ectx val_ctx + fcont ectx val_ctx ) - | Call(vel_out, Procedure sk, vel_in, lxm) -> ( + | Call(vel_out, Procedure (sk,_), vel_in, lxm) -> ( let (proc_name,_,_) = sk in let path_saved = val_ctx.cpath in let val_ctx = { val_ctx with cpath = proc_name::val_ctx.cpath } in @@ -508,9 +508,9 @@ and (do_gao : Soc.tbl -> RdbgEvent.t -> gao -> SocExecValue.ctx -> let cont ectx val_ctx = do_soc_step lxm None step val_ctx soc_tbl soc vel_in vel_out ectx cont in - cont ectx val_ctx + cont ectx val_ctx ) - | Call(vel_out, Method((inst_name,sk),step_name), vel_in, lxm) -> ( + | Call(vel_out, Method((inst_name,sk),step_name,_), vel_in, lxm) -> ( let path_saved = val_ctx.cpath in let val_ctx = { val_ctx with cpath = inst_name::val_ctx.cpath } in let soc = SocUtils.find lxm sk soc_tbl in @@ -521,19 +521,19 @@ and (do_gao : Soc.tbl -> RdbgEvent.t -> gao -> SocExecValue.ctx -> let val_ctx = { val_ctx with cpath = path_saved } in cont ectx val_ctx in - let cont ectx val_ctx = + let cont ectx val_ctx = do_soc_step lxm None step val_ctx soc_tbl soc vel_in vel_out ectx cont in - cont ectx val_ctx + cont ectx val_ctx ) and (do_soc_step : Lxm.t -> int option -> step_method -> SocExecValue.ctx -> - Soc.tbl -> Soc.t -> var_expr list -> var_expr list -> RdbgEvent.t -> + Soc.tbl -> Soc.t -> var_expr list -> var_expr list -> RdbgEvent.t -> (RdbgEvent.t -> SocExecValue.ctx -> RdbgEvent.t) -> RdbgEvent.t) = - fun lxm int_opt step val_ctx0 soc_tbl soc vel_in vel_out ectx0 cont0 -> + fun lxm int_opt step val_ctx0 soc_tbl soc vel_in vel_out ectx0 cont0 -> let (soc_name,_,_) = soc.key in profile_info ("SocExecDbg.do_soc_step "^soc_name^"\n"); let soc_in_vars, soc_out_vars = soc.profile in - let step_in_vars = filter_params soc soc_in_vars step.idx_ins in + let step_in_vars = filter_params soc soc_in_vars step.idx_ins in let step_out_vars = filter_params soc soc_out_vars step.idx_outs in let new_s = substitute_args_and_params vel_in step_in_vars val_ctx0 in let step_name = match soc.step with @@ -550,7 +550,7 @@ and (do_soc_step : Lxm.t -> int option -> step_method -> SocExecValue.ctx -> | Iterator _ | Boolred _ | Condact _ - | Extern + | Extern | Predef -> [] in let locals = match soc.memory with @@ -577,7 +577,7 @@ and (do_soc_step : Lxm.t -> int option -> step_method -> SocExecValue.ctx -> let s_out = substitute_params_and_args step_out_vars vel_out val_ctx in cont0 ectx { val_ctx with s = s_out } in - let (datal:Data.subst list) = SocExecValue.get_vals val_ctx in + let (datal:Data.subst list) = SocExecValue.get_vals val_ctx in let nectx = RdbgEvent.incr_event_nb local_ectx in let nectx = RdbgEvent.decr_event_depth nectx in let nectx = { nectx with RdbgEvent.sinfo = initial_sinfo } in @@ -596,7 +596,7 @@ and (do_soc_step : Lxm.t -> int option -> step_method -> SocExecValue.ctx -> RdbgEvent.next = (fun () -> cont3 nectx val_ctx); RdbgEvent.terminate = nectx.RdbgEvent.terminate; RdbgEvent.reset = nectx.RdbgEvent.reset; - } + } in let cont1 lectx val_ctx = let ectx = { @@ -610,8 +610,8 @@ and (do_soc_step : Lxm.t -> int option -> step_method -> SocExecValue.ctx -> in let val_ctx = { val_ctx with s = new_s } in (* let (datal:Data.subst list) = get_all_subst val_ctx.s in *) - let datal = get_input_vals val_ctx step_in_vars in - { ectx with + let datal = get_input_vals val_ctx step_in_vars in + { ectx with RdbgEvent.kind = RdbgEvent.Call; RdbgEvent.lang = "lustre"; RdbgEvent.data = datal; @@ -628,28 +628,28 @@ and (do_soc_step : Lxm.t -> int option -> step_method -> SocExecValue.ctx -> (* get the step params from its soc params *) and (filter_params : Soc.t -> Soc.var list -> int list -> Soc.var list) = fun _soc el il -> - let local_nth i l = - try List.nth l i - with _ -> + let local_nth i l = + try List.nth l i + with _ -> print_string ( - "\n*** Cannot get the " ^ (string_of_int (i+1)) ^ + "\n*** Cannot get the " ^ (string_of_int (i+1)) ^ "the element of a list of size " ^ (string_of_int (List.length l))^"\n"); flush stdout; - assert false + assert false in let res = List.map (fun i -> local_nth i el) il in res (* End of XXX duplication of SocExec ! *) (****************************************************************************) - -(* exported *) + +(* exported *) and (do_step_dbg : Soc.tbl -> Soc.t -> RdbgEvent.t -> SocExecValue.ctx -> (RdbgEvent.t -> SocExecValue.ctx -> RdbgEvent.t) -> RdbgEvent.t) = fun soc_tbl soc ectx val_ctx cont -> let soc_in_vars, _soc_out_vars = soc.profile in (* let (datal:Data.subst list) = get_all_subst val_ctx.s in *) - let (datal:Data.subst list) = get_input_vals val_ctx soc_in_vars in + let (datal:Data.subst list) = get_input_vals val_ctx soc_in_vars in let (soc_name,_,_) = soc.key in let lxm = (List.hd soc.step).lxm in let locals = if soc.step = [] then [] else @@ -658,16 +658,16 @@ and (do_step_dbg : Soc.tbl -> Soc.t -> RdbgEvent.t -> SocExecValue.ctx -> | Iterator _ | Boolred _ | Condact _ - | Predef + | Predef | Extern -> [] in - let sinfo = + let sinfo = Some(fun () -> let atom = { RdbgEvent.str = soc_name; - RdbgEvent.file = Lxm.file lxm; - RdbgEvent.line = Lxm.line lxm,Lxm.line lxm; + RdbgEvent.file = Lxm.file lxm; + RdbgEvent.line = Lxm.line lxm,Lxm.line lxm; RdbgEvent.char = Lxm.cstart lxm, Lxm.cend lxm; RdbgEvent.stack = None; } @@ -681,8 +681,8 @@ and (do_step_dbg : Soc.tbl -> Soc.t -> RdbgEvent.t -> SocExecValue.ctx -> } ) in - let ectx = { - ectx with + let ectx = { + ectx with RdbgEvent.name = soc_name; RdbgEvent.depth = ectx.RdbgEvent.depth+1; RdbgEvent.data = datal; @@ -690,11 +690,11 @@ and (do_step_dbg : Soc.tbl -> Soc.t -> RdbgEvent.t -> SocExecValue.ctx -> RdbgEvent.outputs = snd soc.profile; RdbgEvent.locals = locals; RdbgEvent.sinfo = sinfo; - } + } in let cont2 local_ectx val_ctx = (* je pourrais enlver les entrées... *) - let (datal:Data.subst list) = SocExecValue.get_vals val_ctx in + let (datal:Data.subst list) = SocExecValue.get_vals val_ctx in let nectx = { ectx with RdbgEvent.nb = local_ectx.RdbgEvent.nb+1; RdbgEvent.data = datal; @@ -716,7 +716,7 @@ and (do_step_dbg : Soc.tbl -> Soc.t -> RdbgEvent.t -> SocExecValue.ctx -> RdbgEvent.next = (fun () -> cont nectx val_ctx); RdbgEvent.terminate = ectx.RdbgEvent.terminate; RdbgEvent.reset = ectx.RdbgEvent.reset; - } + } in { ectx with RdbgEvent.step = ectx.RdbgEvent.step; @@ -730,7 +730,7 @@ and (do_step_dbg : Soc.tbl -> Soc.t -> RdbgEvent.t -> SocExecValue.ctx -> RdbgEvent.locals = locals; RdbgEvent.sinfo = sinfo; RdbgEvent.data = ectx.RdbgEvent.data; - RdbgEvent.next = (fun () -> + RdbgEvent.next = (fun () -> let step = match soc.step with [step] -> step | _ -> assert false in let ectx = RdbgEvent.incr_event_nb ectx in soc_step step.lxm step soc_tbl soc ectx val_ctx cont2 diff --git a/lib/socNameC.ml b/lib/socNameC.ml index 0d397c535d824433e7c722b4652b362a87f8b772..8416de554dd5b4f51a430279e03c1d1ea8ac0bbb 100644 --- a/lib/socNameC.ml +++ b/lib/socNameC.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 22/07/2022 (at 14:31) by Erwan Jahier> *) +(** Time-stamp: <modified the 14/06/2024 (at 13:57) by Erwan Jahier> *) type variable_type = { id: int; @@ -73,8 +73,8 @@ let get_variables_assoc : Soc.t -> (string * variable_type) list = fun soc -> let get_variables : Soc.t -> variable_type list = fun soc -> snd(List.split (get_variables_assoc soc)) - -let get_gaol soc = + +let get_gaol soc = let step_impl = match soc.step with | [sm] -> sm.impl @@ -91,7 +91,7 @@ let get_gaol soc = | Extern -> assert false in gaol - + let get_nodes : Soc.t -> node_type list = fun soc -> let gaol = get_gaol soc in let tbl = Hashtbl.create 2 in @@ -99,8 +99,8 @@ let get_nodes : Soc.t -> node_type list = fun soc -> | Call(_,ao,_,_) -> let is_method, k = match ao with | Assign -> assert false - | Method((_,k),_) -> true, k - | Procedure k -> false, k + | Method((_,k),_,_) -> true, k + | Procedure (k,_) -> false, k in if Hashtbl.mem tbl k then cpt, acc @@ -124,10 +124,10 @@ let (var_expr_to_index : (string * variable_type) list -> var_expr -> int) = match List.assoc_opt (fst var) var_tbl with | None -> assert false | Some vt -> vt.id - ) + ) | Const _ -> assert false | Field _ -> assert false - | Index _ -> assert false + | Index _ -> assert false | Slice _ -> assert false @@ -135,7 +135,7 @@ let print_instance_type i = Printf.printf "{id=%d ; node=%d ; var_in=[%s] ; var_out=[%s] }\n" i.id i.node (String.concat "," (List.map string_of_int i.var_in)) (String.concat "," (List.map string_of_int i.var_out)) - + let get_instances : Soc.t -> instance_type list = fun soc -> let gaol = get_gaol soc in let ltbl = Hashtbl.create 2 in @@ -144,8 +144,8 @@ let get_instances : Soc.t -> instance_type list = fun soc -> let gao_to_instance_type i gao = match gao with | Call(_,Assign,_,_) -> assert false - | Call(args_out, Method((_,k), _), args_in, _) - | Call(args_out, Procedure k , args_in, _) -> + | Call(args_out, Method((_,k), _,_), args_in, _) + | Call(args_out, Procedure (k,_) , args_in, _) -> let node_cpt, _inst_cpt = match Hashtbl.find_opt ltbl k with | None -> incr node_cpt_ref; Hashtbl.add ltbl k (!node_cpt_ref, 0); !node_cpt_ref, 0 | Some (node_cpt, inst_cpt) -> @@ -153,7 +153,7 @@ let get_instances : Soc.t -> instance_type list = fun soc -> Hashtbl.add ltbl k (node_cpt, inst_cpt); node_cpt, inst_cpt in - { + { id = i+1; node = node_cpt; var_in = List.map (var_expr_to_index all_vars) args_in; diff --git a/lib/socPredef.ml b/lib/socPredef.ml index 390d67bb7ffc16d007dd4dc6f80807c1633baa37..9aee2f79bfc7010f9f202fde961ff9eb27b2041e 100644 --- a/lib/socPredef.ml +++ b/lib/socPredef.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 17/05/2022 (at 23:31) by Erwan Jahier> *) +(* Time-stamp: <modified the 14/06/2024 (at 15:16) by Erwan Jahier> *) (** Synchronous Object Code for Predefined operators. *) @@ -16,26 +16,26 @@ let _aab t1 t2 = ["i1", t1; "i2",t2], ["out", Bool] (* if/then/else *) let baaa t = ["cond", b; "xthen", t; "xelse", t], ["out", t] -let (soc_profile_of_types : Data.t list -> var list * var list) = +let (soc_profile_of_types : Data.t list -> var list * var list) = function | [t1; t2] -> aa t1 t2 | [t1;t2;t3] -> aaa t1 t2 t3 - | [Bool;t1;_t2;_t3] -> baaa t1 - | tl -> + | [Bool;t1;_t2;_t3] -> baaa t1 + | tl -> print_string ("Unsupported case: "^ ( String.concat "," (List.map SocUtils.string_of_type_ref tl))); flush stdout; assert false -(* For diese and nor *) -let (soc_profile_of_types_nary : Data.t list -> var list * var list) = +(* For diese and nor *) +let (soc_profile_of_types_nary : Data.t list -> var list * var list) = fun vl -> match vl with | ta::Bool::[] -> ["i1", ta], ["out",Bool] | _ -> let inputs = List.mapi (fun i t -> assert(t=Bool); "i"^(string_of_int i),t) vl in List.tl inputs, ["out",Bool] - + let step11 lxm _str = { (* a useful alias again *) name = "step"; @@ -58,6 +58,7 @@ let make_soc key profile steps = { profile = profile; clock_profile = []; instances = []; + tasks = []; (* init = None; *) precedences = []; step = steps; @@ -66,10 +67,10 @@ let make_soc key profile steps = { } let (get_mem_name : Soc.key -> Data.t -> string) = - fun (_k,_tl,_) _vt -> + fun (_k,_tl,_) _vt -> "_memory" (* - match Str.split (Str.regexp "::") k with + match Str.split (Str.regexp "::") k with | ["Lustre";op] -> ( match op.[0] with | 'i' | 'b' | 'r' -> String.set op 0 '_'; ("mem"^op) @@ -80,22 +81,23 @@ let (get_mem_name : Soc.key -> Data.t -> string) = (* let dummy = Lxm.dummy "predef" *) -let of_fby_soc_key :Lxm.t -> Soc.var_expr -> Soc.key -> Soc.t = - fun lxm _init sk -> +let of_fby_soc_key :Lxm.t -> Soc.var_expr -> Soc.key -> Soc.t = + fun lxm _init sk -> let _,tl,_ = sk in let t = List.hd tl in let pre_mem:var = (get_mem_name sk t, t) in let prof = soc_profile_of_types tl in - let _v1,v2,vout = - match prof with ([v1;v2],[vout]) -> v1,v2,vout | _ -> assert false + let _v1,v2,vout = + match prof with ([v1;v2],[vout]) -> v1,v2,vout | _ -> assert false in { key = sk; profile = prof; clock_profile = []; instances = []; + tasks = []; memory = Mem t; (* so that pre_mem exist *) - step = [ + step = [ (* faire qque chose de init maintenant !!! *) { name = "get"; @@ -110,7 +112,7 @@ let of_fby_soc_key :Lxm.t -> Soc.var_expr -> Soc.key -> Soc.t = (* ]); *) }; { - name = "set"; + name = "set"; lxm = lxm; idx_ins = [1]; idx_outs = []; @@ -120,16 +122,16 @@ let of_fby_soc_key :Lxm.t -> Soc.var_expr -> Soc.key -> Soc.t = precedences = ["set", ["get"]]; assertions = []; } - + (* exported *) -let of_soc_key : Lxm.t -> Soc.key -> Soc.t = - fun lxm sk -> +let of_soc_key : Lxm.t -> Soc.key -> Soc.t = + fun lxm sk -> let (id, tl, _) = sk in let sp = soc_profile_of_types in let sp_nary = soc_profile_of_types_nary in match id with - | "Lustre::ruminus" - | "Lustre::iuminus" + | "Lustre::ruminus" + | "Lustre::iuminus" | "Lustre::uminus" | "Lustre::not" | "Lustre::real2int" @@ -138,20 +140,20 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = -> (make_soc sk (sp tl) [step11 lxm id]) | "Lustre::mod" - | "Lustre::iplus" - | "Lustre::rplus" + | "Lustre::iplus" + | "Lustre::rplus" | "Lustre::plus" | "Lustre::times" | "Lustre::itimes" | "Lustre::rtimes" - | "Lustre::slash" - | "Lustre::islash" + | "Lustre::slash" + | "Lustre::islash" | "Lustre::rslash" | "Lustre::div" | "Lustre::idiv" | "Lustre::rdiv" - | "Lustre::minus" - | "Lustre::iminus" + | "Lustre::minus" + | "Lustre::iminus" | "Lustre::rminus" | "Lustre::lt" @@ -176,46 +178,47 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = (* Those have instances *) | "Lustre::current" -> ( - match sk with + match sk with | _,tl, Curr(cc) -> ( assert(tl<>[]); - let t = List.hd (List.tl tl) in - let mem:var = (get_mem_name sk t, t) in - let prof:var list * var list = sp tl in - let cv,vin,vout = - match prof with ([cv;vin],[vout]) -> cv,vin,vout | _ -> assert false - in - { - key = sk; - profile = (sp tl); + let t = List.hd (List.tl tl) in + let mem:var = (get_mem_name sk t, t) in + let prof:var list * var list = sp tl in + let cv,vin,vout = + match prof with ([cv;vin],[vout]) -> cv,vin,vout | _ -> assert false + in + { + key = sk; + profile = (sp tl); clock_profile = []; - instances = []; - memory = Mem (t); - step = [ - { - name = "step"; + instances = []; + tasks = []; + memory = Mem (t); + step = [ + { + name = "step"; lxm = lxm; - idx_ins = [0;1]; - idx_outs = [0]; - impl = - Gaol([], + idx_ins = [0;1]; + idx_outs = [0]; + impl = + Gaol([], [Case((fst cv),[ (Lv6Id.string_of_long false cc, [Call([Var(mem)], Assign, [Var(vin)], lxm)])], lxm); - Call([Var(vout)], Assign, [Var(mem)], lxm )]) - }; - ]; - precedences = []; + Call([Var(vout)], Assign, [Var(mem)], lxm )]) + }; + ]; + precedences = []; assertions = []; } ) - | _,_tl, Nomore -> (* current is applied to something on the base clock *) + | _,_tl, Nomore -> (* current is applied to something on the base clock *) raise (Lv6errors.Compile_error(lxm, "current applied on the base clock")) | _,_, _ -> assert false ) - | "Lustre::pre" -> + | "Lustre::pre" -> let _,tl,_ = sk in let t = List.hd tl in let pre_mem:var = (get_mem_name sk t, t) in @@ -226,6 +229,7 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = profile = (sp tl); clock_profile = []; instances = []; + tasks = []; memory = Mem (t); (* so that pre_mem exist *) step = [ { @@ -234,29 +238,30 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = idx_ins = []; idx_outs = [0]; (* impl = Predef; *) - impl = Gaol([],[Call([Var(vout)], Assign, [Var(pre_mem)], lxm)]); + impl = Gaol([],[Call([Var(vout)], Assign, [Var(pre_mem)], lxm)]); (*impl = Gaol([pre_mem],[Call([Var(vout)], Assign, [Var(pre_mem)])]); *) }; { - name = "set"; + name = "set"; lxm = lxm; idx_ins = [0]; idx_outs = []; (* impl = Predef; *) - impl = Gaol([],[Call([Var(pre_mem)], Assign, [Var(v1)], lxm )]); + impl = Gaol([],[Call([Var(pre_mem)], Assign, [Var(v1)], lxm )]); (* impl = Gaol([pre_mem],[Call([Var(pre_mem)], Assign, [Var(v1)])]); *) }; ]; precedences = ["set", ["get"]]; assertions = []; } - | "Lustre::arrow" -> + | "Lustre::arrow" -> let prof = sp tl in { key = sk; profile = prof; clock_profile = []; instances = []; + tasks = []; step = [ { name = "step"; @@ -275,6 +280,7 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = profile = (sp tl); clock_profile = []; instances = []; + tasks = []; (* init = None; *) precedences = []; assertions = []; @@ -287,21 +293,22 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = idx_outs = [0]; impl = Predef; } ]; - } - | "Lustre::nor" -> + } + | "Lustre::nor" -> let size = match sk with | _,[Array(Bool,size);_],_ -> size | _,bools,_ -> if List.exists (fun t -> t<>Bool) bools then failwith "type error in nor" else - List.length bools + List.length bools in { Soc.key = sk; Soc.profile = sp_nary tl; Soc.clock_profile = []; Soc.instances = [] ; + tasks = []; Soc.step = [ { name = "step"; @@ -314,7 +321,7 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = Soc.memory = No_mem; Soc.precedences = []; Soc.assertions = []; - } + } | "Lustre::diese" -> let size = match sk with | _,[Array(Bool,size);_],_ -> size @@ -322,13 +329,14 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = if List.exists (fun t -> t<>Bool) bools then failwith "type error in #" else - List.length bools + List.length bools in { Soc.key = sk; Soc.profile = sp_nary tl; Soc.clock_profile = []; Soc.instances = [] ; + tasks = []; Soc.step = [ { name = "step"; @@ -341,20 +349,20 @@ let of_soc_key : Lxm.t -> Soc.key -> Soc.t = Soc.memory = No_mem; Soc.precedences = []; Soc.assertions = []; - } - | _ -> + } + | _ -> failwith ("*** The soc of "^id ^ " is not defined! \n") - + (** Instancie un composant polymorphe avec un type concret. *) -let instanciate_soc: Soc.t -> Data.t -> Soc.t = +let instanciate_soc: Soc.t -> Data.t -> Soc.t = fun c concrete_type -> let rec instanciate_type vt = - match vt with - | Alpha _ -> concrete_type - | Struct(sn, fl) -> + match vt with + | Alpha _ -> concrete_type + | Struct(sn, fl) -> Struct(sn, List.map (fun (id,vt) -> (id,instanciate_type vt)) fl) | Array(vt,i) -> Array(instanciate_type vt,i) | vt -> vt @@ -363,15 +371,15 @@ let instanciate_soc: Soc.t -> Data.t -> Soc.t = List.map (fun (vn,vt) -> vn, instanciate_type vt) (fst c.profile), List.map (fun (vn,vt) -> vn, instanciate_type vt) (snd c.profile) in - let instanciate_key (key1, key2, key3) = - (key1, List.map instanciate_type key2, key3) + let instanciate_key (key1, key2, key3) = + (key1, List.map instanciate_type key2, key3) in - let new_key = instanciate_key c.key in - let new_instances = + let new_key = instanciate_key c.key in + let new_instances = List.map (fun (id,sk) -> (id,instanciate_key sk)) c.instances in - { - c with + { + c with key = new_key; profile = new_profile; instances = new_instances; @@ -379,7 +387,7 @@ let instanciate_soc: Soc.t -> Data.t -> Soc.t = (* - XXX Faut-il definir une version générique des composants tranches ? + XXX Faut-il definir une version générique des composants tranches ? Je les ai défini directement via "make_slice_soc", ce qui n'est pas homogene avec la facon dont sont traités les autres @@ -399,18 +407,19 @@ let instanciate_soc: Soc.t -> Data.t -> Soc.t = idem pour "x^n" (Hat_n). *) -let make_array_slice_soc : Lxm.t -> Lic.slice_info -> int -> Data.t -> Soc.t = - fun lxm si s t -> +let make_array_slice_soc : Lxm.t -> Lic.slice_info -> int -> Data.t -> Soc.t = + fun lxm si s t -> let size = si.Lic.se_width in let array_type_in = Array(t,s) in let array_type_out = Array(t,size) in let key_prof = [array_type_in; array_type_out] in { - key = ("Lustre::array_slice", key_prof, + key = ("Lustre::array_slice", key_prof, Slic(si.Lic.se_first,si.Lic.se_last,si.Lic.se_step)); profile = (["i1", array_type_in], ["out", array_type_out]); clock_profile = []; instances = []; + tasks = []; step = [ { name = "step"; @@ -423,11 +432,11 @@ let make_array_slice_soc : Lxm.t -> Lic.slice_info -> int -> Data.t -> Soc.t = precedences = []; assertions = []; memory = No_mem; - } + } -let make_array_soc: Lxm.t -> int -> Data.t -> Soc.t = - fun lxm i t -> - let iprof = +let make_array_soc: Lxm.t -> int -> Data.t -> Soc.t = + fun lxm i t -> + let iprof = let res = ref [] in for k=i downto 1 do res:= ("i"^(string_of_int k),t) :: !res; @@ -441,6 +450,7 @@ let make_array_soc: Lxm.t -> int -> Data.t -> Soc.t = profile = (iprof, ["out", array_type]); clock_profile = []; instances = []; + tasks = []; step = [ { name = "step"; @@ -453,11 +463,11 @@ let make_array_soc: Lxm.t -> int -> Data.t -> Soc.t = precedences = []; assertions = []; memory = No_mem; - } + } -let make_array_concat_soc: Lxm.t -> int -> int -> Data.t -> Soc.t = - fun lxm s1 s2 t -> +let make_array_concat_soc: Lxm.t -> int -> int -> Data.t -> Soc.t = + fun lxm s1 s2 t -> let iprof = (["i1", Array(t,s1); "i2", Array(t,s2)], ["out", Array(t,s1+s2)])in let key_prof = [Array(t,s1); Array(t,s2); Array(t,s1+s2)] in { @@ -465,6 +475,7 @@ let make_array_concat_soc: Lxm.t -> int -> int -> Data.t -> Soc.t = profile = iprof; clock_profile = []; instances = []; + tasks = []; step = [ { name = "step"; @@ -477,13 +488,13 @@ let make_array_concat_soc: Lxm.t -> int -> int -> Data.t -> Soc.t = precedences = []; assertions = []; memory = No_mem; - } + } -let make_hat_soc: Lxm.t -> int -> Data.t -> Soc.t = - fun lxm i t -> - let array_type = +let make_hat_soc: Lxm.t -> int -> Data.t -> Soc.t = + fun lxm i t -> + let array_type = match t with - | Data.Alpha _ -> assert false + | Data.Alpha _ -> assert false | t -> Data.Array(t,i) in { @@ -491,6 +502,7 @@ let make_hat_soc: Lxm.t -> int -> Data.t -> Soc.t = profile = ([("i1", t)], ["out", array_type]); clock_profile = []; instances = []; + tasks = []; step = [ { name = "step"; @@ -503,7 +515,7 @@ let make_hat_soc: Lxm.t -> int -> Data.t -> Soc.t = precedences = []; assertions = []; memory = No_mem; - } + } let output_type_of_op op tl = match op with (* beurk, pas bô *) @@ -533,7 +545,7 @@ let output_type_of_op op tl = (* in all other cases, the outpout type is the same as the first input (really?)*) List.hd tl -let (soc_interface_of_pos_op: +let (soc_interface_of_pos_op: Lxm.t -> Lic.by_pos_op -> Data.t list -> Soc.var_expr option -> Soc.t) = fun lxm op types fby_init_opt -> match (op, types,fby_init_opt) with @@ -550,7 +562,7 @@ let (soc_interface_of_pos_op: soc | Lic.FBY, _, Some init -> let concrete_type = List.nth types 0 in - let soc = of_fby_soc_key lxm init (("Lustre::fby"), + let soc = of_fby_soc_key lxm init (("Lustre::fby"), types@[concrete_type], MemInit init) in instanciate_soc soc concrete_type | Lic.FBY, _, None -> assert false (* should ot occur *) @@ -568,8 +580,8 @@ let (soc_interface_of_pos_op: instanciate_soc soc concrete_type | Lic.ARROW, _, _ -> let concrete_type = List.nth types 0 in - let soc = of_soc_key lxm (("Lustre::arrow"), types@[concrete_type], - MemInit(Const("_true", Data.Bool))) + let soc = of_soc_key lxm (("Lustre::arrow"), types@[concrete_type], + MemInit(Const("_true", Data.Bool))) in let soc = instanciate_soc soc concrete_type in soc @@ -585,12 +597,12 @@ let (soc_interface_of_pos_op: | Lic.ARRAY_SLICE sinfo, [Array (t, s)], _ -> (make_array_slice_soc lxm sinfo s t) | Lic.ARRAY_SLICE _sinfo, _, _ -> assert false - | Lic.CONCAT, [Array (t1, s1); Array (t2, s2)], _-> + | Lic.CONCAT, [Array (t1, s1); Array (t2, s2)], _-> assert (t1=t2); (make_array_concat_soc lxm s1 s2 t1) | Lic.CONCAT , _, _ -> assert false - | Lic.CALL _,_,_ -> assert false + | Lic.CALL _,_,_ -> assert false | Lic.CONST _ , _,_ -> assert false (* Those are not soc *) @@ -600,4 +612,3 @@ let (soc_interface_of_pos_op: | Lic.WHEN _, _,_ -> assert false | Lic.TUPLE, _,_ -> assert false | Lic.ARRAY_ACCES _, _,_ -> assert false - diff --git a/lib/socPredef2cStack.ml b/lib/socPredef2cIoArgs.ml similarity index 71% rename from lib/socPredef2cStack.ml rename to lib/socPredef2cIoArgs.ml index d1970f240967f80c4a88ba4743f6580200a6a228..44645535596aae2b4144b5671ac62effe9f5c28a 100644 --- a/lib/socPredef2cStack.ml +++ b/lib/socPredef2cIoArgs.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 17/05/2022 (at 23:35) by Erwan Jahier> *) +(* Time-stamp: <modified the 05/06/2024 (at 15:06) by Erwan Jahier> *) open Data open Soc @@ -14,102 +14,102 @@ let (lustre_binop : Soc.key -> string -> string) = | _, [],_ -> assert false in (match sk with - | (("Lustre::eq"|"Lustre::equal"),(Array _)::_,_) -> + | (("Lustre::eq"|"Lustre::equal"),(Array _)::_,_) -> Printf.sprintf " *out = memcmp(%s i1, %s i2, %s)==0;\n" cast cast ctype - | (("Lustre::eq"|"Lustre::equal"),(Struct _)::_,_) -> + | (("Lustre::eq"|"Lustre::equal"),(Struct _)::_,_) -> Printf.sprintf " *out = memcmp(%s &i1, %s &i2, %s)==0;\n" cast cast ctype | (("Lustre::neq"|"Lustre::diff"),(Array _)::_,_) -> Printf.sprintf " *out = !memcmp(%s i1, %s i2, %s)==0;\n" cast cast ctype | (("Lustre::neq"|"Lustre::diff"),(Struct _)::_,_) -> Printf.sprintf " *out = !memcmp(%s &i1, %s &i2, %s)==0;\n" cast cast ctype - | _ -> + | _ -> Printf.sprintf " *out = (i1 %s i2);\n" op ) let (lustre_unop : Soc.key -> string -> string) = - fun _sk op -> + fun _sk op -> (* use gen_assign? *) - Printf.sprintf" *out = %s i1;\n" op + Printf.sprintf" *out = %s i1;\n" op let (lustre_ite : Soc.key -> string) = - fun sk -> + fun sk -> let t = match sk with (_,_::t::_,_) -> t | _ -> assert false in (* Printf.sprintf" %s.z = (%s.c)? %s.xt : %s.xe;\n" ctx ctx ctx ctx *) - Soc2cStack.gen_assign t (Printf.sprintf "*out") + Soc2cIoArgs.gen_assign t (Printf.sprintf "*out") (Printf.sprintf "(cond)? xthen : xelse") let (lustre_impl : Soc.key -> string) = - fun _sk -> + fun _sk -> (* use gen_assign? *) Printf.sprintf" *out = (!i1 || i2);\n" - + let (lustre_arrow : Soc.key -> string) = - fun sk -> - + fun sk -> + let t = match sk with (_,_::t::_,_) -> t | _ -> assert false in let x,y = "i1", "i2" in let z = match t with | Data.Array(_,_) -> "out" - | _ -> "*out" - in - let vo = Printf.sprintf"((ctx->_memory)? %s : %s)" x y in - (Soc2cStack.gen_assign t z vo) ^ - (" ctx->_memory = _false;\n") - + | _ -> "*out" + in + let vo = Printf.sprintf"((_ctx->_memory)? %s : %s)" x y in + (Soc2cIoArgs.gen_assign t z vo) ^ + (" _ctx->_memory = _false;\n") + let (lustre_hat : Soc.key -> string) = - fun (_n,tl,_si_opt) -> + fun (_n,tl,_si_opt) -> let i,t = match tl with | [_;Data.Array(t,i)] -> i,t | _ -> assert false in let buff = ref "" in for j=0 to i-1 do - buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "out[%d]" j) - (Printf.sprintf "i1")); + buff := !buff^(Soc2cIoArgs.gen_assign t (Printf.sprintf "out[%d]" j) + (Printf.sprintf "i1")); done; !buff let (lustre_array: Soc.key -> string) = - fun (_n,tl,_si_opt) -> + fun (_n,tl,_si_opt) -> let t,i = match List.hd (List.rev tl) with | Data.Array(t,i) -> t,i | _ -> assert false in let buff = ref "" in for j=0 to i-1 do - buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "out[%d]" j) - (Printf.sprintf "i%d" (j+1))); + buff := !buff^(Soc2cIoArgs.gen_assign t (Printf.sprintf "out[%d]" j) + (Printf.sprintf "i%d" (j+1))); done; !buff - + let (lustre_concat: Soc.key -> string) = - fun (_n,tl,_si_opt) -> + fun (_n,tl,_si_opt) -> let t,s1,s2 = match tl with | [Data.Array(t,s1); Data.Array(_,s2); _] -> t,s1,s2 | _ -> assert false in let t1 = Printf.sprintf "i1" - and t2 = Printf.sprintf "i2" - and t12 = Printf.sprintf "out" + and t2 = Printf.sprintf "i2" + and t12 = Printf.sprintf "out" 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 + and t2_type = Soc2cUtil.data_type_to_c (Data.Array(t,s2)) "" + in if not Lv6MainArgs.global_opt.Lv6MainArgs.gen_wcet then ( - (Printf.sprintf " memcpy(%s, %s, sizeof(%s));\n" t12 t1 t1_type)^ + (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) ) else ( (* Both seems to work *) let buff = ref "" in for j=0 to s1-1 do - buff := !buff^(Soc2cStack.gen_assign t + buff := !buff^(Soc2cIoArgs.gen_assign t (Printf.sprintf "%s[%d]" t12 j) (Printf.sprintf "%s[%d]" t1 j) ); done; for j=s1 to s1+s2-1 do - buff := !buff^(Soc2cStack.gen_assign t + buff := !buff^(Soc2cIoArgs.gen_assign t (Printf.sprintf "%s[%d]" t12 j) (Printf.sprintf "%s[%d]" t2 (j-s1)) ); @@ -118,30 +118,30 @@ let (lustre_concat: Soc.key -> string) = ) (* let buff = ref "" in *) (* for j=0 to s1-1 do *) -(* buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j)); *) +(* buff := !buff^(Soc2cIoArgs.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)); *) +(* buff := !buff^(Soc2cIoArgs.gen_assign t (Printf.sprintf "%s.z[%d]" ctx j)); *) (* done; *) (* !buff *) let (lustre_slice: Soc.key -> string) = - fun (_n,tl,si_opt) -> + fun (_n,tl,si_opt) -> let t,_size = match List.hd (List.rev tl) with | Data.Array(t,i) -> t,i | _ -> assert false in match si_opt with - | Slic(b,e,step) -> - let buff = ref "" in + | Slic(b,e,step) -> + let buff = ref "" in let j=ref 0 in for i = b to e do if (i-b) mod step = 0 then ( - buff := !buff^(Soc2cStack.gen_assign t (Printf.sprintf "out[%d]" !j) + buff := !buff^(Soc2cIoArgs.gen_assign t (Printf.sprintf "out[%d]" !j) (Printf.sprintf "i1[%d]" i) - ); + ); incr j); - done; + done; !buff | _ -> assert false @@ -149,43 +149,43 @@ let (lustre_slice: Soc.key -> string) = (* exported *) let (get_predef_op: Soc.key -> string) = - fun sk -> + fun sk -> let (n,_tl,_si_opt) = sk in match n with - | "Lustre::rplus" + | "Lustre::rplus" | "Lustre::plus" - | "Lustre::iplus" -> lustre_binop sk "+" - | "Lustre::itimes" + | "Lustre::iplus" -> lustre_binop sk "+" + | "Lustre::itimes" | "Lustre::times" - | "Lustre::rtimes" -> lustre_binop sk "*" + | "Lustre::rtimes" -> lustre_binop sk "*" | "Lustre::idiv" - | "Lustre::div" - | "Lustre::rdiv" -> lustre_binop sk "/" - | "Lustre::islash" - | "Lustre::slash" + | "Lustre::div" + | "Lustre::rdiv" -> lustre_binop sk "/" + | "Lustre::islash" + | "Lustre::slash" | "Lustre::rslash" -> lustre_binop sk "/" | "Lustre::iminus" | "Lustre::minus" - | "Lustre::rminus" -> lustre_binop sk "-" + | "Lustre::rminus" -> lustre_binop sk "-" | "Lustre::mod" -> lustre_binop sk "%" | "Lustre::iuminus" - | "Lustre::uminus" - | "Lustre::ruminus"-> lustre_unop sk "-" + | "Lustre::uminus" + | "Lustre::ruminus"-> lustre_unop sk "-" - | "Lustre::eq" -> lustre_binop sk "==" - | "Lustre::equal" -> lustre_binop sk "==" + | "Lustre::eq" -> lustre_binop sk "==" + | "Lustre::equal" -> lustre_binop sk "==" - | "Lustre::and" -> lustre_binop sk "&&" - | "Lustre::neq" -> lustre_binop sk "!=" - | "Lustre::diff" -> lustre_binop sk "!=" - | "Lustre::or" -> lustre_binop sk "||" + | "Lustre::and" -> lustre_binop sk "&&" + | "Lustre::neq" -> lustre_binop sk "!=" + | "Lustre::diff" -> lustre_binop sk "!=" + | "Lustre::or" -> lustre_binop sk "||" - | "Lustre::xor" -> lustre_binop sk "!=" + | "Lustre::xor" -> lustre_binop sk "!=" | "Lustre::not" -> lustre_unop sk "!" | "Lustre::real2int" -> lustre_unop sk "(_integer)" | "Lustre::int2real" -> lustre_unop sk "(_real)" - + | "Lustre::random_int" -> lustre_unop sk "rand() % " | "Lustre::lt" @@ -194,7 +194,7 @@ let (get_predef_op: Soc.key -> string) = | "Lustre::gt" | "Lustre::rgt" | "Lustre::igt" -> lustre_binop sk ">" - | "Lustre::lte" + | "Lustre::lte" | "Lustre::rlte" | "Lustre::ilte" -> lustre_binop sk "<=" | "Lustre::gte" @@ -221,47 +221,47 @@ let (get_predef_op: Soc.key -> string) = | _ -> assert false -let rec _type_elt_of_array = function +let rec _type_elt_of_array = function | Data.Array(t,_) -> t | Data.Alias(_,t) -> _type_elt_of_array t | _ -> assert false -let (not_an_array : Data.t -> bool) = function +let (not_an_array : Data.t -> bool) = function | Data.Array(_,_) -> false | _ -> true (* exported *) -let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = - fun soc iterator it_soc n -> +let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = + fun soc iterator it_soc n -> 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 = match soc.instances with | [] -> ( let (array_index : int -> Soc.var -> Soc.var_expr) = fun i (vn,vt) -> (* Var(Printf.sprintf "%s[%d]" vn i, type_elt_of_array vt) *) let vt_elt = match vt with - | Data.Array(vt,_) -> vt + | Data.Array(vt,_) -> vt | _ -> assert false - in + in Index(Var (vn,vt),i,vt_elt) - in - Array.make n "", + in + Array.make n "", Array.make n (get_ctx_name it_soc.key), array_index ) - | _ -> + | _ -> let il, _ = Soc2cInstances.to_array soc.instances in let step_args = List.flatten(List.map( - fun (sk,i) -> + fun (sk,i) -> let l = Lv6util.gen_N i in let id = get_ctx_name sk in - let step_args = List.map (fun n -> Printf.sprintf "&ctx->%s_tab[%d]" id n) l in - (* let ctx = List.map (fun n -> Printf.sprintf "&ctx->%s" id n) l in *) + let step_args = List.map (fun n -> Printf.sprintf "&_ctx->%s_tab[%d]" id n) l in + (* let ctx = List.map (fun n -> Printf.sprintf "_&ctx->%s" id n) l in *) step_args ) il) in - let ctx = step_args (*List.map (fun sn -> ("ctx->"^(id2s sn))) inst_names *) in + let ctx = step_args (*List.map (fun sn -> ("_ctx->"^(id2s sn))) inst_names *) in let (array_index : int -> var -> Soc.var_expr) = fun i (vn,vt) -> let vt_elt = match vt with @@ -281,15 +281,15 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = (* if the accumulator is passed by adress (eg, if it is an array), we need an extra variable for fillred (not for map) *) let a_in_bis = "_local_"^name in (* can it clash? *) - let acc_is_passed_by_value = + let acc_is_passed_by_value = match telt with | Alias(_, (Enum _ | Bool | Int | Real)) | Struct _ (* ZZZ if we pass struct by adress one day, I should move that line *) - | Enum _ | Bool | Int | Real -> + | Enum _ | Bool | Int | Real -> (* arg passed by value are copied into the stack, so it's safe to use the same variable *) true - | String | Alias _ | Alpha _ -> assert false + | String | Alias _ | Alpha _ -> assert false (* ougth to be deadcode; true is the safe value anyway *) | Extern _ | Array _ -> false @@ -298,7 +298,7 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = let a_in_v = Var(a_in, telt) in let a_in_bis_v = Var(a_in_bis, telt) in if not acc_is_passed_by_value && iterator <> "map" then ( - buff := !buff^(Printf.sprintf " %s;\n" + buff := !buff^(Printf.sprintf " %s;\n" (Soc2cUtil.data_type_to_c telt a_in_bis)); ); (match Lv6MainArgs.global_opt.Lv6MainArgs.soc2c_inline_loops, iterator with @@ -309,12 +309,12 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = List.map (array_index i) iter_outputs) in buff := !buff^( - Soc2cStack.gen_step_call + Soc2cIoArgs.gen_step_call soc it_soc vel_out vel_in ctx.(i) node_step step_args.(i)); done ) | false, "map" -> ( - let vel_in, vel_out = + let vel_in, vel_out = (* xxx <ugly>... Soc.var_expr cannot hold index variable and I don't want to rewrite (nor duplicate) gen_step_call for now. Hence this ugly 666 turn-around *) @@ -322,7 +322,7 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = List.map (array_index (-666)) iter_outputs) in let for_loop = Printf.sprintf "for (_i=0 ; _i<%i ; _i+=1) {" n in - let body = Soc2cStack.gen_step_call + let body = Soc2cIoArgs.gen_step_call soc it_soc vel_out vel_in ctx.(0) node_step step_args.(0); in let body = @@ -332,32 +332,32 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = buff := !buff ^ str ) | true, ("fold" | "red" | "fill" | "fillred") -> ( - let a_out = + let a_out = let o,t = List.hd iter_outputs in - if Soc2cStack.is_soc_output (Var(o,t)) soc && not_an_array t + if Soc2cIoArgs.is_soc_output (Var(o,t)) soc && not_an_array t then "*"^o else o in for i=0 to n-1 do let vel_in, vel_out = - let a_in_v, a_in_bis_v = + let a_in_v, a_in_bis_v = if i mod 2 = 0 then a_in_v, a_in_bis_v else a_in_bis_v, a_in_v in a_in_v ::(List.map (array_index i) (List.tl iter_inputs)), a_in_bis_v::(List.map (array_index i) (List.tl iter_outputs)) in buff := !buff^( - Soc2cStack.gen_step_call + Soc2cIoArgs.gen_step_call soc it_soc vel_out vel_in ctx.(i) node_step step_args.(i)) ; done; - if n mod 2 = 0 then - buff := !buff^(Soc2cStack.gen_assign telt a_out a_in) (* a_out=a_n *) + if n mod 2 = 0 then + buff := !buff^(Soc2cIoArgs.gen_assign telt a_out a_in) (* a_out=a_n *) else - buff := !buff^(Soc2cStack.gen_assign telt a_out a_in_bis) + buff := !buff^(Soc2cIoArgs.gen_assign telt a_out a_in_bis) ) | false, ("fold" | "red" | "fill" | "fillred") -> ( - let a_out = + let a_out = let o,t = List.hd iter_outputs in - if Soc2cStack.is_soc_output (Var(o,t)) soc && not_an_array t + if Soc2cIoArgs.is_soc_output (Var(o,t)) soc && not_an_array t then "*"^o else o in let for_loop = Printf.sprintf "for (_i=0 ; _i<%i ; _i+=2){" (n-1) in @@ -373,36 +373,36 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = Str.global_replace (Str.regexp "\\[0\\]") "[_i]" step_args.(0) in let step_arg2 = Str.global_replace (Str.regexp "\\[0\\]") "[_i+1]" step_args.(0) in - let body = Soc2cStack.gen_step_call + let body = Soc2cIoArgs.gen_step_call soc it_soc vel_out vel_in ctx.(0) node_step step_arg; in - let body2 = Soc2cStack.gen_step_call + let body2 = Soc2cIoArgs.gen_step_call soc it_soc vel_out2 vel_in2 ctx.(0) node_step step_arg2; in let call1 = Str.global_replace (Str.regexp "\\[-666\\]") "[_i]" body in - let call2 = Str.global_replace (Str.regexp "\\[-666\\]") "[_i+1]" body2 in (* </ugly> *) - let call3 = if (n mod 2 = 1) then + let call2 = Str.global_replace (Str.regexp "\\[-666\\]") "[_i+1]" body2 in (* </ugly> *) + let call3 = if (n mod 2 = 1) then Str.global_replace (Str.regexp "\\[-666\\]") ("["^string_of_int (n-1)^"]") body else "" in - let str = Printf.sprintf - " int _i;\n %s\n %s %s }\n%s " for_loop call1 call2 call3 + let str = Printf.sprintf + " int _i;\n %s\n %s %s }\n%s " for_loop call1 call2 call3 in buff := !buff ^ str; - if n mod 2 = 0 then - buff := !buff^(Soc2cStack.gen_assign telt a_out a_in) (* a_out=a_n *) + if n mod 2 = 0 then + buff := !buff^(Soc2cIoArgs.gen_assign telt a_out a_in) (* a_out=a_n *) else - buff := !buff^(Soc2cStack.gen_assign telt a_out a_in_bis) + buff := !buff^(Soc2cIoArgs.gen_assign telt a_out a_in_bis) ) | _,_ -> assert false (* SNO *) ); !buff - + (* exported *) -let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) = - fun soc condact_soc el -> +let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) = + fun soc condact_soc el -> let buff = ref "" in let add str = buff:=!buff^(str^"\n") in let add_ncr str = buff:=!buff^(str) in @@ -412,40 +412,40 @@ let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) = let vel_in = List.tl vel_in in let vel_in = List.map (fun var -> Var var) vel_in in let vel_out = List.map (fun var -> Var var) vel_out in - add (Printf.sprintf "\n if (%s == _true) { " clk); + add (Printf.sprintf "\n if (%s == _true) { " clk); (if SocUtils.is_memory_less condact_soc then let condact_ctx = get_ctx_name condact_soc.key in - add (Soc2cStack.gen_step_call soc condact_soc vel_out vel_in condact_ctx "step" "") + add (Soc2cIoArgs.gen_step_call soc condact_soc vel_out vel_in condact_ctx "step" "") else - let condact_ctx = + let condact_ctx = match soc.instances with - | [inst] -> + | [inst] -> let _, get_index = Soc2cInstances.to_array soc.instances in let index = get_index (inst) in - (Printf.sprintf "ctx->%s_tab[%d]" (get_ctx_name condact_soc.key) index) + (Printf.sprintf "_ctx->%s_tab[%d]" (get_ctx_name condact_soc.key) index) | _ -> assert false in - add_ncr (Soc2cStack.gen_step_call soc condact_soc vel_out vel_in + add_ncr (Soc2cIoArgs.gen_step_call soc condact_soc vel_out vel_in condact_ctx "step" ("&"^condact_ctx)) ); - add " ctx->_memory = _false;"; - add " } else if (ctx->_memory == _true) {"; - List.iter2 (fun var ve -> - add (Printf.sprintf " *%s = %s;" (Soc2cStack.string_of_var_expr soc var) - (Soc2cStack.string_of_var_expr soc ve) ) + add " _ctx->_memory = _false;"; + add " } else if (_ctx->_memory == _true) {"; + List.iter2 (fun var ve -> + add (Printf.sprintf " *%s = %s;" (Soc2cIoArgs.string_of_var_expr soc var) + (Soc2cIoArgs.string_of_var_expr soc ve) ) ) vel_out el ; - add " ctx->_memory = _false;"; + add " _ctx->_memory = _false;"; add " }"; !buff (* exported *) -let (get_boolred : Soc.t -> int -> int -> int -> string )= - fun _soc i j k -> +let (get_boolred : Soc.t -> int -> int -> int -> string )= + fun _soc i j k -> let buff = ref "" in let add str = buff:=!buff^(str^"\n") in add " int cpt,i;"; add " cpt=0;"; - add (Printf.sprintf " for (i = 0 ; i < %d ; i += 1) if (i1[i] == _true) cpt++;" k); + add (Printf.sprintf " for (i = 0 ; i < %d ; i += 1) if (i1[i] == _true) cpt++;" k); add (Printf.sprintf " *out = (%d <= cpt && cpt <= %d) ? _true : _false;" i j); !buff diff --git a/lib/socPredef2cStack.mli b/lib/socPredef2cIoArgs.mli similarity index 100% rename from lib/socPredef2cStack.mli rename to lib/socPredef2cIoArgs.mli diff --git a/lib/socPredef2cHeap.ml b/lib/socPredef2cIoCtx.ml similarity index 52% rename from lib/socPredef2cHeap.ml rename to lib/socPredef2cIoCtx.ml index 730f7e14312521ad4ec2e4825220bc94d5aad1ea..d7c51968c207906cdc1c3effc4ae4211b977d5f8 100644 --- a/lib/socPredef2cHeap.ml +++ b/lib/socPredef2cIoCtx.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 29/08/2019 (at 17:10) by Erwan Jahier> *) +(* Time-stamp: <modified the 12/06/2024 (at 16:34) by Erwan Jahier> *) open Data open Soc @@ -7,101 +7,104 @@ open Soc2cIdent (* A boring but simple module... *) let (lustre_binop : Soc.key -> string -> string) = - fun sk op -> - let ctx = get_ctx_name sk in + fun sk op -> + let ctx = "_ctx" in let cast = "(const void *)" in let ctype = match sk with | _,t::_,_ -> Printf.sprintf "sizeof(%s)" (Soc2cUtil.data_type_to_c t "") | _, [],_ -> assert false in (match sk with - | (("Lustre::eq"|"Lustre::equal"),(Array _)::_,_) -> - Printf.sprintf " %s.out = memcmp(%s %s.i1, %s %s.i2, %s)==0;\n" + | (("Lustre::eq"|"Lustre::equal"),(Array _)::_,_) -> + Printf.sprintf " %s->out = memcmp(%s %s->i1, %s %s->i2, %s)==0;\n" ctx ctx cast ctx cast ctype - | (("Lustre::eq"|"Lustre::equal"),(Struct _)::_,_) -> - Printf.sprintf " %s.out = memcmp(%s &%s.i1, %s &%s.i2, %s)==0;\n" + | (("Lustre::eq"|"Lustre::equal"),(Struct _)::_,_) -> + Printf.sprintf " %s->out = memcmp(%s &%s->i1, %s &%s->i2, %s)==0;\n" ctx ctx cast ctx cast ctype | (("Lustre::neq"|"Lustre::diff"),(Array _)::_,_) -> - Printf.sprintf " %s.out = !memcmp(%s %s.i1, %s %s.i2, %s)==0;\n" + Printf.sprintf " %s->out = !memcmp(%s %s->i1, %s %s->i2, %s)==0;\n" ctx ctx cast ctx cast ctype | (("Lustre::neq"|"Lustre::diff"),(Struct _)::_,_) -> - Printf.sprintf " %s.out = !memcmp(%s &%s.i1, %s &%s.i2, %s)==0;\n" + Printf.sprintf " %s->out = !memcmp(%s &%s->i1, %s &%s->i2, %s)==0;\n" ctx ctx cast ctx cast ctype - | _ -> - Printf.sprintf " %s.out = (%s.i1 %s %s.i2);\n" ctx ctx op ctx + | _ -> + Printf.sprintf " %s->out = (%s->i1 %s %s->i2);\n" ctx ctx op ctx ) let (lustre_unop : Soc.key -> string -> string) = - fun sk op -> - let ctx = get_ctx_name sk in + fun _sk op -> + let ctx = "_ctx" in (* use gen_assign? *) - Printf.sprintf" %s.out = %s %s.i1;\n" ctx op ctx + Printf.sprintf" %s->out = %s %s->i1;\n" ctx op ctx let (lustre_ite : Soc.key -> string) = - fun sk -> - let ctx = get_ctx_name sk in - let t = match sk with (_,_::t::_,_) -> t | _ -> assert false in -(* Printf.sprintf" %s.z = (%s.c)? %s.xt : %s.xe;\n" ctx ctx ctx ctx *) - Soc2cHeap.gen_assign t (Printf.sprintf "%s.out" ctx) - (Printf.sprintf "(%s.cond)? %s.xthen : %s.xelse" ctx ctx ctx) - + fun sk -> + let ctx = "_ctx" in + let t = match sk with (_,_::t::_,_) -> t | _ -> assert false in + (* Printf.sprintf" %s.z = (%s.c)? %s.xt : %s.xe;\n" ctx ctx ctx ctx *) + Soc2cIoCtx.gen_assign t (Printf.sprintf "%s->out" ctx) + (Printf.sprintf "(%s.cond)? %s.xthen : %s.xelse" ctx ctx ctx) + let (lustre_impl : Soc.key -> string) = - fun sk -> - let ctx = get_ctx_name sk in - (* use gen_assign? *) - Printf.sprintf" %s.out = (!%s.i1 || %s.i2);\n" ctx ctx ctx + fun _sk -> + let ctx = "_ctx" in + (* use gen_assign? *) + Printf.sprintf" %s->out = (!%s->i1 || %s->i2);\n" ctx ctx ctx + - let (lustre_arrow : Soc.key -> string) = - fun sk -> - let x,y,z = "ctx->i1", "ctx->i2", "ctx->out" in + fun sk -> + let x,y,z = "_ctx->i1", "_ctx->i2", "_ctx->out" in let t = match sk with (_,_::t::_,_) -> t | _ -> assert false in - let vo = Printf.sprintf"((ctx->_memory)? %s : %s)" x y in - (Soc2cHeap.gen_assign t z vo) ^ (" ctx->_memory = _false;\n") - + let vo = Printf.sprintf"((_ctx->_memory)? %s : %s)" x y in + (Soc2cIoCtx.gen_assign t z vo) ^ (" _ctx->_memory = _false;\n") + let (lustre_hat : Soc.key -> string) = - fun (n,tl,si_opt) -> - let ctx = get_ctx_name (n,tl,si_opt) in + fun (_n,tl,_si_opt) -> + let ctx = "_ctx" + (* get_ctx_name (n,tl,si_opt) *) + in let i,t = match tl with | [_;Data.Array(t,i)] -> i,t | _ -> assert false in let buff = ref "" in for j=0 to i-1 do - buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.out[%d]" ctx j) - (Printf.sprintf "%s.i1" ctx)); + buff := !buff^(Soc2cIoCtx.gen_assign t (Printf.sprintf "%s->out[%d]" ctx j) + (Printf.sprintf "%s->i1" ctx)); done; !buff let (lustre_array: Soc.key -> string) = - fun (n,tl,si_opt) -> - let ctx = get_ctx_name (n,tl,si_opt) in + fun (_n,tl,_si_opt) -> + let ctx = "_ctx" in let t,i = match List.hd (List.rev tl) with | Data.Array(t,i) -> t,i | _ -> assert false in let buff = ref "" in for j=0 to i-1 do - buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.out[%d]" ctx j) - (Printf.sprintf "%s.i%d" ctx (j+1))); + buff := !buff^(Soc2cIoCtx.gen_assign t (Printf.sprintf "%s->out[%d]" ctx j) + (Printf.sprintf "%s->i%d" ctx (j+1))); done; !buff - + let (lustre_concat: Soc.key -> string) = - fun (n,tl,si_opt) -> - let ctx = get_ctx_name (n,tl,si_opt) in + fun (_n,tl,_si_opt) -> + (* let ctx = get_ctx_name (n,tl,si_opt) in *) + let ctx = "_ctx" in let t,s1,s2 = match tl with | [Data.Array(t,s1); Data.Array(_,s2); _] -> t,s1,s2 | _ -> assert false in - let t1 = Printf.sprintf "%s.i1" ctx - and t2 = Printf.sprintf "%s.i2" ctx - and t12 = Printf.sprintf "%s.out" ctx + let t1 = Printf.sprintf "%s->i1" ctx + and t2 = Printf.sprintf "%s->i2" ctx + and t12 = Printf.sprintf "%s->out" 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 + and t2_type = Soc2cUtil.data_type_to_c (Data.Array(t,s2)) "" + in if not Lv6MainArgs.global_opt.Lv6MainArgs.gen_wcet then ( - (Printf.sprintf " memcpy(&%s, &%s, sizeof(%s));\n" t12 t1 t1_type)^ + (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) ^ (Printf.sprintf " memcpy(&%s[%d], &%s, sizeof(%s));\n" t12 s1 t2 t2_type) ) @@ -109,13 +112,13 @@ let (lustre_concat: Soc.key -> string) = (* Both seems to work *) let buff = ref "" in for j=0 to s1-1 do - buff := !buff^(Soc2cHeap.gen_assign t + buff := !buff^(Soc2cIoCtx.gen_assign t (Printf.sprintf "%s[%d]" t12 j) (Printf.sprintf "%s[%d]" t1 j) ); done; for j=s1 to s1+s2-1 do - buff := !buff^(Soc2cHeap.gen_assign t + buff := !buff^(Soc2cIoCtx.gen_assign t (Printf.sprintf "%s[%d]" t12 j) (Printf.sprintf "%s[%d]" t2 (j-s1)) ); @@ -123,23 +126,23 @@ let (lustre_concat: Soc.key -> string) = !buff let (lustre_slice: Soc.key -> string) = - fun (n,tl,si_opt) -> - let ctx = get_ctx_name (n,tl,si_opt) in + fun (_n,tl,si_opt) -> + let ctx = "_ctx" in let t, _size = match List.hd (List.rev tl) with | Data.Array(t,i) -> t,i | _ -> assert false in match si_opt with - | Slic(b,e,step) -> - let buff = ref "" in + | Slic(b,e,step) -> + let buff = ref "" in let j=ref 0 in for i = b to e do if (i-b) mod step = 0 then ( - buff := !buff^(Soc2cHeap.gen_assign t (Printf.sprintf "%s.out[%d]" ctx !j) - (Printf.sprintf "%s.i1[%d]" ctx i) - ); + buff := !buff^(Soc2cIoCtx.gen_assign t (Printf.sprintf "%s->out[%d]" ctx !j) + (Printf.sprintf "%s->i1[%d]" ctx i) + ); incr j); - done; + done; !buff | _ -> assert false @@ -147,39 +150,39 @@ let (lustre_slice: Soc.key -> string) = (* exported *) let (get_predef_op: Soc.key -> string) = - fun sk -> + fun sk -> let (n,_tl,_si_opt) = sk in match n with - | "Lustre::rplus" + | "Lustre::rplus" | "Lustre::plus" - | "Lustre::iplus" -> lustre_binop sk "+" - | "Lustre::itimes" + | "Lustre::iplus" -> lustre_binop sk "+" + | "Lustre::itimes" | "Lustre::times" - | "Lustre::rtimes" -> lustre_binop sk "*" + | "Lustre::rtimes" -> lustre_binop sk "*" | "Lustre::idiv" - | "Lustre::div" - | "Lustre::rdiv" -> lustre_binop sk "/" - | "Lustre::islash" - | "Lustre::slash" + | "Lustre::div" + | "Lustre::rdiv" -> lustre_binop sk "/" + | "Lustre::islash" + | "Lustre::slash" | "Lustre::rslash" -> lustre_binop sk "/" | "Lustre::iminus" | "Lustre::minus" - | "Lustre::rminus" -> lustre_binop sk "-" + | "Lustre::rminus" -> lustre_binop sk "-" | "Lustre::mod" -> lustre_binop sk "%" | "Lustre::iuminus" - | "Lustre::uminus" - | "Lustre::ruminus"-> lustre_unop sk "-" + | "Lustre::uminus" + | "Lustre::ruminus"-> lustre_unop sk "-" - | "Lustre::eq" -> lustre_binop sk "==" - | "Lustre::equal" -> lustre_binop sk "==" + | "Lustre::eq" -> lustre_binop sk "==" + | "Lustre::equal" -> lustre_binop sk "==" - | "Lustre::and" -> lustre_binop sk "&&" - | "Lustre::neq" -> lustre_binop sk "!=" - | "Lustre::diff" -> lustre_binop sk "!=" - | "Lustre::or" -> lustre_binop sk "||" + | "Lustre::and" -> lustre_binop sk "&&" + | "Lustre::neq" -> lustre_binop sk "!=" + | "Lustre::diff" -> lustre_binop sk "!=" + | "Lustre::or" -> lustre_binop sk "||" - | "Lustre::xor" -> lustre_binop sk "!=" + | "Lustre::xor" -> lustre_binop sk "!=" | "Lustre::not" -> lustre_unop sk "!" | "Lustre::real2int" -> lustre_unop sk "(_integer)" | "Lustre::int2real" -> lustre_unop sk "(_real)" @@ -190,7 +193,7 @@ let (get_predef_op: Soc.key -> string) = | "Lustre::gt" | "Lustre::rgt" | "Lustre::igt" -> lustre_binop sk ">" - | "Lustre::lte" + | "Lustre::lte" | "Lustre::rlte" | "Lustre::ilte" -> lustre_binop sk "<=" | "Lustre::gte" @@ -217,43 +220,43 @@ let (get_predef_op: Soc.key -> string) = | _ -> assert false -let rec type_elt_of_array = function +let rec type_elt_of_array = function | Data.Array(t,_) -> t | Data.Alias(_,t) -> type_elt_of_array t | _ -> assert false (* exported *) -let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = - fun soc iterator it_soc n -> +let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = + fun soc iterator it_soc n -> 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,ctx_access = + 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 ctx_access = Printf.sprintf "_ctx->" in let (array_index : int -> var -> Soc.var_expr) = fun i (vn,vt) -> Var(Printf.sprintf "%s%s[%d]" ctx_access vn i, type_elt_of_array vt) - in - Array.make n "", - Array.make n (get_ctx_name it_soc.key), + in + Array.make n (Printf.sprintf "&_ctx->%s" (get_ctx_name it_soc.key)), + Array.make n (Printf.sprintf "_ctx->%s" (get_ctx_name it_soc.key)), array_index,ctx_access ) - | _ -> + | _ -> let il, _ = Soc2cInstances.to_array soc.instances in let step_args = List.flatten(List.map( - fun (sk,i) -> + fun (sk,i) -> let l = Lv6util.gen_N i in let id = get_ctx_name sk in - let step_args = List.map (fun n -> Printf.sprintf "ctx->%s_tab[%d]" id n) l in + let step_args = List.map (fun n -> Printf.sprintf "_ctx->%s_tab[%d]" id n) l in step_args ) il) in let ctx = step_args in let step_args = List.map (fun x -> "&"^x) step_args in - let ctx_access = "ctx->" in + let ctx_access = "_ctx->" in let (array_index : int -> var -> Soc.var_expr) = - fun i (vn,vt) -> Var(Printf.sprintf "ctx->%s[%d]" vn i,vt) + fun i (vn,vt) -> Var(Printf.sprintf "_ctx->%s[%d]" vn i,vt) in Array.of_list step_args, Array.of_list ctx, @@ -263,7 +266,7 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = for i=0 to n-1 do let vel_in, vel_out = match iterator with - | "map" -> + | "map" -> (List.map (array_index i) iter_inputs, List.map (array_index i) iter_outputs) | "fold" | "red" | "fill" | "fillred" -> @@ -275,67 +278,67 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = | _ -> assert false (* should not occur *) in buff := !buff^( - Soc2cHeap.gen_step_call - soc it_soc vel_out vel_in ctx.(i) node_step step_args.(i)) + Soc2cIoCtx.gen_step_call + soc it_soc false vel_out vel_in (ctx.(i)) node_step (step_args.(i))) done; if iterator <> "map" then ( 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) (* a_out=a_n *) + buff := !buff^(Soc2cIoCtx.gen_assign type_in a_out a_in) (* a_out=a_n *) ); !buff - + (* exported *) -let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) = - fun soc condact_soc el -> - let buff = ref "" in - let add str = buff:=!buff^(str^"\n") in - let add_ncr str = buff:=!buff^(str) in - - let clk = Printf.sprintf "ctx->activate" in - let vel_in,vel_out = soc.profile in - let vel_in = List.tl vel_in in - let vel_in = List.map (fun var -> Var var) vel_in in - let vel_out = List.map (fun var -> Var var) vel_out in - add (Printf.sprintf "\n if (%s == _true) { " clk); - if SocUtils.is_memory_less condact_soc then - let condact_ctx = get_ctx_name condact_soc.key in - add (Soc2cHeap.gen_step_call soc condact_soc vel_out vel_in condact_ctx "step" "") - else ( - let condact_ctx = - match soc.instances with - | [inst] -> - let _, get_index = Soc2cInstances.to_array soc.instances in - let index = get_index (inst) in - (Printf.sprintf "ctx->%s_tab[%d]" (get_ctx_name condact_soc.key) index) - | _ -> assert false - in - add_ncr (Soc2cHeap.gen_step_call soc condact_soc vel_out vel_in - condact_ctx "step" ("&"^condact_ctx)) - ); - add " ctx->_memory = _false;"; - add " } else if (ctx->_memory == _true) {"; - List.iter2 (fun var ve -> - add (Printf.sprintf " %s = %s;" (Soc2cHeap.string_of_var_expr soc var) - (Soc2cHeap.string_of_var_expr soc ve) ) +let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) = + fun soc condact_soc el -> + let buff = ref "" in + let add str = buff:=!buff^(str^"\n") in + let add_ncr str = buff:=!buff^(str) in + + let clk = Printf.sprintf "_ctx->activate" in + let vel_in,vel_out = soc.profile in + let vel_in = List.tl vel_in in + let vel_in = List.map (fun var -> Var var) vel_in in + let vel_out = List.map (fun var -> Var var) vel_out in + add (Printf.sprintf "\n if (%s == _true) { " clk); + if SocUtils.is_memory_less condact_soc then + let condact_ctx = get_ctx_name condact_soc.key in + add (Soc2cIoCtx.gen_step_call soc condact_soc false vel_out vel_in condact_ctx "step" "") + else ( + let condact_ctx = + match soc.instances with + | [inst] -> + let _, get_index = Soc2cInstances.to_array soc.instances in + let index = get_index (inst) in + (Printf.sprintf "_ctx->%s_tab[%d]" (get_ctx_name condact_soc.key) index) + | _ -> assert false + in + add_ncr (Soc2cIoCtx.gen_step_call soc condact_soc false vel_out vel_in + condact_ctx "step" ("&"^condact_ctx)) + ); + add " _ctx->_memory = _false;"; + add " } else if (_ctx->_memory == _true) {"; + List.iter2 (fun var ve -> + add (Printf.sprintf " %s = %s;" (Soc2cIoCtx.string_of_var_expr soc var) + (Soc2cIoCtx.string_of_var_expr soc ve) ) ) vel_out el ; - add " ctx->_memory = _false;"; - add " }"; - !buff + add " _ctx->_memory = _false;"; + add " }"; + !buff (* exported *) -let (get_boolred : Soc.t -> int -> int -> int -> string )= - fun soc i j k -> - let ctx = get_ctx_name soc.key in +let (get_boolred : Soc.t -> int -> int -> int -> string )= + fun _soc i j k -> + let ctx = "_ctx" in let buff = ref "" in let add str = buff:=!buff^(str^"\n") in add " int cpt,i;"; add " cpt=0;"; add (Printf.sprintf - " for (i = 0 ; i < %d ; i += 1) if (%s.i1[i] == _true) cpt++;" k ctx); - add (Printf.sprintf " %s.out = (%d <= cpt && cpt <= %d) ? _true : _false;" ctx i j ); + " for (i = 0 ; i < %d ; i += 1) if (%s->i1[i] == _true) cpt++;" k ctx); + add (Printf.sprintf " %s->out = (%d <= cpt && cpt <= %d) ? _true : _false;" ctx i j ); !buff diff --git a/lib/socPredef2cHeap.mli b/lib/socPredef2cIoCtx.mli similarity index 100% rename from lib/socPredef2cHeap.mli rename to lib/socPredef2cIoCtx.mli diff --git a/lib/socUtils.ml b/lib/socUtils.ml index 2e6b14829e18204cac5e76e80b3d5db40d54b964..76e213537ee420c595d35dfb54b80cbd25805850 100644 --- a/lib/socUtils.ml +++ b/lib/socUtils.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 21/03/2022 (at 11:11) by Erwan Jahier> *) +(** Time-stamp: <modified the 17/06/2024 (at 15:38) by Erwan Jahier> *) open Soc @@ -33,9 +33,9 @@ let call_fun_ff: ((Format.formatter -> unit) -> string) = fun f -> s (* Type *) -let rec string_of_type_ref_ff: (Data.t -> Format.formatter -> unit) = fun v ff -> +let rec string_of_type_ref_ff: (Data.t -> Format.formatter -> unit) = fun v ff -> let str = Data.type_to_string_alias v in - fprintf ff "%s" str + fprintf ff "%s" str and string_of_type_ref: (Data.t -> string) = fun v -> call_fun_ff (string_of_type_ref_ff v) @@ -50,33 +50,33 @@ let string_of_var: (Soc.var -> string) = fun v -> call_fun_ff (string_of_var_ff v) -let string_of_instance_ff: (instance -> Format.formatter -> unit) = +let string_of_instance_ff: (instance -> Format.formatter -> unit) = fun (name,_sk) ff -> fprintf ff "%s" name let _string_of_instance: (instance -> string) = fun (name,_sk) -> name - + (* Filtre d'accès *) -let rec string_of_filter_ff: (Soc.var_expr -> Format.formatter -> unit) = +let rec string_of_filter_ff: (Soc.var_expr -> Format.formatter -> unit) = fun v ff -> match v with - | Const(id, _) + | Const(id, _) | Var (id,_) -> fprintf ff "%s" id | Field(f, id,_) -> string_of_filter_ff f ff; fprintf ff ".%s" id | Index(f, index,_) -> string_of_filter_ff f ff; fprintf ff "[%d]" index | Slice(f,fi,la,st,_wi,_vt) -> - string_of_filter_ff f ff; fprintf ff "[%d..%d step %d]" fi la st + string_of_filter_ff f ff; fprintf ff "[%d..%d step %d]" fi la st let string_of_filter: (Soc.var_expr -> string) = fun v -> call_fun_ff (string_of_filter_ff v) (* Clé de composant *) -let string_of_soc_key_ff: (Soc.key -> Format.formatter -> unit) = +let string_of_soc_key_ff: (Soc.key -> Format.formatter -> unit) = fun (id, types, si_opt) ff -> (match types with | [] -> fprintf ff "%s" id - | _ -> fprintf ff "%s:%s" id + | _ -> fprintf ff "%s:%s" id (String.concat " -> " (List.map string_of_type_ref types))); (match si_opt with | Nomore -> () @@ -84,17 +84,17 @@ let string_of_soc_key_ff: (Soc.key -> Format.formatter -> unit) = | Slic(f,l,step) -> fprintf ff "[%d .. %d step %d]" f l step | MemInit ve -> string_of_filter_ff ve ff ) - + let string_of_soc_key: (Soc.key -> string) = fun v -> call_fun_ff (string_of_soc_key_ff v) (* Opération *) -let string_of_operation_ff: (atomic_operation -> Format.formatter -> unit) = +let string_of_operation_ff: (atomic_operation -> Format.formatter -> unit) = fun v ff -> match v with | Assign -> () (* On suppose qu'il est déjà affiché dans string_of_gao *) - | Method((n, _sk),sname) -> fprintf ff "%s.%s" n sname - | Procedure(proc) -> fprintf ff "%s" (string_of_soc_key proc) + | Method((n, _sk),sname,_) -> fprintf ff "%s.%s" n sname + | Procedure(proc,_) -> fprintf ff "%s" (string_of_soc_key proc) let string_of_operation: (atomic_operation -> string) = fun v -> call_fun_ff (string_of_operation_ff v) @@ -115,7 +115,7 @@ let rec string_of_gao_ff: (gao -> Format.formatter -> unit) = fun v ff -> match let _ = match dests with | [] -> () (* pas de destinations, on affiche pas de "=" *) - | _ -> + | _ -> let dests = String.concat ", " (List.map string_of_filter dests) in fprintf ff "%s = " dests in @@ -155,7 +155,7 @@ let string_interface_of_method: (Soc.t -> step_method -> string) = fun c m -> (* Méthode complète *) -let string_of_method_ff: (Soc.t -> step_method -> Format.formatter -> unit) = +let string_of_method_ff: (Soc.t -> step_method -> Format.formatter -> unit) = fun c m ff -> fprintf ff "@[<v>@[<v 2>"; string_interface_of_method_ff c m ff; @@ -222,7 +222,7 @@ let string_of_soc_factory_ff: ( (instance -> Format.formatter -> unit) option -> (* Formatage des mémoires *) unit ) = fun comp ff format_meth format_mem -> - let display_mem () = + let display_mem () = match format_mem with | None -> () | Some f -> ( @@ -291,7 +291,7 @@ let string_of_soc_ff: (Soc.t -> Format.formatter -> unit) = fun comp ff -> let string_of_soc: (Soc.t -> string) = fun v -> call_fun_ff (string_of_soc_ff v) -let output: (bool -> string -> Soc.t list -> unit) = +let output: (bool -> string -> Soc.t list -> unit) = fun no_header pkg_name socs -> let header = "Package '" ^ pkg_name ^ "' :" in let deco = (String.make (String.length header) '=') in @@ -319,13 +319,13 @@ let (find : Lxm.t -> Soc.key -> Soc.tbl -> Soc.t) = let (add: key -> t -> tbl -> tbl) = fun k soc tbl -> - SocMap.add k soc tbl - + SocMap.add k soc tbl + let (find_no_exc : Soc.key -> Soc.tbl -> Soc.t) = - fun sk soc_tbl -> + fun sk soc_tbl -> try find (Lxm.dummy "") sk soc_tbl with Lv6errors.Compile_error(_,msg) -> - print_string msg; + print_string msg; flush stdout; assert false @@ -338,37 +338,37 @@ let gen_index_list n = let _ = assert (gen_index_list 5 = [0;1;2;3;4]) -external format_float: string -> float -> string = "caml_format_float" +external format_float: string -> float -> string = "caml_format_float" (* external format_float: string -> float -> string = "format_float" *) - + let (my_string_of_float_precision : int option -> float -> string) = - fun p_opt f -> + fun p_opt f -> match p_opt with | None -> string_of_float f - | Some p -> - let precision_str = string_of_int p in - format_float ("%." ^ precision_str ^ "f") f + | Some p -> + let precision_str = string_of_int p in + format_float ("%." ^ precision_str ^ "f") f let (is_memory_less : Soc.t -> bool) = - fun soc -> - soc.memory = No_mem && soc.instances = [] + fun soc -> + soc.memory = No_mem && soc.instances = [] && soc.tasks = [] (* exported *) let (ctx_is_global : Soc.t -> bool) = - fun soc -> + fun soc -> match Lv6MainArgs.global_opt.Lv6MainArgs.io_transmit_mode with - | Lv6MainArgs.Heap -> is_memory_less soc - | Lv6MainArgs.Stack | Lv6MainArgs.HeapStack -> false + | Lv6MainArgs.Ctx -> is_memory_less soc + | Lv6MainArgs.Args | Lv6MainArgs.CtxArgs -> false let (get_rank : 'a -> ('a * 'b) list -> int) = - fun x l -> + fun x l -> let rec aux i l = match l with | [] -> 0 | (y,_)::l -> if x = y then i else aux (i+1) l in aux 1 l - + let _ = assert (get_rank 5 [(1,4);(3,4);(5,5)] = 3) @@ -378,46 +378,45 @@ let (filter_step_params : int list -> 'a list -> 'a list) = match il,vl with | [],_ -> acc | _::_, [] -> assert false - | i::til,v::tvl -> - if i = idx then aux til tvl (idx+1) (v::acc) - else if i > idx then aux il tvl (idx+1) acc + | i::til,v::tvl -> + if i = idx then aux til tvl (idx+1) (v::acc) + else if i > idx then aux il tvl (idx+1) acc else assert false - in + in List.rev (aux il vl 0 []) let _ = ( assert (filter_step_params [0;1;4] ["v1";"v2";"v3";"v4";"v5"] = ["v1";"v2";"v5"])) - + let rec (get_top_var : Soc.var_expr -> Soc.var_expr) = - fun var -> + fun var -> (* if var = t.[2].field, then it returns (also) t.[2] and t *) match var with | Soc.Slice(ve,_,_,_,_,_) - | Soc.Field(ve,_,_) + | Soc.Field(ve,_,_) | Soc.Index(ve,_,_) -> get_top_var ve | Soc.Var(_,_vt) - | Soc.Const(_,_vt) -> var + | Soc.Const(_,_vt) -> var open Soc2cIdent -let rec (lustre_string_of_var_expr: Soc.var_expr -> string) = +let rec (lustre_string_of_var_expr: Soc.var_expr -> string) = function | Const("true", _) -> "true" | Const("false", _) -> "false" | Const(id, _) -> id2s id | Var (id,_) -> id - | Field(f, id,_) -> Printf.sprintf "%s.%s" (lustre_string_of_var_expr f) (id2s id) + | Field(f, id,_) -> Printf.sprintf "%s.%s" (lustre_string_of_var_expr f) (id2s id) | Index(f, index,_) -> Printf.sprintf "%s[%i]" (lustre_string_of_var_expr f) index | Slice(_f,_fi,_la,_st,_wi,_vt) -> assert false (* should not occur *) -let rec (string_of_var_expr: Soc.var_expr -> string) = +let rec (string_of_var_expr: Soc.var_expr -> string) = function | Const("true", t) -> "true:" ^(Data.type_to_string t) | Const("false", t) -> "false:"^(Data.type_to_string t) | Const(id, t) -> id^":"^(Data.type_to_string t) | Var (id,t) -> id^":"^(Data.type_to_string t) - | Field(f, id,_) -> Printf.sprintf "%s.%s" (string_of_var_expr f) (id2s id) + | Field(f, id,_) -> Printf.sprintf "%s.%s" (string_of_var_expr f) (id2s id) | Index(f, index,_) -> Printf.sprintf "%s[%i]" (string_of_var_expr f) index | Slice(_f,_fi,_la,_st,_wi,_vt) -> assert false (* should not occur *) - diff --git a/lib/socVar.ml b/lib/socVar.ml index fdd92a10237020f7fad6a5101dae7406fb2a2f18..50067a6912b77fabae529d6bd3794e86825b605c 100644 --- a/lib/socVar.ml +++ b/lib/socVar.ml @@ -1,32 +1,37 @@ -(* Time-stamp: <modified the 12/03/2020 (at 15:02) by Erwan Jahier> *) +(* Time-stamp: <modified the 05/06/2024 (at 15:15) by Erwan Jahier> *) open Data -let rec (expand_profile : bool -> bool -> Soc.var list -> Soc.var list) = - fun enum_flag c_access vl -> - let res = List.flatten (List.map (expand_var enum_flag c_access) vl) in +type acces_mode = + | C + | PP + + +let rec (expand_profile : bool -> acces_mode -> Soc.var list -> Soc.var list) = + fun enum_flag access_mode vl -> + let res = List.flatten (List.map (expand_var enum_flag access_mode) vl) in (* fix point. now useless ? *) if List.length res = List.length vl then res else - expand_profile enum_flag c_access res -and expand_var enum_flag c_access var = match var with + expand_profile enum_flag access_mode res +and expand_var enum_flag access_mode var = match var with | (_vn,(Bool| Int | Real)) -> [var] | (vn,Enum(_n,_l)) -> if enum_flag then [vn,Int] else [var] | (vn,Array(vt,i)) -> let res = ref [] in for k=i-1 downto 0 do - let access = - if c_access then "["^(string_of_int k)^"]" else "_"^(string_of_int k) + let access = + if access_mode <> PP then "["^(string_of_int k)^"]" else "_"^(string_of_int k) in res := (vn^access,vt) :: !res; done; - (expand_profile enum_flag c_access !res) - | (vn,Struct(_name,fl)) -> - expand_profile enum_flag c_access - (List.map (fun (fn,t) -> vn^(if c_access then "." else "_")^fn,t ) fl) + (expand_profile enum_flag access_mode !res) + | (vn,Struct(_name,fl)) -> + expand_profile enum_flag access_mode + (List.map (fun (fn,t) -> vn^(match access_mode with C -> "." | PP -> "_")^fn,t ) fl) | (_vn,Extern _id) -> [var] - | (vn,Alias(_n, t)) -> expand_var enum_flag c_access (vn,t) - | (_vn,Alpha _) -> assert false (* should not occur *) - | (_vn, String) -> assert false (* should not occur *) + | (vn,Alias(_n, t)) -> expand_var enum_flag access_mode (vn,t) + | (_vn,Alpha _) -> assert false (* should not occur *) + | (_vn, String) -> assert false (* should not occur *) let (_int_to_enum : Data.v -> Soc.ident list -> Data.v) = fun v el -> @@ -41,11 +46,11 @@ let (expand_subst: Data.subst -> Data.subst list) = match v with | U | I _ | F _ | B _ | Str _ -> (n,v)::acc | E(_e,i) -> (n,I i)::acc - | S fl -> + | S fl -> let f (fn,fv) = n^"_"^fn, fv in let fl = List.map f fl in List.fold_left aux acc fl - | A a -> + | A a -> let res = ref acc in for i=0 to (Array.length a)-1 do let n_i = n^"_"^(string_of_int i) in @@ -70,19 +75,19 @@ type sl = Data.subst list (* Reconstruct the flattenned data *) let (unexpand_profile : sl -> Soc.var list -> sl) = - fun sl vl -> + fun sl vl -> let rec (aux : sl -> sl -> Soc.var list -> sl * sl)= - fun sl_done sl_todo vl -> + fun sl_done sl_todo vl -> (* Returns the (accumulated) result and the unused subst (which should be empty at the top-level call) *) match sl_todo, vl with - | [],_::_ -> sl_done,[] + | [],_::_ -> sl_done,[] | _,[] -> sl_done, sl_todo | s::sl, (_, (Bool| Int | Real | Extern _ | String ))::vl -> aux (s::sl_done) sl vl - | (id,v)::sl, (_,Enum(_n,el))::vl -> + | (id,v)::sl, (_,Enum(_n,el))::vl -> let s = (id, int_to_enum v el) in - aux (s::sl_done) sl vl + aux (s::sl_done) sl vl | _, (vn, Array(vt,i))::vl -> ( let sl_todo_ref = ref sl_todo in let sl_done_ref = ref [] in @@ -94,17 +99,17 @@ let (unexpand_profile : sl -> Soc.var list -> sl) = sl_todo_ref:=sl_todo_v; sl_done_ref:=sl_done_v; Array.set res k (snd (List.hd !sl_done_ref)); - done; + done; let sl_done = (vn, A res)::sl_done in aux sl_done !sl_todo_ref vl ) - | _, (vn,Struct(_sn,fl))::vl -> + | _, (vn,Struct(_sn,fl))::vl -> let sl_todo, fl = List.fold_left aux_field (sl_todo,[]) fl in let sl_done = (vn, S fl)::sl_done in aux sl_done sl_todo vl - | _, (_vn,Alpha _ )::_ -> assert false (* should not occur *) - | _, (_, Alias _)::_ -> assert false (* should not occur *) + | _, (_vn,Alpha _ )::_ -> assert false (* should not occur *) + | _, (_, Alias _)::_ -> assert false (* should not occur *) and (aux_field : sl * (ident * Data.v) list -> ident * Data.t -> sl * (ident * Data.v) list ) = fun (sl_todo, fl) (fn, t) -> diff --git a/lib/socVar.mli b/lib/socVar.mli index f7532ff6cb6e8f3f5cacf4055017d56a71f4d0cb..387c8f837f239bef533ec7534105150e6790892b 100644 --- a/lib/socVar.mli +++ b/lib/socVar.mli @@ -1,10 +1,10 @@ -(* Time-stamp: <modified the 21/03/2018 (at 17:30) by Erwan Jahier> *) +(* Time-stamp: <modified the 05/06/2024 (at 15:13) by Erwan Jahier> *) (** Expand struct and arrays when communicating with the outside world *) -(** If the first bool flag is true, enum are translated into integers +(** If the first bool flag is true, enum are translated into integers If the second one is true, we generate var name that actually corresponds to their access in C. For instance, an array element that is itself in a structure @@ -12,7 +12,10 @@ XXX should be 2 functions: expand_profile and expand_profile_for_c *) -val expand_profile : bool -> bool -> Soc.var list -> Soc.var list +type acces_mode = + C (* C syntax *) + | PP (* for pretty-print *) +val expand_profile : bool -> acces_mode -> Soc.var list -> Soc.var list val unexpand_profile : Data.subst list -> Soc.var list -> Data.subst list val expand_subst: Data.subst -> Data.subst list diff --git a/lv6-ref-man/lv6-ref-man.tex b/lv6-ref-man/lv6-ref-man.tex index 34212a914f618dafd3adea6f222e96a4a34e61ca..3008d86efb8beed972fc92e5b58bad21b4be11b0 100644 --- a/lv6-ref-man/lv6-ref-man.tex +++ b/lv6-ref-man/lv6-ref-man.tex @@ -1246,6 +1246,7 @@ Here are a few examples of array declarations and definitions. \newcommand{\reduceop}{{\tt red}} % Reduce \newcommand{\redop}{{\tt red}} % Reduce \newcommand{\fillredop}{{\tt fillred}} % fill/reduce +\newcommand{\foldop}{{\tt fold}} % f \newcommand{\boolredop}{{\tt boolred}} %Boolean reduce @@ -1439,7 +1440,7 @@ $\forall i = 0 \cdots \mbox{\tt n}-1$, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% FILLRED ITERATOR -\subsection{From arrays to arrays: \fillredop} +\subsection{From arrays to arrays: \fillredop (a.k.a. \foldop} \label{fillred-iterator} diff --git a/test/Makefile b/test/Makefile index f6358f47aeadddb9b647e6a9e3520fb33ee577bd..d0ecd38db50c178d65796299b5a527c8e757bcfb 100644 --- a/test/Makefile +++ b/test/Makefile @@ -7,8 +7,9 @@ rest: reftest lus2lic.time jenkins: clean qtest rest -TEST_MACHINE=ssh ovaz -TEST_MACHINE=eval +ifndef TEST_MACHINE + TEST_MACHINE=eval +endif # This fixes sporadic memory errors I get when running tests OCAMLRUNPARAM=s=1M,i=32M,o=150 @@ -63,17 +64,22 @@ utest: valgrind.res: grep -n ERROR tmp1/*.log | grep -v ' 0 errors' > $@; [ ! -s $@ ] -# reftest isslower than qtest, but less sensible to the load of the machine (which is better wrt time measurements) +# reftest is slower than qtest (less proc are used), but less sensible +# to the load of the machine (which is better wrt time measurements) reftest: rm -f $(LOG) $(TEST_MACHINE) "cd $(testdir); make tmpdirs" time -o lus2lic.ref_time make $(LOG) make lus2lic.time +ifndef CORE_NB + CORE_NB=4 +endif + qtest: rm -f $(LOG) $(TEST_MACHINE) "cd $(testdir); make tmpdirs" - time -o lus2lic.quick_time make -j 4 $(LOG) + time -o lus2lic.quick_time make -j $(CORE_NB) $(LOG) cat lus2lic.quick_time make lus2lic.time @@ -148,3 +154,6 @@ clean: lclean: rm -f *.ec *.lus *.lut *.cov *.gp *.rif *.out *.cov *.c *.h *.log *.sum *time rm -rf Data + +# not gitted stuff +-include ./Makefile.local diff --git a/test/lus2lic.sum b/test/lus2lic.sum index 2f4289580b47998e637af9b82180d84b63e1972d..c84aaf16e205d02eb4fd4929d2359765efe1ea4e 100644 --- a/test/lus2lic.sum +++ b/test/lus2lic.sum @@ -1,5 +1,5 @@ ==> lus2lic0.sum <== -Test run by jahier on Tue Feb 27 15:23:31 +Test run by jahier on Tue Jun 18 15:52:59 Native configuration is x86_64-pc-linux-gnu === lus2lic0 tests === @@ -66,7 +66,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 Tue Feb 27 15:23:33 +Test run by jahier on Tue Jun 18 15:53:00 Native configuration is x86_64-pc-linux-gnu === lus2lic1 tests === @@ -81,149 +81,178 @@ PASS: sh COUNTER.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c COUNTER.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en COUNTER.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang COUNTER.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs COUNTER.lus {} PASS: ./lus2lic {-2c CURRENT.lus -n CURRENT} PASS: sh CURRENT.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c CURRENT.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en CURRENT.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang CURRENT.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs CURRENT.lus {} PASS: ./lus2lic {-2c Condact.lus -n Condact} PASS: ./lus2lic {-2c EDGE.lus -n EDGE} PASS: sh EDGE.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c EDGE.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en EDGE.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang EDGE.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs EDGE.lus {} PASS: ./lus2lic {-2c ELMU.lus -n ELMU} PASS: sh ELMU.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ELMU.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ELMU.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ELMU.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ELMU.lus {} PASS: ./lus2lic {-2c FALLING_EDGE.lus -n FALLING_EDGE} PASS: sh FALLING_EDGE.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c FALLING_EDGE.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en FALLING_EDGE.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang FALLING_EDGE.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs FALLING_EDGE.lus {} PASS: ./lus2lic {-2c FillFollowedByRed.lus -n FillFollowedByRed} PASS: sh FillFollowedByRed.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c FillFollowedByRed.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en FillFollowedByRed.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang FillFollowedByRed.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs FillFollowedByRed.lus {} PASS: ./lus2lic {-2c Gyroscope.lus -n Gyroscope} PASS: sh Gyroscope.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c Gyroscope.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en Gyroscope.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang Gyroscope.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs Gyroscope.lus {} PASS: ./lus2lic {-2c Gyroscope2.lus -n Gyroscope2} PASS: sh Gyroscope2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c Gyroscope2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en Gyroscope2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang Gyroscope2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs Gyroscope2.lus {} PASS: ./lus2lic {-2c aa.lus -n aa} PASS: sh aa.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c aa.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en aa.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang aa.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs aa.lus {} PASS: ./lus2lic {-2c access.lus -n access} PASS: sh access.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c access.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en access.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang access.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs access.lus {} PASS: ./lus2lic --expand-nodes {-2c activation1.lus -n activation1} PASS: sh activation1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c activation1.lus { --expand-nodes} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en activation1.lus { --expand-nodes} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang activation1.lus { --expand-nodes} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs activation1.lus { --expand-nodes} PASS: ./lus2lic --expand-nodes {-2c activation2.lus -n activation2} PASS: sh activation2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c activation2.lus { --expand-nodes} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en activation2.lus { --expand-nodes} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang activation2.lus { --expand-nodes} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs activation2.lus { --expand-nodes} PASS: ./lus2lic {-2c activation_ec.lus -n activation_ec} PASS: sh activation_ec.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c activation_ec.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en activation_ec.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang activation_ec.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs activation_ec.lus {} PASS: ./lus2lic {-2c after.lus -n after} PASS: sh after.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c after.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en after.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang after.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs after.lus {} PASS: ./lus2lic {-2c alias.lus -n alias} PASS: sh alias.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c alias.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en alias.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang alias.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs alias.lus {} PASS: ./lus2lic {-2c amaury.lus -n amaury} PASS: sh amaury.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c amaury.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en amaury.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang amaury.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs amaury.lus {} PASS: ./lus2lic {-2c arbitre.lus -n arbitre} PASS: ./lus2lic {-2c argos.lus -n argos} PASS: sh argos.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c argos.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en argos.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang argos.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs argos.lus {} PASS: ./lus2lic {-2c array_concat.lus -n array_concat} PASS: sh array_concat.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c array_concat.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en array_concat.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang array_concat.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs array_concat.lus {} PASS: ./lus2lic {-2c array_concat2.lus -n array_concat2} PASS: sh array_concat2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c array_concat2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en array_concat2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang array_concat2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs array_concat2.lus {} PASS: ./lus2lic {-2c array_equals.lus -n array_equals} PASS: sh array_equals.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c array_equals.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en array_equals.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang array_equals.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs array_equals.lus {} PASS: ./lus2lic {-2c arrays.lus -n arrays} PASS: sh arrays.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c arrays.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en arrays.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang arrays.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs arrays.lus {} PASS: ./lus2lic --expand-nodes {-2c asservi.lus -n asservi} PASS: ./lus2lic {-2c bad_call03.lus -n bad_call03} PASS: sh bad_call03.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c bad_call03.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en bad_call03.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang bad_call03.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs bad_call03.lus {} PASS: ./lus2lic {-2c bascule.lus -n bascule} PASS: sh bascule.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c bascule.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en bascule.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang bascule.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs bascule.lus {} PASS: ./lus2lic {-2c bob.lus -n bob} PASS: sh bob.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c bob.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en bob.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang bob.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs bob.lus {} PASS: ./lus2lic {-2c bred.lus -n bred} PASS: sh bred.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c bred.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en bred.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang bred.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs bred.lus {} PASS: ./lus2lic {-2c bred_lv4.lus -n bred_lv4} PASS: sh bred_lv4.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c bred_lv4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en bred_lv4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang bred_lv4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs bred_lv4.lus {} PASS: ./lus2lic {-2c bug.lus -n bug} PASS: sh bug.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c bug.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en bug.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang bug.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs bug.lus {} PASS: ./lus2lic {-2c bug2.lus -n bug2} PASS: sh bug2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c bug2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en bug2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang bug2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs bug2.lus {} PASS: ./lus2lic {-2c calculs_max.lus -n calculs_max} PASS: sh calculs_max.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c calculs_max.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en calculs_max.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang calculs_max.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs calculs_max.lus {} PASS: ./lus2lic {-2c call.lus -n call} PASS: ./lus2lic {-2c call01.lus -n call01} PASS: ./lus2lic {-2c call02.lus -n call02} @@ -231,12 +260,14 @@ PASS: sh call02.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c call02.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en call02.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang call02.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs call02.lus {} PASS: ./lus2lic {-2c call03.lus -n call03} PASS: ./lus2lic {-2c call04.lus -n call04} PASS: sh call04.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c call04.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en call04.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang call04.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs call04.lus {} PASS: ./lus2lic {-2c call05.lus -n call05} PASS: ./lus2lic {-2c call06.lus -n call06} PASS: ./lus2lic {-2c call07.lus -n call07} @@ -244,108 +275,129 @@ PASS: sh call07.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c call07.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en call07.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang call07.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs call07.lus {} PASS: ./lus2lic {-2c carV2.lus -n carV2} PASS: sh carV2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c carV2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en carV2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang carV2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs carV2.lus {} PASS: ./lus2lic {-2c carligths.lus -n carligths} PASS: sh carligths.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c carligths.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en carligths.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang carligths.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs carligths.lus {} PASS: ./lus2lic {-2c ck2.lus -n ck2} PASS: sh ck2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ck2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ck2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ck2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ck2.lus {} PASS: ./lus2lic {-2c ck3.lus -n ck3} PASS: sh ck3.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ck3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ck3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ck3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ck3.lus {} PASS: ./lus2lic {-2c ck4.lus -n ck4} PASS: sh ck4.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ck4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ck4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ck4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ck4.lus {} PASS: ./lus2lic {-2c ck5.lus -n ck5} PASS: sh ck5.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ck5.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ck5.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ck5.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ck5.lus {} PASS: ./lus2lic {-2c ck7.lus -n ck7} PASS: sh ck7.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ck7.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ck7.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ck7.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ck7.lus {} PASS: ./lus2lic {-2c clock1_2ms.lus -n clock1_2ms} PASS: sh clock1_2ms.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c clock1_2ms.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en clock1_2ms.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang clock1_2ms.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs clock1_2ms.lus {} PASS: ./lus2lic {-2c clock_ite.lus -n clock_ite} PASS: sh clock_ite.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c clock_ite.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en clock_ite.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang clock_ite.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs clock_ite.lus {} PASS: ./lus2lic {-2c cminus.lus -n cminus} PASS: sh cminus.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c cminus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en cminus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang cminus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs cminus.lus {} PASS: ./lus2lic {-2c complex.lus -n complex} PASS: ./lus2lic {-2c compteur.lus -n compteur} PASS: sh compteur.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c compteur.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en compteur.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang compteur.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs compteur.lus {} PASS: ./lus2lic {-2c cond01.lus -n cond01} PASS: sh cond01.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c cond01.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en cond01.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang cond01.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs cond01.lus {} PASS: ./lus2lic {-2c consensus.lus -n consensus} PASS: sh consensus.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c consensus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en consensus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang consensus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs consensus.lus {} PASS: ./lus2lic {-2c consensus2.lus -n consensus2} PASS: sh consensus2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c consensus2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en consensus2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang consensus2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs consensus2.lus {} PASS: ./lus2lic {-2c contractForElementSelectionInArray.lus -n contractForElementSelectionInArray} PASS: sh contractForElementSelectionInArray.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c contractForElementSelectionInArray.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en contractForElementSelectionInArray.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang contractForElementSelectionInArray.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs contractForElementSelectionInArray.lus {} PASS: ./lus2lic {-2c convert.lus -n convert} PASS: sh convert.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c convert.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en convert.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang convert.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs convert.lus {} PASS: ./lus2lic {-2c count.lus -n count} PASS: sh count.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c count.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en count.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang count.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs count.lus {} PASS: ./lus2lic {-2c cpt.lus -n cpt} PASS: sh cpt.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c cpt.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en cpt.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang cpt.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs cpt.lus {} PASS: ./lus2lic {-2c cst.lus -n cst} PASS: sh cst.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c cst.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en cst.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang cst.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs cst.lus {} PASS: ./lus2lic {-2c dadic.lus -n dadic} PASS: ./lus2lic {-2c deSimone.lus -n deSimone} PASS: sh deSimone.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c deSimone.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en deSimone.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang deSimone.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs deSimone.lus {} PASS: ./lus2lic {-2c decl.lus -n decl} PASS: ./lus2lic {-2c declaration.lus -n declaration} PASS: ./lus2lic {-2c deconne.lus -n deconne} @@ -354,203 +406,243 @@ PASS: sh dep.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c dep.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en dep.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang dep.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs dep.lus {} PASS: ./lus2lic {-2c depend.lus -n depend} PASS: sh depend.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c depend.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en depend.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang depend.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs depend.lus {} PASS: ./lus2lic {-2c dependeur.lus -n dependeur} PASS: sh dependeur.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c dependeur.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en dependeur.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang dependeur.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs dependeur.lus {} PASS: ./lus2lic {-2c dependeur_struct.lus -n dependeur_struct} PASS: sh dependeur_struct.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c dependeur_struct.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en dependeur_struct.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang dependeur_struct.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs dependeur_struct.lus {} PASS: ./lus2lic {-2c double_delay.lus -n double_delay} PASS: sh double_delay.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c double_delay.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en double_delay.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang double_delay.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs double_delay.lus {} PASS: ./lus2lic {-2c ec.lus -n ec} PASS: sh ec.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ec.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ec.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ec.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ec.lus {} PASS: ./lus2lic {-2c enum0.lus -n enum0} PASS: sh enum0.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c enum0.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en enum0.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang enum0.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs enum0.lus {} PASS: ./lus2lic {-2c ex.lus -n ex} PASS: sh ex.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ex.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ex.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ex.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ex.lus {} PASS: ./lus2lic {-2c exclusion.lus -n exclusion} PASS: sh exclusion.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c exclusion.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en exclusion.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang exclusion.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs exclusion.lus {} PASS: ./lus2lic {-2c filliter.lus -n filliter} PASS: sh filliter.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c filliter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en filliter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang filliter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs filliter.lus {} PASS: ./lus2lic {-2c filter.lus -n filter} PASS: sh filter.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c filter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en filter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang filter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs filter.lus {} PASS: ./lus2lic {-2c flo.lus -n flo} PASS: sh flo.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c flo.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en flo.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang flo.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs flo.lus {} PASS: ./lus2lic {-2c followed_by.lus -n followed_by} PASS: sh followed_by.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c followed_by.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en followed_by.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang followed_by.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs followed_by.lus {} PASS: ./lus2lic {-2c foo.lus -n foo} PASS: sh foo.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c foo.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en foo.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang foo.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs foo.lus {} PASS: ./lus2lic {-2c fresh_name.lus -n fresh_name} PASS: sh fresh_name.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c fresh_name.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en fresh_name.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang fresh_name.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs fresh_name.lus {} PASS: ./lus2lic {-2c func_with_body.lus -n func_with_body} PASS: ./lus2lic {-2c hanane.lus -n hanane} PASS: sh hanane.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c hanane.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en hanane.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang hanane.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs hanane.lus {} PASS: ./lus2lic {-2c heater_control.lus -n heater_control} PASS: sh heater_control.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c heater_control.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en heater_control.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang heater_control.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs heater_control.lus {} PASS: ./lus2lic {-2c impl_priority.lus -n impl_priority} PASS: sh impl_priority.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c impl_priority.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en impl_priority.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang impl_priority.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs impl_priority.lus {} PASS: ./lus2lic {-2c import1.lus -n import1} PASS: ./lus2lic {-2c initial.lus -n initial} PASS: sh initial.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c initial.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en initial.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang initial.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs initial.lus {} PASS: ./lus2lic {-2c integrator.lus -n integrator} PASS: sh integrator.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c integrator.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en integrator.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang integrator.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs integrator.lus {} PASS: ./lus2lic {-2c is_stable.lus -n is_stable} PASS: sh is_stable.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c is_stable.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en is_stable.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang is_stable.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs is_stable.lus {} PASS: ./lus2lic {-2c iter.lus -n iter} PASS: sh iter.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c iter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en iter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang iter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs iter.lus {} PASS: ./lus2lic {-2c iterFibo.lus -n iterFibo} PASS: sh iterFibo.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c iterFibo.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en iterFibo.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang iterFibo.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs iterFibo.lus {} PASS: ./lus2lic {-2c iterate.lus -n iterate} PASS: sh iterate.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c iterate.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en iterate.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang iterate.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs iterate.lus {} PASS: ./lus2lic {-2c long_et_stupide_nom_de_noeud.lus -n long_et_stupide_nom_de_noeud} PASS: sh long_et_stupide_nom_de_noeud.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c long_et_stupide_nom_de_noeud.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en long_et_stupide_nom_de_noeud.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang long_et_stupide_nom_de_noeud.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs long_et_stupide_nom_de_noeud.lus {} PASS: ./lus2lic {-2c lucky.lus -n lucky} PASS: sh lucky.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c lucky.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en lucky.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang lucky.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs lucky.lus {} PASS: ./lus2lic {-2c lustre_test1_ok.lus -n lustre_test1_ok} PASS: sh lustre_test1_ok.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c lustre_test1_ok.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en lustre_test1_ok.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang lustre_test1_ok.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs lustre_test1_ok.lus {} PASS: ./lus2lic {-2c map_red_iter.lus -n map_red_iter} PASS: sh map_red_iter.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c map_red_iter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en map_red_iter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang map_red_iter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs map_red_iter.lus {} PASS: ./lus2lic {-2c mapdeRed.lus -n mapdeRed} PASS: sh mapdeRed.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mapdeRed.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mapdeRed.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mapdeRed.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mapdeRed.lus {} PASS: ./lus2lic {-2c mapinf.lus -n mapinf} PASS: sh mapinf.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mapinf.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mapinf.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mapinf.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mapinf.lus {} PASS: ./lus2lic {-2c mapiter.lus -n mapiter} PASS: sh mapiter.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mapiter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mapiter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mapiter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mapiter.lus {} PASS: ./lus2lic {-2c mappredef.lus -n mappredef} PASS: sh mappredef.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mappredef.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mappredef.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mappredef.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mappredef.lus {} PASS: ./lus2lic {-2c matrice.lus -n matrice} PASS: sh matrice.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c matrice.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en matrice.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang matrice.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs matrice.lus {} PASS: ./lus2lic {-2c matrice2.lus -n matrice2} PASS: sh matrice2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c matrice2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en matrice2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang matrice2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs matrice2.lus {} PASS: ./lus2lic {-2c matrix_constant.lus -n matrix_constant} PASS: sh matrix_constant.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c matrix_constant.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en matrix_constant.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang matrix_constant.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs matrix_constant.lus {} PASS: ./lus2lic {-2c minmax1.lus -n minmax1} PASS: sh minmax1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c minmax1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en minmax1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang minmax1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs minmax1.lus {} PASS: ./lus2lic {-2c minmax2.lus -n minmax2} PASS: sh minmax2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c minmax2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en minmax2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang minmax2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs minmax2.lus {} PASS: ./lus2lic {-2c minmax3.lus -n minmax3} PASS: sh minmax3.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c minmax3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en minmax3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang minmax3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs minmax3.lus {} PASS: ./lus2lic {-2c minmax4.lus -n minmax4} PASS: sh minmax4.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c minmax4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en minmax4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang minmax4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs minmax4.lus {} PASS: ./lus2lic {-2c minmax4_bis.lus -n minmax4_bis} PASS: sh minmax4_bis.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c minmax4_bis.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en minmax4_bis.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang minmax4_bis.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs minmax4_bis.lus {} PASS: ./lus2lic {-2c minmax5.lus -n minmax5} PASS: ./lus2lic {-2c minmax5_random.lus -n minmax5_random} PASS: ./lus2lic {-2c minmax6.lus -n minmax6} @@ -558,80 +650,95 @@ PASS: sh minmax6.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c minmax6.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en minmax6.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang minmax6.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs minmax6.lus {} PASS: ./lus2lic {-2c minus.lus -n minus} PASS: sh minus.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c minus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en minus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang minus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs minus.lus {} PASS: ./lus2lic {-2c mm.lus -n mm} PASS: sh mm.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mm.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mm.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mm.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mm.lus {} PASS: ./lus2lic {-2c mm1.lus -n mm1} PASS: sh mm1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mm1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mm1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mm1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mm1.lus {} PASS: ./lus2lic {-2c mm22.lus -n mm22} PASS: sh mm22.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mm22.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mm22.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mm22.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mm22.lus {} PASS: ./lus2lic {-2c mm3.lus -n mm3} PASS: sh mm3.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mm3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mm3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mm3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mm3.lus {} PASS: ./lus2lic {-2c modelInst.lus -n modelInst} PASS: ./lus2lic {-2c modes3x2_v2.lus -n modes3x2_v2} PASS: sh modes3x2_v2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c modes3x2_v2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en modes3x2_v2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang modes3x2_v2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs modes3x2_v2.lus {} PASS: ./lus2lic {-2c modes3x2_v3.lus -n modes3x2_v3} PASS: sh modes3x2_v3.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c modes3x2_v3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en modes3x2_v3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang modes3x2_v3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs modes3x2_v3.lus {} PASS: ./lus2lic {-2c modes3x2_v4.lus -n modes3x2_v4} PASS: ./lus2lic {-2c mouse.lus -n mouse} PASS: sh mouse.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mouse.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mouse.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mouse.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mouse.lus {} PASS: ./lus2lic {-2c mouse1.lus -n mouse1} PASS: sh mouse1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mouse1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mouse1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mouse1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mouse1.lus {} PASS: ./lus2lic {-2c mouse2.lus -n mouse2} PASS: sh mouse2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mouse2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mouse2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mouse2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mouse2.lus {} PASS: ./lus2lic {-2c mouse3.lus -n mouse3} PASS: sh mouse3.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c mouse3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en mouse3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang mouse3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs mouse3.lus {} PASS: ./lus2lic {-2c moyenne.lus -n moyenne} PASS: sh moyenne.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c moyenne.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en moyenne.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang moyenne.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs moyenne.lus {} PASS: ./lus2lic {-2c multiclock.lus -n multiclock} PASS: sh multiclock.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multiclock.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en multiclock.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang multiclock.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs multiclock.lus {} PASS: ./lus2lic {-2c multipar.lus -n multipar} PASS: sh multipar.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en multipar.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang multipar.lus {} ==> lus2lic2.sum <== -Test run by jahier on Tue Feb 27 15:27:19 +Test run by jahier on Tue Jun 18 15:59:06 Native configuration is x86_64-pc-linux-gnu === lus2lic2 tests === @@ -646,173 +753,207 @@ PASS: sh SOURIS.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c SOURIS.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en SOURIS.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang SOURIS.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs SOURIS.lus {} PASS: ./lus2lic {-2c STABLE.lus -n STABLE} PASS: sh STABLE.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c STABLE.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en STABLE.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang STABLE.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs STABLE.lus {} PASS: ./lus2lic {-2c SWITCH.lus -n SWITCH} PASS: sh SWITCH.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c SWITCH.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en SWITCH.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang SWITCH.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs SWITCH.lus {} PASS: ./lus2lic {-2c SWITCH1.lus -n SWITCH1} PASS: sh SWITCH1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c SWITCH1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en SWITCH1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang SWITCH1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs SWITCH1.lus {} PASS: ./lus2lic {-2c TIME_STABLE.lus -n TIME_STABLE} PASS: sh TIME_STABLE.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c TIME_STABLE.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en TIME_STABLE.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang TIME_STABLE.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs TIME_STABLE.lus {} PASS: ./lus2lic {-2c TIME_STABLE1.lus -n TIME_STABLE1} PASS: sh TIME_STABLE1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c TIME_STABLE1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en TIME_STABLE1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang TIME_STABLE1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs TIME_STABLE1.lus {} PASS: ./lus2lic {-2c Watch.lus -n Watch} PASS: ./lus2lic {-2c X.lus -n X} PASS: sh X.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c X.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en X.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang X.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs X.lus {} PASS: ./lus2lic {-2c X2.lus -n X2} PASS: sh X2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c X2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en X2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang X2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs X2.lus {} PASS: ./lus2lic {-2c Xr.lus -n Xr} PASS: sh Xr.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c Xr.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en Xr.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang Xr.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs Xr.lus {} PASS: ./lus2lic {-2c nc1.lus -n nc1} PASS: sh nc1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc1.lus {} PASS: ./lus2lic {-2c nc10.lus -n nc10} PASS: sh nc10.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc10.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc10.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc10.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc10.lus {} PASS: ./lus2lic {-2c nc2.lus -n nc2} PASS: sh nc2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc2.lus {} PASS: ./lus2lic {-2c nc3.lus -n nc3} PASS: sh nc3.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc3.lus {} PASS: ./lus2lic {-2c nc4.lus -n nc4} PASS: sh nc4.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc4.lus {} PASS: ./lus2lic {-2c nc5.lus -n nc5} PASS: sh nc5.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc5.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc5.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc5.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc5.lus {} PASS: ./lus2lic {-2c nc6.lus -n nc6} PASS: sh nc6.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc6.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc6.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc6.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc6.lus {} PASS: ./lus2lic {-2c nc7.lus -n nc7} PASS: sh nc7.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc7.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc7.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc7.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc7.lus {} PASS: ./lus2lic {-2c nc8.lus -n nc8} PASS: sh nc8.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc8.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc8.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc8.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc8.lus {} PASS: ./lus2lic {-2c nc9.lus -n nc9} PASS: sh nc9.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc9.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nc9.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nc9.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nc9.lus {} PASS: ./lus2lic {-2c nested.lus -n nested} PASS: sh nested.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nested.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nested.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nested.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nested.lus {} PASS: ./lus2lic {-2c newpacks.lus -n newpacks} PASS: ./lus2lic {-2c noAlarm.lus -n noAlarm} PASS: sh noAlarm.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c noAlarm.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en noAlarm.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang noAlarm.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs noAlarm.lus {} PASS: ./lus2lic {-2c node_caller1.lus -n node_caller1} PASS: sh node_caller1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c node_caller1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en node_caller1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang node_caller1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs node_caller1.lus {} PASS: ./lus2lic {-2c nodeparam.lus -n nodeparam} PASS: sh nodeparam.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nodeparam.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en nodeparam.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang nodeparam.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs nodeparam.lus {} PASS: ./lus2lic {-2c noeudsIndependants.lus -n noeudsIndependants} PASS: sh noeudsIndependants.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c noeudsIndependants.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en noeudsIndependants.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang noeudsIndependants.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs noeudsIndependants.lus {} PASS: ./lus2lic {-2c noinput.lus -n noinput} PASS: sh noinput.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c noinput.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en noinput.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang noinput.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs noinput.lus {} PASS: ./lus2lic {-2c normal.lus -n normal} PASS: sh normal.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c normal.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en normal.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang normal.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs normal.lus {} PASS: ./lus2lic {-2c notTwo.lus -n notTwo} PASS: sh notTwo.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c notTwo.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en notTwo.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang notTwo.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs notTwo.lus {} PASS: ./lus2lic {-2c o2l_feux_compl.lus -n o2l_feux_compl} PASS: sh o2l_feux_compl.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c o2l_feux_compl.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en o2l_feux_compl.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang o2l_feux_compl.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs o2l_feux_compl.lus {} PASS: ./lus2lic {-2c oneq.lus -n oneq} PASS: sh oneq.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c oneq.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en oneq.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang oneq.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs oneq.lus {} PASS: ./lus2lic {-2c onlyroll.lus -n onlyroll} PASS: sh onlyroll.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c onlyroll.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en onlyroll.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang onlyroll.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs onlyroll.lus {} PASS: ./lus2lic {-2c onlyroll2.lus -n onlyroll2} PASS: sh onlyroll2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c onlyroll2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en onlyroll2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang onlyroll2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs onlyroll2.lus {} PASS: ./lus2lic {-2c over2.lus -n over2} PASS: sh over2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c over2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en over2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang over2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs over2.lus {} PASS: ./lus2lic {-2c over3.lus -n over3} PASS: sh over3.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c over3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en over3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang over3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs over3.lus {} PASS: ./lus2lic {-2c overload.lus -n overload} PASS: sh overload.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c overload.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en overload.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang overload.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs overload.lus {} PASS: ./lus2lic {-2c p.lus -n p} PASS: ./lus2lic {-2c pack1.lus -n pack1} PASS: ./lus2lic {-2c packageTableau.lus -n packageTableau} @@ -823,198 +964,236 @@ PASS: sh param_node.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c param_node.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en param_node.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang param_node.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs param_node.lus {} PASS: ./lus2lic {-2c param_node2.lus -n param_node2} PASS: sh param_node2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c param_node2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en param_node2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang param_node2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs param_node2.lus {} PASS: ./lus2lic {-2c param_node3.lus -n param_node3} PASS: sh param_node3.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c param_node3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en param_node3.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang param_node3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs param_node3.lus {} PASS: ./lus2lic {-2c param_node4.lus -n param_node4} PASS: sh param_node4.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c param_node4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en param_node4.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang param_node4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs param_node4.lus {} PASS: ./lus2lic {-2c param_struct.lus -n param_struct} PASS: sh param_struct.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c param_struct.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en param_struct.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang param_struct.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs param_struct.lus {} PASS: ./lus2lic --expand-nodes {-2c pilote.lus -n pilote} PASS: ./lus2lic {-2c pipeline.lus -n pipeline} PASS: sh pipeline.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c pipeline.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en pipeline.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang pipeline.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs pipeline.lus {} PASS: ./lus2lic {-2c plus.lus -n plus} PASS: sh plus.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c plus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en plus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang plus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs plus.lus {} PASS: ./lus2lic {-2c ply01.lus -n ply01} PASS: sh ply01.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ply01.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ply01.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ply01.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ply01.lus {} PASS: ./lus2lic -rnc {-2c ply02.lus -n ply02} PASS: sh ply02.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ply02.lus { -rnc} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ply02.lus { -rnc} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ply02.lus { -rnc} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ply02.lus { -rnc} PASS: ./lus2lic -rnc {-2c ply03.lus -n ply03} PASS: sh ply03.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ply03.lus { -rnc} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ply03.lus { -rnc} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ply03.lus { -rnc} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ply03.lus { -rnc} PASS: ./lus2lic {-2c polymorphic_pack.lus -n polymorphic_pack} PASS: ./lus2lic {-2c poussoir.lus -n poussoir} PASS: sh poussoir.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c poussoir.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en poussoir.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang poussoir.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs poussoir.lus {} PASS: ./lus2lic {-2c pplus.lus -n pplus} PASS: sh pplus.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c pplus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en pplus.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang pplus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs pplus.lus {} PASS: ./lus2lic {-2c pre_x.lus -n pre_x} PASS: sh pre_x.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c pre_x.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en pre_x.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang pre_x.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs pre_x.lus {} PASS: ./lus2lic {-2c predef01.lus -n predef01} PASS: sh predef01.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c predef01.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en predef01.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang predef01.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs predef01.lus {} PASS: ./lus2lic {-2c predef02.lus -n predef02} PASS: sh predef02.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c predef02.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en predef02.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang predef02.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs predef02.lus {} PASS: ./lus2lic {-2c predef03.lus -n predef03} PASS: sh predef03.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c predef03.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en predef03.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang predef03.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs predef03.lus {} PASS: ./lus2lic {-2c predefOp.lus -n predefOp} PASS: sh predefOp.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c predefOp.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en predefOp.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang predefOp.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs predefOp.lus {} PASS: ./lus2lic {-2c produitBool.lus -n produitBool} PASS: sh produitBool.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c produitBool.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en produitBool.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang produitBool.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs produitBool.lus {} PASS: ./lus2lic {-2c random.lus -n random} PASS: ./lus2lic {-2c real_ex.lus -n real_ex} PASS: sh real_ex.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c real_ex.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en real_ex.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang real_ex.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs real_ex.lus {} PASS: ./lus2lic {-2c redIf.lus -n redIf} PASS: sh redIf.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c redIf.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en redIf.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang redIf.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs redIf.lus {} PASS: ./lus2lic {-2c rediter.lus -n rediter} PASS: sh rediter.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c rediter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en rediter.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang rediter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs rediter.lus {} PASS: ./lus2lic {-2c redoptest.lus -n redoptest} PASS: sh redoptest.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c redoptest.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en redoptest.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang redoptest.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs redoptest.lus {} PASS: ./lus2lic {-2c remplissage.lus -n remplissage} PASS: ./lus2lic {-2c rs.lus -n rs} PASS: sh rs.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c rs.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en rs.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang rs.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs rs.lus {} PASS: ./lus2lic {-2c sample_time_change.lus -n sample_time_change} PASS: sh sample_time_change.sh FAIL: Try to compare lus2lic -exec and -2c: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c sample_time_change.lus {} FAIL: Try to compare lv6 -2c with and without -en: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en sample_time_change.lus {} FAIL: Try to compare gcc and clang: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang sample_time_change.lus {} +FAIL: Try to compare -2c-io-a and -2c-io-c: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs sample_time_change.lus {} PASS: ./lus2lic {-2c sample_time_change_MainNode.lus -n sample_time_change_MainNode} PASS: sh sample_time_change_MainNode.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c sample_time_change_MainNode.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en sample_time_change_MainNode.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang sample_time_change_MainNode.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs sample_time_change_MainNode.lus {} PASS: ./lus2lic {-2c shiftFill_ludic.lus -n shiftFill_ludic} PASS: sh shiftFill_ludic.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c shiftFill_ludic.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en shiftFill_ludic.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang shiftFill_ludic.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs shiftFill_ludic.lus {} PASS: ./lus2lic {-2c shift_ludic.lus -n shift_ludic} PASS: sh shift_ludic.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c shift_ludic.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en shift_ludic.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang shift_ludic.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs shift_ludic.lus {} PASS: ./lus2lic {-2c simple.lus -n simple} PASS: ./lus2lic {-2c simpleRed.lus -n simpleRed} PASS: sh simpleRed.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c simpleRed.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en simpleRed.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang simpleRed.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs simpleRed.lus {} PASS: ./lus2lic {-2c sincos.lus -n sincos} PASS: sh sincos.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c sincos.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en sincos.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang sincos.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs sincos.lus {} PASS: ./lus2lic --expand-nodes {-2c speedcontrol.lus -n speedcontrol} PASS: sh speedcontrol.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c speedcontrol.lus { --expand-nodes} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en speedcontrol.lus { --expand-nodes} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang speedcontrol.lus { --expand-nodes} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs speedcontrol.lus { --expand-nodes} PASS: ./lus2lic {-2c stopwatch.lus -n stopwatch} PASS: sh stopwatch.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c stopwatch.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en stopwatch.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang stopwatch.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs stopwatch.lus {} PASS: ./lus2lic {-2c struct0.lus -n struct0} PASS: sh struct0.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c struct0.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en struct0.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang struct0.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs struct0.lus {} PASS: ./lus2lic {-2c struct_equality.lus -n struct_equality} PASS: sh struct_equality.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c struct_equality.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en struct_equality.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang struct_equality.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs struct_equality.lus {} PASS: ./lus2lic {-2c struct_with.lus -n struct_with} PASS: sh struct_with.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c struct_with.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en struct_with.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang struct_with.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs struct_with.lus {} PASS: ./lus2lic {-2c t0.lus -n t0} PASS: ./lus2lic {-2c t1.lus -n t1} PASS: sh t1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c t1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en t1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang t1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs t1.lus {} PASS: ./lus2lic {-2c t2.lus -n t2} PASS: sh t2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c t2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en t2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang t2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs t2.lus {} PASS: ./lus2lic {-2c test.lus -n test} PASS: sh test.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test.lus {} PASS: ./lus2lic {-2c testBoite.lus -n testBoite} PASS: ./lus2lic {-2c testCA.lus -n testCA} PASS: sh testCA.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c testCA.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en testCA.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang testCA.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs testCA.lus {} PASS: ./lus2lic {-2c testCapt.lus -n testCapt} PASS: ./lus2lic {-2c testPilote.lus -n testPilote} PASS: ./lus2lic -rnc {-2c test_Int.lus -n test_Int} @@ -1023,32 +1202,38 @@ PASS: sh test_arrow.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_arrow.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_arrow.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_arrow.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_arrow.lus {} PASS: ./lus2lic {-2c test_boolred.lus -n test_boolred} PASS: sh test_boolred.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_boolred.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_boolred.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_boolred.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_boolred.lus {} PASS: ./lus2lic {-2c test_clash.lus -n test_clash} PASS: ./lus2lic {-2c test_condact.lus -n test_condact} PASS: sh test_condact.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_condact.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_condact.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_condact.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_condact.lus {} PASS: ./lus2lic {-2c test_const.lus -n test_const} PASS: sh test_const.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_const.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_const.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_const.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_const.lus {} PASS: ./lus2lic {-2c test_diese.lus -n test_diese} PASS: sh test_diese.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_diese.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_diese.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_diese.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_diese.lus {} PASS: ./lus2lic {-2c test_enum.lus -n test_enum} PASS: sh test_enum.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_enum.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_enum.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_enum.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_enum.lus {} PASS: ./lus2lic {-2c test_extern.lus -n test_extern} PASS: ./lus2lic {-2c test_lustre.lus -n test_lustre} PASS: ./lus2lic {-2c test_map.lus -n test_map} @@ -1056,11 +1241,13 @@ PASS: sh test_map.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_map.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_map.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_map.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_map.lus {} PASS: ./lus2lic {-2c test_merge.lus -n test_merge} PASS: sh test_merge.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_merge.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_merge.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_merge.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_merge.lus {} PASS: ./lus2lic {-2c test_model.lus -n test_model} PASS: ./lus2lic {-2c test_model2.lus -n test_model2} PASS: ./lus2lic {-2c test_node_expand.lus -n test_node_expand} @@ -1068,116 +1255,138 @@ PASS: sh test_node_expand.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_node_expand.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_node_expand.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_node_expand.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_node_expand.lus {} PASS: ./lus2lic {-2c test_node_expand2.lus -n test_node_expand2} PASS: sh test_node_expand2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_node_expand2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_node_expand2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_node_expand2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_node_expand2.lus {} PASS: ./lus2lic -rnc {-2c test_poly.lus -n test_poly} PASS: sh test_poly.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_poly.lus { -rnc} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_poly.lus { -rnc} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_poly.lus { -rnc} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_poly.lus { -rnc} PASS: ./lus2lic {-2c test_sqrt.lus -n test_sqrt} PASS: ./lus2lic {-2c test_struct.lus -n test_struct} PASS: sh test_struct.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_struct.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en test_struct.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang test_struct.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs test_struct.lus {} PASS: ./lus2lic {-2c titi.lus -n titi} PASS: sh titi.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c titi.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en titi.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang titi.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs titi.lus {} PASS: ./lus2lic {-2c toolate.lus -n toolate} PASS: sh toolate.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c toolate.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en toolate.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang toolate.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs toolate.lus {} PASS: ./lus2lic {-2c toto.lus -n toto} PASS: sh toto.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c toto.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en toto.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang toto.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs toto.lus {} PASS: ./lus2lic {-2c tri.lus -n tri} PASS: sh tri.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c tri.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en tri.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang tri.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs tri.lus {} PASS: ./lus2lic {-2c triSel.lus -n triSel} PASS: sh triSel.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c triSel.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en triSel.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang triSel.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs triSel.lus {} PASS: ./lus2lic {-2c trivial.lus -n trivial} PASS: sh trivial.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c trivial.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en trivial.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang trivial.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs trivial.lus {} PASS: ./lus2lic {-2c trivial2.lus -n trivial2} PASS: sh trivial2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c trivial2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en trivial2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang trivial2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs trivial2.lus {} PASS: ./lus2lic {-2c trivial_array.lus -n trivial_array} PASS: sh trivial_array.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c trivial_array.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en trivial_array.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang trivial_array.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs trivial_array.lus {} PASS: ./lus2lic {-2c ts01.lus -n ts01} PASS: sh ts01.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ts01.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ts01.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ts01.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ts01.lus {} PASS: ./lus2lic {-2c ts04.lus -n ts04} PASS: sh ts04.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c ts04.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en ts04.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang ts04.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs ts04.lus {} PASS: ./lus2lic {-2c tuple.lus -n tuple} PASS: sh tuple.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c tuple.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en tuple.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang tuple.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs tuple.lus {} PASS: ./lus2lic {-2c type_decl.lus -n type_decl} PASS: sh type_decl.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c type_decl.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en type_decl.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang type_decl.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs type_decl.lus {} PASS: ./lus2lic {-2c uu.lus -n uu} PASS: sh uu.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c uu.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en uu.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang uu.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs uu.lus {} PASS: ./lus2lic {-2c v1.lus -n v1} PASS: sh v1.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c v1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en v1.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang v1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs v1.lus {} PASS: ./lus2lic {-2c when_tuple.lus -n when_tuple} PASS: ./lus2lic {-2c xx.lus -n xx} PASS: sh xx.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c xx.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en xx.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang xx.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs xx.lus {} PASS: ./lus2lic {-2c yyy.lus -n yyy} PASS: sh yyy.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c yyy.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en yyy.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang yyy.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs yyy.lus {} PASS: ./lus2lic {-2c zzz.lus -n zzz} PASS: sh zzz.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en zzz.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang zzz.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs zzz.lus {} PASS: ./lus2lic {-2c zzz2.lus -n zzz2} PASS: sh zzz2.sh PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_lv6_and_lv6_en zzz2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang zzz2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs zzz2.lus {} ==> lus2lic3.sum <== -Test run by jahier on Tue Feb 27 15:31:32 +Test run by jahier on Tue Jun 18 16:06:01 Native configuration is x86_64-pc-linux-gnu === lus2lic3 tests === @@ -1191,10 +1400,12 @@ PASS: ./lus2lic {} {-lic -o COUNTER.lic COUNTER.lus -n COUNTER} PASS: ./lus2lic {-ec -o COUNTER.ec COUNTER.lus -n COUNTER} PASS: ./myec2c {-o COUNTER.c COUNTER.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node COUNTER.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc COUNTER.lus {} PASS: ./lus2lic {} {-lic -o CURRENT.lic CURRENT.lus -n CURRENT} PASS: ./lus2lic {-ec -o CURRENT.ec CURRENT.lus -n CURRENT} PASS: ./myec2c {-o CURRENT.c CURRENT.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node CURRENT.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc CURRENT.lus {} PASS: ./lus2lic {} {-lic -o Condact.lic Condact.lus -n Condact} PASS: ./lus2lic {-ec -o Condact.ec Condact.lus -n Condact} PASS: ./myec2c {-o Condact.c Condact.ec} @@ -1202,6 +1413,7 @@ PASS: ./lus2lic {} {-lic -o EDGE.lic EDGE.lus -n EDGE} PASS: ./lus2lic {-ec -o EDGE.ec EDGE.lus -n EDGE} PASS: ./myec2c {-o EDGE.c EDGE.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node EDGE.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc EDGE.lus {} PASS: ./lus2lic {} {-lic -o ELMU.lic ELMU.lus -n ELMU} PASS: ./lus2lic {-ec -o ELMU.ec ELMU.lus -n ELMU} PASS: ./myec2c {-o ELMU.c ELMU.ec} @@ -1209,50 +1421,62 @@ PASS: ./lus2lic {} {-lic -o FALLING_EDGE.lic FALLING_EDGE.lus -n FALLING_EDGE} PASS: ./lus2lic {-ec -o FALLING_EDGE.ec FALLING_EDGE.lus -n FALLING_EDGE} PASS: ./myec2c {-o FALLING_EDGE.c FALLING_EDGE.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node FALLING_EDGE.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc FALLING_EDGE.lus {} PASS: ./lus2lic {} {-lic -o FillFollowedByRed.lic FillFollowedByRed.lus -n FillFollowedByRed} PASS: ./lus2lic {-ec -o FillFollowedByRed.ec FillFollowedByRed.lus -n FillFollowedByRed} PASS: ./myec2c {-o FillFollowedByRed.c FillFollowedByRed.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node FillFollowedByRed.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc FillFollowedByRed.lus {} PASS: ./lus2lic {} {-lic -o Gyroscope.lic Gyroscope.lus -n Gyroscope} PASS: ./lus2lic {-ec -o Gyroscope.ec Gyroscope.lus -n Gyroscope} PASS: ./myec2c {-o Gyroscope.c Gyroscope.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node Gyroscope.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc Gyroscope.lus {} PASS: ./lus2lic {} {-lic -o Gyroscope2.lic Gyroscope2.lus -n Gyroscope2} PASS: ./lus2lic {-ec -o Gyroscope2.ec Gyroscope2.lus -n Gyroscope2} PASS: ./myec2c {-o Gyroscope2.c Gyroscope2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node Gyroscope2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc Gyroscope2.lus {} PASS: ./lus2lic {} {-lic -o aa.lic aa.lus -n aa} PASS: ./lus2lic {-ec -o aa.ec aa.lus -n aa} PASS: ./myec2c {-o aa.c aa.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node aa.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc aa.lus {} PASS: ./lus2lic {} {-lic -o access.lic access.lus -n access} PASS: ./lus2lic {-ec -o access.ec access.lus -n access} PASS: ./myec2c {-o access.c access.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node access.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc access.lus {} PASS: ./lus2lic { --expand-nodes} {-lic -o activation1.lic activation1.lus -n activation1} PASS: ./lus2lic {-ec -o activation1.ec activation1.lus -n activation1} PASS: ./myec2c {-o activation1.c activation1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node activation1.lus { --expand-nodes} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc activation1.lus { --expand-nodes} PASS: ./lus2lic { --expand-nodes} {-lic -o activation2.lic activation2.lus -n activation2} PASS: ./lus2lic {-ec -o activation2.ec activation2.lus -n activation2} PASS: ./myec2c {-o activation2.c activation2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node activation2.lus { --expand-nodes} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc activation2.lus { --expand-nodes} PASS: ./lus2lic {} {-lic -o activation_ec.lic activation_ec.lus -n activation_ec} PASS: ./lus2lic {-ec -o activation_ec.ec activation_ec.lus -n activation_ec} PASS: ./myec2c {-o activation_ec.c activation_ec.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node activation_ec.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc activation_ec.lus {} PASS: ./lus2lic {} {-lic -o after.lic after.lus -n after} PASS: ./lus2lic {-ec -o after.ec after.lus -n after} PASS: ./myec2c {-o after.c after.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node after.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc after.lus {} PASS: ./lus2lic {} {-lic -o alias.lic alias.lus -n alias} PASS: ./lus2lic {-ec -o alias.ec alias.lus -n alias} PASS: ./myec2c {-o alias.c alias.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node alias.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc alias.lus {} PASS: ./lus2lic {} {-lic -o amaury.lic amaury.lus -n amaury} PASS: ./lus2lic {-ec -o amaury.ec amaury.lus -n amaury} PASS: ./myec2c {-o amaury.c amaury.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node amaury.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc amaury.lus {} PASS: ./lus2lic {} {-lic -o arbitre.lic arbitre.lus -n arbitre} PASS: ./lus2lic {-ec -o arbitre.ec arbitre.lus -n arbitre} PASS: ./myec2c {-o arbitre.c arbitre.ec} @@ -1260,22 +1484,27 @@ PASS: ./lus2lic {} {-lic -o argos.lic argos.lus -n argos} PASS: ./lus2lic {-ec -o argos.ec argos.lus -n argos} PASS: ./myec2c {-o argos.c argos.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node argos.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc argos.lus {} PASS: ./lus2lic {} {-lic -o array_concat.lic array_concat.lus -n array_concat} PASS: ./lus2lic {-ec -o array_concat.ec array_concat.lus -n array_concat} PASS: ./myec2c {-o array_concat.c array_concat.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node array_concat.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc array_concat.lus {} PASS: ./lus2lic {} {-lic -o array_concat2.lic array_concat2.lus -n array_concat2} PASS: ./lus2lic {-ec -o array_concat2.ec array_concat2.lus -n array_concat2} PASS: ./myec2c {-o array_concat2.c array_concat2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node array_concat2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc array_concat2.lus {} PASS: ./lus2lic {} {-lic -o array_equals.lic array_equals.lus -n array_equals} PASS: ./lus2lic {-ec -o array_equals.ec array_equals.lus -n array_equals} PASS: ./myec2c {-o array_equals.c array_equals.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node array_equals.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc array_equals.lus {} PASS: ./lus2lic {} {-lic -o arrays.lic arrays.lus -n arrays} PASS: ./lus2lic {-ec -o arrays.ec arrays.lus -n arrays} PASS: ./myec2c {-o arrays.c arrays.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node arrays.lus {} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc arrays.lus {} PASS: ./lus2lic { --expand-nodes} {-lic -o asservi.lic asservi.lus -n asservi} PASS: ./lus2lic {-ec -o asservi.ec asservi.lus -n asservi} PASS: ./myec2c {-o asservi.c asservi.ec} @@ -1283,35 +1512,43 @@ PASS: ./lus2lic {} {-lic -o bad_call03.lic bad_call03.lus -n bad_call03} PASS: ./lus2lic {-ec -o bad_call03.ec bad_call03.lus -n bad_call03} PASS: ./myec2c {-o bad_call03.c bad_call03.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node bad_call03.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc bad_call03.lus {} PASS: ./lus2lic {} {-lic -o bascule.lic bascule.lus -n bascule} PASS: ./lus2lic {-ec -o bascule.ec bascule.lus -n bascule} PASS: ./myec2c {-o bascule.c bascule.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node bascule.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc bascule.lus {} PASS: ./lus2lic {} {-lic -o bob.lic bob.lus -n bob} PASS: ./lus2lic {-ec -o bob.ec bob.lus -n bob} PASS: ./myec2c {-o bob.c bob.ec} UNRESOLVED: Time out: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node bob.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc bob.lus {} PASS: ./lus2lic {} {-lic -o bred.lic bred.lus -n bred} PASS: ./lus2lic {-ec -o bred.ec bred.lus -n bred} PASS: ./myec2c {-o bred.c bred.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node bred.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc bred.lus {} PASS: ./lus2lic {} {-lic -o bred_lv4.lic bred_lv4.lus -n bred_lv4} PASS: ./lus2lic {-ec -o bred_lv4.ec bred_lv4.lus -n bred_lv4} PASS: ./myec2c {-o bred_lv4.c bred_lv4.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node bred_lv4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc bred_lv4.lus {} PASS: ./lus2lic {} {-lic -o bug.lic bug.lus -n bug} PASS: ./lus2lic {-ec -o bug.ec bug.lus -n bug} PASS: ./myec2c {-o bug.c bug.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node bug.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc bug.lus {} PASS: ./lus2lic {} {-lic -o bug2.lic bug2.lus -n bug2} PASS: ./lus2lic {-ec -o bug2.ec bug2.lus -n bug2} PASS: ./myec2c {-o bug2.c bug2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node bug2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc bug2.lus {} FAIL: without any option: ./lus2lic {} {-lic -o bug_map_fby.lic bug_map_fby.lus -n bug_map_fby} PASS: ./lus2lic {} {-lic -o calculs_max.lic calculs_max.lus -n calculs_max} PASS: ./lus2lic {-ec -o calculs_max.ec calculs_max.lus -n calculs_max} PASS: ./myec2c {-o calculs_max.c calculs_max.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node calculs_max.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc calculs_max.lus {} PASS: ./lus2lic {} {-lic -o call.lic call.lus -n call} PASS: ./lus2lic {-ec -o call.ec call.lus -n call} PASS: ./myec2c {-o call.c call.ec} @@ -1322,6 +1559,7 @@ PASS: ./lus2lic {} {-lic -o call02.lic call02.lus -n call02} PASS: ./lus2lic {-ec -o call02.ec call02.lus -n call02} PASS: ./myec2c {-o call02.c call02.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node call02.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc call02.lus {} PASS: ./lus2lic {} {-lic -o call03.lic call03.lus -n call03} PASS: ./lus2lic {-ec -o call03.ec call03.lus -n call03} PASS: ./myec2c {-o call03.c call03.ec} @@ -1329,6 +1567,7 @@ PASS: ./lus2lic {} {-lic -o call04.lic call04.lus -n call04} PASS: ./lus2lic {-ec -o call04.ec call04.lus -n call04} PASS: ./myec2c {-o call04.c call04.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node call04.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc call04.lus {} PASS: ./lus2lic {} {-lic -o call05.lic call05.lus -n call05} PASS: ./lus2lic {-ec -o call05.ec call05.lus -n call05} PASS: ./myec2c {-o call05.c call05.ec} @@ -1339,6 +1578,7 @@ PASS: ./lus2lic {} {-lic -o call07.lic call07.lus -n call07} PASS: ./lus2lic {-ec -o call07.ec call07.lus -n call07} PASS: ./myec2c {-o call07.c call07.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node call07.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc call07.lus {} PASS: ./lus2lic {} {-lic -o carV2.lic carV2.lus -n carV2} PASS: ./lus2lic {-ec -o carV2.ec carV2.lus -n carV2} PASS: ./myec2c {-o carV2.c carV2.ec} @@ -1346,39 +1586,48 @@ PASS: ./lus2lic {} {-lic -o carligths.lic carligths.lus -n carligths} PASS: ./lus2lic {-ec -o carligths.ec carligths.lus -n carligths} PASS: ./myec2c {-o carligths.c carligths.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node carligths.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc carligths.lus {} PASS: ./lus2lic {} {-lic -o ck2.lic ck2.lus -n ck2} PASS: ./lus2lic {-ec -o ck2.ec ck2.lus -n ck2} PASS: ./myec2c {-o ck2.c ck2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ck2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ck2.lus {} PASS: ./lus2lic {} {-lic -o ck3.lic ck3.lus -n ck3} PASS: ./lus2lic {-ec -o ck3.ec ck3.lus -n ck3} PASS: ./myec2c {-o ck3.c ck3.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ck3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ck3.lus {} PASS: ./lus2lic {} {-lic -o ck4.lic ck4.lus -n ck4} PASS: ./lus2lic {-ec -o ck4.ec ck4.lus -n ck4} PASS: ./myec2c {-o ck4.c ck4.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ck4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ck4.lus {} PASS: ./lus2lic {} {-lic -o ck5.lic ck5.lus -n ck5} PASS: ./lus2lic {-ec -o ck5.ec ck5.lus -n ck5} PASS: ./myec2c {-o ck5.c ck5.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ck5.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ck5.lus {} FAIL: without any option: ./lus2lic {} {-lic -o ck6.lic ck6.lus -n ck6} PASS: ./lus2lic {} {-lic -o ck7.lic ck7.lus -n ck7} PASS: ./lus2lic {-ec -o ck7.ec ck7.lus -n ck7} PASS: ./myec2c {-o ck7.c ck7.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ck7.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ck7.lus {} PASS: ./lus2lic {} {-lic -o clock1_2ms.lic clock1_2ms.lus -n clock1_2ms} PASS: ./lus2lic {-ec -o clock1_2ms.ec clock1_2ms.lus -n clock1_2ms} PASS: ./myec2c {-o clock1_2ms.c clock1_2ms.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node clock1_2ms.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc clock1_2ms.lus {} PASS: ./lus2lic {} {-lic -o clock_ite.lic clock_ite.lus -n clock_ite} PASS: ./lus2lic {-ec -o clock_ite.ec clock_ite.lus -n clock_ite} PASS: ./myec2c {-o clock_ite.c clock_ite.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node clock_ite.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc clock_ite.lus {} PASS: ./lus2lic {} {-lic -o cminus.lic cminus.lus -n cminus} PASS: ./lus2lic {-ec -o cminus.ec cminus.lus -n cminus} PASS: ./myec2c {-o cminus.c cminus.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node cminus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc cminus.lus {} PASS: ./lus2lic {} {-lic -o complex.lic complex.lus -n complex} PASS: ./lus2lic {-ec -o complex.ec complex.lus -n complex} PASS: ./myec2c {-o complex.c complex.ec} @@ -1386,38 +1635,47 @@ PASS: ./lus2lic {} {-lic -o compteur.lic compteur.lus -n compteur} PASS: ./lus2lic {-ec -o compteur.ec compteur.lus -n compteur} PASS: ./myec2c {-o compteur.c compteur.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node compteur.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc compteur.lus {} PASS: ./lus2lic {} {-lic -o cond01.lic cond01.lus -n cond01} PASS: ./lus2lic {-ec -o cond01.ec cond01.lus -n cond01} PASS: ./myec2c {-o cond01.c cond01.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node cond01.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc cond01.lus {} PASS: ./lus2lic {} {-lic -o consensus.lic consensus.lus -n consensus} PASS: ./lus2lic {-ec -o consensus.ec consensus.lus -n consensus} PASS: ./myec2c {-o consensus.c consensus.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node consensus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc consensus.lus {} PASS: ./lus2lic {} {-lic -o consensus2.lic consensus2.lus -n consensus2} PASS: ./lus2lic {-ec -o consensus2.ec consensus2.lus -n consensus2} PASS: ./myec2c {-o consensus2.c consensus2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node consensus2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc consensus2.lus {} PASS: ./lus2lic {} {-lic -o contractForElementSelectionInArray.lic contractForElementSelectionInArray.lus -n contractForElementSelectionInArray} PASS: ./lus2lic {-ec -o contractForElementSelectionInArray.ec contractForElementSelectionInArray.lus -n contractForElementSelectionInArray} PASS: ./myec2c {-o contractForElementSelectionInArray.c contractForElementSelectionInArray.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node contractForElementSelectionInArray.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc contractForElementSelectionInArray.lus {} PASS: ./lus2lic {} {-lic -o convert.lic convert.lus -n convert} PASS: ./lus2lic {-ec -o convert.ec convert.lus -n convert} PASS: ./myec2c {-o convert.c convert.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node convert.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc convert.lus {} PASS: ./lus2lic {} {-lic -o count.lic count.lus -n count} PASS: ./lus2lic {-ec -o count.ec count.lus -n count} PASS: ./myec2c {-o count.c count.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node count.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc count.lus {} PASS: ./lus2lic {} {-lic -o cpt.lic cpt.lus -n cpt} PASS: ./lus2lic {-ec -o cpt.ec cpt.lus -n cpt} PASS: ./myec2c {-o cpt.c cpt.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node cpt.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc cpt.lus {} PASS: ./lus2lic {} {-lic -o cst.lic cst.lus -n cst} PASS: ./lus2lic {-ec -o cst.ec cst.lus -n cst} PASS: ./myec2c {-o cst.c cst.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node cst.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc cst.lus {} PASS: ./lus2lic {} {-lic -o dadic.lic dadic.lus -n dadic} PASS: ./lus2lic {-ec -o dadic.ec dadic.lus -n dadic} PASS: ./myec2c {-o dadic.c dadic.ec} @@ -1426,6 +1684,7 @@ PASS: ./lus2lic {} {-lic -o deSimone.lic deSimone.lus -n deSimone} PASS: ./lus2lic {-ec -o deSimone.ec deSimone.lus -n deSimone} PASS: ./myec2c {-o deSimone.c deSimone.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node deSimone.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc deSimone.lus {} PASS: ./lus2lic {} {-lic -o decl.lic decl.lus -n decl} PASS: ./lus2lic {-ec -o decl.ec decl.lus -n decl} PASS: ./myec2c {-o decl.c decl.ec} @@ -1439,26 +1698,32 @@ PASS: ./lus2lic {} {-lic -o dep.lic dep.lus -n dep} PASS: ./lus2lic {-ec -o dep.ec dep.lus -n dep} PASS: ./myec2c {-o dep.c dep.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node dep.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc dep.lus {} PASS: ./lus2lic {} {-lic -o depend.lic depend.lus -n depend} PASS: ./lus2lic {-ec -o depend.ec depend.lus -n depend} PASS: ./myec2c {-o depend.c depend.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node depend.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc depend.lus {} PASS: ./lus2lic {} {-lic -o dependeur.lic dependeur.lus -n dependeur} PASS: ./lus2lic {-ec -o dependeur.ec dependeur.lus -n dependeur} PASS: ./myec2c {-o dependeur.c dependeur.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node dependeur.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc dependeur.lus {} PASS: ./lus2lic {} {-lic -o dependeur_struct.lic dependeur_struct.lus -n dependeur_struct} PASS: ./lus2lic {-ec -o dependeur_struct.ec dependeur_struct.lus -n dependeur_struct} PASS: ./myec2c {-o dependeur_struct.c dependeur_struct.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node dependeur_struct.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc dependeur_struct.lus {} PASS: ./lus2lic {} {-lic -o double_delay.lic double_delay.lus -n double_delay} PASS: ./lus2lic {-ec -o double_delay.ec double_delay.lus -n double_delay} PASS: ./myec2c {-o double_delay.c double_delay.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node double_delay.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc double_delay.lus {} PASS: ./lus2lic {} {-lic -o ec.lic ec.lus -n ec} PASS: ./lus2lic {-ec -o ec.ec ec.lus -n ec} PASS: ./myec2c {-o ec.c ec.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ec.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ec.lus {} PASS: ./lus2lic {} {-lic -o enum0.lic enum0.lus -n enum0} PASS: ./lus2lic {-ec -o enum0.ec enum0.lus -n enum0} PASS: ./myec2c {-o enum0.c enum0.ec} @@ -1466,34 +1731,42 @@ PASS: ./lus2lic {} {-lic -o ex.lic ex.lus -n ex} PASS: ./lus2lic {-ec -o ex.ec ex.lus -n ex} PASS: ./myec2c {-o ex.c ex.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ex.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ex.lus {} PASS: ./lus2lic {} {-lic -o exclusion.lic exclusion.lus -n exclusion} PASS: ./lus2lic {-ec -o exclusion.ec exclusion.lus -n exclusion} PASS: ./myec2c {-o exclusion.c exclusion.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node exclusion.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc exclusion.lus {} PASS: ./lus2lic {} {-lic -o filliter.lic filliter.lus -n filliter} PASS: ./lus2lic {-ec -o filliter.ec filliter.lus -n filliter} PASS: ./myec2c {-o filliter.c filliter.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node filliter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc filliter.lus {} PASS: ./lus2lic {} {-lic -o filter.lic filter.lus -n filter} PASS: ./lus2lic {-ec -o filter.ec filter.lus -n filter} PASS: ./myec2c {-o filter.c filter.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node filter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc filter.lus {} PASS: ./lus2lic {} {-lic -o flo.lic flo.lus -n flo} PASS: ./lus2lic {-ec -o flo.ec flo.lus -n flo} PASS: ./myec2c {-o flo.c flo.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node flo.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc flo.lus {} PASS: ./lus2lic {} {-lic -o followed_by.lic followed_by.lus -n followed_by} PASS: ./lus2lic {-ec -o followed_by.ec followed_by.lus -n followed_by} PASS: ./myec2c {-o followed_by.c followed_by.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node followed_by.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc followed_by.lus {} PASS: ./lus2lic {} {-lic -o foo.lic foo.lus -n foo} PASS: ./lus2lic {-ec -o foo.ec foo.lus -n foo} PASS: ./myec2c {-o foo.c foo.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node foo.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc foo.lus {} PASS: ./lus2lic {} {-lic -o fresh_name.lic fresh_name.lus -n fresh_name} PASS: ./lus2lic {-ec -o fresh_name.ec fresh_name.lus -n fresh_name} PASS: ./myec2c {-o fresh_name.c fresh_name.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node fresh_name.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc fresh_name.lus {} PASS: ./lus2lic {} {-lic -o func_with_body.lic func_with_body.lus -n func_with_body} PASS: ./lus2lic {-ec -o func_with_body.ec func_with_body.lus -n func_with_body} PASS: ./myec2c {-o func_with_body.c func_with_body.ec} @@ -1501,14 +1774,17 @@ PASS: ./lus2lic {} {-lic -o hanane.lic hanane.lus -n hanane} PASS: ./lus2lic {-ec -o hanane.ec hanane.lus -n hanane} PASS: ./myec2c {-o hanane.c hanane.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node hanane.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc hanane.lus {} PASS: ./lus2lic {} {-lic -o heater_control.lic heater_control.lus -n heater_control} PASS: ./lus2lic {-ec -o heater_control.ec heater_control.lus -n heater_control} PASS: ./myec2c {-o heater_control.c heater_control.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node heater_control.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc heater_control.lus {} PASS: ./lus2lic {} {-lic -o impl_priority.lic impl_priority.lus -n impl_priority} PASS: ./lus2lic {-ec -o impl_priority.ec impl_priority.lus -n impl_priority} PASS: ./myec2c {-o impl_priority.c impl_priority.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node impl_priority.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc impl_priority.lus {} PASS: ./lus2lic {} {-lic -o import1.lic import1.lus -n import1} PASS: ./lus2lic {-ec -o import1.ec import1.lus -n import1} PASS: ./myec2c {-o import1.c import1.ec} @@ -1516,43 +1792,53 @@ PASS: ./lus2lic {} {-lic -o initial.lic initial.lus -n initial} PASS: ./lus2lic {-ec -o initial.ec initial.lus -n initial} PASS: ./myec2c {-o initial.c initial.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node initial.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc initial.lus {} PASS: ./lus2lic {} {-lic -o integrator.lic integrator.lus -n integrator} PASS: ./lus2lic {-ec -o integrator.ec integrator.lus -n integrator} PASS: ./myec2c {-o integrator.c integrator.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node integrator.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc integrator.lus {} PASS: ./lus2lic {} {-lic -o is_stable.lic is_stable.lus -n is_stable} PASS: ./lus2lic {-ec -o is_stable.ec is_stable.lus -n is_stable} PASS: ./myec2c {-o is_stable.c is_stable.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node is_stable.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc is_stable.lus {} PASS: ./lus2lic {} {-lic -o iter.lic iter.lus -n iter} PASS: ./lus2lic {-ec -o iter.ec iter.lus -n iter} PASS: ./myec2c {-o iter.c iter.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node iter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc iter.lus {} PASS: ./lus2lic {} {-lic -o iterFibo.lic iterFibo.lus -n iterFibo} PASS: ./lus2lic {-ec -o iterFibo.ec iterFibo.lus -n iterFibo} PASS: ./myec2c {-o iterFibo.c iterFibo.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node iterFibo.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc iterFibo.lus {} PASS: ./lus2lic {} {-lic -o iterate.lic iterate.lus -n iterate} PASS: ./lus2lic {-ec -o iterate.ec iterate.lus -n iterate} PASS: ./myec2c {-o iterate.c iterate.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node iterate.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc iterate.lus {} PASS: ./lus2lic { "--expand-nodes -esa"} {-lic -o iterate_on_plus.lic iterate_on_plus.lus -n iterate_on_plus} PASS: ./lus2lic {} {-lic -o left.lic left.lus -n left} PASS: ./lus2lic {-ec -o left.ec left.lus -n left} PASS: ./myec2c {-o left.c left.ec} FAIL: Try to compare lus2lic -exec and ecexe: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node left.lus {} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc left.lus {} PASS: ./lus2lic {} {-lic -o long_et_stupide_nom_de_noeud.lic long_et_stupide_nom_de_noeud.lus -n long_et_stupide_nom_de_noeud} PASS: ./lus2lic {-ec -o long_et_stupide_nom_de_noeud.ec long_et_stupide_nom_de_noeud.lus -n long_et_stupide_nom_de_noeud} PASS: ./myec2c {-o long_et_stupide_nom_de_noeud.c long_et_stupide_nom_de_noeud.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node long_et_stupide_nom_de_noeud.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc long_et_stupide_nom_de_noeud.lus {} PASS: ./lus2lic {} {-lic -o lucky.lic lucky.lus -n lucky} PASS: ./lus2lic {-ec -o lucky.ec lucky.lus -n lucky} PASS: ./myec2c {-o lucky.c lucky.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node lucky.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc lucky.lus {} PASS: ./lus2lic {} {-lic -o lustre_test1_ok.lic lustre_test1_ok.lus -n lustre_test1_ok} PASS: ./lus2lic {-ec -o lustre_test1_ok.ec lustre_test1_ok.lus -n lustre_test1_ok} PASS: ./myec2c {-o lustre_test1_ok.c lustre_test1_ok.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node lustre_test1_ok.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc lustre_test1_ok.lus {} PASS: ./lus2lic {} {-lic -o map_red_iter.lic map_red_iter.lus -n map_red_iter} PASS: ./lus2lic {-ec -o map_red_iter.ec map_red_iter.lus -n map_red_iter} PASS: ./myec2c {-o map_red_iter.c map_red_iter.ec} @@ -1560,50 +1846,62 @@ PASS: ./lus2lic {} {-lic -o mapdeRed.lic mapdeRed.lus -n mapdeRed} PASS: ./lus2lic {-ec -o mapdeRed.ec mapdeRed.lus -n mapdeRed} PASS: ./myec2c {-o mapdeRed.c mapdeRed.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mapdeRed.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mapdeRed.lus {} PASS: ./lus2lic {} {-lic -o mapinf.lic mapinf.lus -n mapinf} PASS: ./lus2lic {-ec -o mapinf.ec mapinf.lus -n mapinf} PASS: ./myec2c {-o mapinf.c mapinf.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mapinf.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mapinf.lus {} PASS: ./lus2lic {} {-lic -o mapiter.lic mapiter.lus -n mapiter} PASS: ./lus2lic {-ec -o mapiter.ec mapiter.lus -n mapiter} PASS: ./myec2c {-o mapiter.c mapiter.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mapiter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mapiter.lus {} PASS: ./lus2lic {} {-lic -o mappredef.lic mappredef.lus -n mappredef} PASS: ./lus2lic {-ec -o mappredef.ec mappredef.lus -n mappredef} PASS: ./myec2c {-o mappredef.c mappredef.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mappredef.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mappredef.lus {} PASS: ./lus2lic {} {-lic -o matrice.lic matrice.lus -n matrice} PASS: ./lus2lic {-ec -o matrice.ec matrice.lus -n matrice} PASS: ./myec2c {-o matrice.c matrice.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node matrice.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc matrice.lus {} PASS: ./lus2lic {} {-lic -o matrice2.lic matrice2.lus -n matrice2} PASS: ./lus2lic {-ec -o matrice2.ec matrice2.lus -n matrice2} PASS: ./myec2c {-o matrice2.c matrice2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node matrice2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc matrice2.lus {} PASS: ./lus2lic {} {-lic -o matrix_constant.lic matrix_constant.lus -n matrix_constant} PASS: ./lus2lic {-ec -o matrix_constant.ec matrix_constant.lus -n matrix_constant} PASS: ./myec2c {-o matrix_constant.c matrix_constant.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node matrix_constant.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc matrix_constant.lus {} PASS: ./lus2lic {} {-lic -o minmax1.lic minmax1.lus -n minmax1} PASS: ./lus2lic {-ec -o minmax1.ec minmax1.lus -n minmax1} PASS: ./myec2c {-o minmax1.c minmax1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node minmax1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc minmax1.lus {} PASS: ./lus2lic {} {-lic -o minmax2.lic minmax2.lus -n minmax2} PASS: ./lus2lic {-ec -o minmax2.ec minmax2.lus -n minmax2} PASS: ./myec2c {-o minmax2.c minmax2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node minmax2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc minmax2.lus {} PASS: ./lus2lic {} {-lic -o minmax3.lic minmax3.lus -n minmax3} PASS: ./lus2lic {-ec -o minmax3.ec minmax3.lus -n minmax3} PASS: ./myec2c {-o minmax3.c minmax3.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node minmax3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc minmax3.lus {} PASS: ./lus2lic {} {-lic -o minmax4.lic minmax4.lus -n minmax4} PASS: ./lus2lic {-ec -o minmax4.ec minmax4.lus -n minmax4} PASS: ./myec2c {-o minmax4.c minmax4.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node minmax4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc minmax4.lus {} PASS: ./lus2lic {} {-lic -o minmax4_bis.lic minmax4_bis.lus -n minmax4_bis} PASS: ./lus2lic {-ec -o minmax4_bis.ec minmax4_bis.lus -n minmax4_bis} PASS: ./myec2c {-o minmax4_bis.c minmax4_bis.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node minmax4_bis.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc minmax4_bis.lus {} PASS: ./lus2lic {} {-lic -o minmax5.lic minmax5.lus -n minmax5} PASS: ./lus2lic {-ec -o minmax5.ec minmax5.lus -n minmax5} PASS: ./myec2c {-o minmax5.c minmax5.ec} @@ -1614,26 +1912,32 @@ PASS: ./lus2lic {} {-lic -o minmax6.lic minmax6.lus -n minmax6} PASS: ./lus2lic {-ec -o minmax6.ec minmax6.lus -n minmax6} PASS: ./myec2c {-o minmax6.c minmax6.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node minmax6.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc minmax6.lus {} PASS: ./lus2lic {} {-lic -o minus.lic minus.lus -n minus} PASS: ./lus2lic {-ec -o minus.ec minus.lus -n minus} PASS: ./myec2c {-o minus.c minus.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node minus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc minus.lus {} PASS: ./lus2lic {} {-lic -o mm.lic mm.lus -n mm} PASS: ./lus2lic {-ec -o mm.ec mm.lus -n mm} PASS: ./myec2c {-o mm.c mm.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mm.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mm.lus {} PASS: ./lus2lic {} {-lic -o mm1.lic mm1.lus -n mm1} PASS: ./lus2lic {-ec -o mm1.ec mm1.lus -n mm1} PASS: ./myec2c {-o mm1.c mm1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mm1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mm1.lus {} PASS: ./lus2lic {} {-lic -o mm22.lic mm22.lus -n mm22} PASS: ./lus2lic {-ec -o mm22.ec mm22.lus -n mm22} PASS: ./myec2c {-o mm22.c mm22.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mm22.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mm22.lus {} PASS: ./lus2lic {} {-lic -o mm3.lic mm3.lus -n mm3} PASS: ./lus2lic {-ec -o mm3.ec mm3.lus -n mm3} PASS: ./myec2c {-o mm3.c mm3.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mm3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mm3.lus {} PASS: ./lus2lic {} {-lic -o modelInst.lic modelInst.lus -n modelInst} PASS: ./lus2lic {-ec -o modelInst.ec modelInst.lus -n modelInst} PASS: ./myec2c {-o modelInst.c modelInst.ec} @@ -1641,6 +1945,7 @@ PASS: ./lus2lic {} {-lic -o modes3x2_v2.lic modes3x2_v2.lus -n modes3x2_v2} PASS: ./lus2lic {-ec -o modes3x2_v2.ec modes3x2_v2.lus -n modes3x2_v2} PASS: ./myec2c {-o modes3x2_v2.c modes3x2_v2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node modes3x2_v2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc modes3x2_v2.lus {} PASS: ./lus2lic {} {-lic -o modes3x2_v3.lic modes3x2_v3.lus -n modes3x2_v3} PASS: ./lus2lic {-ec -o modes3x2_v3.ec modes3x2_v3.lus -n modes3x2_v3} PASS: ./lus2lic {} {-lic -o modes3x2_v4.lic modes3x2_v4.lus -n modes3x2_v4} @@ -1649,54 +1954,66 @@ PASS: ./lus2lic {} {-lic -o morel.lic morel.lus -n morel} PASS: ./lus2lic {-ec -o morel.ec morel.lus -n morel} PASS: ./myec2c {-o morel.c morel.ec} FAIL: Try to compare lus2lic -exec and ecexe: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node morel.lus {} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc morel.lus {} PASS: ./lus2lic {} {-lic -o morel2.lic morel2.lus -n morel2} PASS: ./lus2lic {-ec -o morel2.ec morel2.lus -n morel2} PASS: ./myec2c {-o morel2.c morel2.ec} FAIL: Try to compare lus2lic -exec and ecexe: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node morel2.lus {} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc morel2.lus {} PASS: ./lus2lic {} {-lic -o morel3.lic morel3.lus -n morel3} PASS: ./lus2lic {-ec -o morel3.ec morel3.lus -n morel3} PASS: ./myec2c {-o morel3.c morel3.ec} FAIL: Try to compare lus2lic -exec and ecexe: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node morel3.lus {} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc morel3.lus {} PASS: ./lus2lic {} {-lic -o morel4.lic morel4.lus -n morel4} PASS: ./lus2lic {-ec -o morel4.ec morel4.lus -n morel4} PASS: ./myec2c {-o morel4.c morel4.ec} FAIL: Try to compare lus2lic -exec and ecexe: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node morel4.lus {} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc morel4.lus {} PASS: ./lus2lic {} {-lic -o morel5.lic morel5.lus -n morel5} PASS: ./lus2lic {-ec -o morel5.ec morel5.lus -n morel5} PASS: ./myec2c {-o morel5.c morel5.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node morel5.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc morel5.lus {} PASS: ./lus2lic {} {-lic -o mouse.lic mouse.lus -n mouse} PASS: ./lus2lic {-ec -o mouse.ec mouse.lus -n mouse} PASS: ./myec2c {-o mouse.c mouse.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mouse.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mouse.lus {} PASS: ./lus2lic {} {-lic -o mouse1.lic mouse1.lus -n mouse1} PASS: ./lus2lic {-ec -o mouse1.ec mouse1.lus -n mouse1} PASS: ./myec2c {-o mouse1.c mouse1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mouse1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mouse1.lus {} PASS: ./lus2lic {} {-lic -o mouse2.lic mouse2.lus -n mouse2} PASS: ./lus2lic {-ec -o mouse2.ec mouse2.lus -n mouse2} PASS: ./myec2c {-o mouse2.c mouse2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mouse2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mouse2.lus {} PASS: ./lus2lic {} {-lic -o mouse3.lic mouse3.lus -n mouse3} PASS: ./lus2lic {-ec -o mouse3.ec mouse3.lus -n mouse3} PASS: ./myec2c {-o mouse3.c mouse3.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node mouse3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc mouse3.lus {} PASS: ./lus2lic {} {-lic -o moyenne.lic moyenne.lus -n moyenne} PASS: ./lus2lic {-ec -o moyenne.ec moyenne.lus -n moyenne} PASS: ./myec2c {-o moyenne.c moyenne.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node moyenne.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc moyenne.lus {} PASS: ./lus2lic {} {-lic -o multiclock.lic multiclock.lus -n multiclock} PASS: ./lus2lic {-ec -o multiclock.ec multiclock.lus -n multiclock} PASS: ./myec2c {-o multiclock.c multiclock.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multiclock.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc multiclock.lus {} PASS: ./lus2lic {} {-lic -o multipar.lic multipar.lus -n multipar} PASS: ./lus2lic {-ec -o multipar.ec multipar.lus -n multipar} PASS: ./myec2c {-o multipar.c multipar.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc multipar.lus {} ==> lus2lic4.sum <== -Test run by jahier on Tue Feb 27 15:32:45 +Test run by jahier on Tue Jun 18 16:08:08 Native configuration is x86_64-pc-linux-gnu === lus2lic4 tests === @@ -1712,26 +2029,32 @@ PASS: ./lus2lic {} {-lic -o SOURIS.lic SOURIS.lus -n SOURIS} PASS: ./lus2lic {-ec -o SOURIS.ec SOURIS.lus -n SOURIS} PASS: ./myec2c {-o SOURIS.c SOURIS.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node SOURIS.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc SOURIS.lus {} PASS: ./lus2lic {} {-lic -o STABLE.lic STABLE.lus -n STABLE} PASS: ./lus2lic {-ec -o STABLE.ec STABLE.lus -n STABLE} PASS: ./myec2c {-o STABLE.c STABLE.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node STABLE.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc STABLE.lus {} PASS: ./lus2lic {} {-lic -o SWITCH.lic SWITCH.lus -n SWITCH} PASS: ./lus2lic {-ec -o SWITCH.ec SWITCH.lus -n SWITCH} PASS: ./myec2c {-o SWITCH.c SWITCH.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node SWITCH.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc SWITCH.lus {} PASS: ./lus2lic {} {-lic -o SWITCH1.lic SWITCH1.lus -n SWITCH1} PASS: ./lus2lic {-ec -o SWITCH1.ec SWITCH1.lus -n SWITCH1} PASS: ./myec2c {-o SWITCH1.c SWITCH1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node SWITCH1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc SWITCH1.lus {} PASS: ./lus2lic {} {-lic -o TIME_STABLE.lic TIME_STABLE.lus -n TIME_STABLE} PASS: ./lus2lic {-ec -o TIME_STABLE.ec TIME_STABLE.lus -n TIME_STABLE} PASS: ./myec2c {-o TIME_STABLE.c TIME_STABLE.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node TIME_STABLE.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc TIME_STABLE.lus {} PASS: ./lus2lic {} {-lic -o TIME_STABLE1.lic TIME_STABLE1.lus -n TIME_STABLE1} PASS: ./lus2lic {-ec -o TIME_STABLE1.ec TIME_STABLE1.lus -n TIME_STABLE1} PASS: ./myec2c {-o TIME_STABLE1.c TIME_STABLE1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node TIME_STABLE1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc TIME_STABLE1.lus {} PASS: ./lus2lic {} {-lic -o Watch.lic Watch.lus -n Watch} PASS: ./lus2lic {-ec -o Watch.ec Watch.lus -n Watch} PASS: ./myec2c {-o Watch.c Watch.ec} @@ -1739,59 +2062,73 @@ PASS: ./lus2lic {} {-lic -o X.lic X.lus -n X} PASS: ./lus2lic {-ec -o X.ec X.lus -n X} PASS: ./myec2c {-o X.c X.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node X.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc X.lus {} PASS: ./lus2lic {} {-lic -o X2.lic X2.lus -n X2} PASS: ./lus2lic {-ec -o X2.ec X2.lus -n X2} PASS: ./myec2c {-o X2.c X2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node X2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc X2.lus {} FAIL: without any option: ./lus2lic {} {-lic -o X6.lic X6.lus -n X6} PASS: ./lus2lic {} {-lic -o Xr.lic Xr.lus -n Xr} PASS: ./lus2lic {-ec -o Xr.ec Xr.lus -n Xr} PASS: ./myec2c {-o Xr.c Xr.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node Xr.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc Xr.lus {} PASS: ./lus2lic {} {-lic -o nc1.lic nc1.lus -n nc1} PASS: ./lus2lic {-ec -o nc1.ec nc1.lus -n nc1} PASS: ./myec2c {-o nc1.c nc1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc1.lus {} PASS: ./lus2lic {} {-lic -o nc10.lic nc10.lus -n nc10} PASS: ./lus2lic {-ec -o nc10.ec nc10.lus -n nc10} PASS: ./myec2c {-o nc10.c nc10.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc10.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc10.lus {} PASS: ./lus2lic {} {-lic -o nc2.lic nc2.lus -n nc2} PASS: ./lus2lic {-ec -o nc2.ec nc2.lus -n nc2} PASS: ./myec2c {-o nc2.c nc2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc2.lus {} PASS: ./lus2lic {} {-lic -o nc3.lic nc3.lus -n nc3} PASS: ./lus2lic {-ec -o nc3.ec nc3.lus -n nc3} PASS: ./myec2c {-o nc3.c nc3.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc3.lus {} PASS: ./lus2lic {} {-lic -o nc4.lic nc4.lus -n nc4} PASS: ./lus2lic {-ec -o nc4.ec nc4.lus -n nc4} PASS: ./myec2c {-o nc4.c nc4.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc4.lus {} PASS: ./lus2lic {} {-lic -o nc5.lic nc5.lus -n nc5} PASS: ./lus2lic {-ec -o nc5.ec nc5.lus -n nc5} PASS: ./myec2c {-o nc5.c nc5.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc5.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc5.lus {} PASS: ./lus2lic {} {-lic -o nc6.lic nc6.lus -n nc6} PASS: ./lus2lic {-ec -o nc6.ec nc6.lus -n nc6} PASS: ./myec2c {-o nc6.c nc6.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc6.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc6.lus {} PASS: ./lus2lic {} {-lic -o nc7.lic nc7.lus -n nc7} PASS: ./lus2lic {-ec -o nc7.ec nc7.lus -n nc7} PASS: ./myec2c {-o nc7.c nc7.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc7.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc7.lus {} PASS: ./lus2lic {} {-lic -o nc8.lic nc8.lus -n nc8} PASS: ./lus2lic {-ec -o nc8.ec nc8.lus -n nc8} PASS: ./myec2c {-o nc8.c nc8.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc8.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc8.lus {} PASS: ./lus2lic {} {-lic -o nc9.lic nc9.lus -n nc9} PASS: ./lus2lic {-ec -o nc9.ec nc9.lus -n nc9} PASS: ./myec2c {-o nc9.c nc9.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nc9.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nc9.lus {} PASS: ./lus2lic {} {-lic -o nested.lic nested.lus -n nested} PASS: ./lus2lic {-ec -o nested.ec nested.lus -n nested} PASS: ./myec2c {-o nested.c nested.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nested.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nested.lus {} PASS: ./lus2lic {} {-lic -o newpacks.lic newpacks.lus -n newpacks} PASS: ./lus2lic {-ec -o newpacks.ec newpacks.lus -n newpacks} PASS: ./myec2c {-o newpacks.c newpacks.ec} @@ -1799,22 +2136,27 @@ PASS: ./lus2lic {} {-lic -o noAlarm.lic noAlarm.lus -n noAlarm} PASS: ./lus2lic {-ec -o noAlarm.ec noAlarm.lus -n noAlarm} PASS: ./myec2c {-o noAlarm.c noAlarm.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node noAlarm.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc noAlarm.lus {} PASS: ./lus2lic {} {-lic -o node_caller1.lic node_caller1.lus -n node_caller1} PASS: ./lus2lic {-ec -o node_caller1.ec node_caller1.lus -n node_caller1} PASS: ./myec2c {-o node_caller1.c node_caller1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node node_caller1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc node_caller1.lus {} PASS: ./lus2lic {} {-lic -o nodeparam.lic nodeparam.lus -n nodeparam} PASS: ./lus2lic {-ec -o nodeparam.ec nodeparam.lus -n nodeparam} PASS: ./myec2c {-o nodeparam.c nodeparam.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node nodeparam.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc nodeparam.lus {} PASS: ./lus2lic {} {-lic -o noeudsIndependants.lic noeudsIndependants.lus -n noeudsIndependants} PASS: ./lus2lic {-ec -o noeudsIndependants.ec noeudsIndependants.lus -n noeudsIndependants} PASS: ./myec2c {-o noeudsIndependants.c noeudsIndependants.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node noeudsIndependants.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc noeudsIndependants.lus {} PASS: ./lus2lic {} {-lic -o noinput.lic noinput.lus -n noinput} PASS: ./lus2lic {-ec -o noinput.ec noinput.lus -n noinput} PASS: ./myec2c {-o noinput.c noinput.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node noinput.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc noinput.lus {} PASS: ./lus2lic {} {-lic -o normal.lic normal.lus -n normal} PASS: ./lus2lic {-ec -o normal.ec normal.lus -n normal} PASS: ./myec2c {-o normal.c normal.ec} @@ -1822,10 +2164,12 @@ PASS: ./lus2lic {} {-lic -o notTwo.lic notTwo.lus -n notTwo} PASS: ./lus2lic {-ec -o notTwo.ec notTwo.lus -n notTwo} PASS: ./myec2c {-o notTwo.c notTwo.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node notTwo.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc notTwo.lus {} PASS: ./lus2lic {} {-lic -o o2l_feux_compl.lic o2l_feux_compl.lus -n o2l_feux_compl} PASS: ./lus2lic {-ec -o o2l_feux_compl.ec o2l_feux_compl.lus -n o2l_feux_compl} PASS: ./myec2c {-o o2l_feux_compl.c o2l_feux_compl.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node o2l_feux_compl.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc o2l_feux_compl.lus {} PASS: ./lus2lic {} {-lic -o oneq.lic oneq.lus -n oneq} PASS: ./lus2lic {-ec -o oneq.ec oneq.lus -n oneq} PASS: ./myec2c {-o oneq.c oneq.ec} @@ -1833,22 +2177,27 @@ PASS: ./lus2lic {} {-lic -o onlyroll.lic onlyroll.lus -n onlyroll} PASS: ./lus2lic {-ec -o onlyroll.ec onlyroll.lus -n onlyroll} PASS: ./myec2c {-o onlyroll.c onlyroll.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node onlyroll.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc onlyroll.lus {} PASS: ./lus2lic {} {-lic -o onlyroll2.lic onlyroll2.lus -n onlyroll2} PASS: ./lus2lic {-ec -o onlyroll2.ec onlyroll2.lus -n onlyroll2} PASS: ./myec2c {-o onlyroll2.c onlyroll2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node onlyroll2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc onlyroll2.lus {} PASS: ./lus2lic {} {-lic -o over2.lic over2.lus -n over2} PASS: ./lus2lic {-ec -o over2.ec over2.lus -n over2} PASS: ./myec2c {-o over2.c over2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node over2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc over2.lus {} PASS: ./lus2lic {} {-lic -o over3.lic over3.lus -n over3} PASS: ./lus2lic {-ec -o over3.ec over3.lus -n over3} PASS: ./myec2c {-o over3.c over3.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node over3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc over3.lus {} PASS: ./lus2lic {} {-lic -o overload.lic overload.lus -n overload} PASS: ./lus2lic {-ec -o overload.ec overload.lus -n overload} PASS: ./myec2c {-o overload.c overload.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node overload.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc overload.lus {} PASS: ./lus2lic {} {-lic -o p.lic p.lus -n p} PASS: ./lus2lic {-ec -o p.ec p.lus -n p} PASS: ./myec2c {-o p.c p.ec} @@ -1868,22 +2217,27 @@ PASS: ./lus2lic {} {-lic -o param_node.lic param_node.lus -n param_node} PASS: ./lus2lic {-ec -o param_node.ec param_node.lus -n param_node} PASS: ./myec2c {-o param_node.c param_node.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node param_node.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc param_node.lus {} PASS: ./lus2lic {} {-lic -o param_node2.lic param_node2.lus -n param_node2} PASS: ./lus2lic {-ec -o param_node2.ec param_node2.lus -n param_node2} PASS: ./myec2c {-o param_node2.c param_node2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node param_node2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc param_node2.lus {} PASS: ./lus2lic {} {-lic -o param_node3.lic param_node3.lus -n param_node3} PASS: ./lus2lic {-ec -o param_node3.ec param_node3.lus -n param_node3} PASS: ./myec2c {-o param_node3.c param_node3.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node param_node3.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc param_node3.lus {} PASS: ./lus2lic {} {-lic -o param_node4.lic param_node4.lus -n param_node4} PASS: ./lus2lic {-ec -o param_node4.ec param_node4.lus -n param_node4} PASS: ./myec2c {-o param_node4.c param_node4.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node param_node4.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc param_node4.lus {} PASS: ./lus2lic {} {-lic -o param_struct.lic param_struct.lus -n param_struct} PASS: ./lus2lic {-ec -o param_struct.ec param_struct.lus -n param_struct} PASS: ./myec2c {-o param_struct.c param_struct.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node param_struct.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc param_struct.lus {} PASS: ./lus2lic { --expand-nodes} {-lic -o pilote.lic pilote.lus -n pilote} PASS: ./lus2lic {-ec -o pilote.ec pilote.lus -n pilote} PASS: ./myec2c {-o pilote.c pilote.ec} @@ -1891,22 +2245,27 @@ PASS: ./lus2lic {} {-lic -o pipeline.lic pipeline.lus -n pipeline} PASS: ./lus2lic {-ec -o pipeline.ec pipeline.lus -n pipeline} PASS: ./myec2c {-o pipeline.c pipeline.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node pipeline.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc pipeline.lus {} PASS: ./lus2lic {} {-lic -o plus.lic plus.lus -n plus} PASS: ./lus2lic {-ec -o plus.ec plus.lus -n plus} PASS: ./myec2c {-o plus.c plus.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node plus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc plus.lus {} PASS: ./lus2lic {} {-lic -o ply01.lic ply01.lus -n ply01} PASS: ./lus2lic {-ec -o ply01.ec ply01.lus -n ply01} PASS: ./myec2c {-o ply01.c ply01.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ply01.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ply01.lus {} PASS: ./lus2lic { -rnc} {-lic -o ply02.lic ply02.lus -n ply02} PASS: ./lus2lic {-ec -o ply02.ec ply02.lus -n ply02} PASS: ./myec2c {-o ply02.c ply02.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ply02.lus { -rnc} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ply02.lus { -rnc} PASS: ./lus2lic { -rnc} {-lic -o ply03.lic ply03.lus -n ply03} PASS: ./lus2lic {-ec -o ply03.ec ply03.lus -n ply03} PASS: ./myec2c {-o ply03.c ply03.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ply03.lus { -rnc} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ply03.lus { -rnc} PASS: ./lus2lic {} {-lic -o polymorphic_pack.lic polymorphic_pack.lus -n polymorphic_pack} PASS: ./lus2lic {-ec -o polymorphic_pack.ec polymorphic_pack.lus -n polymorphic_pack} PASS: ./myec2c {-o polymorphic_pack.c polymorphic_pack.ec} @@ -1914,34 +2273,42 @@ PASS: ./lus2lic {} {-lic -o poussoir.lic poussoir.lus -n poussoir} PASS: ./lus2lic {-ec -o poussoir.ec poussoir.lus -n poussoir} PASS: ./myec2c {-o poussoir.c poussoir.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node poussoir.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc poussoir.lus {} PASS: ./lus2lic {} {-lic -o pplus.lic pplus.lus -n pplus} PASS: ./lus2lic {-ec -o pplus.ec pplus.lus -n pplus} PASS: ./myec2c {-o pplus.c pplus.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node pplus.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc pplus.lus {} PASS: ./lus2lic {} {-lic -o pre_x.lic pre_x.lus -n pre_x} PASS: ./lus2lic {-ec -o pre_x.ec pre_x.lus -n pre_x} PASS: ./myec2c {-o pre_x.c pre_x.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node pre_x.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc pre_x.lus {} PASS: ./lus2lic {} {-lic -o predef01.lic predef01.lus -n predef01} PASS: ./lus2lic {-ec -o predef01.ec predef01.lus -n predef01} PASS: ./myec2c {-o predef01.c predef01.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node predef01.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc predef01.lus {} PASS: ./lus2lic {} {-lic -o predef02.lic predef02.lus -n predef02} PASS: ./lus2lic {-ec -o predef02.ec predef02.lus -n predef02} PASS: ./myec2c {-o predef02.c predef02.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node predef02.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc predef02.lus {} PASS: ./lus2lic {} {-lic -o predef03.lic predef03.lus -n predef03} PASS: ./lus2lic {-ec -o predef03.ec predef03.lus -n predef03} PASS: ./myec2c {-o predef03.c predef03.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node predef03.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc predef03.lus {} PASS: ./lus2lic {} {-lic -o predefOp.lic predefOp.lus -n predefOp} PASS: ./lus2lic {-ec -o predefOp.ec predefOp.lus -n predefOp} PASS: ./myec2c {-o predefOp.c predefOp.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node predefOp.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc predefOp.lus {} PASS: ./lus2lic {} {-lic -o produitBool.lic produitBool.lus -n produitBool} PASS: ./lus2lic {-ec -o produitBool.ec produitBool.lus -n produitBool} PASS: ./myec2c {-o produitBool.c produitBool.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node produitBool.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc produitBool.lus {} PASS: ./lus2lic {} {-lic -o random.lic random.lus -n random} PASS: ./lus2lic {-ec -o random.ec random.lus -n random} FAIL: Try ec2c on the result: ./myec2c {-o random.c random.ec} @@ -1949,18 +2316,22 @@ PASS: ./lus2lic {} {-lic -o real_ex.lic real_ex.lus -n real_ex} PASS: ./lus2lic {-ec -o real_ex.ec real_ex.lus -n real_ex} PASS: ./myec2c {-o real_ex.c real_ex.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node real_ex.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc real_ex.lus {} PASS: ./lus2lic {} {-lic -o redIf.lic redIf.lus -n redIf} PASS: ./lus2lic {-ec -o redIf.ec redIf.lus -n redIf} PASS: ./myec2c {-o redIf.c redIf.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node redIf.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc redIf.lus {} PASS: ./lus2lic {} {-lic -o rediter.lic rediter.lus -n rediter} PASS: ./lus2lic {-ec -o rediter.ec rediter.lus -n rediter} PASS: ./myec2c {-o rediter.c rediter.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node rediter.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc rediter.lus {} PASS: ./lus2lic {} {-lic -o redoptest.lic redoptest.lus -n redoptest} PASS: ./lus2lic {-ec -o redoptest.ec redoptest.lus -n redoptest} PASS: ./myec2c {-o redoptest.c redoptest.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node redoptest.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc redoptest.lus {} PASS: ./lus2lic {} {-lic -o remplissage.lic remplissage.lus -n remplissage} PASS: ./lus2lic {-ec -o remplissage.ec remplissage.lus -n remplissage} PASS: ./myec2c {-o remplissage.c remplissage.ec} @@ -1968,22 +2339,27 @@ PASS: ./lus2lic {} {-lic -o rs.lic rs.lus -n rs} PASS: ./lus2lic {-ec -o rs.ec rs.lus -n rs} PASS: ./myec2c {-o rs.c rs.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node rs.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc rs.lus {} PASS: ./lus2lic {} {-lic -o sample_time_change.lic sample_time_change.lus -n sample_time_change} PASS: ./lus2lic {-ec -o sample_time_change.ec sample_time_change.lus -n sample_time_change} PASS: ./myec2c {-o sample_time_change.c sample_time_change.ec} FAIL: Try to compare lus2lic -exec and ecexe: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node sample_time_change.lus {} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc sample_time_change.lus {} PASS: ./lus2lic {} {-lic -o sample_time_change_MainNode.lic sample_time_change_MainNode.lus -n sample_time_change_MainNode} PASS: ./lus2lic {-ec -o sample_time_change_MainNode.ec sample_time_change_MainNode.lus -n sample_time_change_MainNode} PASS: ./myec2c {-o sample_time_change_MainNode.c sample_time_change_MainNode.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node sample_time_change_MainNode.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc sample_time_change_MainNode.lus {} PASS: ./lus2lic {} {-lic -o shiftFill_ludic.lic shiftFill_ludic.lus -n shiftFill_ludic} PASS: ./lus2lic {-ec -o shiftFill_ludic.ec shiftFill_ludic.lus -n shiftFill_ludic} PASS: ./myec2c {-o shiftFill_ludic.c shiftFill_ludic.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node shiftFill_ludic.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc shiftFill_ludic.lus {} PASS: ./lus2lic {} {-lic -o shift_ludic.lic shift_ludic.lus -n shift_ludic} PASS: ./lus2lic {-ec -o shift_ludic.ec shift_ludic.lus -n shift_ludic} PASS: ./myec2c {-o shift_ludic.c shift_ludic.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node shift_ludic.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc shift_ludic.lus {} PASS: ./lus2lic {} {-lic -o simple.lic simple.lus -n simple} PASS: ./lus2lic {-ec -o simple.ec simple.lus -n simple} PASS: ./myec2c {-o simple.c simple.ec} @@ -1991,30 +2367,37 @@ PASS: ./lus2lic {} {-lic -o simpleRed.lic simpleRed.lus -n simpleRed} PASS: ./lus2lic {-ec -o simpleRed.ec simpleRed.lus -n simpleRed} PASS: ./myec2c {-o simpleRed.c simpleRed.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node simpleRed.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc simpleRed.lus {} PASS: ./lus2lic {} {-lic -o sincos.lic sincos.lus -n sincos} PASS: ./lus2lic {-ec -o sincos.ec sincos.lus -n sincos} PASS: ./myec2c {-o sincos.c sincos.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node sincos.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc sincos.lus {} PASS: ./lus2lic { --expand-nodes} {-lic -o speedcontrol.lic speedcontrol.lus -n speedcontrol} PASS: ./lus2lic {-ec -o speedcontrol.ec speedcontrol.lus -n speedcontrol} PASS: ./myec2c {-o speedcontrol.c speedcontrol.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node speedcontrol.lus { --expand-nodes} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc speedcontrol.lus { --expand-nodes} PASS: ./lus2lic {} {-lic -o stopwatch.lic stopwatch.lus -n stopwatch} PASS: ./lus2lic {-ec -o stopwatch.ec stopwatch.lus -n stopwatch} PASS: ./myec2c {-o stopwatch.c stopwatch.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node stopwatch.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc stopwatch.lus {} PASS: ./lus2lic {} {-lic -o struct0.lic struct0.lus -n struct0} PASS: ./lus2lic {-ec -o struct0.ec struct0.lus -n struct0} PASS: ./myec2c {-o struct0.c struct0.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node struct0.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc struct0.lus {} PASS: ./lus2lic {} {-lic -o struct_equality.lic struct_equality.lus -n struct_equality} PASS: ./lus2lic {-ec -o struct_equality.ec struct_equality.lus -n struct_equality} PASS: ./myec2c {-o struct_equality.c struct_equality.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node struct_equality.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc struct_equality.lus {} PASS: ./lus2lic {} {-lic -o struct_with.lic struct_with.lus -n struct_with} PASS: ./lus2lic {-ec -o struct_with.ec struct_with.lus -n struct_with} PASS: ./myec2c {-o struct_with.c struct_with.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node struct_with.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc struct_with.lus {} PASS: ./lus2lic {} {-lic -o t0.lic t0.lus -n t0} PASS: ./lus2lic {-ec -o t0.ec t0.lus -n t0} PASS: ./myec2c {-o t0.c t0.ec} @@ -2022,14 +2405,17 @@ PASS: ./lus2lic {} {-lic -o t1.lic t1.lus -n t1} PASS: ./lus2lic {-ec -o t1.ec t1.lus -n t1} PASS: ./myec2c {-o t1.c t1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node t1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc t1.lus {} PASS: ./lus2lic {} {-lic -o t2.lic t2.lus -n t2} PASS: ./lus2lic {-ec -o t2.ec t2.lus -n t2} PASS: ./myec2c {-o t2.c t2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node t2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc t2.lus {} PASS: ./lus2lic {} {-lic -o test.lic test.lus -n test} PASS: ./lus2lic {-ec -o test.ec test.lus -n test} PASS: ./myec2c {-o test.c test.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test.lus {} PASS: ./lus2lic {} {-lic -o testBoite.lic testBoite.lus -n testBoite} PASS: ./lus2lic {-ec -o testBoite.ec testBoite.lus -n testBoite} PASS: ./myec2c {-o testBoite.c testBoite.ec} @@ -2037,6 +2423,7 @@ PASS: ./lus2lic {} {-lic -o testCA.lic testCA.lus -n testCA} PASS: ./lus2lic {-ec -o testCA.ec testCA.lus -n testCA} PASS: ./myec2c {-o testCA.c testCA.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node testCA.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc testCA.lus {} PASS: ./lus2lic {} {-lic -o testCapt.lic testCapt.lus -n testCapt} PASS: ./lus2lic {-ec -o testCapt.ec testCapt.lus -n testCapt} PASS: ./myec2c {-o testCapt.c testCapt.ec} @@ -2050,10 +2437,12 @@ PASS: ./lus2lic {} {-lic -o test_arrow.lic test_arrow.lus -n test_arrow} PASS: ./lus2lic {-ec -o test_arrow.ec test_arrow.lus -n test_arrow} PASS: ./myec2c {-o test_arrow.c test_arrow.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_arrow.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_arrow.lus {} PASS: ./lus2lic {} {-lic -o test_boolred.lic test_boolred.lus -n test_boolred} PASS: ./lus2lic {-ec -o test_boolred.ec test_boolred.lus -n test_boolred} PASS: ./myec2c {-o test_boolred.c test_boolred.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_boolred.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_boolred.lus {} PASS: ./lus2lic {} {-lic -o test_clash.lic test_clash.lus -n test_clash} PASS: ./lus2lic {-ec -o test_clash.ec test_clash.lus -n test_clash} PASS: ./myec2c {-o test_clash.c test_clash.ec} @@ -2061,14 +2450,17 @@ PASS: ./lus2lic {} {-lic -o test_condact.lic test_condact.lus -n test_condact} PASS: ./lus2lic {-ec -o test_condact.ec test_condact.lus -n test_condact} PASS: ./myec2c {-o test_condact.c test_condact.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_condact.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_condact.lus {} PASS: ./lus2lic {} {-lic -o test_const.lic test_const.lus -n test_const} PASS: ./lus2lic {-ec -o test_const.ec test_const.lus -n test_const} PASS: ./myec2c {-o test_const.c test_const.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_const.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_const.lus {} PASS: ./lus2lic {} {-lic -o test_diese.lic test_diese.lus -n test_diese} PASS: ./lus2lic {-ec -o test_diese.ec test_diese.lus -n test_diese} PASS: ./myec2c {-o test_diese.c test_diese.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_diese.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_diese.lus {} PASS: ./lus2lic {} {-lic -o test_enum.lic test_enum.lus -n test_enum} PASS: ./lus2lic {-ec -o test_enum.ec test_enum.lus -n test_enum} PASS: ./myec2c {-o test_enum.c test_enum.ec} @@ -2082,6 +2474,7 @@ PASS: ./lus2lic {} {-lic -o test_map.lic test_map.lus -n test_map} PASS: ./lus2lic {-ec -o test_map.ec test_map.lus -n test_map} PASS: ./myec2c {-o test_map.c test_map.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_map.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_map.lus {} PASS: ./lus2lic {} {-lic -o test_merge.lic test_merge.lus -n test_merge} PASS: ./lus2lic {-ec -o test_merge.ec test_merge.lus -n test_merge} PASS: ./lus2lic {} {-lic -o test_model.lic test_model.lus -n test_model} @@ -2094,14 +2487,17 @@ PASS: ./lus2lic {} {-lic -o test_node_expand.lic test_node_expand.lus -n test_no PASS: ./lus2lic {-ec -o test_node_expand.ec test_node_expand.lus -n test_node_expand} PASS: ./myec2c {-o test_node_expand.c test_node_expand.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_node_expand.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_node_expand.lus {} PASS: ./lus2lic {} {-lic -o test_node_expand2.lic test_node_expand2.lus -n test_node_expand2} PASS: ./lus2lic {-ec -o test_node_expand2.ec test_node_expand2.lus -n test_node_expand2} PASS: ./myec2c {-o test_node_expand2.c test_node_expand2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_node_expand2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_node_expand2.lus {} PASS: ./lus2lic { -rnc} {-lic -o test_poly.lic test_poly.lus -n test_poly} PASS: ./lus2lic {-ec -o test_poly.ec test_poly.lus -n test_poly} PASS: ./myec2c {-o test_poly.c test_poly.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_poly.lus { -rnc} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_poly.lus { -rnc} PASS: ./lus2lic {} {-lic -o test_sqrt.lic test_sqrt.lus -n test_sqrt} PASS: ./lus2lic {-ec -o test_sqrt.ec test_sqrt.lus -n test_sqrt} PASS: ./myec2c {-o test_sqrt.c test_sqrt.ec} @@ -2109,54 +2505,67 @@ PASS: ./lus2lic {} {-lic -o test_struct.lic test_struct.lus -n test_struct} PASS: ./lus2lic {-ec -o test_struct.ec test_struct.lus -n test_struct} PASS: ./myec2c {-o test_struct.c test_struct.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node test_struct.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc test_struct.lus {} PASS: ./lus2lic {} {-lic -o titi.lic titi.lus -n titi} PASS: ./lus2lic {-ec -o titi.ec titi.lus -n titi} PASS: ./myec2c {-o titi.c titi.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node titi.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc titi.lus {} PASS: ./lus2lic {} {-lic -o toolate.lic toolate.lus -n toolate} PASS: ./lus2lic {-ec -o toolate.ec toolate.lus -n toolate} PASS: ./myec2c {-o toolate.c toolate.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node toolate.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc toolate.lus {} PASS: ./lus2lic {} {-lic -o toto.lic toto.lus -n toto} PASS: ./lus2lic {-ec -o toto.ec toto.lus -n toto} PASS: ./myec2c {-o toto.c toto.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node toto.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc toto.lus {} PASS: ./lus2lic {} {-lic -o tranche.lic tranche.lus -n tranche} PASS: ./lus2lic {-ec -o tranche.ec tranche.lus -n tranche} PASS: ./myec2c {-o tranche.c tranche.ec} FAIL: Try to compare lus2lic -exec and ecexe: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node tranche.lus {} +FAIL: Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c: /home/jahier/lus2lic/test/../utils/check_knc tranche.lus {} PASS: ./lus2lic {} {-lic -o tri.lic tri.lus -n tri} PASS: ./lus2lic {-ec -o tri.ec tri.lus -n tri} PASS: ./myec2c {-o tri.c tri.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node tri.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc tri.lus {} PASS: ./lus2lic {} {-lic -o triSel.lic triSel.lus -n triSel} PASS: ./lus2lic {-ec -o triSel.ec triSel.lus -n triSel} PASS: ./myec2c {-o triSel.c triSel.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node triSel.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc triSel.lus {} PASS: ./lus2lic {} {-lic -o trivial.lic trivial.lus -n trivial} PASS: ./lus2lic {-ec -o trivial.ec trivial.lus -n trivial} PASS: ./myec2c {-o trivial.c trivial.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node trivial.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc trivial.lus {} PASS: ./lus2lic {} {-lic -o trivial2.lic trivial2.lus -n trivial2} PASS: ./lus2lic {-ec -o trivial2.ec trivial2.lus -n trivial2} PASS: ./myec2c {-o trivial2.c trivial2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node trivial2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc trivial2.lus {} PASS: ./lus2lic {} {-lic -o trivial_array.lic trivial_array.lus -n trivial_array} PASS: ./lus2lic {-ec -o trivial_array.ec trivial_array.lus -n trivial_array} PASS: ./myec2c {-o trivial_array.c trivial_array.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node trivial_array.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc trivial_array.lus {} PASS: ./lus2lic {} {-lic -o ts01.lic ts01.lus -n ts01} PASS: ./lus2lic {-ec -o ts01.ec ts01.lus -n ts01} PASS: ./myec2c {-o ts01.c ts01.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ts01.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ts01.lus {} PASS: ./lus2lic {} {-lic -o ts04.lic ts04.lus -n ts04} PASS: ./lus2lic {-ec -o ts04.ec ts04.lus -n ts04} PASS: ./myec2c {-o ts04.c ts04.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node ts04.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc ts04.lus {} PASS: ./lus2lic {} {-lic -o tuple.lic tuple.lus -n tuple} PASS: ./lus2lic {-ec -o tuple.ec tuple.lus -n tuple} PASS: ./myec2c {-o tuple.c tuple.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node tuple.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc tuple.lus {} PASS: ./lus2lic {} {-lic -o type_decl.lic type_decl.lus -n type_decl} PASS: ./lus2lic {-ec -o type_decl.ec type_decl.lus -n type_decl} PASS: ./myec2c {-o type_decl.c type_decl.ec} @@ -2164,10 +2573,12 @@ PASS: ./lus2lic {} {-lic -o uu.lic uu.lus -n uu} PASS: ./lus2lic {-ec -o uu.ec uu.lus -n uu} PASS: ./myec2c {-o uu.c uu.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node uu.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc uu.lus {} PASS: ./lus2lic {} {-lic -o v1.lic v1.lus -n v1} PASS: ./lus2lic {-ec -o v1.ec v1.lus -n v1} PASS: ./myec2c {-o v1.c v1.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node v1.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc v1.lus {} PASS: ./lus2lic {} {-lic -o when_tuple.lic when_tuple.lus -n when_tuple} PASS: ./lus2lic {-ec -o when_tuple.ec when_tuple.lus -n when_tuple} PASS: ./myec2c {-o when_tuple.c when_tuple.ec} @@ -2175,18 +2586,22 @@ PASS: ./lus2lic {} {-lic -o xx.lic xx.lus -n xx} PASS: ./lus2lic {-ec -o xx.ec xx.lus -n xx} PASS: ./myec2c {-o xx.c xx.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node xx.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc xx.lus {} PASS: ./lus2lic {} {-lic -o yyy.lic yyy.lus -n yyy} PASS: ./lus2lic {-ec -o yyy.ec yyy.lus -n yyy} PASS: ./myec2c {-o yyy.c yyy.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node yyy.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc yyy.lus {} PASS: ./lus2lic {} {-lic -o zzz.lic zzz.lus -n zzz} PASS: ./lus2lic {-ec -o zzz.ec zzz.lus -n zzz} PASS: ./myec2c {-o zzz.c zzz.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc zzz.lus {} PASS: ./lus2lic {} {-lic -o zzz2.lic zzz2.lus -n zzz2} PASS: ./lus2lic {-ec -o zzz2.ec zzz2.lus -n zzz2} PASS: ./myec2c {-o zzz2.c zzz2.ec} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {} +PASS: /home/jahier/lus2lic/test/../utils/check_knc zzz2.lus {} ==> lus2lic0.sum <== === lus2lic0 Summary === @@ -2195,40 +2610,40 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {} # of expected failures 54 ==> lus2lic1.sum <== -PASS: /home/jahier/lus2lic/test/../utils/compare_gcc_and_clang multipar.lus {} +PASS: /home/jahier/lus2lic/test/../utils/compare_2ch_and_2cs multipar.lus {} === lus2lic1 Summary === -# of expected passes 554 +# of expected passes 661 ==> lus2lic2.sum <== === lus2lic2 Summary === -# of expected passes 531 -# of unexpected failures 3 +# of expected passes 632 +# of unexpected failures 4 ==> lus2lic3.sum <== === lus2lic3 Summary === -# of expected passes 497 -# of unexpected failures 8 +# of expected passes 597 +# of unexpected failures 16 # of unresolved testcases 1 ==> lus2lic4.sum <== === lus2lic4 Summary === -# of expected passes 475 -# of unexpected failures 6 +# of expected passes 570 +# of unexpected failures 9 =============================== -# Total number of failures: 17 -lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 2 seconds -lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 226 seconds -lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 253 seconds -lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 73 seconds -lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 54 seconds +# Total number of failures: 29 +lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds +lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 366 seconds +lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 414 seconds +lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 127 seconds +lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 114 seconds * Ref time: -216.58user 76.77system 10:08.93elapsed 48%CPU (0avgtext+0avgdata 99436maxresident)k -91200inputs+573904outputs (501major+20940476minor)pagefaults 0swaps +435.18user 137.98system 17:02.91elapsed 56%CPU (0avgtext+0avgdata 94892maxresident)k +247408inputs+907320outputs (1170major+35412857minor)pagefaults 0swaps * Quick time (-j 4): diff --git a/test/lus2lic.tests/test1.exp b/test/lus2lic.tests/test1.exp index e6ab88c3ee83575c761ea4cfba495378f2c62500..fccd8ff0e20b77eb615ee43d49e9a41ec824d0af 100644 --- a/test/lus2lic.tests/test1.exp +++ b/test/lus2lic.tests/test1.exp @@ -1,11 +1,12 @@ set timeout 30 +# do half of the test (to be able to run the other half in parallel) # for some reason [glob should_work/[a-n]*.lus] does not work set ok_files [lsort [glob should_work/{a,b,c,d,e,f,g,h,i,j,k,l,m,A,B,C,D,E,F,G,H,I,J,K,L,M}*.lus]] # should be a fresh dir... set tmp [pwd]/tmp1/ - -nonreg_exec_and_2c $ok_files $tmp +# cf site.exp +nonreg_pass1 $ok_files $tmp diff --git a/test/lus2lic.tests/test2.exp b/test/lus2lic.tests/test2.exp index 50db445da11dd186fb66f4dfb674c816ff93580b..3f10bad370b38d5c000572a7b50006644530c432 100644 --- a/test/lus2lic.tests/test2.exp +++ b/test/lus2lic.tests/test2.exp @@ -1,12 +1,12 @@ set timeout 40 +# do half of the test (to be able to run the other half in parallel) # for some reason [glob should_work/[a-n]*.lus] does not work set ok_files [lsort [glob should_work/{n,o,p,q,r,s,t,u,v,w,x,y,z,N,O,P,Q,R,S,T,U,V,W,X,Y,Z}*.lus]] - # should be a fresh dir... set tmp ./tmp1/ - -nonreg_exec_and_2c $ok_files $tmp +# cf site.exp +nonreg_pass1 $ok_files $tmp diff --git a/test/lus2lic.tests/test3.exp b/test/lus2lic.tests/test3.exp index 4d6f8b074b1b50af5f275f5e4222633232ae3279..7945e4067179d2beef6a45c6146306c8c99399c8 100644 --- a/test/lus2lic.tests/test3.exp +++ b/test/lus2lic.tests/test3.exp @@ -1,11 +1,12 @@ set timeout 30 +# do half of the test (to be able to run the other half in parallel) # for some reason [glob should_work/[a-n]*.lus] does not work set ok_files [lsort [glob should_work/{a,b,c,d,e,f,g,h,i,j,k,l,m,A,B,C,D,E,F,G,H,I,J,K,L,M}*.lus]] # should be a fresh dir... set tmp ./tmp2/ - -nonreg_exec_and_ecexe $ok_files $tmp +# cf site.exp +nonreg_pass2 $ok_files $tmp diff --git a/test/lus2lic.tests/test4.exp b/test/lus2lic.tests/test4.exp index 63dfbfcef7be0fc69ece0c4fc964d6a5e7d0b09e..b55989c3127b69ff7d56d316f4288da67035dd4d 100644 --- a/test/lus2lic.tests/test4.exp +++ b/test/lus2lic.tests/test4.exp @@ -1,12 +1,12 @@ set timeout 40 +# do half of the test (to be able to run the other half in parallel) # for some reason [glob should_work/[a-n]*.lus] does not work set ok_files [lsort [glob should_work/{n,o,p,q,r,s,t,u,v,w,x,y,z,N,O,P,Q,R,S,T,U,V,W,X,Y,Z}*.lus]] - # should be a fresh dir... set tmp ./tmp2/ - -nonreg_exec_and_ecexe $ok_files $tmp +# cf site.exp +nonreg_pass2 $ok_files $tmp diff --git a/test/site.exp b/test/site.exp index 2f58343f183836df69fb6aef365da791d2efa472..54b7aecf3f5a2e92865d2b9f29cd0203c00e1d22 100644 --- a/test/site.exp +++ b/test/site.exp @@ -1,5 +1,5 @@ -# Time-stamp: <modified the 23/03/2022 (at 09:47) by Erwan Jahier> -# +# Time-stamp: <modified the 05/06/2024 (at 15:10) by Erwan Jahier> +# # (nonreg-)test harness main file set testdir [pwd] @@ -9,8 +9,11 @@ set ec2c "./myec2c" set test_lus2lic_no_node "$testdir/../utils/test_lus2lic_no_node_rdbg" set test_lus2lic_no_node "$testdir/../utils/test_lus2lic_no_node" set compare_exec_and_2c "$testdir/../utils/compare_exec_and_2c" +set compare_exec_and_2cmc "$testdir/../utils/compare_exec_and_2cmc" set compare_lv6_and_lv6_en "$testdir/../utils/compare_lv6_and_lv6_en" set compare_gcc_and_clang "$testdir/../utils/compare_gcc_and_clang" +set compare_2ch_and_2cs "$testdir/../utils/compare_2ch_and_2cs" +set check_knc "$testdir/../utils/check_knc" set timeout 10 proc should_work { test_name command_line args } { @@ -26,7 +29,7 @@ proc should_work { test_name command_line args } { send_user "starting $command_line\n" } # Running the program. - eval spawn $command_line {*}$args + eval spawn $command_line {*}$args set pid [exp_pid] puts "PID: $pid ($command_line $args)" expect { @@ -80,7 +83,7 @@ proc should_work { test_name command_line args } { set failed 1 exp_continue } - # to avoid that match_max (the expect buffer size) is reached + # to avoid that match_max (the expect buffer size) is reached # which truncate the outputs "\n" { exp_continue @@ -124,7 +127,7 @@ proc should_fail { test_name fail_kind command_line args } { } eof { if $failed { - xfail "$test_name ($fail_kind): $cl $args" + xfail "$test_name ($fail_kind): $cl $args" } else { xpass "$test_name ($fail_kind): $cl $args" } @@ -154,7 +157,7 @@ proc does_not_contain_string {f str} { proc does_not_contain_left_slices {f} { set lines [fileutil::grep "\\.\\..*=" $f] - + set occ [llength $lines] if { ($occ == 1 ) } { puts " $f contains $occ occurence of left slices" } if { ($occ > 1 ) } { puts " $f contains $occ occurence(s) of left slices" } @@ -166,24 +169,24 @@ proc does_not_contain_left_slices {f} { # do no try to use lurette on files that contains extern nodes or package. -# Package won't work because appending the tested lustre file with the +# Package won't work because appending the tested lustre file with the # generated oracle as I do is wrong in presence of package (fixme) proc do_ecexe_vs_exec {f} { - if { + if { [does_not_contain_string "$f" "enum "] && [does_not_contain_string "$f" "extern"] && - [does_not_contain_string "$f" "package"] - } { + [does_not_contain_string "$f" "package"] + } { return 1 } return 0 } proc do_2c {f} { - if { + if { [does_not_contain_string "$f" "extern"] && - [does_not_contain_string "$f" "package"] - } { + [does_not_contain_string "$f" "package"] + } { return 1 } return 0 @@ -216,7 +219,7 @@ proc get_next_free_port {port} { # get the option (to pass to lus2lic) at the first line of the lustre file proc read_opt {f} { set oc [open $f] - set line [gets $oc] + set line [gets $oc] set res "" if { [string range $line 0 9] == "-- nonreg:" } { set res [string range $line 10 end] @@ -224,13 +227,18 @@ proc read_opt {f} { return $res } -### Compare the result of lv6 -exec vs lv6 -2c, and the result of lv6 -2c with and without -en -proc nonreg_exec_and_2c {files tmp} { +### Compare the result of +### - lv6 -exec vs lv6 -2c +### - lv6 -2c with and without -en +### - lv6 -2 using clang or gcc +proc nonreg_pass1 {files tmp} { global lus2lic global compare_exec_and_2c + global compare_exec_and_2cmc global compare_lv6_and_lv6_en global compare_gcc_and_clang - + global compare_2ch_and_2cs + foreach f $files { eval spawn "cp -f $f $tmp" } @@ -248,14 +256,14 @@ proc nonreg_exec_and_2c {files tmp} { if { [nonemptyfile "$bf.lic"] && [does_not_contain_left_slices "$f"] } { set id1 [should_work "Generate c code " "$lus2lic $opt" "-2c $f -n $node"] wait -i $id1 - + if { [nonemptyfile "${node}_${node}.c"] && [do_2c "$f"] } { set id2 [should_work "Check that the generated C code compiles " \ "sh ${node}.sh"] wait -i $id2 catch { exp_close -i $id2 } catch { exp_wait -i $id2 } output - + if { [nonemptyfile "${node}.exec"] && [do_2c "$f"] } { set id3 [should_work "Try to compare lus2lic -exec and -2c" \ "$compare_exec_and_2c" "$f" "$port" "$opt"] @@ -271,6 +279,11 @@ proc nonreg_exec_and_2c {files tmp} { "$compare_gcc_and_clang" "$f" "$opt"] catch { exp_close -i $id5 } catch { exp_wait -i $id5 } output + + set id6 [should_work "Try to compare -2c-io-a and -2c-io-c" \ + "$compare_2ch_and_2cs" "$f" "$opt"] + catch { exp_close -i $id6 } + catch { exp_wait -i $id6 } output } } catch { exp_close -i $id1 } @@ -281,11 +294,20 @@ proc nonreg_exec_and_2c {files tmp} { } -### Compare the result of lv6 -exec vs lv6 -ec+ecexe -proc nonreg_exec_and_ecexe {files tmp} { +### Check the generation of +### - lic +### - ec +### - c +### Compare the result of +### - lv6 -exec vs lv6 -ec+ecexe +### - lv6 -exec vs lv6 -exec -knc +### - lv6 -exec vs lv6 -exec -knpc +proc nonreg_pass2 {files tmp} { global lus2lic global ec2c global test_lus2lic_no_node + global compare_exec_and_2cmc + global check_knc foreach f $files { eval spawn "cp -f $f $tmp" @@ -304,20 +326,32 @@ proc nonreg_exec_and_ecexe {files tmp} { if { [nonemptyfile "$bf.lic"] } { set id2 [should_work "Generate ec code " "$lus2lic" "-ec -o $bf.ec $f -n $node"] wait -i $id2 - + if { [nonemptyfile "$bf.ec"] && [does_not_contain_string "$f" "merge"] } { set id3 [should_work "Try ec2c on the result" "$ec2c" "-o $bf.c $bf.ec"] wait -i $id3 catch { exp_close -i $id3 } catch { exp_wait -i $id3 } output } - + if { [nonemptyfile "$bf.c"] && [do_ecexe_vs_exec "$f"] } { set id4 [should_work "Try to compare lus2lic -exec and ecexe" \ "$test_lus2lic_no_node" "$f" "$opt"] catch { exp_close -i $id4 } catch { exp_wait -i $id4 } output + + set id5 [should_work "Try to compare lv6 -2c vs lv6 -knc/-knpc -lv4 |lv6 -2c" \ + "$check_knc" "$f" "$opt"] + catch { exp_close -i $id5 } + catch { exp_wait -i $id5 } output + + #set id6 [should_work "Try to compare -exec and -2cmc" \ + # "$compare_exec_and_2cmc" "$f" "$opt"] + # catch { exp_close -i $id6 } + # catch { exp_wait -i $id6 } output + } + catch { exp_close -i $id2 } catch { exp_wait -i $id2 } output } @@ -326,4 +360,3 @@ proc nonreg_exec_and_ecexe {files tmp} { } return 0 } - diff --git a/utils/check_knc b/utils/check_knc new file mode 100755 index 0000000000000000000000000000000000000000..38548d9c360ea17f0c9097dd840ce503d4f01234 --- /dev/null +++ b/utils/check_knc @@ -0,0 +1,120 @@ +#!/bin/sh + +# compares with lurette the results of: +# lv6 -2c +# lv6 -knc -lv4 | lv6 -2c +# lv6 -knpc -lv4 | lv6 -2c + + +lustre_file=$1 +OPT=$2 + +node=`basename $lustre_file .lus` +_oracle=_"$node"_oracle.lus +oracle="$node"_oracle +lv4="$node"_lv4.lus +ec="$node".ec +lv4_node="$node__$node" +env=_"$node"_env.lut +env_node="$node"_env +tmpdir=/tmp/lustre-test-$node +v4_knc=$tmpdir/"$node"_knc +v4_knpc=$tmpdir/"$node"_knpc + +. /home/jahier/.opam/opam-init/variables.sh +set -x verbose #echo on + +# _$node_env.lut, $node.exec, etc have already been generated by compare_exec_and_2c + +if + [ -f $env_node ]; +then + echo "$env_node generated" + +else if + ./lus2lic $OPT $lustre_file -n $node --gen-autotest -np; + cat $lustre_file >> $_oracle; +then + echo "./lus2lic $OPT $lustre_file -n $node --gen-autotest -np: ok" +else + echo "Error" + exit 2 +fi +fi + +# generate oracle exec +if + ./lus2lic -dir $tmpdir $OPT $_oracle -n $oracle -np -2c -cc -o $tmpdir/$oracle.exec; +then + echo "lus2lic -dir $tmpdir $OPT $_oracle -n $oracle -np -2c -cc -o $tmpdir/$oracle.exec: done" +else + echo "lus2lic -dir $tmpdir $OPT $_oracle -n $oracle -np -2c -cc -o $tmpdir/$oracle.exec: Error" + exit 2 +fi + +# generate exec via -lv4 file using -knc +if + ./lus2lic -dir $tmpdir $OPT $lustre_file -n $node -lv4 -knc -np -o $v4_knc.lus; +then + echo "lus2lic -dir $tmpdir $OPT $lustre_file -n $node -lv4 -knc -np -o $v4_knc.lus: done" +else + echo "lus2lic -dir $tmpdir $OPT $lustre_file -n $node -lv4 -knc -np -o $v4_knc.lus: error" + exit 2 +fi +if + ./lus2lic -dir $tmpdir $OPT $v4_knc.lus -n $node -2c -cc -o $v4_knc.exec; +then + echo "lus2lic -dir $tmpdir $OPT $v4_knc.lus -n $node -2c -cc -o $v4_knc.exec: done" +else + echo "lus2lic -dir $tmpdir $OPT $v4_knc.lus -n $node -2c -cc -o $v4_knc.exec: error" + exit 2 +fi + +# generate exec via -lv4 file using -knpc +if + ./lus2lic -dir $tmpdir $OPT $lustre_file -n $node -lv4 -knc -np -o $v4_knpc.lus; +then + echo "lus2lic -dir $tmpdir $OPT $lustre_file -n $node -lv4 -knc -np -o $v4_knpc.lus: done" +else + echo "lus2lic -dir $tmpdir $OPT $lustre_file -n $node -lv4 -knc -np -o $v4_knpc.lus: error" + exit 2 +fi +if + ./lus2lic -dir $tmpdir $OPT $v4_knpc.lus -n $node -2c -cc -o $v4_knpc.exec; +then + echo "lus2lic -dir $tmpdir $OPT $v4_knpc.lus -n $node -2c -cc -o $v4_knpc.exec: done" +else + echo "lus2lic -dir $tmpdir $OPT $v4_knpc.lus -n $node -2c -cc -o $v4_knpc.exec: error" + exit 2 +fi + + + + + +PRECISION=4 +if + lurette -l 10 \ + -sut "$v4_knc.exec " \ + -env "lutin $env -n $env_node -p $PRECISION -seed 42" \ + -oracle "$tmpdir/$oracle.exec"; +then + echo "Comparison of 'lv6 -2c' and 'lv6 -lv4 -knc | lv6 -2c' with lurette on $lustre_file: ok" + echo "lurette ok" +else + echo "error" + exit 2 +fi +if + lurette -l 10 \ + -sut "$v4_knpc.exec " \ + -env "lutin $env -n $env_node -p $PRECISION -seed 42" \ + -oracle "$tmpdir/$oracle.exec"; +then + echo "Comparison of 'lv6 -2c' and 'lv6 -lv4 -knpc | lv6 -2c' with lurette on $lustre_file: ok" + echo "lurette ok" +else + echo "error" + exit 2 +fi +exit 0 diff --git a/utils/compare_2ch_and_2cs b/utils/compare_2ch_and_2cs new file mode 100755 index 0000000000000000000000000000000000000000..7950492378b04961fe2c5fac4e169613d91639fc --- /dev/null +++ b/utils/compare_2ch_and_2cs @@ -0,0 +1,79 @@ +#!/bin/sh + +# compares with lurette the results of: +# lv6 -exec -en +# lv6 -2c-exec + + +lustre_file=$1 +OPT=$2 + +node=`basename $lustre_file .lus` +_oracle=_"$node"_oracle.lus +oracle="$node"_oracle +lv4="$node"_lv4.lus +ec="$node".ec +lv4_node="$node__$node" +env=_"$node"_env.lut +env_node="$node"_env +tmpdir=/tmp/lustre-test-ch-$node +tmpdir2=/tmp/lustre-test-cs-$node + +. /home/jahier/.opam/opam-init/variables.sh +set -x verbose #echo on + + +# Compares +# lv6 -2c-ioa +# versus +# lv6 -2c-ioc +# XXX il y a -2c-ioah aussi ! et puis -2cgc +if + [ -f $env_node ]; +then + echo "$env_node generated" + +else if + ./lus2lic $OPT $lustre_file -n $node --gen-autotest -np; + cat $lustre_file >> $_oracle; +then + echo "./lus2lic $OPT $lustre_file -n $node --gen-autotest -np: ok" +else + echo "Error" + exit 2 +fi +fi + +if + ./lus2lic -dir $tmpdir $OPT $lustre_file -n $node -2c-ioc -cc -o ${node}_ch.exec; +then + echo "lus2lic -dir $tmpdir $OPT $lustre_file -n $node -2c-ioc -cc -o ${node}_ch.exec: done" +else + echo "lus2lic -dir $tmpdir $OPT $lustre_file -n $node -2c-ioc -cc -o ${node}_ch.exec: Error" + exit 2 +fi + +if + ./lus2lic -dir $tmpdir2 -en $OPT $_oracle -n $oracle -2c-ioa -cc -o ${oracle}_cs.exec; +then + echo "lus2lic -dir $tmpdir2 -en $OPT $_oracle -n $oracle -2c-ioa -cc -o ${oracle}_cs.exec: done" +else + echo "lus2lic -dir $tmpdir2 -en $OPT $_oracle -n $oracle -2c-ioa -cc -o ${oracle}_cs.exec: Error" + exit 2 +fi + + +PRECISION=4 +if + lurette -l 10 \ + -sut "./${node}_ch.exec" \ + -env "lutin $env -n $env_node -p $PRECISION -seed 42" \ + -oracle "./${oracle}_cs.exec"; +then + echo "Comparison of gcc and clang with lurette on $lustre_file: ok" + echo "lurette ok" +else + echo "error" + exit 2 +fi +exit 0 diff --git a/utils/compare_gcc_and_clang b/utils/compare_gcc_and_clang index 35f5022b8c8fa3668fbafe2235acf4880bffd5b4..05e5f840ab992015a88286474864d703b1c5b426 100755 --- a/utils/compare_gcc_and_clang +++ b/utils/compare_gcc_and_clang @@ -32,13 +32,13 @@ set -x verbose #echo on if [ -f $env_node ]; then - echo "$env_node generated" - + echo "$env_node generated" + else if ./lus2lic $OPT $lustre_file -n $node --gen-autotest -np; cat $lustre_file >> $_oracle; then - echo "./lus2lic $OPT $lustre_file -n $node --gen-autotest -np: ok" + echo "./lus2lic $OPT $lustre_file -n $node --gen-autotest -np: ok" else echo "Error" exit 2 @@ -46,7 +46,7 @@ fi fi if - export C_COMPILER="gcc -g -O -Wall" && ./lus2lic -dir /tmp/lustre-test-gcc-$lustre_file-$node $OPT $lustre_file -n $node -en -2c -cc -o ${node}_gcc.exec; + export C_COMPILER="gcc -g -O -Wall" && ./lus2lic -dir /tmp/lustre-test-gcc-$lustre_file-$node $OPT $lustre_file -n $node -en -2c -cc -o ${node}_gcc.exec; then echo "lus2lic -2c done" else @@ -71,7 +71,7 @@ if -env "lutin $env -n $env_node -p $PRECISION -seed 42" \ -oracle "valgrind --log-file=${node}_oracle-clang-valgrind.log ./${node}_oracle_clang.exec"; then - echo "Comparison of gcc and clangd with lurette on $lustre_file: ok" + echo "Comparison of gcc and clang with lurette on $lustre_file: ok" echo "lurette ok" else echo "error" diff --git a/utils/lv6-kind2.sh b/utils/lv6-kind2.sh new file mode 100755 index 0000000000000000000000000000000000000000..b7e3cf90716faca607327c41b4f3d7e48d80a077 --- /dev/null +++ b/utils/lv6-kind2.sh @@ -0,0 +1,171 @@ +#!/bin/bash +set -x + +# if [ -z ${ROOTDIR+x} ]; then ROOTDIR=$(git rev-parse --show-toplevel); fi + + +help="This script calls the lv6 compiler to generate kind2 compatible lustre + +usage: + $0 [[[property] [int]] [solver]] + +where: + - property is one of the verify node variable (in verify.lus) (ok by default) + - int is in {int, int8, uint8, int16, uint16, ..., uinit64} [2] (int8+ by default) + - solver is in {Z3, Bitwuzla, cvc5, MathSAT, Yices, Yices2} [3] (Bitwuzla by default) + + +[2] int means natural numbers (infinite) + uint8 : 0 to 255 + uint16 : 0 to 65535 + uint32 : 0 to 4294967295 + uint64 : 0 to 18446744073709551615 + int8 : -128 to 127 + int16 : -32768 to 32767 + int32 : -2147483648 to 2147483647 + int64 : -9223372036854775808 to 9223372036854775807 +[3] cf kind2 documentation +" + +kind2 --version || { echo "kind2 is not installed. try: opam install kind2" ; exit 2; } + +int=int8 +solver=Bitwuzla +prop=ok + +#### Dealing with CL arguments +# at least 2 arguments are required +# if [[ $# < 2 ]] +# then +# printf "$help" +# exit 2 +# elif [[ $# == 2 ]] +# then +# main=$1$2 +# prop=ok +# daemon=distributed +# int=int8 +# solver=Z3 +# shift +# shift +# elif [[ $# == 3 ]] +# then +# topology=$1 +# n=$2 +# main=$1$2 +# prop=$3 +# daemon=distributed +# int=int8 +# solver=Z3 +# shift +# shift +# shift +# elif [[ $# == 4 ]] +# then +# topology=$1 +# n=$2 +# main=$1$2 +# prop=$3 +# daemon=$4 +# int=int8 +# solver=Z3 +# shift +# shift +# shift +# shift +# elif [[ $# == 5 ]] +# then +# topology=$1 +# n=$2 +# main=$1$2 +# prop=$3 +# daemon=$4 +# int=$5 +# solver=$6 +# shift +# shift +# shift +# shift +# shift +# else +# topology=$1 +# n=$2 +# main=$1$2 +# prop=$3 +# daemon=$4 +# int=$5 +# solver=$6 +# shift +# shift +# shift +# shift +# shift +# shift +# fi + + +# if [ -z ${TIMEOUT} ]; then TIMEOUT=194400.; fi # n: 194400s = 54 hours (2,3 jours) +if [ -z ${TIMEOUT} ]; then TIMEOUT=1944000.; fi # n: 1944000s = 540 hours (23 jours) +if [ -z ${kind2_opt_more} ]; then kind2_opt_more="--modular true --compositional true"; fi + + +#### playing with kind2 options +kind2_opt="--timeout 36000 -json -v " +kind2_opt="--enable BMC --enable IND --timeout 36000 -json -v" +kind2_opt="--enable BMC --enable IND --enable IC3 --timeout 36000" +kind2_opt="--exit_code_mode results_and_errors --smt_solver $solver --enable BMC --enable IND ${kind2_opt_more} --timeout ${TIMEOUT} " + +# --qe_method {precise|impl|cooper} + +# work in a tmp dir to ease the cleaning +# TMP=.tmp-`uname -n` +# [ -d ${TMP} ] || mkdir ${TMP} +# cp *.lus ${TMP} +# cd ${TMP} + +start0=`date +%s.%N` + + +main=proove_me +options="-eei --lustre-v4 -np -knc -knpc --assert-in-contract" + +# Get rif of the lutre v6 constructs that kind2 does not handle +lv6 $@ $options -o $main.verify.lv4 || ( echo "lv6 $@ $options failed"; exit 2 ) + +# set the property to check +cat $main.verify.lv4 | sed -e "s/--%PROPERTY \(.*\);/--%PROPERTY $prop;/g" > $main.verify.lv4.tmp +mv $main.verify.lv4.tmp $main.verify.lv4 + +# using machine integers instead of int: eg, replace 42 by (uint8 42) + +cat $main.verify.lv4 | \ + sed -r "s/([ \t\r\n=([<>\/\*\+]+)((-)?[[:digit:]]+)/ \1(${int} \2)/g" | \ + sed -r "s/:int/:${int}/g" \ + > $main.verify.${int}.lv4 + +pb="|" +start=`date +%s.%N` +time kind2 --color true ${kind2_opt} $main.verify.${int}.lv4 || pb="|ZZZ_kind_failed!!! " +end=`time date +%s.%N` +wallclock0=$( echo "$end - $start0" | bc -l ) +wallclock=$( echo "$end - $start" | bc -l ) + +timestamp=`date +"%d/%m/%Y-%H:%M:%S"` +algodir=$(dirname $PWD) +algo=$(basename $algodir) + +LC_NUMERIC="en_US.UTF-8" + +# let's keep a track of all runs (it can expensive, it should not be lost) +# in a .org file +ALL_RESULT="lv6-result-`uname -n`.org" +printf "%s | %.2f-%.2f | %s | %s | %s | %s |\n" $pb \ + $wallclock0 $wallclock $int $solver $timestamp `kind2 --version | cut -d ' ' -f2` >> ${ALL_RESULT} + +echo "cf ${ALL_RESULT}" + +if [ "$pb" = "|" ]; then + echo "kind2 proved the property." +else + exit 2 +fi \ No newline at end of file