Add regression tests for unpacked l-value concat errors

Check that class objects, dynamic arrays, queues, strings and static
unpacked arrays can not be used as l-value concatenation operands. Check
procedural and continuous assignment concatenations, including single
operand concatenations.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2026-05-10 22:12:54 -07:00
parent 208078838e
commit f9ab26b3d9
41 changed files with 357 additions and 0 deletions

View File

@ -0,0 +1,15 @@
// Check that class objects can not be used in l-value concatenations.
module test;
class C;
endclass
int x;
C c;
initial begin
{x, c} = x;
end
endmodule

View File

@ -0,0 +1,15 @@
// Check that class objects can not be used in single operand l-value concatenations.
module test;
class C;
endclass
int x;
C c;
initial begin
{c} = x;
end
endmodule

View File

@ -0,0 +1,14 @@
// Check that class objects can not be used in continuous assignment l-value concatenations.
module test;
class C;
endclass
int x;
C c;
int y;
assign {x, c} = y;
endmodule

View File

@ -0,0 +1,13 @@
// Check that class objects can not be used in single operand continuous assignment l-value concatenations.
module test;
class C;
endclass
C c;
int y;
assign {c} = y;
endmodule

View File

@ -0,0 +1,12 @@
// Check that dynamic arrays can not be used in l-value concatenations.
module test;
int x;
int d[];
initial begin
{x, d} = x;
end
endmodule

View File

@ -0,0 +1,12 @@
// Check that dynamic arrays can not be used in single operand l-value concatenations.
module test;
int x;
int d[];
initial begin
{d} = x;
end
endmodule

View File

@ -0,0 +1,11 @@
// Check that dynamic arrays can not be used in continuous assignment l-value concatenations.
module test;
int x;
int d[];
int y;
assign {x, d} = y;
endmodule

View File

@ -0,0 +1,10 @@
// Check that dynamic arrays can not be used in single operand continuous assignment l-value concatenations.
module test;
int d[];
int y;
assign {d} = y;
endmodule

View File

@ -0,0 +1,12 @@
// Check that queues can not be used in l-value concatenations.
module test;
int x;
int q[$];
initial begin
{x, q} = x;
end
endmodule

View File

@ -0,0 +1,12 @@
// Check that queues can not be used in single operand l-value concatenations.
module test;
int x;
int q[$];
initial begin
{q} = x;
end
endmodule

View File

@ -0,0 +1,11 @@
// Check that queues can not be used in continuous assignment l-value concatenations.
module test;
int x;
int q[$];
int y;
assign {x, q} = y;
endmodule

View File

@ -0,0 +1,10 @@
// Check that queues can not be used in single operand continuous assignment l-value concatenations.
module test;
int q[$];
int y;
assign {q} = y;
endmodule

View File

@ -0,0 +1,12 @@
// Check that strings can not be used in l-value concatenations.
module test;
int x;
string s;
initial begin
{x, s} = x;
end
endmodule

View File

@ -0,0 +1,12 @@
// Check that strings can not be used in single operand l-value concatenations.
module test;
int x;
string s;
initial begin
{s} = x;
end
endmodule

View File

@ -0,0 +1,11 @@
// Check that strings can not be used in continuous assignment l-value concatenations.
module test;
int x;
string s;
int y;
assign {x, s} = y;
endmodule

View File

@ -0,0 +1,10 @@
// Check that strings can not be used in single operand continuous assignment l-value concatenations.
module test;
string s;
int y;
assign {s} = y;
endmodule

View File

@ -0,0 +1,12 @@
// Check that static unpacked arrays can not be used in l-value concatenations.
module test;
int x;
int u[0:0];
initial begin
{x, u} = x;
end
endmodule

View File

@ -0,0 +1,12 @@
// Check that static unpacked arrays can not be used in single operand l-value concatenations.
module test;
int x;
int u[0:0];
initial begin
{u} = x;
end
endmodule

View File

@ -0,0 +1,11 @@
// Check that static unpacked arrays can not be used in continuous assignment l-value concatenations.
module test;
int x;
int u[0:0];
int y;
assign {x, u} = y;
endmodule

View File

@ -0,0 +1,10 @@
// Check that static unpacked arrays can not be used in single operand continuous assignment l-value concatenations.
module test;
int u[0:0];
int y;
assign {u} = y;
endmodule

View File

@ -274,6 +274,26 @@ sv_foreach9 vvp_tests/sv_foreach9.json
sv_foreach10 vvp_tests/sv_foreach10.json
sv_interface vvp_tests/sv_interface.json
sv_literals vvp_tests/sv_literals.json
sv_lval_concat_class_fail1 vvp_tests/sv_lval_concat_class_fail1.json
sv_lval_concat_class_fail2 vvp_tests/sv_lval_concat_class_fail2.json
sv_lval_concat_class_fail3 vvp_tests/sv_lval_concat_class_fail3.json
sv_lval_concat_class_fail4 vvp_tests/sv_lval_concat_class_fail4.json
sv_lval_concat_darray_fail1 vvp_tests/sv_lval_concat_darray_fail1.json
sv_lval_concat_darray_fail2 vvp_tests/sv_lval_concat_darray_fail2.json
sv_lval_concat_darray_fail3 vvp_tests/sv_lval_concat_darray_fail3.json
sv_lval_concat_darray_fail4 vvp_tests/sv_lval_concat_darray_fail4.json
sv_lval_concat_queue_fail1 vvp_tests/sv_lval_concat_queue_fail1.json
sv_lval_concat_queue_fail2 vvp_tests/sv_lval_concat_queue_fail2.json
sv_lval_concat_queue_fail3 vvp_tests/sv_lval_concat_queue_fail3.json
sv_lval_concat_queue_fail4 vvp_tests/sv_lval_concat_queue_fail4.json
sv_lval_concat_string_fail1 vvp_tests/sv_lval_concat_string_fail1.json
sv_lval_concat_string_fail2 vvp_tests/sv_lval_concat_string_fail2.json
sv_lval_concat_string_fail3 vvp_tests/sv_lval_concat_string_fail3.json
sv_lval_concat_string_fail4 vvp_tests/sv_lval_concat_string_fail4.json
sv_lval_concat_uarray_fail1 vvp_tests/sv_lval_concat_uarray_fail1.json
sv_lval_concat_uarray_fail2 vvp_tests/sv_lval_concat_uarray_fail2.json
sv_lval_concat_uarray_fail3 vvp_tests/sv_lval_concat_uarray_fail3.json
sv_lval_concat_uarray_fail4 vvp_tests/sv_lval_concat_uarray_fail4.json
sv_mixed_assign1 vvp_tests/sv_mixed_assign1.json
sv_mixed_assign2 vvp_tests/sv_mixed_assign2.json
sv_mixed_assign_error1 vvp_tests/sv_mixed_assign_error1.json

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_class_fail1.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_class_fail2.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_class_fail3.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_class_fail4.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_darray_fail1.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_darray_fail2.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_darray_fail3.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_darray_fail4.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_queue_fail1.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_queue_fail2.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_queue_fail3.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_queue_fail4.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_string_fail1.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_string_fail2.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_string_fail3.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_string_fail4.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_uarray_fail1.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_uarray_fail2.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_uarray_fail3.v",
"iverilog-args" : [ "-g2005-sv" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "sv_lval_concat_uarray_fail4.v",
"iverilog-args" : [ "-g2005-sv" ]
}