VERILOG2064: Implicit conversions from integer to boolean value should be reviewed

Summary

Count: 1

ReliabilitySecurityMaintainabilityCode attributeEffort to fixTags
HIGH--Intentionality | Logical10minsynthesis, 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.