From 3a148d76338217de4409cf12f2bec4cec5d8537f Mon Sep 17 00:00:00 2001 From: Lofty Date: Mon, 10 Aug 2026 12:58:29 +0100 Subject: [PATCH] synth_gowin: remove classic ABC mapping --- techlibs/gowin/synth_gowin.cc | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/techlibs/gowin/synth_gowin.cc b/techlibs/gowin/synth_gowin.cc index d5ebdafea..aa8eec004 100644 --- a/techlibs/gowin/synth_gowin.cc +++ b/techlibs/gowin/synth_gowin.cc @@ -84,9 +84,6 @@ struct SynthGowinPass : public ScriptPass log(" -noflatten\n"); log(" do not flatten design before synthesis\n"); log("\n"); - log(" -retime\n"); - log(" run 'abc' with '-dff -D 1' options\n"); - log("\n"); log(" -nowidelut\n"); log(" do not use muxes to implement LUTs larger than LUT4s\n"); log("\n"); @@ -96,9 +93,6 @@ struct SynthGowinPass : public ScriptPass log(" -noalu\n"); log(" do not use ALU cells\n"); log("\n"); - log(" -noabc9\n"); - log(" disable use of new ABC9 flow\n"); - log("\n"); log(" -no-rw-check\n"); log(" marks all recognized read ports as \"return don't-care value on\n"); log(" read/write collision\" (same result as setting the no_rw_check\n"); @@ -121,7 +115,7 @@ struct SynthGowinPass : public ScriptPass } string top_opt, vout_file, json_file, family; - bool retime, nobram, nolutram, flatten, nodffe, strict_gw5a_dffs, nowidelut, abc9, noiopads, noalu, no_rw_check, setundef, nodsp; + bool nobram, nolutram, flatten, nodffe, strict_gw5a_dffs, nowidelut, noiopads, noalu, no_rw_check, setundef, nodsp; void clear_flags() override { @@ -129,14 +123,12 @@ struct SynthGowinPass : public ScriptPass top_opt = "-auto-top"; vout_file = ""; json_file = ""; - retime = false; flatten = true; nobram = false; nodffe = false; strict_gw5a_dffs = false; nolutram = false; nowidelut = false; - abc9 = true; noiopads = false; noalu = false; no_rw_check = false; @@ -177,7 +169,7 @@ struct SynthGowinPass : public ScriptPass continue; } if (args[argidx] == "-retime") { - retime = true; + // Removed: ABC9 does not support retiming. continue; } if (args[argidx] == "-nobram") { @@ -209,11 +201,11 @@ struct SynthGowinPass : public ScriptPass continue; } if (args[argidx] == "-abc9") { - // removed, ABC9 is on by default. + // Removed: ABC9 is on by default. continue; } if (args[argidx] == "-noabc9") { - abc9 = false; + // Removed: ABC9 can't be disabled. continue; } if (args[argidx] == "-noiopads") { @@ -330,8 +322,6 @@ struct SynthGowinPass : public ScriptPass run("techmap -map +/techmap.v -map +/gowin/arith_map.v"); } run("opt -fast"); - if (retime || help_mode) - run("abc -dff -D 1", "(only if -retime)"); if (!noiopads || help_mode) run("iopadmap -bits -inpad IBUF O:I -outpad OBUF I:O " "-toutpad TBUF ~OEN:I:O -tinoutpad IOBUF ~OEN:O:I:IO", "(unless -noiopads)"); @@ -361,16 +351,11 @@ struct SynthGowinPass : public ScriptPass if (check_label("map_luts")) { run("sort"); - if (nowidelut && abc9) { - run("read_verilog -icells -lib -specify +/abc9_model.v"); + run("read_verilog -icells -lib -specify +/abc9_model.v"); + if (nowidelut) { run("abc9 -maxlut 4 -W 500"); - } else if (nowidelut && !abc9) { - run("abc -lut 4"); - } else if (!nowidelut && abc9) { - run("read_verilog -icells -lib -specify +/abc9_model.v"); + } else if (!nowidelut) { run("abc9 -maxlut 8 -W 500"); - } else if (!nowidelut && !abc9) { - run("abc -lut 4:8"); } run("clean"); }