diff options
Diffstat (limited to 'ecp5/pack.cc')
-rw-r--r-- | ecp5/pack.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc index a6f31656..0c95b66c 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -1522,6 +1522,10 @@ class Ecp5Packer // Check if two nets have identical constant drivers bool equal_constant(NetInfo *a, NetInfo *b) { + if (a == nullptr && b == nullptr) + return true; + if ((a == nullptr) != (b == nullptr)) + return false; if (a->driver.cell == nullptr || b->driver.cell == nullptr) return (a->driver.cell == nullptr && b->driver.cell == nullptr); if (a->driver.cell->type != id_GND && a->driver.cell->type != id_VCC) @@ -2251,7 +2255,8 @@ class Ecp5Packer iol->params[id_CEMUX] = str_or_default(ci->params, id_CEMUX, "CE"); ci->movePortTo(id_CE, iol, id_CE); } else { - if (iol->getPort(id_CE) != ci->getPort(id_CE) || + if ((iol->getPort(id_CE) != ci->getPort(id_CE) && + !equal_constant(iol->getPort(id_CE), ci->getPort(id_CE))) || str_or_default(ci->params, id_CEMUX, "CE") != str_or_default(iol->params, id_CEMUX, "CE")) log_error("CE signal or polarity mismatch for IO flipflop %s with other IOFFs at " @@ -2317,7 +2322,8 @@ class Ecp5Packer iol->params[id_CEMUX] = str_or_default(ci->params, id_CEMUX, "CE"); ci->movePortTo(id_CE, iol, id_CE); } else { - if (iol->getPort(id_CE) != ci->getPort(id_CE) || + if ((iol->getPort(id_CE) != ci->getPort(id_CE) && + !equal_constant(iol->getPort(id_CE), ci->getPort(id_CE))) || str_or_default(ci->params, id_CEMUX, "CE") != str_or_default(iol->params, id_CEMUX, "CE")) log_error("CE signal or polarity mismatch for IO flipflop %s with other IOFFs at " |