aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/elab-vhdl_insts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-09-11 11:22:16 +0200
committerTristan Gingold <tgingold@free.fr>2022-09-11 11:22:16 +0200
commit1ca1bd17a6d6ae95d67d58345f495aee3fe272f0 (patch)
tree93dba1ea161aa3233359915003f8ee51b03e98af /src/synth/elab-vhdl_insts.adb
parenta67ead12564c47068e02fe702d07ad1ae2b832c9 (diff)
downloadghdl-1ca1bd17a6d6ae95d67d58345f495aee3fe272f0.tar.gz
ghdl-1ca1bd17a6d6ae95d67d58345f495aee3fe272f0.tar.bz2
ghdl-1ca1bd17a6d6ae95d67d58345f495aee3fe272f0.zip
synth: improve handling of top-level interfaces subtype
Diffstat (limited to 'src/synth/elab-vhdl_insts.adb')
-rw-r--r--src/synth/elab-vhdl_insts.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/synth/elab-vhdl_insts.adb b/src/synth/elab-vhdl_insts.adb
index 8705909db..30ea40b3b 100644
--- a/src/synth/elab-vhdl_insts.adb
+++ b/src/synth/elab-vhdl_insts.adb
@@ -873,7 +873,7 @@ package body Elab.Vhdl_Insts is
(Top_Inst, Get_Default_Value (Inter), Inter_Typ);
pragma Assert (Is_Static (Val.Val));
Val := Unshare (Val, Instance_Pool);
- Val.Typ := Unshare (Val.Typ, Instance_Pool);
+ Val.Typ := Unshare_Type_Instance (Val.Typ, Inter_Typ);
Create_Object (Top_Inst, Inter, Val);
Release_Expr_Pool (Em);
end;
@@ -897,12 +897,17 @@ package body Elab.Vhdl_Insts is
else
declare
Def : constant Node := Get_Default_Value (Inter);
+ Marker : Mark_Type;
Inter_Typ : Type_Acc;
Val : Valtyp;
begin
+ Mark_Expr_Pool (Marker);
pragma Assert (Def /= Null_Node);
Inter_Typ := Elab_Declaration_Type (Top_Inst, Inter);
Val := Synth_Expression_With_Type (Top_Inst, Def, Inter_Typ);
+ Val := Unshare (Val, Instance_Pool);
+ Val.Typ := Unshare_Type_Instance (Val.Typ, Inter_Typ);
+ Release_Expr_Pool (Marker);
Create_Signal (Top_Inst, Inter, Val.Typ);
end;
end if;