aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-inference.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-23 07:47:13 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-23 07:47:13 +0200
commit5225faf76fd5638863711f4ca40ce7353e179e33 (patch)
tree7b1e94b1a17a75f6f97ab65d61bbd864e05b7c67 /src/synth/netlists-inference.adb
parent0509e5ae98b1018ebcfe44240c6d71cec9cc6c52 (diff)
downloadghdl-5225faf76fd5638863711f4ca40ce7353e179e33.tar.gz
ghdl-5225faf76fd5638863711f4ca40ce7353e179e33.tar.bz2
ghdl-5225faf76fd5638863711f4ca40ce7353e179e33.zip
netlists-inference: adjust guard. Fix ghdl/ghdl-yosys-plugin#110
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;