In reply to vinodh1180:
The procedural assignment is allowed, but does not give you the functionality you are looking for. A better idea is defining your covergroup as
overgroup flag_cvg (input bit [63:0] one_hot_bit_position) with function sample(logic [63:0] flag);
flag_cvp: coverpoint (one_hot_bit_position & flag) != 0;
option.per_instance = 1;
endgroup : flag_cvg
Then pass the flag value at each sample
foreach(flag_bits[i])
flag_bits[i].sample(vif.flag);