From: Marcelina Koƛcielnicka Date: Tue, 7 Jun 2022 02:26:25 +0000 (+0200) Subject: opt_ffinv: Harden against simple ff/inv loop. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d07828b40958c6c2a1d09cf13c9a307c75b855b4;p=yosys.git opt_ffinv: Harden against simple ff/inv loop. --- diff --git a/passes/opt/opt_ffinv.cc b/passes/opt/opt_ffinv.cc index fd76dd2be..fe5b59fa5 100644 --- a/passes/opt/opt_ffinv.cc +++ b/passes/opt/opt_ffinv.cc @@ -72,6 +72,8 @@ struct OptFfInvWorker for (auto &port: q_ports) { if (port.cell == ff.cell && port.port == ID::Q) continue; + if (port.cell == d_inv) + return false; if (port.port != ID::A) return false; if (!port.cell->type.in(ID($not), ID($_NOT_), ID($lut))) @@ -148,6 +150,8 @@ struct OptFfInvWorker for (auto &port: q_ports) { if (port.cell == ff.cell && port.port == ID::Q) continue; + if (port.cell == d_lut) + return false; if (port.port != ID::A) return false; if (port.cell->type.in(ID($not), ID($_NOT_))) {