Hi Dave,
Same issue coming.
module array_return_test();
class array_test;
typedef bit [3:0] arr[];
bit [3:0] g_arr[];
rand bit [3:0] c_arr[$];
int g =1;
int k =2;
constraint AAA {
c_arr == test(g,k);
//c_arr == test(1,2);
}
function arr test(input bit [3:0] a=1,b=2);
bit [3:0] lcl_arr[$];
for(int i=0;i<5;i++)
begin
lcl_arr.push_back(a+b);
end
return lcl_arr;
endfunction
endclass
array_test at= new();
initial
for(int i=0;i<5;i++)
begin
at.randomize();
at.g_arr = at.test(i,i+1);
$display($time," C_ARRY = %p; gbl array is %p",at.c_arr,at.g_arr);
end
endmodule
Results:
Parsing design file ‘fun_return.sv’
Top Level Modules:
array_return_test
No TimeScale specified
Error-[IVCB-INTVAR] Non integral variable
fun_return.sv, 11
array_return_test, “c_arr”
The variable c_arr is not an integral type.
Change the type of the variable or remove it from the constraint expression.
Error-[IVCB-INTVAR] Non integral variable
fun_return.sv, 11
array_return_test, “this.test(this.g, this.k)”
The variable this.test(this.g, this.k) is not an integral type.
Change the type of the variable or remove it from the constraint expression.
[b]
2 errors
CPU time: .083 seconds to compile