From b5d63b3ebcddbda84f797281c833e695f2629c49 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 7 Oct 2019 18:39:12 +0200 Subject: synth-disp_vhdl: handle enum of width 1 for --- src/synth/synth-disp_vhdl.adb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/synth/synth-disp_vhdl.adb') diff --git a/src/synth/synth-disp_vhdl.adb b/src/synth/synth-disp_vhdl.adb index 0ea78fc26..d2e83fb6d 100644 --- a/src/synth/synth-disp_vhdl.adb +++ b/src/synth/synth-disp_vhdl.adb @@ -100,7 +100,6 @@ package body Synth.Disp_Vhdl is Put_Line (Pfx & ";"); else -- Any other enum. - -- TODO: width = 1 W := Typ.W; Disp_In_Lhs (Mname, Off, W, Full); if W = 1 then @@ -233,7 +232,12 @@ package body Synth.Disp_Vhdl is W := Typ.W; Put (Name_Table.Image (Get_Identifier (Get_Type_Declarator (Ptype)))); - Put ("'val (to_integer(unsigned("); + Put ("'val (to_integer(unsigned"); + if W = 1 then + Put ("'(0 => "); + else + Put ('('); + end if; Disp_Out_Rhs (Mname, Off, W, Full); Put_Line (")));"); end if; -- cgit v1.2.3