diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-12-04 14:29:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 14:29:21 -0800 |
commit | 70c417174d8f42ca8613a1f9a53b2cdc85a4a3c4 (patch) | |
tree | 192af2f55aa7ecf007e1f051d32d32356b94e75a /techlibs/ice40/synth_ice40.cc | |
parent | 47c89d600c11aee97e325351d295781169d62978 (diff) | |
parent | 3e5ab50a73ec05badee2a8808cc0953a34dc9ae2 (diff) | |
download | yosys-70c417174d8f42ca8613a1f9a53b2cdc85a4a3c4.tar.gz yosys-70c417174d8f42ca8613a1f9a53b2cdc85a4a3c4.tar.bz2 yosys-70c417174d8f42ca8613a1f9a53b2cdc85a4a3c4.zip |
Merge pull request #702 from smunaut/min_ce_use
Add option to only use DFFE is the resulting E signal would be use > N times
Diffstat (limited to 'techlibs/ice40/synth_ice40.cc')
-rw-r--r-- | techlibs/ice40/synth_ice40.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index b0687e5e3..93965a55d 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -69,6 +69,10 @@ struct SynthIce40Pass : public ScriptPass log(" -nodffe\n"); log(" do not use SB_DFFE* cells in output netlist\n"); log("\n"); + log(" -dffe_min_ce_use <min_ce_use>\n"); + log(" do not use SB_DFFE* cells if the resulting CE line would go to less\n"); + log(" than min_ce_use SB_DFFE*in output netlist\n"); + log("\n"); log(" -nobram\n"); log(" do not use SB_RAM40_4K* cells in output netlist\n"); log("\n"); @@ -87,6 +91,7 @@ struct SynthIce40Pass : public ScriptPass string top_opt, blif_file, edif_file, json_file; bool nocarry, nodffe, nobram, flatten, retime, abc2, vpr; + int min_ce_use; void clear_flags() YS_OVERRIDE { @@ -96,6 +101,7 @@ struct SynthIce40Pass : public ScriptPass json_file = ""; nocarry = false; nodffe = false; + min_ce_use = -1; nobram = false; flatten = true; retime = false; @@ -155,6 +161,10 @@ struct SynthIce40Pass : public ScriptPass nodffe = true; continue; } + if (args[argidx] == "-dffe_min_ce_use" && argidx+1 < args.size()) { + min_ce_use = std::stoi(args[++argidx]); + continue; + } if (args[argidx] == "-nobram") { nobram = true; continue; @@ -228,6 +238,10 @@ struct SynthIce40Pass : public ScriptPass run("dffsr2dff"); if (!nodffe) run("dff2dffe -direct-match $_DFF_*"); + if (min_ce_use >= 0) { + run("opt_merge"); + run(stringf("dff2dffe -unmap-mince %d", min_ce_use)); + } run("techmap -D NO_LUT -map +/ice40/cells_map.v"); run("opt_expr -mux_undef"); run("simplemap"); |