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

29 lines
622 B
Verilog

module test14;
import work14_pkg::*;
bit clk = 0;
parameter longint maxvalue = 2**29 + 17;
logic [29:0] mvalue;
logic [29:0] lvalue;
initial begin : clkgen forever #10 clk = ~clk; end
assign lvalue = maxvalue;
work14_comp #(.max_out_val(maxvalue)) duv (.clk_i(clk), .val(mvalue));
initial begin
@(posedge clk);
#1;
if (lvalue !== mvalue) $display ("ERROR due to mismatch between lvalue=%d and mvalue=%d", lvalue, mvalue);
@(posedge clk);
#1;
if (lvalue !== mvalue) $display ("ERROR due to mismatch between lvalue=%d and mvalue=%d", lvalue, mvalue);
#5;
$display ("PASSED");
$finish;
end
endmodule