From 043c2a94133063d3fdbf6458e238ebafa3c57b35 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 16 Apr 2020 18:22:26 +0200 Subject: synth: fix bounds computation for concatenations. --- src/synth/synth-oper.adb | 7 ++++--- 1 file 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)); -- cgit v1.2.3