Uvm_wait_for_nba_region , #0 , wait(0) difference

In reply to Jeff_Li_90:

The wait(0) is a permanent suspension of a process. They could have used m_phase_proc.suspend() to achieve the same behavior. Why they needed to do this is not documented.

This is very different from what the other 2 constructs are trying to achieve. #0 in procedural code is a poor attempt at addressing race conditions between processes. Unfortunately #0 delays can accumulate and the race re-appears. The uvm_wait_for_nba_region routine is a more deterministic way of eliminating races. But since it was a latter addition to the UVM, no-one has gone back and retrofitted to remove all the #0’s