mistral: Fix MLAB clustering

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2021-10-11 20:12:08 +01:00
parent dd2c5942a4
commit 15c10796bd
2 changed files with 9 additions and 2 deletions

View File

@ -492,6 +492,12 @@ void Arch::update_alm_input_count(uint32_t lab, uint8_t alm)
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
if (!luts[i]) if (!luts[i])
continue; continue;
// MLAB that has been clustered with other MLABs (due to shared read port) costs no extra inputs
if (luts[i]->combInfo.mlab_group != -1 && luts[i]->constr_z > 2) {
alm_data.unique_input_count = 0;
return;
}
total_lut_inputs += luts[i]->combInfo.used_lut_input_count - luts[i]->combInfo.chain_shared_input_count; total_lut_inputs += luts[i]->combInfo.used_lut_input_count - luts[i]->combInfo.chain_shared_input_count;
} }
int shared_lut_inputs = 0; int shared_lut_inputs = 0;

View File

@ -367,8 +367,9 @@ struct MistralPacker
CellInfo *ci = group.at(i); CellInfo *ci = group.at(i);
CellInfo *base = group.at((i / cluster_size) * cluster_size); CellInfo *base = group.at((i / cluster_size) * cluster_size);
int cell_index = int(i) % cluster_size; int cell_index = int(i) % cluster_size;
int alm = i / 2; int alm = cell_index / 2;
int alm_cell = i % 2; int alm_cell = cell_index % 2;
ci->cluster = base->name;
ci->constr_abs_z = true; ci->constr_abs_z = true;
ci->constr_z = alm * 6 + alm_cell; ci->constr_z = alm * 6 + alm_cell;
if (cell_index != 0) { if (cell_index != 0) {