Merge remote-tracking branch 'origin/xaig' into xc7mux
authorEddie Hung <eddie@fpgeh.com>
Wed, 26 Jun 2019 17:33:54 +0000 (10:33 -0700)
committerEddie Hung <eddie@fpgeh.com>
Wed, 26 Jun 2019 17:33:54 +0000 (10:33 -0700)
1  2 
techlibs/xilinx/synth_xilinx.cc

index 4367f2b993f06c75a9a9cdf2919538fc23f8b62a,b17b9beb5abe1a2738e4e5efce62b60f5596e862..2a641e933d2a0e542dd5afa3865be32225e7239a
@@@ -73,11 -73,12 +73,17 @@@ struct SynthXilinxPass : public ScriptP
                log("    -nosrl\n");
                log("        disable inference of shift registers\n");
                log("\n");
+               log("    -nocarry\n");
+               log("        do not use XORCY/MUXCY/CARRY4 cells in output netlist\n");
+               log("\n");
+               log("    -nowidelut\n");
+               log("        do not use MUXF[78] resources to implement LUTs larger than LUT6s\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("        default: 0 (no inference)\n");
 +              log("\n");
                log("    -run <from_label>:<to_label>\n");
                log("        only run the commands between the labels (see below). an empty\n");
                log("        from label is synonymous to 'begin', and empty to label is\n");
        }
  
        std::string top_opt, edif_file, blif_file, abc, arch;
-       bool flatten, retime, vpr, nocarry, nobram, nodram, nosrl;
+       bool flatten, retime, vpr, nobram, nodram, nosrl, nocarry, nowidelut, abc9;
 +      int widemux;
  
        void clear_flags() YS_OVERRIDE
        {
                nobram = false;
                nodram = false;
                nosrl = false;
-               arch = "xc7";
+               nocarry = false;
+               nowidelut = false;
+               abc9 = false;
 +              widemux = 0;
        }
  
        void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
                                nosrl = true;
                                continue;
                        }
 +                      if (args[argidx] == "-widemux" && argidx+1 < args.size()) {
 +                              widemux = atoi(args[++argidx].c_str());
 +                              continue;
 +                      }
                        if (args[argidx] == "-abc9") {
-                               abc = "abc9";
+                               abc9 = true;
                                continue;
                        }
                        break;
                                run("shregmap -tech xilinx -minlen 3", "(skip if '-nosrl')");
                        }
  
 -                      std::string techmap_files = " -map +/techmap.v";
 +                      std::string techmap_args = " -map +/techmap.v";
 +                      if (help_mode)
 +                              techmap_args += " [-map +/xilinx/mux_map.v]";
 +                      else if (widemux > 0)
 +                              techmap_args += stringf(" -D MIN_MUX_INPUTS=%d -map +/xilinx/mux_map.v", widemux);
                        if (help_mode)
 -                              techmap_files += " [-map +/xilinx/arith_map.v]";
 +                              techmap_args += " [-map +/xilinx/arith_map.v]";
                        else if (!nocarry) {
 -                              techmap_files += " -map +/xilinx/arith_map.v";
 +                              techmap_args += " -map +/xilinx/arith_map.v";
                                if (vpr)
 -                                      techmap_files += " -D _EXPLICIT_CARRY";
 +                                      techmap_args += " -D _EXPLICIT_CARRY";
-                               else if (abc == "abc9")
+                               else if (abc9)
 -                                      techmap_files += " -D _CLB_CARRY";
 +                                      techmap_args += " -D _CLB_CARRY";
                        }
 -                      run("techmap " + techmap_files);
 +                      run("techmap " + techmap_args);
                        run("opt -fast");
                }