Fix assert on wide expression (#5319) (#5324)

This commit is contained in:
Varun Koyyalagunta
2024-08-06 01:45:57 -04:00
committed by GitHub
parent f4cb2c8cf2
commit 31c1df638b
3 changed files with 356 additions and 3 deletions
+5 -3
View File
@@ -420,11 +420,13 @@ class AssertVisitor final : public VNVisitor {
// else $error("multiple match");
// end
AstNodeExpr* const ohot = new AstOneHot{nodep->fileline(), propp};
AstConst* const zero = new AstConst{
nodep->fileline(), AstConst::WidthedValue{}, propp->width(), 0};
AstIf* const ohotIfp
= new AstIf{nodep->fileline(), new AstLogNot{nodep->fileline(), ohot}};
AstIf* const zeroIfp
= new AstIf{nodep->fileline(),
new AstLogNot{nodep->fileline(), propp->cloneTreePure(false)}};
AstIf* const zeroIfp = new AstIf{
nodep->fileline(),
new AstEq{nodep->fileline(), propp->cloneTreePure(false), zero}};
AstNodeExpr* const exprp = nodep->exprp();
const string pragmaStr = nodep->pragmaString();
if (!allow_none)