Files
iverilog/ivtest/ivltests/sv_ap_uarray_single2.v
T
Lars-Peter Clausen 74491cfe9f Add regression tests for single element unpacked array assignments
Check that continuous assignment of an assignment pattern to a single element
unpacked array is accepted. Check that assigning a scalar expression to the
whole unpacked array is rejected for both procedural and continuous
assignments.

Check that a selected element of a single element static unpacked array can be
used in a continuous l-value concatenation.

Signed-off-by: Lars-Peter Clausen <[email protected]>
2026-05-16 21:11:30 -07:00

29 lines
522 B
Verilog

// Check that continuous assignment of unpacked array assignment patterns to
// single element arrays is supported.
module test;
reg failed;
integer a[0:0];
assign a = '{42};
`define check(val, exp) \
if (val !== exp) begin \
$display("FAILED(%0d). '%s' expected %0d, got %0d", `__LINE__, \
`"val`", exp, val); \
failed = 1'b1; \
end
initial begin
failed = 1'b0;
#1;
`check(a[0], 42);
if (!failed) begin
$display("PASSED");
end
end
endmodule