aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-11-16 19:05:34 +0100
committerTristan Gingold <tgingold@free.fr>2020-11-16 19:05:34 +0100
commite5b000fad3d13b1f33c5157abe94b96ffcd9227b (patch)
tree6cfb41f854b4e2ee761740c5505b52c8ac7e7a99 /src/synth
parent31ca0d8a687f0b3cc5615407e2ee6160e4355baa (diff)
downloadghdl-e5b000fad3d13b1f33c5157abe94b96ffcd9227b.tar.gz
ghdl-e5b000fad3d13b1f33c5157abe94b96ffcd9227b.tar.bz2
ghdl-e5b000fad3d13b1f33c5157abe94b96ffcd9227b.zip
synth-objtypes: fix width computation. Fix #1509
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/synth-objtypes.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/synth/synth-objtypes.adb b/src/synth/synth-objtypes.adb
index 25857f065..4b9e6ea54 100644
--- a/src/synth/synth-objtypes.adb
+++ b/src/synth/synth-objtypes.adb
@@ -148,7 +148,7 @@ package body Synth.Objtypes is
else
declare
Wl : constant Width := Width (Clog2 (Uns64 (-Lo)));
- Wh : constant Width := Width (Clog2 (Uns64 (Hi)));
+ Wh : constant Width := Width (Clog2 (Uns64 (Hi) + 1));
begin
W := Width'Max (Wl, Wh) + 1;
end;