gatemate: fix OUT3/GPIO_EN inversion

This commit is contained in:
Patrick Urban 2026-05-11 23:32:01 +02:00 committed by myrtle
parent 8b7dbbedd1
commit 2669f0d932
1 changed files with 5 additions and 2 deletions

View File

@ -602,8 +602,11 @@ void GateMatePacker::pack_io_sel()
Loc root_loc = ctx->getBelLocation(ci.bel);
for (int i = 0; i < 4; i++) {
CellInfo *cpe = move_ram_o_fixed(&ci, ctx->idf("OUT%d", i + 1), root_loc).first;
if (cpe && is_inverted[i])
cpe->params[id_INIT_L10] = Property(LUT_INV_D0, 4);
if (cpe && is_inverted[i]) {
uint8_t existing = int_or_default(cpe->params, id_INIT_L10, 0);
uint8_t inverted = (existing ^ 0xF);
cpe->params[id_INIT_L10] = Property(inverted, 4);
}
}
}
flush_cells();