From f300fd8ecf46c0e7af875040a8d40c63c3bb6886 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 16 Jun 2022 21:51:05 +0200 Subject: synth-vhdl_insts(synth_single_input_assoc): handle type conversion. Fix #2099 --- src/synth/synth-vhdl_expr.ads | 3 +++ src/synth/synth-vhdl_insts.adb | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/synth/synth-vhdl_expr.ads b/src/synth/synth-vhdl_expr.ads index 5c81701c1..5eadb879f 100644 --- a/src/synth/synth-vhdl_expr.ads +++ b/src/synth/synth-vhdl_expr.ads @@ -100,6 +100,9 @@ package Synth.Vhdl_Expr is function Synth_Expression_With_Basetype (Syn_Inst : Synth_Instance_Acc; Expr : Node) return Valtyp; + function Synth_Type_Conversion + (Syn_Inst : Synth_Instance_Acc; Conv : Node) return Valtyp; + function Synth_PSL_Expression (Syn_Inst : Synth_Instance_Acc; Expr : PSL.Types.PSL_Node) return Net; diff --git a/src/synth/synth-vhdl_insts.adb b/src/synth/synth-vhdl_insts.adb index 002a387af..8d77b06b5 100644 --- a/src/synth/synth-vhdl_insts.adb +++ b/src/synth/synth-vhdl_insts.adb @@ -647,10 +647,16 @@ package body Synth.Vhdl_Insts is Conv := Null_Node; end if; if Conv /= Null_Node then - pragma Assert (Get_Kind (Conv) = Iir_Kind_Function_Call); - pragma Assert (Act_Inst = Syn_Inst); - -- This is an abuse, but it works like a user operator. - Act := Synth_User_Operator (Syn_Inst, Actual, Null_Node, Conv); + case Get_Kind (Conv) is + when Iir_Kind_Function_Call => + pragma Assert (Act_Inst = Syn_Inst); + -- This is an abuse, but it works like a user operator. + Act := Synth_User_Operator (Syn_Inst, Actual, Null_Node, Conv); + when Iir_Kind_Type_Conversion => + Act := Synth_Type_Conversion (Syn_Inst, Conv); + when others => + Vhdl.Errors.Error_Kind ("synth_single_input_assoc", Conv); + end case; else Act := Synth_Expression_With_Type (Act_Inst, Actual, Inter_Typ); end if; -- cgit v1.2.3