synth_ice40: add -noabc option, to use built-in LUT techmapping.

This should be combined with -relut to get sensible results.
This commit is contained in:
whitequark 2018-12-05 05:24:15 +00:00
parent 9ef078848a
commit d9fa4387c9
1 changed files with 16 additions and 2 deletions

View File

@ -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)");