3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-15 22:55:34 +00:00

Merge pull request #5844 from YosysHQ/lofty/abc-refactor-5

abc_new: integration testing via synth_gatemate
This commit is contained in:
Lofty 2026-05-06 13:40:15 +00:00 committed by GitHub
commit ab316c14d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 292 additions and 33 deletions

View file

@ -69,7 +69,8 @@ struct SynthGateMatePass : public ScriptPass
log(" do not use CC_MX{8,4} multiplexer cells in output netlist.\n");
log("\n");
log(" -luttree\n");
log(" use new LUT tree mapping approach (EXPERIMENTAL).\n");
log(" use LUT tree mapping for output to nextpnr. Do not use this if targeting\n");
log(" legacy p_r.\n");
log("\n");
log(" -dff\n");
log(" run 'abc' with -dff option\n");
@ -77,6 +78,9 @@ struct SynthGateMatePass : public ScriptPass
log(" -retime\n");
log(" run 'abc' with '-dff -D 1' options\n");
log("\n");
log(" -abc_new\n");
log(" use 'abc_new' instead of 'abc' for mapping. (EXPERIMENTAL)\n");
log("\n");
log(" -noiopad\n");
log(" disable I/O buffer insertion (useful for hierarchical or \n");
log(" out-of-context flows).\n");
@ -90,7 +94,7 @@ struct SynthGateMatePass : public ScriptPass
}
string top_opt, vlog_file, json_file;
bool noflatten, nobram, noaddf, nomult, nomx4, nomx8, luttree, dff, retime, noiopad, noclkbuf;
bool noflatten, nobram, noaddf, nomult, nomx4, nomx8, luttree, dff, retime, noiopad, noclkbuf, abc_new;
void clear_flags() override
{
@ -108,6 +112,7 @@ struct SynthGateMatePass : public ScriptPass
retime = false;
noiopad = false;
noclkbuf = false;
abc_new = false;
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
@ -182,6 +187,10 @@ struct SynthGateMatePass : public ScriptPass
noclkbuf = true;
continue;
}
if (args[argidx] == "-abc_new") {
abc_new = true;
continue;
}
break;
}
extra_args(args, argidx, design);
@ -313,7 +322,11 @@ struct SynthGateMatePass : public ScriptPass
if (dff) {
abc_args += " -dff";
}
run("abc " + abc_args, "(with -luttree)");
if (abc_new) {
run("abc_new " + abc_args, "(with -luttree and -abc_new)");
} else {
run("abc " + abc_args, "(with -luttree, without -abc_new)");
}
run("techmap -map +/gatemate/lut_tree_map.v", "(with -luttree)");
run("gatemate_foldinv", "(with -luttree)");
run("techmap -map +/gatemate/inv_map.v", "(with -luttree)");