Files
sv2v/test/basic/shift.sv
Zachary Snow 306d71334b refactor sizing and truncation of integer literals
- use iverilog's -gstrict-expr-width throughout test suite
- add warnings for excess bits or padding zeroes in number literals
- add new --oversized-numbers parameter to retain support for unsized
  numbers wider than 32 bits
- localized use of oversized numbers to new truncate test suite which
  verifies the behavior of both modes, and compares against the known
  behavior of iverilog
2021-08-09 22:10:29 -06:00

31 lines
593 B
Systemverilog

`define TEST_OP(op, a, b) $display(`"%0d op %0d = %0d`", a, b, a op b)
`define TEST(a, b) \
`TEST_OP(>> , a, b); \
`TEST_OP(<< , a, b); \
`TEST_OP(>>>, a, b); \
`TEST_OP(<<<, a, b)
module top;
initial begin
`TEST(-4, 0);
`TEST(-4, 1);
`TEST(-4, 2);
`TEST(-4, 3);
`TEST(-1, 0);
`TEST(-1, 1);
`TEST(-1, 2);
`TEST(-1, 3);
`TEST(1, 0);
`TEST(1, 1);
`TEST(1, 2);
`TEST(1, 3);
`TEST(2, 0);
`TEST(2, 1);
`TEST(2, 2);
`TEST(2, 3);
end
endmodule