ecp5: Don't segfault while packing FFs when DI port of TRELLIS_FF unconnected

Currently a segfault happens when the DI port is not specified. Leaving
it unconnected is probably incorrect, but it shouldn't crash the placer.
Fix by adding a check.
This commit is contained in:
laanwj 2023-11-14 11:06:25 +01:00 committed by myrtle
parent a4d2244300
commit a32ad13a86

View File

@ -240,7 +240,7 @@ class Ecp5Packer
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) {
if (di && 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()) {
// Special procedure where the comb cell is part of an existing macro