diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-06-17 08:15:08 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-06-17 08:15:08 +0200 |
commit | 067952e4214e82060f9b98032870ae8c13eee79a (patch) | |
tree | 4a83d833c468860919059caae43b863521865730 /src/synth/synth-environment.adb | |
parent | b853533397f943615f80a2a0f547fadc0ae0c369 (diff) | |
download | ghdl-067952e4214e82060f9b98032870ae8c13eee79a.tar.gz ghdl-067952e4214e82060f9b98032870ae8c13eee79a.tar.bz2 ghdl-067952e4214e82060f9b98032870ae8c13eee79a.zip |
synth: add a gate on an optimization to simplify memory handling.
Diffstat (limited to 'src/synth/synth-environment.adb')
-rw-r--r-- | src/synth/synth-environment.adb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/synth/synth-environment.adb b/src/synth/synth-environment.adb index fd04f0673..654d74ad2 100644 --- a/src/synth/synth-environment.adb +++ b/src/synth/synth-environment.adb @@ -1361,19 +1361,25 @@ package body Synth.Environment is end loop; -- Possible optimizations: - -- if C1 then _ _ _ - -- if C2 then R0-|0\ R0-|0\ R0 -|0\ - -- R := V; ==> | |--+ | |- R ==> | |- R - -- end if; V-|_/ +----|_/ V-|_/ - -- end if; C1 C2 C1.C2 + -- if C1 then _ _ _ + -- if C2 then R0-|0\ R0-|0\ R0 -|0\ + -- R := V; ==> | |-- T --+ | |- R ==> | |- R + -- end if; V-|_/ +----|_/ V-|_/ + -- end if; C2 C1 C1.C2 + -- + -- Note: N (0) ~ R0, N (1) ~ T = first mux input -- -- This really helps inference as the net R0 doesn't have to be -- walked twice (in absence of memoization). - -- OTOH, it makes memory handling slightly more complex... + -- This optimization is not performed if T is used. This check is + -- not really necessary as if T is assigned it will also be handled + -- in this procedure and will be muxed by C1. But this simplifies + -- memory handling. -- Build mux. N1_Inst := Get_Net_Parent (N (1)); if Get_Id (N1_Inst) = Id_Mux2 + and then not Is_Connected (N (1)) and then Same_Net (Get_Driver (Get_Mux2_I0 (N1_Inst)), N (0)) then declare |