I have to find the value of the index of the minimum value of this index, I’ve been trying to use the find_index but I keep running into an error, can you please help me with this
The return type of min function is unpacked, we can not compare packed data type(here item) with unpacked data type. We can do as below
module test();
int x [] = {13,41,89,31,2,67,2};
int q[$];
int y[$];
initial
begin
y = x.min;
foreach(y[i])
q = x.find_index with(item == y[i]);
$display("%p",q);
end
endmodule