VERILOG2131: A case item with a known value that makes it impossible to ever match the case condition (or vice versa) should be fixed
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 10min | synthesis, vscode, simulation, linter |
Description
Noncompliant code example
module m;
logic [2:0] a;
initial begin
case (a)
4'b1000: ; // Noncompliant
3'b111: ; // Compliant
endcase
end
endmodule
Compliant solution
module m;
logic [2:0] a;
initial begin
case (a)
3'b100: ; // Compliant
3'b111: ; // Compliant
endcase
end
endmodule
A case item has a known value that makes it impossible to ever match the case condition (or vice versa).
Parameters
No parameters.