3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-23 16:04:37 +00:00

synth_gowin: ABC9 support

This adds ABC9 support for synth_gowin; drastically improving
synthesis quality.
This commit is contained in:
Dan Ravensloft 2020-04-01 01:07:30 +01:00 committed by Marcelina Kościelnicka
parent 0d4c2f0a65
commit 7f45cab27a
3 changed files with 345 additions and 35 deletions

View file

@ -69,9 +69,9 @@ struct SynthGowinPass : public ScriptPass
log("\n");
log(" -noiopads\n");
log(" do not emit IOB at top level ports\n");
//log("\n");
//log(" -abc9\n");
//log(" use new ABC9 flow (EXPERIMENTAL)\n");
log("\n");
log(" -abc9\n");
log(" use new ABC9 flow (EXPERIMENTAL)\n");
log("\n");
log("\n");
log("The following commands are executed by this synthesis command:\n");
@ -144,10 +144,10 @@ struct SynthGowinPass : public ScriptPass
nowidelut = true;
continue;
}
//if (args[argidx] == "-abc9") {
// abc9 = true;
// continue;
//}
if (args[argidx] == "-abc9") {
abc9 = true;
continue;
}
if (args[argidx] == "-noiopads") {
noiopads = true;
continue;
@ -171,7 +171,7 @@ struct SynthGowinPass : public ScriptPass
{
if (check_label("begin"))
{
run("read_verilog -lib +/gowin/cells_sim.v");
run("read_verilog -specify -lib +/gowin/cells_sim.v");
run(stringf("hierarchy -check %s", help_mode ? "-top <top>" : top_opt.c_str()));
}
@ -230,13 +230,15 @@ struct SynthGowinPass : public ScriptPass
if (check_label("map_luts"))
{
/*if (nowidelut && abc9) {
run("abc9 -lut 4");
} else*/ if (nowidelut && !abc9) {
if (nowidelut && abc9) {
run("read_verilog -icells -lib -specify +/abc9_model.v");
run("abc9 -maxlut 4 -W 500");
} else if (nowidelut && !abc9) {
run("abc -lut 4");
} else /*if (!nowidelut && abc9) {
run("abc9 -lut 4:8");
} else*/ if (!nowidelut && !abc9) {
} else if (!nowidelut && abc9) {
run("read_verilog -icells -lib -specify +/abc9_model.v");
run("abc9 -maxlut 8 -W 500");
} else if (!nowidelut && !abc9) {
run("abc -lut 4:8");
}
run("clean");
@ -252,6 +254,7 @@ struct SynthGowinPass : public ScriptPass
run("iopadmap -bits -inpad IBUF O:I -outpad OBUF I:O "
"-toutpad TBUF OEN:I:O -tinoutpad IOBUF OEN:O:I:IO", "(unless -noiopads)");
run("clean");
run("autoname");
}
if (check_label("check"))