From a34bfa362972b5b30461c99ff545ee1ce69c483a Mon Sep 17 00:00:00 2001 From: Varun Koyyalagunta Date: Mon, 5 Aug 2024 19:53:26 -0500 Subject: [PATCH] fix: case uniqueness checking fixes #5319 incorporate feedback from https://github.com/verilator/verilator/pull/5324 --- src/V3Assert.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/V3Assert.cpp b/src/V3Assert.cpp index dff5f0f2d9..be16736b47 100644 --- a/src/V3Assert.cpp +++ b/src/V3Assert.cpp @@ -360,11 +360,12 @@ 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)}}; + new AstEq{nodep->fileline(), propp->cloneTreePure(false), zero}}; AstNodeExpr* const exprp = nodep->exprp(); const string pragmaStr = nodep->pragmaString(); if (!allow_none)