Call muxpack and pmux2shiftx before cmp2lut
authorEddie Hung <eddie@fpgeh.com>
Wed, 10 Jul 2019 04:26:38 +0000 (21:26 -0700)
committerEddie Hung <eddie@fpgeh.com>
Wed, 10 Jul 2019 04:26:38 +0000 (21:26 -0700)
techlibs/xilinx/synth_xilinx.cc

index c4877c8af4a32d97e73697bc7ed8f937d36aff44..ef7660288af96dfab454482bfa131699e029ae5f 100644 (file)
@@ -253,14 +253,6 @@ struct SynthXilinxPass : public ScriptPass
                                run("wreduce" + std::string(widemux > 0 ? " -keepdc" : ""));
                        run("peepopt");
                        run("opt_clean");
-                       run("techmap -map +/cmp2lut.v -D LUT_WIDTH=6");
-                       run("alumacc");
-                       run("share");
-                       run("opt");
-                       run("fsm");
-                       run("opt -fast");
-                       run("memory -nomap");
-                       run("opt_clean");
 
                        if (widemux > 0 || help_mode)
                                run("muxpack", "    ('-widemux' only)");
@@ -269,8 +261,19 @@ struct SynthXilinxPass : public ScriptPass
                        //   cells for identifying variable-length shift registers,
                        //   so attempt to convert $pmux-es to the former
                        // Also: wide multiplexer inference benefits from this too
-                       if (!(nosrl && widemux == 0) || help_mode)
+                       if (!(nosrl && widemux == 0) || help_mode) {
                                run("pmux2shiftx", "(skip if '-nosrl' and '-widemux=0')");
+                               run("clean", "      (skip if '-nosrl' and '-widemux=0')");
+                       }
+
+                       run("techmap -map +/cmp2lut.v -D LUT_WIDTH=6");
+                       run("alumacc");
+                       run("share");
+                       run("opt");
+                       run("fsm");
+                       run("opt -fast");
+                       run("memory -nomap");
+                       run("opt_clean");
                }
 
                if (check_label("bram", "(skip if '-nobram')")) {