Gowin. Delete unused OBUFs. (#1581)

Paired with
https://github.com/YosysHQ/yosys/commit/653599500532fb7285bb0ce6d63369f7eb4dc079

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

Signed-off-by: YRabbit <[email protected]>
This commit is contained in:
YRabbit
2025-10-17 14:16:52 +02:00
committed by GitHub
parent 64db93e319
commit dfef396dec
+12
View File
@@ -183,12 +183,20 @@ struct GowinPacker
{ {
log_info("Pack IOBs...\n"); log_info("Pack IOBs...\n");
trim_nextpnr_iobs(); trim_nextpnr_iobs();
std::vector<IdString> cells_to_remove;
for (auto &cell : ctx->cells) { for (auto &cell : ctx->cells) {
CellInfo &ci = *cell.second; CellInfo &ci = *cell.second;
if (!is_io(&ci)) { if (!is_io(&ci)) {
continue; 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) { if (ci.attrs.count(id_BEL) == 0) {
log_error("Unconstrained IO:%s\n", ctx->nameOf(&ci)); log_error("Unconstrained IO:%s\n", ctx->nameOf(&ci));
} }
@@ -202,6 +210,10 @@ struct GowinPacker
} }
make_iob_nets(ci); make_iob_nets(ci);
} }
for (auto cell : cells_to_remove) {
ctx->cells.erase(cell);
}
} }
// =================================== // ===================================