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

23 lines
496 B
Verilog

`begin_keywords "1364-2005"
module top;
reg pass;
reg [3:0] var;
integer lp;
initial begin
pass = 1'b1;
for (lp = 0; lp < 16; lp = lp + 1) begin
var = lp;
// This should bit extend var as unsigned and then
// convert it into a signed value.
if (lp !== $signed(var+5'b0)) begin
$display("FAILED: expected %2d, got %2d", lp, $signed(var+5'b0));
pass = 1'b0;
end
end
if (pass) $display("PASSED");
end
endmodule
`end_keywords