Merge remote-tracking branch 'origin/master' into xc7dsp
authorEddie Hung <eddie@fpgeh.com>
Wed, 10 Jul 2019 22:58:01 +0000 (15:58 -0700)
committerEddie Hung <eddie@fpgeh.com>
Wed, 10 Jul 2019 22:58:01 +0000 (15:58 -0700)
1  2 
techlibs/ecp5/synth_ecp5.cc
techlibs/xilinx/synth_xilinx.cc

Simple merge
index db0cbb64491df8c9a565949a6e4606eb906dcb95,77daa745c8672f39cf2304988c9bc65a119049b4..3da35db75801d5d6e38b6aad81bc84cee740d09b
@@@ -77,12 -78,9 +78,12 @@@ struct SynthXilinxPass : public ScriptP
                log("    -nowidelut\n");
                log("        do not use MUXF[78] resources to implement LUTs larger than LUT6s\n");
                log("\n");
 +              log("    -nodsp\n");
 +              log("        do not use DSP48E1s to implement multipliers and associated logic\n");
 +              log("\n");
                log("    -widemux <int>\n");
-               log("        enable inference of hard multiplexer resources (MuxFx) for muxes at or\n");
-               log("        above this number of inputs (minimum value 5).\n");
+               log("        enable inference of hard multiplexer resources (MUXF[78]) for muxes at or\n");
+               log("        above this number of inputs (minimum value 2, recommended value >= 5).\n");
                log("        default: 0 (no inference)\n");
                log("\n");
                log("    -run <from_label>:<to_label>\n");
                        run("opt_clean");
                        run("check");
                        run("opt");
-                       run("wreduce");
+                       if (help_mode)
+                               run("wreduce [-keepdc]", "(option for '-widemux')");
+                       else
+                               run("wreduce" + std::string(widemux > 0 ? " -keepdc" : ""));
                        run("peepopt");
                        run("opt_clean");
-                       run("share");
-                       run("techmap -map +/cmp2lut.v -D LUT_WIDTH=4");
-                       run("opt_expr");
-                       run("opt_clean");
+                       if (widemux > 0 || help_mode)
+                               run("muxpack", "    ('-widemux' only)");
+                       // shregmap -tech xilinx can cope with $shiftx and $mux
+                       //   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) {
+                               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");
++
 +                      if (!nodsp || help_mode) {
 +                              run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=25 -D DSP_B_MAXWIDTH=18 -D DSP_NAME=$__MUL25X18");
 +                              run("clean");
 +                              run("techmap -map +/xilinx/dsp_map.v");
 +                      }
++
                        run("alumacc");
+                       run("share");
                        run("opt");
                        run("fsm");
                        run("opt -fast");