Skip to content

Commit bea31b9

Browse files
committed
Extend shl4 test
The operands of relational expressions are given an evaluation context with the max width of both operands. Hence, an expression can be equal to two different values.
1 parent 118d042 commit bea31b9

File tree

1 file changed

+7
-1
lines changed
  • regression/verilog/expressions

1 file changed

+7
-1
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
module main;
22

3+
// The arguments of === are adjusted to the maximum of the
4+
// self-determined widths of the lhs and rhs.
5+
// Hence, 4'b1111 << 1 is equal both to 4'b1110 and 5'b11110.
6+
assert final (4'b1111 << 1 === 4'b1110);
37
assert final (4'b1111 << 1 === 5'b11110);
4-
assert final (1 << 6 === 64);
8+
9+
assert final (1'b1 << 6 === 64);
10+
assert final (1'b1 << 6 === 1'b0);
511

612
endmodule

0 commit comments

Comments
 (0)