diff --git a/ivtest/ivltests/sv_ap_uarray_single1.v b/ivtest/ivltests/sv_ap_uarray_single1.v new file mode 100644 index 000000000..437345724 --- /dev/null +++ b/ivtest/ivltests/sv_ap_uarray_single1.v @@ -0,0 +1,27 @@ +// Check that procedural assignment of unpacked array assignment patterns to +// single element arrays is supported. + +module test; + + reg failed; + integer a[0:0]; + + `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; + a = '{42}; + + `check(a[0], 42); + + if (!failed) begin + $display("PASSED"); + end + end + +endmodule diff --git a/ivtest/ivltests/sv_ap_uarray_single2.v b/ivtest/ivltests/sv_ap_uarray_single2.v new file mode 100644 index 000000000..42a722f01 --- /dev/null +++ b/ivtest/ivltests/sv_ap_uarray_single2.v @@ -0,0 +1,28 @@ +// 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 diff --git a/ivtest/ivltests/sv_array_assign_single_fail1.v b/ivtest/ivltests/sv_array_assign_single_fail1.v new file mode 100644 index 000000000..e4f297663 --- /dev/null +++ b/ivtest/ivltests/sv_array_assign_single_fail1.v @@ -0,0 +1,13 @@ +// Check that scalar expressions can not be procedurally assigned to single +// element unpacked arrays. + +module test; + + integer a[0:0]; + + initial begin + a = 1; + $display("FAILED"); + end + +endmodule diff --git a/ivtest/ivltests/sv_array_cassign_single.v b/ivtest/ivltests/sv_array_cassign_single.v new file mode 100644 index 000000000..1a54abf1a --- /dev/null +++ b/ivtest/ivltests/sv_array_cassign_single.v @@ -0,0 +1,30 @@ +// Check that continuous array assignment to single element unpacked arrays is +// supported. + +module test; + + reg failed; + wire [31:0] a[0:0]; + reg [31:0] b[0:0]; + + assign a = b; + + `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; + b[0] = 32'd42; + #1; + `check(a[0], 32'd42); + + if (!failed) begin + $display("PASSED"); + end + end + +endmodule diff --git a/ivtest/ivltests/sv_array_cassign_single_fail1.v b/ivtest/ivltests/sv_array_cassign_single_fail1.v new file mode 100644 index 000000000..2ce3f7fda --- /dev/null +++ b/ivtest/ivltests/sv_array_cassign_single_fail1.v @@ -0,0 +1,10 @@ +// Check that scalar expressions can not be continuously assigned to single +// element unpacked arrays. + +module test; + + wire [31:0] a[0:0]; + + assign a = 1; + +endmodule diff --git a/ivtest/ivltests/sv_lval_concat_uarray1.v b/ivtest/ivltests/sv_lval_concat_uarray1.v new file mode 100644 index 000000000..1d88e907b --- /dev/null +++ b/ivtest/ivltests/sv_lval_concat_uarray1.v @@ -0,0 +1,29 @@ +// Check that single element static unpacked array elements can be used in +// procedural l-value concatenations. + +module test; + + reg failed; + reg [7:0] a[0:0]; + reg [7:0] y; + + `define check(val, exp) \ + if (val !== exp) begin \ + $display("FAILED(%0d). '%s' expected %h, got %h", `__LINE__, \ + `"val`", exp, val); \ + failed = 1'b1; \ + end + + initial begin + failed = 1'b0; + y = 8'h78; + {a[0]} = y; + + `check(a[0], 8'h78); + + if (!failed) begin + $display("PASSED"); + end + end + +endmodule diff --git a/ivtest/ivltests/sv_lval_concat_uarray2.v b/ivtest/ivltests/sv_lval_concat_uarray2.v new file mode 100644 index 000000000..cfa60262c --- /dev/null +++ b/ivtest/ivltests/sv_lval_concat_uarray2.v @@ -0,0 +1,30 @@ +// Check that single element static unpacked array elements can be used in +// continuous l-value concatenations. + +module test; + + reg failed; + wire [7:0] a[0:0]; + reg [7:0] y; + + assign {a[0]} = y; + + `define check(val, exp) \ + if (val !== exp) begin \ + $display("FAILED(%0d). '%s' expected %h, got %h", `__LINE__, \ + `"val`", exp, val); \ + failed = 1'b1; \ + end + + initial begin + failed = 1'b0; + y = 8'h78; + #1; + `check(a[0], 8'h78); + + if (!failed) begin + $display("PASSED"); + end + end + +endmodule diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 7831ff27f..33ab7bda9 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -233,12 +233,17 @@ sv_ap_uarray5 vvp_tests/sv_ap_uarray5.json sv_ap_uarray6 vvp_tests/sv_ap_uarray6.json sv_ap_uarray_fail1 vvp_tests/sv_ap_uarray_fail1.json sv_ap_uarray_fail2 vvp_tests/sv_ap_uarray_fail2.json +sv_ap_uarray_single1 vvp_tests/sv_ap_uarray_single1.json +sv_ap_uarray_single2 vvp_tests/sv_ap_uarray_single2.json sv_argumentless_func vvp_tests/sv_argumentless_func.json sv_array_assign_fail1 vvp_tests/sv_array_assign_fail1.json sv_array_assign_fail2 vvp_tests/sv_array_assign_fail2.json +sv_array_assign_single_fail1 vvp_tests/sv_array_assign_single_fail1.json sv_array_cassign6 vvp_tests/sv_array_cassign6.json sv_array_cassign7 vvp_tests/sv_array_cassign7.json sv_array_cassign8 vvp_tests/sv_array_cassign8.json +sv_array_cassign_single vvp_tests/sv_array_cassign_single.json +sv_array_cassign_single_fail1 vvp_tests/sv_array_cassign_single_fail1.json sv_automatic_2state vvp_tests/sv_automatic_2state.json sv_byte_array_string1 vvp_tests/sv_byte_array_string1.json sv_byte_array_string2 vvp_tests/sv_byte_array_string2.json @@ -321,6 +326,8 @@ 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_uarray1 vvp_tests/sv_lval_concat_uarray1.json +sv_lval_concat_uarray2 vvp_tests/sv_lval_concat_uarray2.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 diff --git a/ivtest/vvp_tests/sv_ap_uarray_single1.json b/ivtest/vvp_tests/sv_ap_uarray_single1.json new file mode 100644 index 000000000..792665cb9 --- /dev/null +++ b/ivtest/vvp_tests/sv_ap_uarray_single1.json @@ -0,0 +1,9 @@ +{ + "type" : "normal", + "source" : "sv_ap_uarray_single1.v", + "iverilog-args" : [ "-g2005-sv" ], + "vlog95" : { + "__comment" : "Array nets are not supported", + "type" : "CE" + } +} diff --git a/ivtest/vvp_tests/sv_ap_uarray_single2.json b/ivtest/vvp_tests/sv_ap_uarray_single2.json new file mode 100644 index 000000000..e372d0a0b --- /dev/null +++ b/ivtest/vvp_tests/sv_ap_uarray_single2.json @@ -0,0 +1,9 @@ +{ + "type" : "normal", + "source" : "sv_ap_uarray_single2.v", + "iverilog-args" : [ "-g2005-sv" ], + "vlog95" : { + "__comment" : "Array nets are not supported", + "type" : "CE" + } +} diff --git a/ivtest/vvp_tests/sv_array_assign_single_fail1.json b/ivtest/vvp_tests/sv_array_assign_single_fail1.json new file mode 100644 index 000000000..54c147114 --- /dev/null +++ b/ivtest/vvp_tests/sv_array_assign_single_fail1.json @@ -0,0 +1,5 @@ +{ + "type" : "CE", + "source" : "sv_array_assign_single_fail1.v", + "iverilog-args" : [ "-g2005-sv" ] +} diff --git a/ivtest/vvp_tests/sv_array_cassign_single.json b/ivtest/vvp_tests/sv_array_cassign_single.json new file mode 100644 index 000000000..23848684d --- /dev/null +++ b/ivtest/vvp_tests/sv_array_cassign_single.json @@ -0,0 +1,9 @@ +{ + "type" : "normal", + "source" : "sv_array_cassign_single.v", + "iverilog-args" : [ "-g2005-sv" ], + "vlog95" : { + "__comment" : "Array nets are not supported", + "type" : "CE" + } +} diff --git a/ivtest/vvp_tests/sv_array_cassign_single_fail1.json b/ivtest/vvp_tests/sv_array_cassign_single_fail1.json new file mode 100644 index 000000000..03252cf4e --- /dev/null +++ b/ivtest/vvp_tests/sv_array_cassign_single_fail1.json @@ -0,0 +1,5 @@ +{ + "type" : "CE", + "source" : "sv_array_cassign_single_fail1.v", + "iverilog-args" : [ "-g2005-sv" ] +} diff --git a/ivtest/vvp_tests/sv_lval_concat_uarray1.json b/ivtest/vvp_tests/sv_lval_concat_uarray1.json new file mode 100644 index 000000000..96d4aced9 --- /dev/null +++ b/ivtest/vvp_tests/sv_lval_concat_uarray1.json @@ -0,0 +1,4 @@ +{ + "type" : "normal", + "source" : "sv_lval_concat_uarray1.v" +} diff --git a/ivtest/vvp_tests/sv_lval_concat_uarray2.json b/ivtest/vvp_tests/sv_lval_concat_uarray2.json new file mode 100644 index 000000000..c678866fb --- /dev/null +++ b/ivtest/vvp_tests/sv_lval_concat_uarray2.json @@ -0,0 +1,8 @@ +{ + "type" : "normal", + "source" : "sv_lval_concat_uarray2.v", + "vlog95" : { + "__comment" : "Array nets are not supported", + "type" : "CE" + } +}