Part 10 · Advanced Topics · Intermediate

Simulation Performance and Memory

Hub - profile-driven UVM optimization: methodology, logging cost, object churn, hierarchy scale, and memory leak prevention.

Overview

Performance work should be evidence-driven. Most large UVM environments lose runtime in a few predictable places: excessive log formatting, avoidable object allocation, overly dense component hierarchy, and unbounded data structures. The fix is not a single trick but a measurement loop.

This topic turns performance tuning into repeatable engineering. You will profile first, prioritize hotspots, apply targeted changes, and validate both speed and correctness. Every lesson includes commands and code patterns you can put directly into regression infrastructure.

Lessons in this topic

  1. Profiling Methodology - build a repeatable baseline and hotspot attribution loop.

  2. Verbosity and Logging Cost - cut expensive logging overhead without losing debuggability.

  3. Object Churn and Field Automation - reduce alloc/copy/print costs in transaction-heavy paths.

  4. Hierarchy and Component Count - control structural overhead in large-scale benches.

  5. Memory, Queues, and Leaks - prevent long-run memory growth and stale object retention.

Performance workflow map

diagram
[PERF] [UVM] optimization workflow

  baseline run
      |
      v
  profile capture (time + memory)
      |
      v
  hotspot ranking (top N contributors)
      |
      v
  targeted fix + A/B measurement
      |
      +--> speedup validated?
              |
             yes ------------------> keep change + add guardrail
              |
             no
              |
              v
           rollback and inspect next hotspot

  [REG] always compare on representative nightly tests, not micro toy only
bash
# Baseline command shape
simv +UVM_TESTNAME=axi_long_random \
     +UVM_VERBOSITY=UVM_LOW \
     -l out/logs/axi_long_random_baseline.log

Key takeaways

  • Profile first, optimize second, re-measure always.

  • Logging and allocation behavior dominate many UVM performance issues.

  • Use representative regression tests for optimization decisions.

  • Treat performance guardrails as part of verification quality.

Common pitfalls

  • Optimizing code paths that are not hotspots.

  • Benchmarking with unrealistic tiny tests and overfitting changes.

  • Trading away observability without adding targeted debug controls.