aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-09-23 06:48:52 +0200
committerTristan Gingold <tgingold@free.fr>2019-09-23 06:48:52 +0200
commitb088e95b6964ef70a2856bf19b33112d391d8aa5 (patch)
treea6bc1137af080ce322a64460b2be4d37edfb7a5e /src
parentfb6f206d29730298d68582da733cea975658679f (diff)
downloadghdl-b088e95b6964ef70a2856bf19b33112d391d8aa5.tar.gz
ghdl-b088e95b6964ef70a2856bf19b33112d391d8aa5.tar.bz2
ghdl-b088e95b6964ef70a2856bf19b33112d391d8aa5.zip
synth-inference: optimize for controls.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-inference.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/synth/synth-inference.adb b/src/synth/synth-inference.adb
index 4ac726c32..e9a6eeab0 100644
--- a/src/synth/synth-inference.adb
+++ b/src/synth/synth-inference.adb
@@ -464,7 +464,13 @@ package body Synth.Inference is
Enable : Net;
begin
if not Flags.Flag_Debug_Noinference then
- Find_Longest_Loop (Val, Prev_Val, Last_Mux, Len);
+ if Get_First_Sink (Prev_Val) = No_Input then
+ -- PREV_VAL is never read, so there cannot be any loop.
+ -- This is an important optimization for control signals.
+ Len := -1;
+ else
+ Find_Longest_Loop (Val, Prev_Val, Last_Mux, Len);
+ end if;
else
Len := -1;
end if;