Identifies a bitwise operator used in a relational expression without parentheses, which can indicate a mistake in the intended order of operations.
module m;
int unsigned flag1, flag2;
initial begin
if (flag1 & 'h1 == 'h1) begin end // Noncompliant
if (flag2 & 'h1 == 'h1) begin end // Noncompliant
end
endmodule
module m;
int unsigned flag1, flag2;
initial begin
if ((flag1 & 'h1) == 'h1) begin end // Compliant: Parentheses around the '&' expression to evaluate it first
if (flag2 & ('h1 == 'h1)) begin end // Compliant: Parentheses around the '==' expression to silence the issue
end
endmodule