mirror of https://github.com/YosysHQ/nextpnr.git
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:
parent
64db93e319
commit
dfef396dec
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===================================
|
// ===================================
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue