opt_expr: with -keepdc disable equality optimization rules that break when ports are sigmapped

This commit is contained in:
Emil J. Tywoniak 2026-03-25 11:50:17 +01:00
parent 15fa0b77df
commit 8ae1d758e2
1 changed files with 7 additions and 2 deletions

View File

@ -1206,8 +1206,13 @@ skip_fine_alu:
replace_cell(assign_map, module, cell, "isneq", ID::Y, new_y);
goto next_cell;
}
if (a[i] == b[i])
continue;
if (keepdc) {
if (!a[i].is_wire() && !b[i].is_wire() && a[i].data != RTLIL::State::Sx && b[i].data != RTLIL::State::Sx && a[i] == b[i])
continue;
} else {
if (a[i] == b[i])
continue;
}
new_a.append(a[i]);
new_b.append(b[i]);
}