Add "synth_ice40 -nodffe"
authorClifford Wolf <clifford@clifford.at>
Mon, 16 Apr 2018 18:44:26 +0000 (20:44 +0200)
committerClifford Wolf <clifford@clifford.at>
Mon, 16 Apr 2018 18:44:26 +0000 (20:44 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
techlibs/ice40/synth_ice40.cc

index 0bb0fb139a10d028f9d6aa361a020da21cf21943..42873305ecfbb7f6ddf29fdc77e73feaec4c6396 100644 (file)
@@ -62,6 +62,9 @@ struct SynthIce40Pass : public ScriptPass
                log("    -nocarry\n");
                log("        do not use SB_CARRY cells in output netlist\n");
                log("\n");
+               log("    -nodffe\n");
+               log("        do not use SB_DFFE* cells in output netlist\n");
+               log("\n");
                log("    -nobram\n");
                log("        do not use SB_RAM40_4K* cells in output netlist\n");
                log("\n");
@@ -79,7 +82,7 @@ struct SynthIce40Pass : public ScriptPass
        }
 
        string top_opt, blif_file, edif_file;
-       bool nocarry, nobram, flatten, retime, abc2, vpr;
+       bool nocarry, nodffe, nobram, flatten, retime, abc2, vpr;
 
        virtual void clear_flags() YS_OVERRIDE
        {
@@ -87,6 +90,7 @@ struct SynthIce40Pass : public ScriptPass
                blif_file = "";
                edif_file = "";
                nocarry = false;
+               nodffe = false;
                nobram = false;
                flatten = true;
                retime = false;
@@ -138,6 +142,10 @@ struct SynthIce40Pass : public ScriptPass
                                nocarry = true;
                                continue;
                        }
+                       if (args[argidx] == "-nodffe") {
+                               nodffe = true;
+                               continue;
+                       }
                        if (args[argidx] == "-nobram") {
                                nobram = true;
                                continue;
@@ -209,7 +217,8 @@ struct SynthIce40Pass : public ScriptPass
                if (check_label("map_ffs"))
                {
                        run("dffsr2dff");
-                       run("dff2dffe -direct-match $_DFF_*");
+                       if (!nodffe)
+                               run("dff2dffe -direct-match $_DFF_*");
                        run("techmap -D NO_SB_LUT4 -map +/ice40/cells_map.v");
                        run("opt_expr -mux_undef");
                        run("simplemap");