Identifies a logical not operator used without parentheses around the operand, followed by a comparison operator. This can indicate a mistake in the intended order of operations.
module m;
int a, b, c, d;
initial begin
if (!a < b) begin end // Noncompliant
if (!c < d) begin end // Noncompliant
end
endmodule
module m;
int a, b, c, d;
initial begin
if (!(a < b)) begin end // Compliant: Parentheses after the '!' to evaluate the comparison first
if ((!c) < d)) begin end // Compliant: Parentheses around left hand side expression to silence this issue
end
endmodule