mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 01:33:07 +02:00
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]>
29 lines
522 B
Verilog
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
|