aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/ice40
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2018-12-05 05:24:15 +0000
committerwhitequark <whitequark@whitequark.org>2018-12-05 17:13:46 +0000
commitd9fa4387c97745c558acdd8ea7f436917302796e (patch)
treec24ccc8fabbe0dbf74f00278900b866d7e6e0b32 /techlibs/ice40
parent9ef078848a5b121336b83043c565ce47433eb2d8 (diff)
downloadyosys-d9fa4387c97745c558acdd8ea7f436917302796e.tar.gz
yosys-d9fa4387c97745c558acdd8ea7f436917302796e.tar.bz2
yosys-d9fa4387c97745c558acdd8ea7f436917302796e.zip
synth_ice40: add -noabc option, to use built-in LUT techmapping.
This should be combined with -relut to get sensible results.
Diffstat (limited to 'techlibs/ice40')
-rw-r--r--techlibs/ice40/synth_ice40.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc
index cc4627cd3..931a190e7 100644
--- a/techlibs/ice40/synth_ice40.cc
+++ b/techlibs/ice40/synth_ice40.cc
@@ -79,6 +79,9 @@ struct SynthIce40Pass : public ScriptPass
log(" -nobram\n");
log(" do not use SB_RAM40_4K* cells in output netlist\n");
log("\n");
+ log(" -noabc\n");
+ log(" use built-in Yosys LUT techmapping instead of abc\n");
+ log("\n");
log(" -abc2\n");
log(" run two passes of 'abc' for slightly improved logic density\n");
log("\n");
@@ -93,7 +96,7 @@ struct SynthIce40Pass : public ScriptPass
}
string top_opt, blif_file, edif_file, json_file;
- bool nocarry, nodffe, nobram, flatten, retime, relut, abc2, vpr;
+ bool nocarry, nodffe, nobram, flatten, retime, relut, noabc, abc2, vpr;
int min_ce_use;
void clear_flags() YS_OVERRIDE
@@ -109,6 +112,7 @@ struct SynthIce40Pass : public ScriptPass
flatten = true;
retime = false;
relut = false;
+ noabc = false;
abc2 = false;
vpr = false;
}
@@ -177,6 +181,10 @@ struct SynthIce40Pass : public ScriptPass
nobram = true;
continue;
}
+ if (args[argidx] == "-noabc") {
+ noabc = true;
+ continue;
+ }
if (args[argidx] == "-abc2") {
abc2 = true;
continue;
@@ -265,7 +273,13 @@ struct SynthIce40Pass : public ScriptPass
run("ice40_opt", "(only if -abc2)");
}
run("techmap -map +/ice40/latches_map.v");
- run("abc -lut 4");
+ if (noabc || help_mode) {
+ run("simplemap", " (only if -noabc)");
+ run("techmap -map +/gate2lut.v -D LUT_WIDTH=4", "(only if -noabc)");
+ }
+ if (!noabc) {
+ run("abc -lut 4", "(skip if -noabc)");
+ }
run("clean");
if (relut || help_mode) {
run("ice40_unlut", " (only if -relut)");