aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-vhdl_expr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-06-05 09:08:27 +0200
committerTristan Gingold <tgingold@free.fr>2022-06-05 09:08:27 +0200
commit68978a5a6bc78b9d71985648ae4976119d3c640c (patch)
treea189dc1aa8b1af40288bde38801da5e935252d8a /src/synth/synth-vhdl_expr.adb
parent58fce267c29f44ccec558ef23b499f1b2917861b (diff)
downloadghdl-68978a5a6bc78b9d71985648ae4976119d3c640c.tar.gz
ghdl-68978a5a6bc78b9d71985648ae4976119d3c640c.tar.bz2
ghdl-68978a5a6bc78b9d71985648ae4976119d3c640c.zip
synth-vhdl_expr: adjust max computation for memidx. Fix #2073
Diffstat (limited to 'src/synth/synth-vhdl_expr.adb')
-rw-r--r--src/synth/synth-vhdl_expr.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/synth/synth-vhdl_expr.adb b/src/synth/synth-vhdl_expr.adb
index d58399021..75d7d7e78 100644
--- a/src/synth/synth-vhdl_expr.adb
+++ b/src/synth/synth-vhdl_expr.adb
@@ -1258,7 +1258,7 @@ package body Synth.Vhdl_Expr is
-- max so that max*step+wd <= len - off
-- max <= (len - off - wd) / step
Max := (Pfx_Bnd.Len - Off.Net_Off - Res_Bnd.Len) / Step;
- if Clog2 (Uns64 (Max)) > Natural (Inp_W) then
+ if Max > 2**Natural (Inp_W) - 1 then
-- The width of Inp limits the max.
Max := 2**Natural (Inp_W) - 1;
end if;