diff options
author | Pepijn de Vos <pepijndevos@gmail.com> | 2021-11-06 16:09:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-06 16:09:30 +0100 |
commit | 0c7461fe5e7ff8deacf4a16fa0e67e6666a17441 (patch) | |
tree | b367bdcf186bbe7fda694c38eb7640ff31637c00 | |
parent | 8f08908d8debd467c0c8c7c28ba37b2296355fcf (diff) | |
download | yosys-0c7461fe5e7ff8deacf4a16fa0e67e6666a17441.tar.gz yosys-0c7461fe5e7ff8deacf4a16fa0e67e6666a17441.tar.bz2 yosys-0c7461fe5e7ff8deacf4a16fa0e67e6666a17441.zip |
gowin: widelut support (#3042)
-rw-r--r-- | passes/opt/opt_lut_ins.cc | 10 | ||||
-rw-r--r-- | techlibs/gowin/synth_gowin.cc | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/passes/opt/opt_lut_ins.cc b/passes/opt/opt_lut_ins.cc index 99043ef7e..2f7c392b2 100644 --- a/passes/opt/opt_lut_ins.cc +++ b/passes/opt/opt_lut_ins.cc @@ -193,6 +193,12 @@ struct OptLutInsPass : public Pass { swz += extra; } } + if (techname == "gowin") { + // Pad the LUT to 1 input, adding consts from the front. + if (new_inputs.empty()) { + new_inputs.insert(new_inputs.begin(), State::S0); + } + } Const new_lut(0, 1 << GetSize(new_inputs)); for (int i = 0; i < GetSize(new_lut); i++) { int lidx = 0; @@ -209,9 +215,9 @@ struct OptLutInsPass : public Pass { } new_lut[i] = lut[lidx]; } - // For ecp5, do not replace with a const driver — the nextpnr + // For ecp5, and gowin do not replace with a const driver — the nextpnr // packer requires a complete set of LUTs for wide LUT muxes. - if (new_inputs.empty() && techname != "ecp5") { + if (new_inputs.empty() && techname != "ecp5" && techname != "gowin") { // const driver. remove_cells.push_back(cell); module->connect(output, new_lut[0]); diff --git a/techlibs/gowin/synth_gowin.cc b/techlibs/gowin/synth_gowin.cc index 087f6b8cf..f35a7af4d 100644 --- a/techlibs/gowin/synth_gowin.cc +++ b/techlibs/gowin/synth_gowin.cc @@ -126,7 +126,6 @@ struct SynthGowinPass : public ScriptPass json_file = args[++argidx]; nobram = true; nolutram = true; - nowidelut = true; noalu = true; continue; } |