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

32 lines
724 B
Verilog

module test;
parameter width = 32;
localparam fill = 32 - width;
localparam extend = 0;
reg passed;
reg [width-1:0] in;
reg [31:0] lat1, lat2;
wire sign_bit = in[width-1];
wire lsb = in[0];
initial begin
passed = 1'b1;
in = 32'h80000001;
// The following are asserting().
lat1 <= {{fill{sign_bit}}, in, {extend{lsb}}};
lat2 = {{fill{sign_bit}}, in, {extend{lsb}}};
#1;
if (lat1 !== 32'h80000001) begin
$display("FAILED: zero-replication (NB): got %h", lat1);
passed = 1'b0;
end
if (lat2 !== 32'h80000001) begin
$display("FAILED: zero-replication (B): got %h", lat2);
passed = 1'b0;
end
if (passed) $display("PASSED");
end
endmodule