aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/xilinx/synth_xilinx.cc
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2019-08-16 03:14:30 +0000
committerMarcin Koƛcielnicki <koriakin@0x04.net>2019-09-07 16:30:43 +0200
commitfda94311ee6e3ec8de0e85e91251a2744673abaf (patch)
tree981082986989dbdadc0a2ecbc6511bc7351d9a45 /techlibs/xilinx/synth_xilinx.cc
parenta82e8df7d37c02258d36223bb16833331dc8808e (diff)
downloadyosys-fda94311ee6e3ec8de0e85e91251a2744673abaf.tar.gz
yosys-fda94311ee6e3ec8de0e85e91251a2744673abaf.tar.bz2
yosys-fda94311ee6e3ec8de0e85e91251a2744673abaf.zip
synth_xilinx: Support init values on Spartan 6 flip-flops properly.
Diffstat (limited to 'techlibs/xilinx/synth_xilinx.cc')
-rw-r--r--techlibs/xilinx/synth_xilinx.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/techlibs/xilinx/synth_xilinx.cc b/techlibs/xilinx/synth_xilinx.cc
index bfc0ac2bf..e0e81ef1d 100644
--- a/techlibs/xilinx/synth_xilinx.cc
+++ b/techlibs/xilinx/synth_xilinx.cc
@@ -266,6 +266,14 @@ struct SynthXilinxPass : public ScriptPass
void script() YS_OVERRIDE
{
+ std::string ff_map_file;
+ if (help_mode)
+ ff_map_file = "+/xilinx/xc6s_ff_map.v";
+ else if (family == "xc6s")
+ ff_map_file = "+/xilinx/xc6s_ff_map.v";
+ else
+ ff_map_file = "+/xilinx/xc7_ff_map.v";
+
if (check_label("begin")) {
if (vpr)
run("read_verilog -lib -D_EXPLICIT_CARRY +/xilinx/cells_sim.v");
@@ -416,11 +424,9 @@ struct SynthXilinxPass : public ScriptPass
}
if (check_label("map_ffs")) {
- if (abc9 || help_mode) {
- run("techmap -map +/xilinx/ff_map.v", "('-abc9' only)");
- run("dffinit -ff FDRE Q INIT -ff FDCE Q INIT -ff FDPE Q INIT -ff FDSE Q INIT "
- "-ff FDRE_1 Q INIT -ff FDCE_1 Q INIT -ff FDPE_1 Q INIT -ff FDSE_1 Q INIT", "('-abc9' only)");
- }
+ if (abc9 || help_mode) {
+ run("techmap -map " + ff_map_file, "('-abc9' only)");
+ }
}
if (check_label("map_luts")) {
@@ -453,15 +459,12 @@ struct SynthXilinxPass : public ScriptPass
run("xilinx_srl -fixed -minlen 3", "(skip if '-nosrl')");
std::string techmap_args = "-map +/xilinx/lut_map.v -map +/xilinx/cells_map.v";
if (help_mode)
- techmap_args += " [-map +/xilinx/ff_map.v]";
+ techmap_args += " [-map " + ff_map_file + "]";
else if (abc9)
techmap_args += " -map +/xilinx/abc_unmap.v";
else
- techmap_args += " -map +/xilinx/ff_map.v";
+ techmap_args += " -map " + ff_map_file;
run("techmap " + techmap_args);
- if (!abc9 || help_mode)
- run("dffinit -ff FDRE Q INIT -ff FDCE Q INIT -ff FDPE Q INIT -ff FDSE Q INIT "
- "-ff FDRE_1 Q INIT -ff FDCE_1 Q INIT -ff FDPE_1 Q INIT -ff FDSE_1 Q INIT", "(without '-abc9' only)");
run("clean");
}