I have doubts about race conditions in SystemVerilog, especially in UVM. In the standard case, we have several drivers that control our spirit in the same front of the watch, generating some function calls on the display. These calls are simultaneous, and it is realistic that they check / modify some common variables in the gold reference model. If these operations are performed with non-blocking assignment, there will be no problems, but with the purpose of blocking there may be race conditions. What is the best way to overcome this problem? To implement the gold reference model is not in the classroom? thanks in advance
An example of a pseudo-code of a scoreboard may be:
function void write_A(input TrA A);
if(GRF.b >= 100 && A.a==1)
GRF.c = 1;
endfunction
function void write_B(input TrB B);
GRF.b+=B.b;
endfunction
Of course, the result depends on the execution order of these two functions, which is unknown. It can be solved using some synchronization mechanism, but things get more complicated when many people write parallel functions. Using non-blocking assignments will make the situation more clear and simple ... maybe the solution could be to have all GRF members static?
source
share