VERILOG2064: Implicit conversions from integer to boolean value should be reviewed
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 10min | synthesis, vscode, linter, simulation |
Description
A multi-bit integer value is implicitly converted to a boolean predicate (such as in an if statement or
loop condition).
This is not necessarily wrong but can indicate mistakes where you intended to compare the value to something.
Noncompliant code example
module fly; int i; initial if (i + 2) begin end endmodule
Compliant solution
module fly; int i; initial if (i + 2 != 0) begin end endmodule
Parameters
No parameters.