(* Print machine code values as matlab expressions. Variable identifiers are
replaced by uX where X is the index of the variables in the list vars of input
variables. *)
letrecpp_valvarsfmtv=
letrecpp_matlab_valvarsfmtv=
matchv.value_descwith
|Cstc->Printers.pp_constfmtc
|LocalVarv
...
...
@@ -151,78 +181,48 @@ let rec pp_val vars fmt v =
ifList.memidvarsthen
Format.fprintffmt"u%i"(get_idxidvars)
else
assertfalse(* impossible to find element id in var list *)
let_=Format.eprintf"Error: looking for var %s in %a@.@?"id(Utils.fprintf_list~sep:","Format.pp_print_string)varsinassertfalse(* impossible to find element id in var list *)
|Fun(n,vl)->pp_funvarsnfmtvl
|_->assertfalse(* not available in EMF backend *)
andpp_funvarsidfmtvl=
(* eprintf "print %s with %i args@.@?" id (List.length vl);*)
In Simulink, this should become one IF block to produce enable ports "var_guard == tag1", "var_guard == tag2", .... as well as one action block per branch: each of these action block shall