diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-03-26 12:58:46 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-03-26 12:58:46 +0100 |
commit | 643f13aab1704494ceee79c3d8e0ac65b75ea2a1 (patch) | |
tree | fd2b9327b88f56132595dda3f6c8c8d688424a2d /src/synth/synth-values.adb | |
parent | 0d36b145f729e5a72822e8f881cb23620a8ffe52 (diff) | |
download | ghdl-643f13aab1704494ceee79c3d8e0ac65b75ea2a1.tar.gz ghdl-643f13aab1704494ceee79c3d8e0ac65b75ea2a1.tar.bz2 ghdl-643f13aab1704494ceee79c3d8e0ac65b75ea2a1.zip |
synth-expr: handle any object for array attributes.
Diffstat (limited to 'src/synth/synth-values.adb')
-rw-r--r-- | src/synth/synth-values.adb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/synth/synth-values.adb b/src/synth/synth-values.adb index 0d10a94da..f9fd187cb 100644 --- a/src/synth/synth-values.adb +++ b/src/synth/synth-values.adb @@ -428,6 +428,22 @@ package body Synth.Values is end case; end Get_Array_Element; + function Get_Array_Bound (Typ : Type_Acc; Dim : Dim_Type) + return Bound_Type is + begin + case Typ.Kind is + when Type_Vector => + if Dim /= 1 then + raise Internal_Error; + end if; + return Typ.Vbound; + when Type_Array => + return Typ.Abounds.D (Iir_Index32 (Dim)); + when others => + raise Internal_Error; + end case; + end Get_Array_Bound; + function Create_Rec_El_Array (Nels : Iir_Index32) return Rec_El_Array_Acc is use System; |