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.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/synth/netlists-inference.adb b/src/synth/netlists-inference.adb
index 66aabf2bc..b0a660ec5 100644
--- a/src/synth/netlists-inference.adb
+++ b/src/synth/netlists-inference.adb
@@ -795,7 +795,8 @@ package body Netlists.Inference is
Val : Net;
Off : Uns32;
Prev_Val : Net;
- Stmt : Synth.Source.Syn_Src) return Net
+ Stmt : Synth.Source.Syn_Src;
+ Last_Use : Boolean) return Net
is
pragma Assert (Val /= No_Net);
pragma Assert (Prev_Val /= No_Net);
@@ -817,6 +818,10 @@ package body Netlists.Inference is
-- No logical loop or self assignment.
return Val;
end if;
+ if Last_Use and then Has_One_Connection (Prev_Val) then
+ -- Value is not used, to be removed. Do not try to infere anything.
+ return Val;
+ end if;
-- So there is a logical loop.
Sel := Get_Mux2_Sel (Last_Mux);