aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-05 19:08:54 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-05 19:08:54 +0100
commit50534920b4f1e9846c6d46dce9ae650d790a9f8e (patch)
tree76810a76e06c251fae65f194dea2112ec5b28fa1
parentde83417dd4417ba6971ac29506b1bdd48f49df21 (diff)
downloadghdl-50534920b4f1e9846c6d46dce9ae650d790a9f8e.tar.gz
ghdl-50534920b4f1e9846c6d46dce9ae650d790a9f8e.tar.bz2
ghdl-50534920b4f1e9846c6d46dce9ae650d790a9f8e.zip
netlists-disp_vhdl: handle truncate to width 1.
-rw-r--r--src/synth/netlists-disp_vhdl.adb9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/synth/netlists-disp_vhdl.adb b/src/synth/netlists-disp_vhdl.adb
index 0ebb67c87..702945c3e 100644
--- a/src/synth/netlists-disp_vhdl.adb
+++ b/src/synth/netlists-disp_vhdl.adb
@@ -982,8 +982,13 @@ package body Netlists.Disp_Vhdl is
declare
W : constant Width := Get_Width (Get_Output (Inst, 0));
begin
- Disp_Template (" \o0 <= \i0 (\n0 downto 0); -- trunc" & NL,
- Inst, (0 => W - 1));
+ Disp_Template (" \o0 <= \i0 ", Inst);
+ if W = 1 then
+ Disp_Template ("(0)", Inst);
+ else
+ Disp_Template ("(\n0 downto 0)", Inst, (0 => W - 1));
+ end if;
+ Disp_Template ("; -- trunc" & NL, Inst);
end;
when Id_Uextend =>
declare