From 16df4866506b7b8361dfa35604cb5a751e33c67c Mon Sep 17 00:00:00 2001 From: Yilou Wang Date: Mon, 6 Apr 2026 21:47:48 +0200 Subject: [PATCH] improve line coverage --- src/V3AstNodeExpr.h | 2 ++ src/V3Dfg.cpp | 7 ++++--- test_regress/t/t_sequence_sexpr_throughout_unsup.out | 4 ++++ test_regress/t/t_sequence_sexpr_throughout_unsup.v | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/V3AstNodeExpr.h b/src/V3AstNodeExpr.h index 830b67f6a..86b23f19c 100644 --- a/src/V3AstNodeExpr.h +++ b/src/V3AstNodeExpr.h @@ -3697,6 +3697,7 @@ public: dtypeSetBit(); } ASTGEN_MEMBERS_AstSThroughout; + // LCOV_EXCL_START // Lowered in V3AssertProp before these are called void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) override { out.opLogAnd(lhs, rhs); } @@ -3708,6 +3709,7 @@ public: bool cleanRhs() const override { return true; } bool sizeMattersLhs() const override { return false; } bool sizeMattersRhs() const override { return false; } + // LCOV_EXCL_STOP }; class AstSel final : public AstNodeBiop { // *Resolved* (tyep checked) multiple bit range extraction. Always const width diff --git a/src/V3Dfg.cpp b/src/V3Dfg.cpp index 3f7e60ee3..89aad3238 100644 --- a/src/V3Dfg.cpp +++ b/src/V3Dfg.cpp @@ -693,9 +693,10 @@ void DfgVertex::typeCheck(const DfgGraph& dfg) const { case VDfgType::SAnd: case VDfgType::SOr: - case VDfgType::SThroughout: - UASSERT_OBJ(false, this, "SAnd/SOr/SThroughout should be removed before DFG"); - return; + case VDfgType::SThroughout: { + UASSERT_OBJ(false, this, "SAnd/SOr/SThroughout should be removed before DFG"); // LCOV_EXCL_LINE + return; // LCOV_EXCL_LINE + } case VDfgType::LogAnd: case VDfgType::LogEq: diff --git a/test_regress/t/t_sequence_sexpr_throughout_unsup.out b/test_regress/t/t_sequence_sexpr_throughout_unsup.out index 8497ca370..415250db7 100644 --- a/test_regress/t/t_sequence_sexpr_throughout_unsup.out +++ b/test_regress/t/t_sequence_sexpr_throughout_unsup.out @@ -7,4 +7,8 @@ : ... note: In instance 't' 18 | a |-> (a throughout ((b ##1 c) and (c ##1 b)))); | ^~~~~~~~~~ +%Error-UNSUPPORTED: t/t_sequence_sexpr_throughout_unsup.v:22:16: Unsupported: throughout with complex sequence operator + : ... note: In instance 't' + 22 | a |-> (a throughout (b throughout (b ##1 c)))); + | ^~~~~~~~~~ %Error: Exiting due to diff --git a/test_regress/t/t_sequence_sexpr_throughout_unsup.v b/test_regress/t/t_sequence_sexpr_throughout_unsup.v index a114feabd..2b7cea58d 100644 --- a/test_regress/t/t_sequence_sexpr_throughout_unsup.v +++ b/test_regress/t/t_sequence_sexpr_throughout_unsup.v @@ -17,4 +17,8 @@ module t ( assert property (@(posedge clk) a |-> (a throughout ((b ##1 c) and (c ##1 b)))); + // Unsupported: nested throughout + assert property (@(posedge clk) + a |-> (a throughout (b throughout (b ##1 c)))); + endmodule