User guide

24-21
SystemVerilog Testbench Constructs
The optional (source_array) argument specifies another array
(dynamic or fixed-size) whose values VCS assigns to the dynamic
array. If you don’t specify the (source_array) argument, VCS
initializes the elements of the newly allocated array to their default
value.
The optional (source_array) argument must have the same data
type as the array on the left-hand side, but it need not have the same
size. If the size of (source_array) is less than the size of the new
array, VCS initializes the extra elements to their default values. If the
size of (source_array) is greater than the size of the new array,
VCS ignores the additional elements.
program prog;
.
.
.
bit bitDA1 [];
bit bitDA2 [];
bit bitDA3 [];
bit bitSA1 [100];
logic logicDA [];
.
.
.
initial
begin
bitDA1 = new[100];
bitDA2 = new[100] (bitDA2);
bitDA3 = new[100] (bitSA1);
logicDA = new[100];
end
.
.
.
endprogram