From 428277de6335c4f926c3d5cde8f2b76e82c0633f Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 27 Oct 2019 21:45:26 +0100 Subject: synth-expr (synth_slice_suffix): compute max value for slices. --- src/synth/synth-expr.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index b5e54c12c..d16dedffe 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1207,6 +1207,7 @@ package body Synth.Expr is Left, Right : Value_Acc; Dir : Iir_Direction; Step : Uns32; + Max : Uns32; begin Off := 0; @@ -1258,9 +1259,11 @@ package body Synth.Expr is Synth_Extract_Dyn_Suffix (Name, Pfx_Bnd, Get_Net (Left), Get_Net (Right), Inp, Step, Off, Wd); + -- FIXME: convert range to offset. + Max := (Pfx_Bnd.Len - Off) / Step; Inp := Build_Memidx (Get_Build (Syn_Inst), - Inp, Step * El_Wd, 0, + Inp, Step * El_Wd, Max, Get_Width (Inp) + Width (Clog2 (Uns64 (Step * El_Wd)))); Wd := Wd * El_Wd; end if; -- cgit v1.2.3