Do not fold IF with 'bx condition before V3Unknown (#2438)

Fixes #2425
This commit is contained in:
Geza Lore
2020-06-20 04:16:07 +01:00
committed by GitHub
parent fa828ac9ba
commit aa595d40de
7 changed files with 177 additions and 1 deletions
+4 -1
View File
@@ -1935,9 +1935,12 @@ private:
if (constp->isZero()) {
UINFO(4, "IF(0,{any},{x}) => {x}: " << nodep << endl);
keepp = nodep->elsesp();
} else {
} else if (!m_doV || constp->isNeqZero()) { // Might be X in Verilog
UINFO(4, "IF(!0,{x},{any}) => {x}: " << nodep << endl);
keepp = nodep->ifsp();
} else {
UINFO(4, "IF condition is X, retaining: " << nodep << endl);
return;
}
if (keepp) {
keepp->unlinkFrBackWithNext();