Part 7 · Advanced & Integration · Intermediate

Waves, Logs & Visibility Cost

Full-hierarchy dump cost, scoped and windowed dumping, log verbosity at scale, and the rerun-with-waves regression flow.

What full-hierarchy dumping actually costs

Recording every signal in every scope ($dumpvars(0, tb_top) or the vendor equivalent) makes the simulator serialize every value change to disk. On an active design this commonly adds 20–50% wall-clock time and produces wave files in the tens of gigabytes. It is the right choice for interactive debug of one failure — and the wrong default for a 2,000-test regression where 1,990 tests pass.

systemverilog
// Full dump — maximum visibility, maximum cost
initial begin
  $dumpfile("waves.vcd");
  $dumpvars(0, tb_top);                 // depth 0 = ALL levels below tb_top
end

// Scoped dump — only the block under debug
initial begin
  $dumpfile("waves.vcd");
  $dumpvars(2, tb_top.dut.u_dma);       // 2 levels under the DMA only
end

// Windowed dump — only the time region of interest
initial begin
  $dumpfile("waves.vcd");
  $dumpvars(1, tb_top.dut.u_dma);
  $dumpoff;                              // start with recording paused
  #1ms        $dumpon;                   // open the window
  #100us      $dumpoff;                  // close it
end

Cheaper visibility levers, in order of preference

  • Scope: dump the suspect block, not the chip — cost scales with signals recorded.

  • Depth: $dumpvars(2, scope) instead of depth 0 — skip the leaf-cell noise.

  • Window: $dumpoff/$dumpon around the failure time learned from a previous run.

  • Format: vendor binary formats (FSDB/WLF/SHM) are far smaller and faster than VCD.


Log verbosity at scale

A single $display is free. A million of them is formatting cost plus file I/O plus a 2 GB log nobody can open. Verbosity systems exist so the same testbench can run quiet in regression and loud in debug — but only if messages are filtered before formatting and verbosity is runtime-selectable.

systemverilog
// Runtime-selectable verbosity via plusarg — no recompile to go quiet
int unsigned verbosity = 100;            // default: regression-quiet

initial begin
  void'($value$plusargs("VERBOSITY=%d", verbosity));
end

// Filter BEFORE formatting (see TB Hotspots) — the guard is the savings
`define LOG_HIGH(msg_args) \
  if (verbosity >= 300) $display msg_args

// per-txn detail: free in regression (guard false), available in debug
// `LOG_HIGH(("txn %s at %0t", tr.convert2string(), $time))
diagram
LOG COST AT SCALE — 2,000-test nightly regression

  per-txn UVM_MEDIUM line, 50K txns/test:
     2,000 tests x 50,000 lines x ~120 bytes  =  ~12 GB of logs
     + formatting CPU + filesystem pressure on the farm

  regression-quiet profile (errors + summary only):
     2,000 tests x ~200 lines                 =  ~50 MB
     Same checking. Same coverage. All signal, no noise.

The rerun-with-waves flow

The professional pattern: regressions run fast and blind — no waves, quiet logs. When a test fails, an automated or one-command rerun repeats that exact test (same seed, same plusargs) with full visibility. You pay the visibility tax only on the handful of failing runs, not on thousands of passing ones.

diagram
POST-FAIL RERUN-WITH-WAVES FLOW

  ┌────────────────────────────────────────────────┐
  │ NIGHTLY REGRESSION (fast profile)              │
  │ 2,000 tests · no waves · quiet logs            │
  └────────────────────────────────────────────────┘
                       │
            1,997 PASS │ 3 FAIL
                       ▼
          ┌─────────────────────────┐
          │ harvest failure info:   │
          │ test name + SEED +      │
          │ plusargs + fail time T  │
          └─────────────────────────┘
                       │
                       ▼
  ┌────────────────────────────────────────────────┐
  │ RERUN (debug profile) — 3 runs only            │
  │ same seed  same behavior                      │
  │ +WAVES  +VERBOSITY=300                         │
  │ wave window opened around time T               │
  └────────────────────────────────────────────────┘
                       │
                       ▼
              debug with full visibility

  Cost: visibility tax on 3 runs instead of 2,000.
  Requirement: seeds logged, runs reproducible.

Key takeaways

  • Full-hierarchy dumping is for interactive debug of one failure, never the regression default.

  • Reduce wave cost in order: scope, depth, time window, binary format.

  • Verbosity must filter before formatting and be runtime-switchable via plusargs.

  • Run regressions blind; rerun failures with full visibility using the logged seed.

Common pitfalls

  • $dumpvars(0, tb_top) left in the regression script — every nightly run pays 30% for waves nobody opens.

  • Verbosity systems that format the message and then discard it.

  • Failing to log the seed — the rerun does not reproduce and the wave window is useless.

  • Dumping VCD when the vendor binary format is 10x smaller and faster.