synth_xilinx -dff to work with abc too

This commit is contained in:
Eddie Hung 2020-01-02 12:53:26 -08:00
parent b454735bea
commit a051801b72
1 changed files with 14 additions and 6 deletions

View File

@ -108,10 +108,11 @@ struct SynthXilinxPass : public ScriptPass
log(" flatten design before synthesis\n"); log(" flatten design before synthesis\n");
log("\n"); log("\n");
log(" -dff\n"); log(" -dff\n");
log(" run 'abc9' with -dff option\n"); log(" run 'abc'/'abc9' with -dff option\n");
log("\n"); log("\n");
log(" -retime\n"); log(" -retime\n");
log(" run 'abc' with '-dff -D 1' options\n"); log(" run 'abc' with '-D 1' option to enable flip-flop retiming.\n");
log(" implies -dff.\n");
log("\n"); log("\n");
log(" -abc9\n"); log(" -abc9\n");
log(" use new ABC9 flow (EXPERIMENTAL)\n"); log(" use new ABC9 flow (EXPERIMENTAL)\n");
@ -195,6 +196,7 @@ struct SynthXilinxPass : public ScriptPass
continue; continue;
} }
if (args[argidx] == "-retime") { if (args[argidx] == "-retime") {
dff_mode = true;
retime = true; retime = true;
continue; continue;
} }
@ -542,7 +544,7 @@ struct SynthXilinxPass : public ScriptPass
if (flatten_before_abc) if (flatten_before_abc)
run("flatten"); run("flatten");
if (help_mode) if (help_mode)
run("abc -luts 2:2,3,6:5[,10,20] [-dff]", "(option for 'nowidelut'; option for '-retime')"); run("abc -luts 2:2,3,6:5[,10,20] [-dff] [-D 1]", "(option for 'nowidelut', '-dff', '-retime')");
else if (abc9) { else if (abc9) {
if (family != "xc7") if (family != "xc7")
log_warning("'synth_xilinx -abc9' not currently supported for the '%s' family, " log_warning("'synth_xilinx -abc9' not currently supported for the '%s' family, "
@ -565,10 +567,16 @@ struct SynthXilinxPass : public ScriptPass
run("techmap -map +/xilinx/abc9_unmap.v"); run("techmap -map +/xilinx/abc9_unmap.v");
} }
else { else {
std::string abc_opts;
if (nowidelut) if (nowidelut)
run("abc -luts 2:2,3,6:5" + string(retime ? " -dff -D 1" : "")); abc_opts += " -luts 2:2,3,6:5";
else else
run("abc -luts 2:2,3,6:5,10,20" + string(retime ? " -dff -D 1" : "")); abc_opts += " -luts 2:2,3,6:5,10,20";
if (dff_mode)
abc_opts += " -dff";
if (retime)
abc_opts += " -D 1";
run("abc" + abc_opts);
} }
run("clean"); run("clean");
@ -581,7 +589,7 @@ struct SynthXilinxPass : public ScriptPass
techmap_args += stringf("[-map %s]", ff_map_file.c_str()); techmap_args += stringf("[-map %s]", ff_map_file.c_str());
else if (!abc9) else if (!abc9)
techmap_args += stringf(" -map %s", ff_map_file.c_str()); techmap_args += stringf(" -map %s", ff_map_file.c_str());
run("techmap " + techmap_args, "(option without '-abc9')"); run("techmap " + techmap_args, "(only if '-abc9')");
run("xilinx_dffopt"); run("xilinx_dffopt");
} }