aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-13 05:32:56 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-13 06:30:33 +0100
commitc138b798d1830e255b4d8a9b229fe620db363919 (patch)
tree1ad53a47e19b07d167314ac4d2f2f40b743af15c /src
parent138516ead7cf495551b7056cc31cc06ed655be8e (diff)
downloadghdl-c138b798d1830e255b4d8a9b229fe620db363919.tar.gz
ghdl-c138b798d1830e255b4d8a9b229fe620db363919.tar.bz2
ghdl-c138b798d1830e255b4d8a9b229fe620db363919.zip
netlists: handle more case of 0 sized nets.
Diffstat (limited to 'src')
-rw-r--r--src/synth/netlists-builders.adb2
-rw-r--r--src/synth/netlists-disp_vhdl.adb1
-rw-r--r--src/synth/netlists-expands.adb5
3 files changed, 5 insertions, 3 deletions
diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb
index 99a7563fe..812679ef1 100644
--- a/src/synth/netlists-builders.adb
+++ b/src/synth/netlists-builders.adb
@@ -818,7 +818,6 @@ package body Netlists.Builders is
function Build_Const_Z (Ctxt : Context_Acc; W : Width) return Net
is
- pragma Assert (W > 0);
Inst : Instance;
O : Net;
begin
@@ -1422,7 +1421,6 @@ package body Netlists.Builders is
(Ctxt : Context_Acc; I : Net; Off, W : Width) return Net
is
Wd : constant Width := Get_Width (I);
- pragma Assert (Wd /= No_Width);
pragma Assert (W + Off <= Wd);
Inst : Instance;
O : Net;
diff --git a/src/synth/netlists-disp_vhdl.adb b/src/synth/netlists-disp_vhdl.adb
index 4bbaaef31..387665705 100644
--- a/src/synth/netlists-disp_vhdl.adb
+++ b/src/synth/netlists-disp_vhdl.adb
@@ -1082,7 +1082,6 @@ package body Netlists.Disp_Vhdl is
Ow : constant Width := Get_Width (Get_Output (Inst, 0));
Iw : constant Width := Get_Width (Get_Input_Net (Inst, 0));
begin
- pragma Assert (Iw > 0);
pragma Assert (Ow > Iw);
Disp_Template (" \o0 <= ", Inst);
if Iw = 1 then
diff --git a/src/synth/netlists-expands.adb b/src/synth/netlists-expands.adb
index 37ff24bf7..09ff5d9c4 100644
--- a/src/synth/netlists-expands.adb
+++ b/src/synth/netlists-expands.adb
@@ -236,6 +236,11 @@ package body Netlists.Expands is
J : Int32;
Step : Int32;
begin
+ if W = 0 then
+ Net_Arr (0) := Build_Const_UB32 (Ctxt, 1, 1);
+ return;
+ end if;
+
for I in reverse 0 .. W - 1 loop
V1 := Build_Extract_Bit (Ctxt, Addr, I);
V0 := Build_Monadic (Ctxt, Id_Not, V1);