Part 6 · Agents & Protocol IP · Intermediate

Monitor Clocking: Safe Edge Selection and Skew

Choosing sampling events and clocking block policy to avoid race-induced decode corruption.

Clocking policy

Monitor sampling edge should match protocol-defined stable windows. Clocking blocks with input skew are usually safest.

diagram
[MON][UVM] race model
edge update region -> settled region -> monitor sample

sample too early => transient/old values
sample at settled point => deterministic decode
systemverilog
clocking mon_cb @(posedge vif.clk);
  input #1step valid, ready, addr, data;
endclocking

task run_phase(uvm_phase phase);
  forever begin
    @(vif.mon_cb);
    if (vif.mon_cb.valid && vif.mon_cb.ready) sample_one();
  end
endtask
  • Keep one documented sampling policy per monitor.

  • Avoid ad-hoc delays instead of clocking discipline.

  • Instrument race checks for first-failure seeds.


Applied Patterns

This appendix consolidates reusable monitor patterns for enterprise-scale UVM environments where multiple teams share protocol VIP.

Use this as a quick implementation checklist before releasing monitor updates into regression branches.

diagram
[MON][UVM][AGT] reusable pattern grid

sampling:
  accepted-handshake gating only

reconstruction:
  key-based accumulator with completion predicate

publishing:
  clone policy + counter instrumentation

debug:
  boundary-first triage with deterministic smoke
systemverilog
function void monitor_health_report();
  `uvm_info("MON_HEALTH",
    $sformatf("sampled=%0d published=%0d dropped=%0d pending=%0d",
      sampled_cnt, published_cnt, dropped_cnt, pending_cnt),
    UVM_LOW)
endfunction
diagram
[MON] review checklist

- passive contract verified
- reset/flush policy documented
- publish ownership policy documented
- consumer fan-out validated
- counters visible in report_phase
  • Design monitor updates as API changes to downstream consumers, not local edits.

  • Keep monitor diagnostics always-on and low overhead for regression reliability.

  • Revalidate sample-to-publish boundary after every protocol extension.