VERILOG2145: Duplicated items in case statement should be removed
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 10min | synthesis, vscode, simulation, linter |
Description
A case statement contains more than one item with the same value. Case items are evaluated and selected in order and so the second one will never be matched.
Noncompliant code example
module fly;
int i;
initial begin
case (i)
1, 2:;
3, 1:;
default;
endcase
end
endmodule
Compliant solution
module fly;
int i;
initial begin
case (i)
1, 2:;
3:;
default;
endcase
end
endmodule
Parameters
No parameters.