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.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/synth/netlists-inference.adb b/src/synth/netlists-inference.adb
index 12c689123..9ec445901 100644
--- a/src/synth/netlists-inference.adb
+++ b/src/synth/netlists-inference.adb
@@ -845,8 +845,16 @@ 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
+ if Last_Use
+ and then Has_One_Connection (Prev_Val)
+ and then not Is_Connected (Val)
+ then
-- Value is not used, to be removed. Do not try to infere anything.
+ -- Conditions:
+ -- * last_use must be true: the signal won't be use after the call
+ -- to infere (because it goes out of scope).
+ -- * Prev_val must be connected once (to create a loop).
+ -- * Val must not be connected (for variables).
return Val;
end if;