ecp5: Improve packer robustness to FF dangling M input

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2023-09-01 14:54:27 +02:00 committed by myrtle
parent a9a9251e42
commit 79c6840fef

View File

@ -234,6 +234,12 @@ class Ecp5Packer
CellInfo *ci = cell.second.get();
if (is_ff(ctx, ci)) {
NetInfo *di = ci->getPort(id_DI);
NetInfo *m = ci->getPort(id_M);
if (ci->ports.count(id_M) && (!m || !m->driver.cell)) {
// M input is floating. Remove it, so renamePort doesn't hit trouble
ci->disconnectPort(id_M);
ci->ports.erase(id_M);
}
if (di->driver.cell != nullptr && di->driver.cell->type == id_TRELLIS_COMB && di->driver.port == id_F) {
CellInfo *comb = di->driver.cell;
if (comb->cluster != ClusterId()) {