diff --git a/scripts/diagnostics.txt b/scripts/diagnostics.txt index 589ab0cf2..6b364120a 100644 --- a/scripts/diagnostics.txt +++ b/scripts/diagnostics.txt @@ -861,8 +861,6 @@ note NoteExpandedHere "expanded here" note SeqAdmitsEmptyMatches "sequence property admits empty matches" note SeqAdmitsNoMatches "sequence property can never be matched" note SeqAcceptsOnlyEmptyMatches "sequence property admits only empty matches" -note SeqPropCondAlwaysFalse "condition is always false" -note DisableIffCondAlwaysTrue "disable iff condition is always true" subsystem Types error InvalidEnumBase "invalid enum base type {} (must be a single dimensional integer type)" diff --git a/source/ast/expressions/AssertionExpr.cpp b/source/ast/expressions/AssertionExpr.cpp index f98a68e14..497ea57cb 100644 --- a/source/ast/expressions/AssertionExpr.cpp +++ b/source/ast/expressions/AssertionExpr.cpp @@ -1345,14 +1345,6 @@ AssertionExpr& ConditionalAssertionExpr::fromSyntax(const ConditionalPropertyExp if (syntax.elseClause) elseExpr = &bind(*syntax.elseClause->expr, context); - // If condition is a constant false value then there is never a match. - if (!elseExpr) { - if (context.tryEval(cond).isFalse()) { - auto& diag = context.addDiag(diag::SeqPropNondegenerate, syntax.sourceRange()); - diag.addNote(diag::SeqPropCondAlwaysFalse, cond.sourceRange); - } - } - return *comp.emplace(cond, ifExpr, elseExpr); } @@ -1424,12 +1416,6 @@ AssertionExpr& DisableIffAssertionExpr::fromSyntax(const DisableIffSyntax& synta checkSampledValueExpr(cond, context, false, diag::DisableIffLocalVar, diag::DisableIffMatched); - // If condition is always true then there's never a match. - if (context.tryEval(cond).isTrue()) { - auto& diag = context.addDiag(diag::SeqPropNondegenerate, syntax.sourceRange()); - diag.addNote(diag::DisableIffCondAlwaysTrue, cond.sourceRange); - } - if (context.assertionInstance && context.assertionInstance->isRecursive) context.addDiag(diag::RecursivePropDisableIff, syntax.sourceRange()); diff --git a/tests/unittests/ast/AssertionTests.cpp b/tests/unittests/ast/AssertionTests.cpp index 170a1d7f2..0094f1e38 100644 --- a/tests/unittests/ast/AssertionTests.cpp +++ b/tests/unittests/ast/AssertionTests.cpp @@ -2382,7 +2382,9 @@ endmodule } else if (diags.size() != 1 || diags[0].code != code) { FAIL_CHECK(expr); - CHECK(diags[0].code == *code); + CHECK(diags.size() == 1); + if (diags.size() == 1) + CHECK(diags[0].code == *code); } }; @@ -2430,7 +2432,9 @@ endmodule } else if (diags.size() != 1 || diags[0].code != code) { FAIL_CHECK(expr); - CHECK(diags[0].code == *code); + CHECK(diags.size() == 1); + if (diags.size() == 1) + CHECK(diags[0].code == *code); } }; @@ -2508,7 +2512,6 @@ endmodule test("if (b) a ##1 c else d ##1 e"); test("if (1'b0) a ##1 c else d ##1 e"); - test("if (1'b0) a ##1 c", diag::SeqPropNondegenerate); test("if (1'b1) a ##1 c else d ##1 e"); test("if (a) b intersect ##2 b", diag::SeqPropNondegenerate); test("if (a) ##2 b intersect ##2 b"); @@ -2516,7 +2519,6 @@ endmodule test("case (b) 1, 2, 3: 1 ##1 b; 4: a and b; default: 1[*0] |-> b; endcase", diag::OverlapImplNondegenerate); test("disable iff (clk) a"); - test("disable iff (1'b1) a", diag::SeqPropNondegenerate); } TEST_CASE("Sequence nondegeneracy tests 3") { @@ -2543,7 +2545,9 @@ endmodule } else if (diags.size() != 1 || diags[0].code != code) { FAIL_CHECK(expr); - CHECK(diags[0].code == *code); + CHECK(diags.size() == 1); + if (diags.size() == 1) + CHECK(diags[0].code == *code); } };