VERILOG2146: Overlapping items in case statement should be avoided
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 10min | synthesis, vscode, linter, simulation |
Description
A wildcard case statement contains overlapping items, which can be confusing since the overlapping value(s) will only ever match the first item in the list.
Noncompliant code example
module fly;
logic [3:0] a;
initial begin
casez (a)
4'b1011:;
4'b101?:;
default;
endcase
end
endmodule
Compliant solution
module fly;
logic [3:0] a;
initial begin
casez (a)
4'b1011:;
4'b111?:;
default;
endcase
end
endmodule
Parameters
No parameters.