From c132b53732cf4f5f002dc06e033d142d000de45c Mon Sep 17 00:00:00 2001 From: Nicolas Berthier Date: Tue, 26 Nov 2013 18:00:11 +0100 Subject: [PATCH] Handle `when' operators in general expressions, in Controllable-Nbac backend. - CtrlNbacGen: ignore sub-sampling in general expressions. --- compiler/minils/ctrl-n/ctrlNbacGen.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/minils/ctrl-n/ctrlNbacGen.ml b/compiler/minils/ctrl-n/ctrlNbacGen.ml index 4cbaef5..baa0975 100644 --- a/compiler/minils/ctrl-n/ctrlNbacGen.ml +++ b/compiler/minils/ctrl-n/ctrlNbacGen.ml @@ -168,7 +168,7 @@ let translate_app ~pref op el = (** [translate_exp gd e] translates the {e memoryless} expression [e] into its Controllable Nbac representation. *) -let translate_exp ~pref t ({ e_desc = desc; e_ty = ty }) = (* XXX clock? *) +let rec translate_exp ~pref t ({ e_desc = desc; e_ty = ty }) = (* XXX clock? *) let typ = translate_typ ty in assert (t = typ); match desc with | Eextvalue ext -> translate_ext ~pref ext | Eapp ({ a_op }, el, _) -> translate_app ~pref a_op el @@ -180,7 +180,7 @@ let translate_exp ~pref t ({ e_desc = desc; e_ty = ty }) = (* XXX clock? *) (translate_ext ~pref e) x) (translate_ext ~pref e) l - | Ewhen _ -> failwith "TODO Unsupported operation: isolated `when'!" + | Ewhen (exp, _, _) -> translate_exp ~pref t exp | Efby _ -> failwith "TODO: translate_exp (fby)" | Estruct _ -> failwith "TODO: translate_exp (struct)" | _ -> failwith "TODO: translate_exp"