diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-12-24 09:55:07 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-12-24 17:48:40 +0100 |
commit | 9ea090cecbebd98d66040a228ecce94c2eb57638 (patch) | |
tree | 0a71f8e6c1063b3a47e267d963175c7172897026 | |
parent | 2233c9cded087521083815881bb26f16164d6bd7 (diff) | |
download | ghdl-9ea090cecbebd98d66040a228ecce94c2eb57638.tar.gz ghdl-9ea090cecbebd98d66040a228ecce94c2eb57638.tar.bz2 ghdl-9ea090cecbebd98d66040a228ecce94c2eb57638.zip |
netlists-disp_vhdl: handle conversion from std_logic to signed/unsigned.
-rw-r--r-- | src/synth/netlists-disp_vhdl.adb | 14 | ||||
-rw-r--r-- | src/synth/netlists-memories.adb | 14 |
2 files changed, 20 insertions, 8 deletions
diff --git a/src/synth/netlists-disp_vhdl.adb b/src/synth/netlists-disp_vhdl.adb index c063c7425..29fc6f169 100644 --- a/src/synth/netlists-disp_vhdl.adb +++ b/src/synth/netlists-disp_vhdl.adb @@ -494,11 +494,21 @@ package body Netlists.Disp_Vhdl is | Conv_Slv => Disp_Net_Name (N); when Conv_Unsigned => - Put ("unsigned ("); + Put ("unsigned"); + if Get_Width (N) = 1 then + Put ("'(1 => "); + else + Put (" ("); + end if; Disp_Net_Name (N); Put (")"); when Conv_Signed => - Put ("signed ("); + Put ("signed"); + if Get_Width (N) = 1 then + Put ("'(1 => "); + else + Put (" ("); + end if; Disp_Net_Name (N); Put (")"); end case; diff --git a/src/synth/netlists-memories.adb b/src/synth/netlists-memories.adb index ff432de64..c1b8603ec 100644 --- a/src/synth/netlists-memories.adb +++ b/src/synth/netlists-memories.adb @@ -443,6 +443,7 @@ package body Netlists.Memories is En := No_Net; Disconnect (Inp); Last_Inst := Iinst; + return; end; elsif Get_Id (Iinst) = Id_Mux2 and then Is_Enable_Dff (Inp) then declare @@ -467,13 +468,14 @@ package body Netlists.Memories is Disconnect (Clk_Inp); Remove_Instance (Iinst); Last_Inst := Dff_Inst; + return; end; end if; - else - Last_Inst := Inst; - Clk := No_Net; - En := No_Net; end if; + + Last_Inst := Inst; + Clk := No_Net; + En := No_Net; end Extract_Extract_Dff; -- Create a mem_rd/mem_rd_sync from a dyn_extract gate. @@ -1541,9 +1543,9 @@ package body Netlists.Memories is Redirect_Inputs (Get_Output (Last_Inst, 0), Rd); Disconnect (Get_Input (In_Inst, 0)); if Last_Inst /= In_Inst then - Remove_Instance (In_Inst); + Remove_Instance (Last_Inst); end if; - Remove_Instance (Last_Inst); + Remove_Instance (In_Inst); end; when Id_Dyn_Insert_En | Id_Dyn_Insert |