From faa2d6fc1c4bc10cda96c2dc3721df209d2d2117 Mon Sep 17 00:00:00 2001
From: Eddie Hung <eddie@fpgeh.com>
Date: Fri, 21 Jun 2019 17:12:34 -0700
Subject: [PATCH] Constrain wreduce only if wide mux

---
 techlibs/xilinx/synth_xilinx.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/techlibs/xilinx/synth_xilinx.cc b/techlibs/xilinx/synth_xilinx.cc
index 3d39afcde..882ebe439 100644
--- a/techlibs/xilinx/synth_xilinx.cc
+++ b/techlibs/xilinx/synth_xilinx.cc
@@ -226,7 +226,10 @@ struct SynthXilinxPass : public ScriptPass
 			run("opt_clean");
 			run("check");
 			run("opt");
-			run("wreduce c:* t:$mux %d");
+			if (help_mode)
+				run("wreduce [c:* t:$mux %d]", "(no selection if -nomux)");
+			else
+				run("wreduce" + nomux ? "" : " c:* t:$mux %d");
 			run("peepopt");
 			run("opt_clean");
 			run("alumacc");