For loop and a random variable

In reply to dave_59:

This is my full code. The issue is for eg:: when i randomize sa_entry_row ,if it is 5 and when entry_add_index is randomized and if the value already in test_entries_indices_added for all 5 times then the loop of 5 goes unused .

I have to make sure that , the variable entry_add_index is unique always when sa_entry_row is looped.

if (sa_op_type == ADD) begin
                    sa_entry_row        = $urandom_range(1,5);//Randomizing  The number of times add entries
                    for(int j=0; j<sa_entry_row; j++) begin
                        entry_add_index = $urandom_range(0,($size(test_entries_add)-1));//Randomizing the SA_entry index
                        //this condition will check existing added list in queue and avoid duplication
                        if (!(entry_add_index inside test_entries_indices_added)) begin
                            add_entries_random(test_entries,test_entries_add,entry_add_index);
                            test_entries_indices_added.push_back(entry_add_index);//Queue created to avoid the duplication of the entry
                            added_entry_indices.push_back(entry_add_index); //This is added entries which used as grep in delete entry
                        end
                    end
                end

Thanks