My question is whether concurrently sampling a coverpoint by multiple threads (after having overridden the buit-in sample method) creates any side-effects.
In more detail, consider the following code:
covergroup p_cg with function sample(bit [1:0] a);
coverpoint a;
endgroup : p_cg
p_cg cg1 = new;
init cg1.sample(0);
init cg1.sample(1);
My understanding is that two threads are going to compete in order to update the covergroup for coverpoint 'a' and method 'sample' is going to execute for both threads (using separate data stacks). Do you think this is going to create any side-effects when both threads try to update the covergroup/coverpoint at the same time? (if so, the obvious solution is using semaphores of course).
Cheers, Stast