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

Soc2c: inline ITE soc, to make things simpler.

Indeed, ite are polymorphic, and thus inventing names during soc
instanciation is error-prone, ugly, innefficient, and increase the
code size.

Moreover, using C ite to translate them online (ie, without going
trough a soc) is straigforward

# of unexpected failures	104->101.
parent d183343e
No related branches found
No related tags found
No related merge requests found
(* Time-stamp: <modified the 18/12/2012 (at 10:13) by Erwan Jahier> *) (* Time-stamp: <modified the 30/06/2014 (at 10:26) by Erwan Jahier> *)
(** Remove overloading of nodes used with iterators.
nb: it actually does not remove remove polymorphism actually -> TODO: Rename this module.
nb2 : only if/then/else is truely polymorphic.
(** Remove polymorphism and overloading
nb : nb :
- il est préférable d'appeler - il est préférable d'appeler
......
(* Time-stamp: <modified the 26/06/2014 (at 17:45) by Erwan Jahier> *) (* Time-stamp: <modified the 01/07/2014 (at 11:21) by Erwan Jahier> *)
(** Synchronous Object Component *) (** Synchronous Object Component *)
...@@ -91,28 +91,11 @@ type t = { ...@@ -91,28 +91,11 @@ type t = {
(* Do this soc have a memory (pre, fby) + its type *) (* Do this soc have a memory (pre, fby) + its type *)
} }
let (compare_soc_key : key -> key -> int) =
fun (id1, tl1, si1) (id2, tl2, si2) ->
let rec unifiable tl1 tl2 =
(* Very simple version that is correct only for keys that
contain at most 1 polymorphic var, which is currently the
case for v6 programs *)
match tl1,tl2 with
| [],[] -> true
| _::tl1, Data.Alpha(_)::tl2
| Data.Alpha(_)::tl1, _::tl2 -> unifiable tl1 tl2
| t1::tl1, t2::tl2 -> t1=t2 && unifiable tl1 tl2
| _,_ -> false
in
if unifiable tl1 tl2
then compare (id1, si1) (id2, si2)
else compare (id1, tl1, si1) (id2, tl2, si2)
(* SocKeyMap ? *) (* SocKeyMap ? *)
module SocMap = Map.Make( module SocMap = Map.Make(
struct struct
type t = key type t = key
let compare = compare_soc_key let compare = compare
end end
) )
......
(* Time-stamp: <modified the 26/06/2014 (at 17:36) by Erwan Jahier> *) (* Time-stamp: <modified the 01/07/2014 (at 14:20) by Erwan Jahier> *)
(* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *) (* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *)
...@@ -83,6 +83,16 @@ let rec (lic_type_to_c_old: Lic.type_ -> string -> string) = ...@@ -83,6 +83,16 @@ let rec (lic_type_to_c_old: Lic.type_ -> string -> string) =
| TypeVar Any -> assert false | TypeVar Any -> assert false
| (TypeVar AnyNum) -> assert false | (TypeVar AnyNum) -> assert false
let (inline_soc : Soc.key -> bool) =
fun (n,_,_) ->
match n with
(* those soc are inlined. Currently we only inlile ite because
of its polymorphism. Maybe simple arith operators
(+-,*,/,etc.) should be inlined too. *)
| "Lustre::if" -> true
| _ -> false
(****************************************************************************) (****************************************************************************)
(* Soc printer *) (* Soc printer *)
...@@ -137,16 +147,7 @@ let (gao2c : Soc.tbl -> 'a soc_pp -> Soc.gao -> unit) = ...@@ -137,16 +147,7 @@ let (gao2c : Soc.tbl -> 'a soc_pp -> Soc.gao -> unit) =
str str
) )
| Call(vel_out, Assign, vel_in) -> ( | Call(vel_out, Assign, vel_in) -> (
let gen_assign2 vi vo = let l = List.map2 (Soc2cUtil.gen_assign_var_expr sp.soc) vel_out vel_in in
match vi,vo with
| Slice _, _ -> assert false
| _, Slice _ -> assert false
| _,_ ->
Soc2cUtil.gen_assign (Soc.data_type_of_var_expr vi)
(string_of_var_expr sp.soc vi) (string_of_var_expr sp.soc vo)
(Printf.sprintf "sizeof(%s)" (string_of_var_expr sp.soc vo))
in
let l = List.map2 gen_assign2 vel_out vel_in in
String.concat "" l String.concat "" l
) )
| Call(vel_out, Method((inst_name,sk),sname), vel_in) -> ( | Call(vel_out, Method((inst_name,sk),sname), vel_in) -> (
...@@ -154,8 +155,6 @@ let (gao2c : Soc.tbl -> 'a soc_pp -> Soc.gao -> unit) = ...@@ -154,8 +155,6 @@ let (gao2c : Soc.tbl -> 'a soc_pp -> Soc.gao -> unit) =
let ctx = Printf.sprintf "ctx->%s" (id2s inst_name) in let ctx = Printf.sprintf "ctx->%s" (id2s inst_name) in
List.iter (fun ve -> assert(var_expr_is_not_a_slice ve)) vel_in; List.iter (fun ve -> assert(var_expr_is_not_a_slice ve)) vel_in;
List.iter (fun ve -> assert(var_expr_is_not_a_slice ve)) vel_out; List.iter (fun ve -> assert(var_expr_is_not_a_slice ve)) vel_out;
let vel_in = List.map (string_of_var_expr sp.soc) vel_in in
let vel_out = List.map (string_of_var_expr sp.soc) vel_out in
Soc2cUtil.gen_step_call sp.soc called_soc vel_out vel_in ctx sname Soc2cUtil.gen_step_call sp.soc called_soc vel_out vel_in ctx sname
("&ctx->"^(id2s inst_name)) ("&ctx->"^(id2s inst_name))
) )
...@@ -164,16 +163,16 @@ let (gao2c : Soc.tbl -> 'a soc_pp -> Soc.gao -> unit) = ...@@ -164,16 +163,16 @@ let (gao2c : Soc.tbl -> 'a soc_pp -> Soc.gao -> unit) =
let ctx = get_ctx_name called_soc.key in let ctx = get_ctx_name called_soc.key in
List.iter (fun ve -> assert(var_expr_is_not_a_slice ve)) vel_in; List.iter (fun ve -> assert(var_expr_is_not_a_slice ve)) vel_in;
List.iter (fun ve -> assert(var_expr_is_not_a_slice ve)) vel_out; List.iter (fun ve -> assert(var_expr_is_not_a_slice ve)) vel_out;
let vel_in = List.map (string_of_var_expr sp.soc) vel_in in
let vel_out = List.map (string_of_var_expr sp.soc) vel_out in
Soc2cUtil.gen_step_call sp.soc called_soc vel_out vel_in ctx "step" "" Soc2cUtil.gen_step_call sp.soc called_soc vel_out vel_in ctx "step" ""
) )
in in
sp.cput (gao2str gao) sp.cput (gao2str gao)
let (step2c : Soc.tbl -> 'a soc_pp -> Soc.step_method -> unit) = let (step2c : Soc.tbl -> 'a soc_pp -> Soc.step_method -> unit) =
fun stbl sp sm -> fun stbl sp sm ->
if inline_soc sp.soc.key then () (* don't generate code if inlined *) else
let sm_str = sm.name in let sm_str = sm.name in
(* let sname = Soc2cUtil.step_name sp.soc.key sm.name in *) (* let sname = Soc2cUtil.step_name sp.soc.key sm.name in *)
let sname = Soc2cUtil.step_name sp.soc.key sm.name in let sname = Soc2cUtil.step_name sp.soc.key sm.name in
...@@ -210,6 +209,7 @@ let (gen_instance_init_call : 'a soc_pp -> Soc.instance -> unit) = ...@@ -210,6 +209,7 @@ let (gen_instance_init_call : 'a soc_pp -> Soc.instance -> unit) =
let (soc2c: int -> out_channel -> out_channel -> Soc.tbl -> Soc.t -> unit) = let (soc2c: int -> out_channel -> out_channel -> Soc.tbl -> Soc.t -> unit) =
fun pass hfile cfile stbl soc -> fun pass hfile cfile stbl soc ->
if inline_soc soc.key then () (* don't generate code if inlined *) else
let hfmt fmt = Printf.kprintf (fun t -> output_string hfile t) fmt in let hfmt fmt = Printf.kprintf (fun t -> output_string hfile t) fmt in
let cfmt fmt = Printf.kprintf (fun t -> output_string cfile t) fmt in let cfmt fmt = Printf.kprintf (fun t -> output_string cfile t) fmt in
let hput str = output_string hfile str in let hput str = output_string hfile str in
...@@ -275,6 +275,7 @@ let (type_to_format_string : Data.t -> string) = ...@@ -275,6 +275,7 @@ let (type_to_format_string : Data.t -> string) =
let (typedef_of_soc : Soc.t -> string) = let (typedef_of_soc : Soc.t -> string) =
fun soc -> fun soc ->
if inline_soc soc.key then "" (* don't generate code if inlined *) else
let ctx_name = get_ctx_name soc.key in 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 il,ol = soc.profile in let il,ol = soc.profile in
......
(* Time-stamp: <modified the 26/06/2014 (at 17:37) by Erwan Jahier> *) (* Time-stamp: <modified the 01/07/2014 (at 10:39) by Erwan Jahier> *)
let colcol = Str.regexp "::" let colcol = Str.regexp "::"
let id2s id = (* XXX Refuser les noms de module à la con plutot *) let id2s id = (* XXX Refuser les noms de module à la con plutot *)
...@@ -11,7 +11,6 @@ let id2s id = (* XXX Refuser les noms de module à la con plutot *) ...@@ -11,7 +11,6 @@ let id2s id = (* XXX Refuser les noms de module à la con plutot *)
| _ -> id | _ -> id
in in
let str = Str.global_replace colcol "_" str in let str = Str.global_replace colcol "_" str in
let str = Str.global_replace (Str.regexp "-") "" str in
str str
let long2s l = id2s (Ident.string_of_long l) let long2s l = id2s (Ident.string_of_long l)
......
(* Time-stamp: <modified the 26/06/2014 (at 17:37) by Erwan Jahier> *) (* Time-stamp: <modified the 01/07/2014 (at 09:43) by Erwan Jahier> *)
open Soc2cIdent
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 *) (* exported *)
...@@ -19,6 +42,15 @@ let rec (gen_assign : Data.t -> string -> string -> string -> string) = ...@@ -19,6 +42,15 @@ let rec (gen_assign : Data.t -> string -> string -> string -> string) =
copy function I guess *) copy function I guess *)
Printf.sprintf " cpy_%s(%s, %s);\n" id vi vo Printf.sprintf " cpy_%s(%s, %s);\n" id vi vo
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)
(Printf.sprintf "sizeof(%s)" (string_of_var_expr soc vo))
let id2s = Soc2cIdent.id2s let id2s = Soc2cIdent.id2s
...@@ -39,56 +71,61 @@ let (ctx_var : var_kind -> Ident.t -> string) = ...@@ -39,56 +71,61 @@ let (ctx_var : var_kind -> Ident.t -> string) =
| M_IO -> Printf.sprintf "ctx->%s" (id2s id) | M_IO -> Printf.sprintf "ctx->%s" (id2s id)
| Local -> Printf.sprintf "%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]))
(* exported *) (* exported *)
let (gen_step_call : Soc.t -> Soc.t -> string list -> string list -> let (gen_step_call : Soc.t -> Soc.t -> Soc.var_expr list -> Soc.var_expr list ->
string -> string -> string -> string) = string -> string -> string -> string) =
fun soc called_soc vel_out vel_in ctx sname step_arg -> fun soc called_soc vel_out vel_in ctx sname step_arg ->
let si_str = let called_soc_name,_,_ = called_soc.key in
if vel_in = [] then "" (* occurs for pre *) else if called_soc_name = "Lustre::if" then
let inputs = fst called_soc.profile in let c,vel_in= match vel_in with [] -> assert false | c::l -> c,l in
let l = try ( let s = (List.length vel_out) in
List.map2 (fun (name, t) ve -> let vel_in_t, vel_in_e = list_split vel_in s in
gen_assign t (Printf.sprintf "%s.%s" ctx name) ve (Printf.sprintf "sizeof(%s)" ve)) let lt = List.map2 (gen_assign_var_expr soc) vel_out vel_in_t in
inputs vel_in let le = List.map2 (gen_assign_var_expr soc) vel_out vel_in_e in
) with _ -> assert false (* are all parameters necessaryly used? *) " if ("^(string_of_var_expr soc c) ^ " == _true) {\n "^
in (String.concat " " lt)^ " } else {\n "^
(String.concat "" l) (String.concat " " le)^ " }\n"
in else
let so_str = let vel_in = List.map (string_of_var_expr soc) vel_in in
if vel_out = [] then "" (* occurs for pre *) else let vel_out = List.map (string_of_var_expr soc) vel_out in
let outputs = snd called_soc.profile in let si_str =
let l = try ( if vel_in = [] then "" (* occurs for pre *) else
List.map2 let inputs = fst called_soc.profile in
(fun (name,t) ve -> let l = try (
let ve2 = Printf.sprintf "%s.%s" ctx name in List.map2 (fun (name, t) ve ->
gen_assign t ve ve2 (Printf.sprintf "sizeof(%s)" ve2)) outputs vel_out gen_assign t (Printf.sprintf "%s.%s" ctx name) ve (Printf.sprintf "sizeof(%s)" ve))
) with _ -> assert false inputs vel_in
in ) with _ -> assert false (* are all parameters necessaryly used? *)
(String.concat "" l) ^"\n" in
in (String.concat "" l)
let str = Printf.sprintf " %s(%s); \n" (step_name called_soc.key sname) step_arg in in
(si_str ^ str ^ so_str) 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 (Printf.sprintf "sizeof(%s)" 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)
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
open Soc2cIdent
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 *)
(* Time-stamp: <modified the 24/06/2014 (at 18:16) by Erwan Jahier> *) (* Time-stamp: <modified the 01/07/2014 (at 14:23) by Erwan Jahier> *)
open Data open Data
open Soc open Soc
...@@ -213,6 +213,10 @@ let (get_key: Soc.key -> string) = ...@@ -213,6 +213,10 @@ let (get_key: Soc.key -> string) =
| _ -> assert false | _ -> assert false
let rec type_elt_of_array = function
| Data.Array(t,_) -> t
| Data.Alias(_,t) -> type_elt_of_array t
| _ -> assert false
(* exported *) (* exported *)
...@@ -224,10 +228,9 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = ...@@ -224,10 +228,9 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) =
match soc.instances with match soc.instances with
| [] -> ( | [] -> (
let ctx_access = Printf.sprintf "%s." (get_ctx_name soc.key) in let ctx_access = Printf.sprintf "%s." (get_ctx_name soc.key) in
let (array_index : int -> var -> string) = let (array_index : int -> var -> Soc.var_expr) =
fun i (vn,vt) -> Printf.sprintf "%s%s[%d]" ctx_access vn i fun i (vn,vt) -> Var(Printf.sprintf "%s%s[%d]" ctx_access vn i, type_elt_of_array vt)
in in
Array.make n "", Array.make n "",
Array.make n (get_ctx_name it_soc.key), Array.make n (get_ctx_name it_soc.key),
array_index,ctx_access array_index,ctx_access
...@@ -237,9 +240,9 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = ...@@ -237,9 +240,9 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) =
let inst_names = List.rev inst_names in let inst_names = List.rev inst_names in
let step_args = List.map (fun sn -> ("&ctx->"^(id2s sn))) inst_names in let step_args = List.map (fun sn -> ("&ctx->"^(id2s sn))) inst_names in
let ctx = List.map (fun sn -> ("ctx->"^(id2s sn))) inst_names in let ctx = List.map (fun sn -> ("ctx->"^(id2s sn))) inst_names in
let ctx_access = Printf.sprintf "ctx->" in let ctx_access = "ctx->" in
let (array_index : int -> var -> string) = let (array_index : int -> var -> Soc.var_expr) =
fun i (vn,vt) -> Printf.sprintf "%s%s[%d]" ctx_access vn i fun i (vn,vt) -> Var(Printf.sprintf "ctx->%s[%d]" vn i,vt)
in in
Array.of_list step_args, Array.of_list step_args,
Array.of_list ctx, Array.of_list ctx,
...@@ -253,18 +256,20 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = ...@@ -253,18 +256,20 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) =
(List.map (array_index i) iter_inputs, (List.map (array_index i) iter_inputs,
List.map (array_index i) iter_outputs) List.map (array_index i) iter_outputs)
| "fold" | "red" | "fill" | "fillred" -> | "fold" | "red" | "fill" | "fillred" ->
let a_in = ctx_access ^ (fst (List.hd iter_inputs)) in let name, telt = List.hd iter_inputs in
let a_in = ctx_access ^ name in
let a_in = Var(a_in, telt) in
( a_in::(List.map (array_index i) (List.tl iter_inputs)), ( a_in::(List.map (array_index i) (List.tl iter_inputs)),
a_in::(List.map (array_index i) (List.tl iter_outputs))) a_in::(List.map (array_index i) (List.tl iter_outputs)))
| _ -> assert false (* should not occur *) | _ -> assert false (* should not occur *)
in in
buff := !buff^( buff := !buff^(
Soc2cUtil.gen_step_call Soc2cUtil.gen_step_call
soc it_soc vel_out vel_in ctx.(i) node_step step_args.(i)) soc it_soc vel_out vel_in ctx.(i) node_step step_args.(i))
done; done;
if iterator <> "map" then ( if iterator <> "map" then (
let type_in = snd (List.hd iter_inputs) in let type_in = (snd (List.hd iter_inputs)) in
let a_in = ctx_access ^ (fst (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 let a_out = ctx_access ^ (fst (List.hd iter_outputs)) in
buff := !buff^(Soc2cUtil.gen_assign type_in a_out a_in buff := !buff^(Soc2cUtil.gen_assign type_in a_out a_in
...@@ -273,8 +278,6 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) = ...@@ -273,8 +278,6 @@ let (get_iterator : Soc.t -> string -> Soc.t -> int -> string) =
!buff !buff
(* exported *) (* exported *)
let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) = let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) =
fun soc condact_soc el -> fun soc condact_soc el ->
...@@ -286,9 +289,8 @@ let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) = ...@@ -286,9 +289,8 @@ let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) =
let string_of_var_soc (id,_) = "ctx->"^(id2s id) in let string_of_var_soc (id,_) = "ctx->"^(id2s id) in
let vel_in,vel_out = soc.profile in let vel_in,vel_out = soc.profile in
let vel_in = List.tl vel_in in let vel_in = List.tl vel_in in
let vel_in = List.map string_of_var_soc vel_in in let vel_in = List.map (fun var -> Var var) vel_in in
let vel_out = List.map string_of_var_soc vel_out in let vel_out = List.map (fun var -> Var var) vel_out in
add (Printf.sprintf " if (%s == _true) { " clk); add (Printf.sprintf " if (%s == _true) { " clk);
if SocUtils.is_memory_less condact_soc then if SocUtils.is_memory_less condact_soc then
let condact_ctx = get_ctx_name condact_soc.key in let condact_ctx = get_ctx_name condact_soc.key in
...@@ -308,7 +310,8 @@ let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) = ...@@ -308,7 +310,8 @@ let (get_condact : Soc.t -> Soc.t -> var_expr list -> string ) =
add " ctx->_memory = _false;"; add " ctx->_memory = _false;";
add " } else if (ctx->_memory == _true) {"; add " } else if (ctx->_memory == _true) {";
List.iter2 (fun var ve -> List.iter2 (fun var ve ->
add (Printf.sprintf " %s = %s;" var (Soc2cUtil.string_of_var_expr soc ve) ) add (Printf.sprintf " %s = %s;" (Soc2cUtil.string_of_var_expr soc var)
(Soc2cUtil.string_of_var_expr soc ve) )
) vel_out el ; ) vel_out el ;
add " ctx->_memory = _false;"; add " ctx->_memory = _false;";
add " }"; add " }";
......
...@@ -52,7 +52,7 @@ prog: ...@@ -52,7 +52,7 @@ prog:
ssh $(TEST_MACHINE) "cd $(testdir) ; runtest --all --tool lus2lic --ignore non-reg.exp" || true ssh $(TEST_MACHINE) "cd $(testdir) ; runtest --all --tool lus2lic --ignore non-reg.exp" || true
clean: clean:
rm -f *.ec *.lus *.lut *.cov *.gp *.rif *.out *.cov rm -f *.ec *.lus *.lut *.cov *.gp *.rif *.out *.cov *.c *.h
Test Run By jahier on Fri Jun 27 11:43:21 2014 Test Run By jahier on Tue Jul 1 10:41:34 2014
Native configuration is i686-pc-linux-gnu Native configuration is i686-pc-linux-gnu
=== lus2lic tests === === lus2lic tests ===
...@@ -145,7 +145,7 @@ PASS: ./lus2lic {-ec -o /tmp/mappredef.ec should_work/mappredef.lus} ...@@ -145,7 +145,7 @@ PASS: ./lus2lic {-ec -o /tmp/mappredef.ec should_work/mappredef.lus}
PASS: ./myec2c {-o /tmp/mappredef.c /tmp/mappredef.ec} PASS: ./myec2c {-o /tmp/mappredef.c /tmp/mappredef.ec}
PASS: ../utils/test_lus2lic_no_node should_work/mappredef.lus PASS: ../utils/test_lus2lic_no_node should_work/mappredef.lus
PASS: ./lus2lic {-2c should_work/mappredef.lus -n mappredef} PASS: ./lus2lic {-2c should_work/mappredef.lus -n mappredef}
FAIL: Check that the generated C code compiles : gcc mappredef_mappredef.c mappredef_mappredef_loop.c PASS: gcc mappredef_mappredef.c mappredef_mappredef_loop.c
PASS: ./lus2lic {-o /tmp/call06.lic should_work/call06.lus} PASS: ./lus2lic {-o /tmp/call06.lic should_work/call06.lus}
PASS: ./lus2lic {-ec -o /tmp/call06.ec should_work/call06.lus} PASS: ./lus2lic {-ec -o /tmp/call06.ec should_work/call06.lus}
PASS: ./myec2c {-o /tmp/call06.c /tmp/call06.ec} PASS: ./myec2c {-o /tmp/call06.c /tmp/call06.ec}
...@@ -759,7 +759,7 @@ PASS: ./lus2lic {-ec -o /tmp/test_enum.ec should_work/test_enum.lus} ...@@ -759,7 +759,7 @@ PASS: ./lus2lic {-ec -o /tmp/test_enum.ec should_work/test_enum.lus}
PASS: ./myec2c {-o /tmp/test_enum.c /tmp/test_enum.ec} PASS: ./myec2c {-o /tmp/test_enum.c /tmp/test_enum.ec}
FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/test_enum.lus FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/test_enum.lus
PASS: ./lus2lic {-2c should_work/test_enum.lus -n test_enum} PASS: ./lus2lic {-2c should_work/test_enum.lus -n test_enum}
FAIL: Check that the generated C code compiles : gcc test_enum_test_enum.c test_enum_test_enum_loop.c PASS: gcc test_enum_test_enum.c test_enum_test_enum_loop.c
PASS: ./lus2lic {-o /tmp/predef01.lic should_work/predef01.lus} PASS: ./lus2lic {-o /tmp/predef01.lic should_work/predef01.lus}
PASS: ./lus2lic {-ec -o /tmp/predef01.ec should_work/predef01.lus} PASS: ./lus2lic {-ec -o /tmp/predef01.ec should_work/predef01.lus}
PASS: ./myec2c {-o /tmp/predef01.c /tmp/predef01.ec} PASS: ./myec2c {-o /tmp/predef01.c /tmp/predef01.ec}
...@@ -1399,7 +1399,7 @@ PASS: ./lus2lic {-ec -o /tmp/minus.ec should_work/minus.lus} ...@@ -1399,7 +1399,7 @@ PASS: ./lus2lic {-ec -o /tmp/minus.ec should_work/minus.lus}
PASS: ./myec2c {-o /tmp/minus.c /tmp/minus.ec} PASS: ./myec2c {-o /tmp/minus.c /tmp/minus.ec}
PASS: ../utils/test_lus2lic_no_node should_work/minus.lus PASS: ../utils/test_lus2lic_no_node should_work/minus.lus
PASS: ./lus2lic {-2c should_work/minus.lus -n minus} PASS: ./lus2lic {-2c should_work/minus.lus -n minus}
FAIL: Check that the generated C code compiles : gcc minus_minus.c minus_minus_loop.c PASS: gcc minus_minus.c minus_minus_loop.c
PASS: ./lus2lic {-o /tmp/remplissage-1.0.lic should_work/remplissage-1.0.lus} PASS: ./lus2lic {-o /tmp/remplissage-1.0.lic should_work/remplissage-1.0.lus}
PASS: ./lus2lic {-ec -o /tmp/remplissage-1.0.ec should_work/remplissage-1.0.lus} PASS: ./lus2lic {-ec -o /tmp/remplissage-1.0.ec should_work/remplissage-1.0.lus}
PASS: ./myec2c {-o /tmp/remplissage-1.0.c /tmp/remplissage-1.0.ec} PASS: ./myec2c {-o /tmp/remplissage-1.0.c /tmp/remplissage-1.0.ec}
...@@ -1475,9 +1475,9 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman ...@@ -1475,9 +1475,9 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
=== lus2lic Summary === === lus2lic Summary ===
# of expected passes 1301 # of expected passes 1304
# of unexpected failures 104 # of unexpected failures 101
# of unexpected successes 21 # of unexpected successes 21
# of expected failures 37 # of expected failures 37
testcase ./lus2lic.tests/non-reg.exp completed in 153 seconds testcase ./lus2lic.tests/non-reg.exp completed in 134 seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds
testcase ./lus2lic.tests/non-reg.exp completed in 153 seconds testcase ./lus2lic.tests/non-reg.exp completed in 134 seconds
testcase ./lus2lic.tests/progression.exp completed in 0 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds
...@@ -37,6 +37,9 @@ oops: lus2lic internal error ...@@ -37,6 +37,9 @@ oops: lus2lic internal error
File "objlinux/socExec.ml", line 202, column 22 File "objlinux/socExec.ml", line 202, column 22
when compiling lustre program should_work/simple.lus when compiling lustre program should_work/simple.lus
** TODO le traitement du condact ne marche plus
- State "TODO" from "" [2014-06-27 Fri 15:26]
depuis le 2eme commit du 18-06-2014
* lus2lic -2C * lus2lic -2C
** TODO Ca plante si un identificateur lustre se nomme double... ** TODO Ca plante si un identificateur lustre se nomme double...
...@@ -58,6 +61,20 @@ http://www.di.ens.fr/~pouzet/bib/lctes12.pdf ...@@ -58,6 +61,20 @@ http://www.di.ens.fr/~pouzet/bib/lctes12.pdf
24. file:test/should_work/left.lus lus2lic -2c should_work/left.lus -n left 24. file:test/should_work/left.lus lus2lic -2c should_work/left.lus -n left
slice en partie gauche slice en partie gauche
** TODO Question : remettre en cause le choix de représentation des Soc.key ?
- State "TODO" from "" [2014-06-27 Fri 15:29]
En effet, il ne reste plus que les ite à etre polymorphes, et c'est à cause des
soc polymorphes que je me trimbale le profile du soc dans les Soc.key !
D'ailleur ne pourrais/devrais-je pas les inliner des maintenant ces ite ?
par ailleur, l2lSplit ne devrait pas splitter les ites, si on veut
pouvoir faire l'optimisation qui consiste à n'executer qu'une des 2
branches si les noeuds ne font pas d'effet de bord. bon, d'un autre coté,
il existe une option qui inhibe ce split (-knc).
* Packages, modeles, etc. * Packages, modeles, etc.
** STARTED Il ne detecte plus les erreurs de type lors d'instanciation de noeuds ** STARTED Il ne detecte plus les erreurs de type lors d'instanciation de noeuds
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment