Gowin. Delete unused OBUFs. (#1581)

Paired with
6535995005

now that we may receive unattached OBUFs, we ignore them.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
This commit is contained in:
YRabbit 2025-10-17 22:16:52 +10:00 committed by GitHub
parent 64db93e319
commit dfef396dec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -183,12 +183,20 @@ struct GowinPacker
{
log_info("Pack IOBs...\n");
trim_nextpnr_iobs();
std::vector<IdString> cells_to_remove;
for (auto &cell : ctx->cells) {
CellInfo &ci = *cell.second;
if (!is_io(&ci)) {
continue;
}
// Special case of OBUF without input - we delete such things.
if (ci.type == id_OBUF && !ci.getPort(id_I)) {
ci.disconnectPort(id_O);
cells_to_remove.push_back(ci.name);
continue;
}
if (ci.attrs.count(id_BEL) == 0) {
log_error("Unconstrained IO:%s\n", ctx->nameOf(&ci));
}
@ -202,6 +210,10 @@ struct GowinPacker
}
make_iob_nets(ci);
}
for (auto cell : cells_to_remove) {
ctx->cells.erase(cell);
}
}
// ===================================