aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorMarcelina Koƛcielnicka <mwk@0x04.net>2022-06-07 04:26:25 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2022-06-07 08:20:06 +0200
commitd07828b40958c6c2a1d09cf13c9a307c75b855b4 (patch)
tree8e03fbddd17ae7070365bd27ccfcdc40430a414c /passes
parent9e8a2ac0511a59762306f75fc9c5267c25d23caf (diff)
downloadyosys-d07828b40958c6c2a1d09cf13c9a307c75b855b4.tar.gz
yosys-d07828b40958c6c2a1d09cf13c9a307c75b855b4.tar.bz2
yosys-d07828b40958c6c2a1d09cf13c9a307c75b855b4.zip
opt_ffinv: Harden against simple ff/inv loop.
Diffstat (limited to 'passes')
-rw-r--r--passes/opt/opt_ffinv.cc4
1 files changed, 4 insertions, 0 deletions
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_))) {