aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-vhdl_decls.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-08-28 12:27:45 +0200
committerTristan Gingold <tgingold@free.fr>2022-09-02 02:31:06 +0200
commit8a8f3d867598a1f9e3125c9d0648ae20a7144253 (patch)
tree9802e5c0c5e68e92acbc5c41caf3025fbe1efe02 /src/synth/synth-vhdl_decls.adb
parent91303467eac522662572d9106e2a3cb724b24a0d (diff)
downloadghdl-8a8f3d867598a1f9e3125c9d0648ae20a7144253.tar.gz
ghdl-8a8f3d867598a1f9e3125c9d0648ae20a7144253.tar.bz2
ghdl-8a8f3d867598a1f9e3125c9d0648ae20a7144253.zip
synth: use areapools
Diffstat (limited to 'src/synth/synth-vhdl_decls.adb')
-rw-r--r--src/synth/synth-vhdl_decls.adb8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/synth/synth-vhdl_decls.adb b/src/synth/synth-vhdl_decls.adb
index 6bf730e35..2a4b792a6 100644
--- a/src/synth/synth-vhdl_decls.adb
+++ b/src/synth/synth-vhdl_decls.adb
@@ -419,7 +419,9 @@ package body Synth.Vhdl_Decls is
Wid := Get_Value_Wire (Val.Val);
if Is_Subprg then
if Is_Static (Init.Val) then
- Phi_Assign_Static (Wid, Get_Memtyp (Init));
+ -- FIXME: use global pool for shared variables ?
+ Phi_Assign_Static
+ (Wid, Unshare (Get_Memtyp (Init), Wireval_Pool'Access));
else
Phi_Assign_Net (Ctxt, Wid, Get_Net (Ctxt, Init), 0);
end if;
@@ -489,6 +491,7 @@ package body Synth.Vhdl_Decls is
Vhdl_Stmts.Synth_Assignment_Prefix (Syn_Inst, Get_Name (Decl),
Base, Typ, Off, Dyn);
pragma Assert (Dyn.Voff = No_Net);
+ Typ := Unshare (Typ, Instance_Pool);
if Base.Val.Kind = Value_Net then
-- Object is a net if it is not writable. Extract the
-- bits for the alias.
@@ -497,11 +500,12 @@ package body Synth.Vhdl_Decls is
Get_Value_Net (Base.Val), Off.Net_Off, Typ.W),
Typ);
else
- Res := Create_Value_Alias (Base, Off, Typ);
+ Res := Create_Value_Alias (Base, Off, Typ, Expr_Pool'Access);
end if;
if Obj_Typ /= null then
Res := Synth_Subtype_Conversion (Syn_Inst, Res, Obj_Typ, True, Decl);
end if;
+ Res := Unshare (Res, Instance_Pool);
Create_Object (Syn_Inst, Decl, Res);
end Synth_Object_Alias_Declaration;