diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-09-07 04:47:46 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-09-07 04:47:46 +0200 |
commit | 3136726f2b52be19d31146a2427f54b0f0718f33 (patch) | |
tree | 146145374082f532dad1052b5d69fa639b2639b2 /src/synth/elab-vhdl_values.adb | |
parent | d2988c827b9785880abc5f083d07714ba81b0cc5 (diff) | |
download | ghdl-3136726f2b52be19d31146a2427f54b0f0718f33.tar.gz ghdl-3136726f2b52be19d31146a2427f54b0f0718f33.tar.bz2 ghdl-3136726f2b52be19d31146a2427f54b0f0718f33.zip |
synth-vhdl_stmts: fix handling of copyback parameters
Diffstat (limited to 'src/synth/elab-vhdl_values.adb')
-rw-r--r-- | src/synth/elab-vhdl_values.adb | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/synth/elab-vhdl_values.adb b/src/synth/elab-vhdl_values.adb index 58f407da5..25ce08b77 100644 --- a/src/synth/elab-vhdl_values.adb +++ b/src/synth/elab-vhdl_values.adb @@ -136,36 +136,33 @@ package body Elab.Vhdl_Values is Init => Init))); end Create_Value_Signal; - function Create_Value_Memory (Vtype : Type_Acc; Pool : Areapool_Acc) - return Valtyp + function Create_Value_Memory_Pool (Mt : Memtyp; Pool : Areapool_Acc) + return Valtyp is subtype Value_Type_Memory is Value_Type (Value_Memory); function Alloc is new Areapools.Alloc_On_Pool_Addr (Value_Type_Memory); - function To_Memory_Ptr is new Ada.Unchecked_Conversion - (System.Address, Memory_Ptr); V : Value_Acc; - M : System.Address; begin - Areapools.Allocate (Pool.all, M, - Vtype.Sz, Size_Type (2 ** Natural (Vtype.Al))); - V := To_Value_Acc - (Alloc (Pool, Value_Type_Memory'(Kind => Value_Memory, - Mem => To_Memory_Ptr (M)))); + V := To_Value_Acc (Alloc (Pool, Value_Type_Memory'(Kind => Value_Memory, + Mem => Mt.Mem))); + return (Mt.Typ, V); + end Create_Value_Memory_Pool; - return (Vtype, V); + function Create_Value_Memory (Mt : Memtyp) return Valtyp is + begin + return Create_Value_Memory_Pool (Mt, Current_Pool); end Create_Value_Memory; - function Create_Value_Memory (Mt : Memtyp) return Valtyp + function Create_Value_Memory (Vtype : Type_Acc; Pool : Areapool_Acc) + return Valtyp is - subtype Value_Type_Memory is Value_Type (Value_Memory); - function Alloc is new Areapools.Alloc_On_Pool_Addr (Value_Type_Memory); - V : Value_Acc; + function To_Memory_Ptr is new Ada.Unchecked_Conversion + (System.Address, Memory_Ptr); + M : System.Address; begin - V := To_Value_Acc - (Alloc (Current_Pool, Value_Type_Memory'(Kind => Value_Memory, - Mem => Mt.Mem))); - - return (Mt.Typ, V); + Areapools.Allocate (Pool.all, M, + Vtype.Sz, Size_Type (2 ** Natural (Vtype.Al))); + return Create_Value_Memory_Pool ((Vtype, To_Memory_Ptr (M)), Pool); end Create_Value_Memory; function Create_Value_File (File : File_Index) return Value_Acc |