mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-29 01:03:29 +02:00
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.
33 lines
677 B
Verilog
33 lines
677 B
Verilog
module main;
|
|
|
|
function integer my_ceil;
|
|
input number;
|
|
real number;
|
|
if (number > $rtoi(number))
|
|
my_ceil = $rtoi(number) + 1;
|
|
else
|
|
my_ceil = number;
|
|
endfunction
|
|
|
|
real tck;
|
|
parameter CL_TIME = 13125;
|
|
wire [31:0] result1 = my_ceil( CL_TIME/tck );
|
|
integer result2;
|
|
initial begin
|
|
tck = 2.0;
|
|
|
|
result2 = my_ceil( CL_TIME/tck );
|
|
if (result2 !== 6563) begin
|
|
$display("FAILED -- result2=%d", result2);
|
|
$finish;
|
|
end
|
|
|
|
#1 if (result1 !== 6563) begin
|
|
$display("FAILED -- result1=%d", result1);
|
|
$finish;
|
|
end
|
|
$display("PASSED");
|
|
end // initial begin
|
|
|
|
endmodule // main
|