mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-11 13:40:53 +00:00
gatemate: Add LUT tree library script
Co-authored-by: Claire Xenia Wolf <claire@clairexen.net> Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
parent
7c756c9959
commit
38a24ec5cc
6 changed files with 591 additions and 6 deletions
|
@ -67,7 +67,10 @@ struct SynthGateMatePass : public ScriptPass
|
|||
log("\n");
|
||||
log(" -nomx8, -nomx4\n");
|
||||
log(" do not use CC_MX{8,4} multiplexer cells in output netlist.\n");
|
||||
log("\n");;
|
||||
log("\n");
|
||||
log(" -luttree\n");
|
||||
log(" use new LUT tree mapping approach (EXPERIMENTAL).\n");
|
||||
log("\n");
|
||||
log(" -dff\n");
|
||||
log(" run 'abc' with -dff option\n");
|
||||
log("\n");
|
||||
|
@ -87,7 +90,7 @@ struct SynthGateMatePass : public ScriptPass
|
|||
}
|
||||
|
||||
string top_opt, vlog_file, json_file;
|
||||
bool noflatten, nobram, noaddf, nomult, nomx4, nomx8, dff, retime, noiopad, noclkbuf;
|
||||
bool noflatten, nobram, noaddf, nomult, nomx4, nomx8, luttree, dff, retime, noiopad, noclkbuf;
|
||||
|
||||
void clear_flags() override
|
||||
{
|
||||
|
@ -100,6 +103,7 @@ struct SynthGateMatePass : public ScriptPass
|
|||
nomult = false;
|
||||
nomx4 = false;
|
||||
nomx8 = false;
|
||||
luttree = false;
|
||||
dff = false;
|
||||
retime = false;
|
||||
noiopad = false;
|
||||
|
@ -158,6 +162,10 @@ struct SynthGateMatePass : public ScriptPass
|
|||
nomx8 = true;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-luttree") {
|
||||
luttree = true;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-dff") {
|
||||
dff = true;
|
||||
continue;
|
||||
|
@ -298,11 +306,23 @@ struct SynthGateMatePass : public ScriptPass
|
|||
|
||||
if (check_label("map_luts"))
|
||||
{
|
||||
std::string abc_args = " -dress -lut 4";
|
||||
if (dff) {
|
||||
abc_args += " -dff";
|
||||
if (luttree || help_mode) {
|
||||
std::string abc_args = " -genlib +/gatemate/lut_tree_cells.genlib";
|
||||
if (dff) {
|
||||
abc_args += " -dff";
|
||||
}
|
||||
run("abc " + abc_args, "(with -luttree)");
|
||||
run("techmap -map +/gatemate/lut_tree_map.v", "(with -luttree)");
|
||||
run("gatemate_foldinv", "(with -luttree)");
|
||||
run("techmap -map +/gatemate/inv_map.v", "(with -luttree)");
|
||||
}
|
||||
if (!luttree || help_mode) {
|
||||
std::string abc_args = " -dress -lut 4";
|
||||
if (dff) {
|
||||
abc_args += " -dff";
|
||||
}
|
||||
run("abc " + abc_args, "(without -luttree)");
|
||||
}
|
||||
run("abc " + abc_args);
|
||||
run("clean");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue