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

25 lines
591 B
Verilog

module test();
reg [31:0] a, b;
reg [65:0] a_l, b_l;
wire [31:0] result = a / b;
wire [31:0] mod = a % b;
wire [65:0] result_l = a_l / b_l;
wire [65:0] mod_l = a_l % b_l;
initial begin
a = 'h1;
b = 'h1;
a_l = 'h1;
b_l = 'h1;
#1; // Need some delay for the calculations to run.
// b_l = 'h0; // This will now fail with an error.
$display("Using normal math routines.");
$display("Result: %0d\nModulus: %h", result, mod);
$display("\nUsing wide math routines.");
$display("Result: %0d\nModulus: %h", result_l, mod_l);
end
endmodule