I have the following function:
function void foo_array_vec_bit (int seed, inout bit [31:0] q [$], input string mem_name, int_type curr_int_type, int arr_size, const ref int vec_bit_size);
bit [31:0] temp;
for (int i = 0; i < arr_size; i++) begin
foo_vec_bit(temp[0 +: vec_bit_size], seed+i, mem_name, vec_bit_size, curr_int_type);
q.push_back(temp);
end
endfunction: foo_array_vec_bit
The call to the function is:
foo_array_vec_bit(seed, arr_vec_bit, "arr_vec_bit", t_data_bit, 9, arr_vec_b_size);
Where:
bit [31:0] arr_vec_bit [$];
int arr_vec_b_size = 9;
I got the folllowing error:
** Error: …\sv\base_transaction.sv(105): Range width must be constant expression.
line 105 is the call for foo_vec_bit.