Hello!
Can you tell me about the syntax error in the below code?
function bit [3:0] array_dup [10] (int i, int j);
for (i = 0; i < 5; i++)
begin
array_dup [i] = i;
$display("a[%0d] = %0d",i,array_dup[i]);
end
j = 9;
for (i = 5; i <= 9; i++)
begin
array_dup[i] = j;
$display("a[%0d] = %0d",i,j);
j--;
end
endfunction
The syntax error: Error: (vlog-13069) array_elements.sv(47): near “[”: syntax error, unexpected ‘[’, expecting ‘;’ or ‘(’.
I’m trying to call this function into constraint.