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.
25 lines
591 B
Verilog
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
|