Files
iverilog/ivtest/ivltests/br_gh414.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

40 lines
713 B
Verilog

module tb;
string txt_i, txt_r, txt_h;
int val_i;
int val_h;
real val_r;
initial begin
txt_i = "123";
txt_r = "1.25";
txt_h = "dead";
val_i = txt_i.atoi();
val_r = txt_r.atoreal();
val_h = txt_h.atohex();
$display("txt_i=%s, val_i=%0d", txt_i, val_i);
if (val_i !== 123) begin
$display("FAILED");
$finish;
end
$display("txt_r=%s, val_r=%0f", txt_r, val_r);
if (val_r != 1.25) begin
$display("FAILED");
$finish;
end
$display("txt_h=%s, val_h=%0h", txt_h, val_h);
if (val_h !== 'hdead) begin
$display("FAILED");
$finish;
end
$display("PASSED");
$finish;
end
endmodule