aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/xilinx/synth_xilinx.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-01-02 12:53:26 -0800
committerEddie Hung <eddie@fpgeh.com>2020-01-02 12:53:26 -0800
commita051801b72c7d526a1c04cf2635ae8d7fe43a135 (patch)
tree4753e9cf8074b08acc8a1f29419081c37742ca81 /techlibs/xilinx/synth_xilinx.cc
parentb454735bea6727f346fdbbc28f261b40d91c61ba (diff)
downloadyosys-a051801b72c7d526a1c04cf2635ae8d7fe43a135.tar.gz
yosys-a051801b72c7d526a1c04cf2635ae8d7fe43a135.tar.bz2
yosys-a051801b72c7d526a1c04cf2635ae8d7fe43a135.zip
synth_xilinx -dff to work with abc too
Diffstat (limited to 'techlibs/xilinx/synth_xilinx.cc')
-rw-r--r--techlibs/xilinx/synth_xilinx.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/techlibs/xilinx/synth_xilinx.cc b/techlibs/xilinx/synth_xilinx.cc
index e2a625f9b..51d2cbbd2 100644
--- a/techlibs/xilinx/synth_xilinx.cc
+++ b/techlibs/xilinx/synth_xilinx.cc
@@ -108,10 +108,11 @@ struct SynthXilinxPass : public ScriptPass
log(" flatten design before synthesis\n");
log("\n");
log(" -dff\n");
- log(" run 'abc9' with -dff option\n");
+ log(" run 'abc'/'abc9' with -dff option\n");
log("\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(" -abc9\n");
log(" use new ABC9 flow (EXPERIMENTAL)\n");
@@ -195,6 +196,7 @@ struct SynthXilinxPass : public ScriptPass
continue;
}
if (args[argidx] == "-retime") {
+ dff_mode = true;
retime = true;
continue;
}
@@ -542,7 +544,7 @@ struct SynthXilinxPass : public ScriptPass
if (flatten_before_abc)
run("flatten");
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) {
if (family != "xc7")
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");
}
else {
+ std::string abc_opts;
if (nowidelut)
- run("abc -luts 2:2,3,6:5" + string(retime ? " -dff -D 1" : ""));
+ abc_opts += " -luts 2:2,3,6:5";
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");
@@ -581,7 +589,7 @@ struct SynthXilinxPass : public ScriptPass
techmap_args += stringf("[-map %s]", ff_map_file.c_str());
else if (!abc9)
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");
}