Add regression test for return type of $bits (issue #1163).

This commit is contained in:
Martin Whitaker 2024-09-07 17:56:15 +01:00
parent 0136db7ee7
commit 2ab57a2b09
3 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,24 @@
`define check(expr) \
result = expr; \
$display("%b", result); \
if (result !== 32'b11111111111111111111111111011111) failed = 1;
module top;
integer x;
localparam Y = 1'sb1;
localparam integer Z = 1'sb1;
reg [31:0] result;
reg failed = 0;
initial begin
`check($bits(x) ^ 1'sb1);
`check($bits(x) ^ Y);
`check($bits(x) ^ Z);
`check($signed($bits(x)) ^ 1'sb1);
`check($signed($bits(x)) ^ Y);
`check($signed($bits(x)) ^ Z);
if (failed)
$display("FAILED");
else
$display("PASSED");
end
endmodule

View File

@ -59,6 +59,7 @@ br_gh1143f vvp_tests/br_gh1143f.json
br_gh1143g vvp_tests/br_gh1143g.json
br_gh1143h vvp_tests/br_gh1143h.json
br_gh1155 vvp_tests/br_gh1155.json
br_gh1163 vvp_tests/br_gh1163.json
ca_time_real` vvp_tests/ca_time_real.json
case1 vvp_tests/case1.json
case2 vvp_tests/case2.json

View File

@ -0,0 +1,4 @@
{
"type" : "normal",
"source" : "br_gh1163.v"
}