Files
iverilog/ivtest/ivltests/bits.v
T
Stephen Williams cea237b407 Add ivtest to the iverilog source tree
By adding ivtest to the iverilog source tree, it is easier to keep
the regression test synchronized with the source that is being tested.
This should be especially helpful for PRs that add a new feature, and
have a matching ivtest PR with the regression test for that feature.
2022-01-15 10:18:50 -08:00

35 lines
601 B
Verilog

module main;
reg foo_reg;
byte foo_byte;
int foo_int;
shortint foo_shortint;
longint foo_longint;
initial begin
if ($bits(foo_reg) != 1) begin
$display("FAILED");
$finish;
end
if ($bits(foo_byte) != 8) begin
$display("FAILED");
$finish;
end
if ($bits(foo_int) != 32) begin
$display("FAILED");
$finish;
end
if ($bits(foo_shortint) != 16) begin
$display("FAILED");
$finish;
end
if ($bits(foo_longint) != 64) begin
$display("FAILED");
$finish;
end
$display("PASSED");
end
endmodule // main