aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-inference.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth/netlists-inference.adb')
-rw-r--r--src/synth/netlists-inference.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/synth/netlists-inference.adb b/src/synth/netlists-inference.adb
index 383211684..9c44b218c 100644
--- a/src/synth/netlists-inference.adb
+++ b/src/synth/netlists-inference.adb
@@ -747,12 +747,13 @@ package body Netlists.Inference is
function Infere_Latch (Ctxt : Context_Acc;
Val : Net;
Prev_Val : Net;
+ Last_Use : Boolean;
Loc : Location_Type) return Net
is
Name : Sname;
begin
-- In case of false loop, do not close the loop but assign X.
- if Is_False_Loop (Prev_Val) then
+ if Last_Use and then Is_False_Loop (Prev_Val) then
return Build_Const_X (Ctxt, Get_Width (Val));
end if;
@@ -862,7 +863,7 @@ package body Netlists.Inference is
Extract_Clock (Ctxt, Get_Driver (Sel), Clk, Enable);
if Clk = No_Net then
-- No clock -> latch or combinational loop
- Res := Infere_Latch (Ctxt, Val, Prev_Val, Loc);
+ Res := Infere_Latch (Ctxt, Val, Prev_Val, Last_Use, Loc);
else
-- Clock -> FF
First_Mux := Get_Net_Parent (Val);