Part 2 · Phases & Lifecycle · Intermediate

Sync Points & Barriers: uvm_domain::sync

Rendezvous mechanics — how sync() blocks domains until both reach the target phase, and choosing sync points for reset and main.

Why sync exists

Independent domains can be in different runtime phases at the same simulation time. When two subsystems share a resource or handoff point, they must rendezvous at a named phase. uvm_domain::sync() installs a barrier: neither domain advances past the target phase until all synced domains have reached it.

diagram
[PHASE][UVM] sync barrier at reset_phase

common domain reaches reset_phase ──┐
                                    ├── both wait until both arrive
pmu_domain reaches reset_phase  ──┘
        │
        ▼
both advance to post_reset together

Reference implementation

systemverilog
function void connect_phase(uvm_phase phase);
  super.connect_phase(phase);
  uvm_domain common = uvm_domain::get_common_domain();
  uvm_domain pmu    = pmu_env.get_domain();

  // Rendezvous before either domain leaves reset
  common.sync(.target(pmu), .phase(uvm_reset_phase::get()));

  // Rendezvous before main-phase cross-domain traffic
  common.sync(.target(pmu), .phase(uvm_main_phase::get()));

  `uvm_info("SYNC", "installed reset and main sync barriers", UVM_MEDIUM)
endfunction
systemverilog
// Alternative: sync from start_of_simulation_phase
function void start_of_simulation_phase(uvm_phase phase);
  super.start_of_simulation_phase(phase);
  uvm_domain common = uvm_domain::get_common_domain();
  uvm_domain island = island_env.get_domain();
  common.sync(.target(island), .phase(uvm_reset_phase::get()));
endfunction
  • Install sync in connect_phase or start_of_simulation — before run-time begins.

  • Typical sync points: reset_phase, configure_phase, main_phase.

  • Too many sync points defeat the purpose of independent domains.

Key takeaways

  • sync() creates phase barriers between domains.

  • Install barriers where hardware dependencies require alignment.

  • Minimize sync points — each one couples the schedules.

Common pitfalls

  • Circular sync dependencies causing deadlock.

  • Syncing at every sub-phase — domains become single-schedule again.

  • Installing sync after run-time started — may be ignored or error.


Barrier debug

diagram
[PHASE][UVM] stuck-at-sync triage

1) +UVM_PHASE_TRACE — which domain reached sync target?
2) Is the lagging domain stuck in an earlier phase (objection leak)?
3) Did sync target phase name match on both sides?
4) Remove sync temporarily to confirm independent progress resumes