diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-06-16 21:51:05 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-06-16 21:51:05 +0200 |
commit | f300fd8ecf46c0e7af875040a8d40c63c3bb6886 (patch) | |
tree | 0ab8742b4d62c6ecafa62c19a33f11de6dfb94e4 /src/synth | |
parent | 5f6e2a07bbb19027352ba18211f5d5eb284521bc (diff) | |
download | ghdl-f300fd8ecf46c0e7af875040a8d40c63c3bb6886.tar.gz ghdl-f300fd8ecf46c0e7af875040a8d40c63c3bb6886.tar.bz2 ghdl-f300fd8ecf46c0e7af875040a8d40c63c3bb6886.zip |
synth-vhdl_insts(synth_single_input_assoc): handle type conversion.
Fix #2099
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-vhdl_expr.ads | 3 | ||||
-rw-r--r-- | src/synth/synth-vhdl_insts.adb | 14 |
2 files changed, 13 insertions, 4 deletions
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; |