Hi,
I have a queue which will is filled with some enum value. i would like to check if the element exists in queue and assign 1 to map if it exists.
typedef enum {A,B,C,....Z} alphabet;
class try;
alphabet var_q[$];
bit map[32];
//in pre randomize, assign the map variable to 1 if element exist in queue
function void pre_randomize();
foreach(map[i]) begin
map[i] = !((var_q.find(x) with (x == i)).size() == 0);
end
endfunction
endclass
DO you see any issue with above code? or is there better way to do it ?
Thanks
endclass