diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-16 18:22:26 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-16 18:22:26 +0200 |
commit | 043c2a94133063d3fdbf6458e238ebafa3c57b35 (patch) | |
tree | a8dd0355555565b1204a4e72b337ecab67ff812a | |
parent | a60a736bfd35ee19a90f4a69e299706079ac76a8 (diff) | |
download | ghdl-043c2a94133063d3fdbf6458e238ebafa3c57b35.tar.gz ghdl-043c2a94133063d3fdbf6458e238ebafa3c57b35.tar.bz2 ghdl-043c2a94133063d3fdbf6458e238ebafa3c57b35.zip |
synth: fix bounds computation for concatenations.
-rw-r--r-- | src/synth/synth-oper.adb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb index 819331e39..3f633fe6d 100644 --- a/src/synth/synth-oper.adb +++ b/src/synth/synth-oper.adb @@ -1205,7 +1205,7 @@ package body Synth.Oper is Bnd := Create_Bounds_From_Length (Syn_Inst, Get_Index_Type (Get_Type (Expr), 0), - Iir_Index32 (Get_Width (L) + 1)); + Iir_Index32 (Get_Bound_Length (Left.Typ, 1) + 1)); return Create_Value_Net (N, Create_Onedimensional_Array_Subtype (Left_Typ, Bnd)); @@ -1221,7 +1221,7 @@ package body Synth.Oper is Bnd := Create_Bounds_From_Length (Syn_Inst, Get_Index_Type (Get_Type (Expr), 0), - Iir_Index32 (Get_Width (R) + 1)); + Iir_Index32 (Get_Bound_Length (Right.Typ, 1) + 1)); return Create_Value_Net (N, Create_Onedimensional_Array_Subtype (Right_Typ, Bnd)); @@ -1251,7 +1251,8 @@ package body Synth.Oper is Bnd := Create_Bounds_From_Length (Syn_Inst, Get_Index_Type (Get_Type (Expr), 0), - Iir_Index32 (Get_Width (L) + Get_Width (R))); + Iir_Index32 (Get_Bound_Length (Left.Typ, 1) + + Get_Bound_Length (Right.Typ, 1))); return Create_Value_Net (N, Create_Onedimensional_Array_Subtype (Expr_Typ, Bnd)); |