mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-02 23:38:58 +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.
38 lines
781 B
Verilog
38 lines
781 B
Verilog
module top();
|
|
|
|
localparam signed [31:0] SizedValue = -1;
|
|
localparam UnsizedValue = -1;
|
|
|
|
reg [35:0] Result;
|
|
reg Failed;
|
|
|
|
initial begin
|
|
Failed = 0;
|
|
// check for sign extension
|
|
Result = SizedValue;
|
|
$display("%h", Result);
|
|
if (Result !== 36'hfffffffff) Failed = 1;
|
|
Result = UnsizedValue;
|
|
$display("%h", Result);
|
|
if (Result !== 36'hfffffffff) Failed = 1;
|
|
|
|
// check for zero extension
|
|
Result = 'd0 + SizedValue;
|
|
$display("%h", Result);
|
|
if (Result !== 36'h0ffffffff) Failed = 1;
|
|
Result = 'd0 + UnsizedValue;
|
|
$display("%h", Result);
|
|
`ifdef OLD_UNSIZED
|
|
if (Result !== 36'hfffffffff) Failed = 1;
|
|
`else
|
|
if (Result !== 36'h0ffffffff) Failed = 1;
|
|
`endif
|
|
|
|
if (Failed)
|
|
$display("FAILED");
|
|
else
|
|
$display("PASSED");
|
|
end
|
|
|
|
endmodule
|