diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-06-09 07:52:39 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-06-09 07:52:39 +0200 |
commit | 46bd0ff2b72f47fa7e12612f66bcae0cb2003b7a (patch) | |
tree | f4f98f223bd97f85575342d935563bfdfe001c9b /src/synth/elab-vhdl_insts.adb | |
parent | 7064ef37029a883d0098d0af665231b36854d5e2 (diff) | |
download | ghdl-46bd0ff2b72f47fa7e12612f66bcae0cb2003b7a.tar.gz ghdl-46bd0ff2b72f47fa7e12612f66bcae0cb2003b7a.tar.bz2 ghdl-46bd0ff2b72f47fa7e12612f66bcae0cb2003b7a.zip |
elab-vhdl_types(Elab_Declaration_Type): rework to handle 'subtype
Fix #2085
Diffstat (limited to 'src/synth/elab-vhdl_insts.adb')
-rw-r--r-- | src/synth/elab-vhdl_insts.adb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/synth/elab-vhdl_insts.adb b/src/synth/elab-vhdl_insts.adb index 820e20ff1..d03f75154 100644 --- a/src/synth/elab-vhdl_insts.adb +++ b/src/synth/elab-vhdl_insts.adb @@ -71,8 +71,7 @@ package body Elab.Vhdl_Insts is Inter := Get_Association_Interface (Assoc, Assoc_Inter); case Iir_Kinds_Interface_Declaration (Get_Kind (Inter)) is when Iir_Kind_Interface_Constant_Declaration => - Elab_Declaration_Type (Sub_Inst, Inter); - Inter_Type := Get_Subtype_Object (Sub_Inst, Get_Type (Inter)); + Inter_Type := Elab_Declaration_Type (Sub_Inst, Inter); case Get_Kind (Assoc) is when Iir_Kind_Association_Element_Open => @@ -349,8 +348,7 @@ package body Elab.Vhdl_Insts is raise Internal_Error; end case; else - Elab_Declaration_Type (Sub_Inst, Inter); - return Get_Subtype_Object (Sub_Inst, Get_Type (Inter)); + return Elab_Declaration_Type (Sub_Inst, Inter); end if; end Elab_Port_Association_Type; @@ -789,12 +787,11 @@ package body Elab.Vhdl_Insts is -- Compute generics. Inter := Get_Generic_Chain (Entity); while Is_Valid (Inter) loop - Elab_Declaration_Type (Top_Inst, Inter); declare Val : Valtyp; Inter_Typ : Type_Acc; begin - Inter_Typ := Get_Subtype_Object (Top_Inst, Get_Type (Inter)); + Inter_Typ := Elab_Declaration_Type (Top_Inst, Inter); Val := Exec_Expression_With_Type (Top_Inst, Get_Default_Value (Inter), Inter_Typ); pragma Assert (Is_Static (Val.Val)); @@ -815,8 +812,7 @@ package body Elab.Vhdl_Insts is declare Inter_Typ : Type_Acc; begin - Elab_Declaration_Type (Top_Inst, Inter); - Inter_Typ := Get_Subtype_Object (Top_Inst, Get_Type (Inter)); + Inter_Typ := Elab_Declaration_Type (Top_Inst, Inter); Create_Signal (Top_Inst, Inter, Inter_Typ, null); end; Inter := Get_Chain (Inter); |