gowin: widelut support (#3042)

This commit is contained in:
Pepijn de Vos 2021-11-06 16:09:30 +01:00 committed by GitHub
parent 8f08908d8d
commit 0c7461fe5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -193,6 +193,12 @@ struct OptLutInsPass : public Pass {
swz += extra; 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)); Const new_lut(0, 1 << GetSize(new_inputs));
for (int i = 0; i < GetSize(new_lut); i++) { for (int i = 0; i < GetSize(new_lut); i++) {
int lidx = 0; int lidx = 0;
@ -209,9 +215,9 @@ struct OptLutInsPass : public Pass {
} }
new_lut[i] = lut[lidx]; 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. // 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. // const driver.
remove_cells.push_back(cell); remove_cells.push_back(cell);
module->connect(output, new_lut[0]); module->connect(output, new_lut[0]);

View File

@ -126,7 +126,6 @@ struct SynthGowinPass : public ScriptPass
json_file = args[++argidx]; json_file = args[++argidx];
nobram = true; nobram = true;
nolutram = true; nolutram = true;
nowidelut = true;
noalu = true; noalu = true;
continue; continue;
} }