From a32ad13a86a24013c1570f020de71bbb4df89180 Mon Sep 17 00:00:00 2001 From: laanwj <126646+laanwj@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:06:25 +0100 Subject: [PATCH] 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. --- ecp5/pack.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecp5/pack.cc b/ecp5/pack.cc index df139860..69d7ccf8 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -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