From 50534920b4f1e9846c6d46dce9ae650d790a9f8e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 5 Nov 2019 19:08:54 +0100 Subject: netlists-disp_vhdl: handle truncate to width 1. --- src/synth/netlists-disp_vhdl.adb | 9 +++++++-- 1 file 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 -- cgit v1.2.3