#0 in SystemVerilog inactive event region

Erhhh, I probably picked the worst example :) There are other examples here and there without wait etc after #0 to move region forward.

But I do agree with you there might be better approach. Actually I just noticed in the same uvm_phase::execute_phase() task, there are a few calls to uvm_wait_for_nba_region(). It is probably the approach you just mentioned “wait for an NBA update event”…

This task is defined in uvm_globals.svh. Basically it does a dummy NBA assignment then force to active region by doing @(nba) before task returns.


task uvm_wait_for_nba_region;
  string s;
  int nba;
  int next_nba;

  //If `included directly in a program block, can't use a non-blocking assign,
  //but it isn't needed since program blocks are in a separate region.
`ifndef UVM_NO_WAIT_FOR_NBA
  next_nba++;
  nba <= next_nba;
  @(nba);
`else
  repeat(`UVM_POUND_ZERO_COUNT) #0;
`endif
endtask

In reply to dave_59: