From fc1f68e9df9fb41e3c9d279366b8b95f5c8cc9ca Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 24 Apr 2020 06:39:13 +0200 Subject: synth-environment: add an optimization. Fix #1258 This optimization is important for the control wires to avoid false paths. --- src/synth/synth-environment.adb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/synth/synth-environment.adb b/src/synth/synth-environment.adb index f11c3f274..03acc2478 100644 --- a/src/synth/synth-environment.adb +++ b/src/synth/synth-environment.adb @@ -1285,6 +1285,10 @@ package body Synth.Environment is N (0), Get_Driver (Get_Mux2_I1 (N1_Inst))); end if; end; + elsif N (0) = N (1) then + -- Minor optimization: no need to add a mux if both sides are + -- equal. But this is important for the control wires. + Res := N (0); else Res := Build_Mux2 (Ctxt, Sel, N (0), N (1)); end if; -- cgit v1.2.3