opt_ffinv: Harden against simple ff/inv loop.

This commit is contained in:
Marcelina Kościelnicka
2022-06-07 08:20:06 +02:00
parent 9e8a2ac051
commit d07828b409
+4
View File
@@ -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_))) {