Skip to content

Commit 307d9a6

Browse files
committed
Verilog: test for signing casts
This tests that signing casts block downwards propagation of expression context.
1 parent 9c8a850 commit 307d9a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

regression/verilog/expressions/signing_cast1.sv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ module main;
1111
// signing casts yield constants
1212
parameter Q = signed'(1);
1313

14+
// signing casts block downwards size/type propagation
15+
initial assert (unsigned'(1'b1 + 1'b1) == 0);
16+
initial assert (signed'(1'b1 + 1'b1) == 0);
17+
initial assert ($bits(unsigned'(1'b1 + 1'b1)) == 1);
18+
1419
endmodule

0 commit comments

Comments
 (0)