Files
lucisv/crates/vlog_linter/tests/cases/case_missing_default.lint
T
lucioandClaude Fable 5 f1db1e5746 Add dv-statements: with clauses, foreach targets, randcase, let, labels
randomize()/std::randomize() with { ... } (block verbatim), array-method
with (expr), foreach over scoped/hierarchical/indexed arrays, randcase,
wait fork, import as a statement, let declarations, empty call arguments,
general statement labels, and endtask: name; (stray semicolon kept).
Also fixes a pre-existing verification failure for a comment between a
then-branch and its else.

Coverage loop round 1, cluster 8: 772 -> 796 / 820 (94.1% -> 97.1%).
Feature README: docs/features/dv-statements/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 01:19:49 -07:00

62 lines
1012 B
Plaintext

# a case without a default is flagged
module m;
always_comb begin
case (s)
//^ 5 case-missing-default
0: x = 1;
endcase
end
endmodule
====
# a default arm satisfies the rule
module m;
always_comb begin
case (s)
0: x = 1;
default: x = 0;
endcase
end
endmodule
====
# a unique case with a default is quiet too
module m;
always_comb begin
unique case (s)
0: x = 1;
default: x = 0;
endcase
end
endmodule
====
# waived from the line above
module m;
always_comb begin
// vfmt: waive case-missing-default
case (s)
0: x = 1;
endcase
end
endmodule
====
# a waiver that waives nothing is reported
module m;
always_comb begin
case (s)
0: x = 1;
default: x = 0;
endcase // vfmt: waive case-missing-default
//^ 13 unused-waiver
end
endmodule
====
# a randcase has no default arm to demand: the rule leaves it alone
class c;
task t();
randcase
1: x = 0;
5: x = 1;
endcase
endtask
endclass