VERILOG023: “default” case item should include a colon
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| - | - | LOW | Consistency | Conventional | 2min | synthesis, readability, vscode, linter, lowrisc, simulation |
Description
Noncompliant code example
unique case (my_state)
StInit: $display("Shall we begin");
StError: $display("Oh boy this is Bad");
default begin // Noncompliant: No ":"
my_state = StInit;
interrupt = 1;
end
endcase
Compliant solution
unique case (my_state)
StInit: $display("Shall we begin");
StError: $display("Oh boy this is Bad");
default: begin
my_state = StInit;
interrupt = 1;
end
endcase
To improve readability, a default case item should include a colon.
Articles & blog posts
Parameters
No parameters.