Part 7 · Environment & Tests · Intermediate

Plusargs Debug: Symptom-First CLI Triage

Deterministic debug workflow for wrong test selection, missing knobs, parser typos, cfg mapping errors, and non-replayable regression failures.

Debug boundary order

Troubleshoot plusarg issues in strict order: test name, seed, built-ins, custom flags, cfg mapping, env consumption.

diagram
[TEST][UVM] plusarg triage matrix

wrong test runs:
  +UVM_TESTNAME typo / class not registered

knob ignored:
  flag name mismatch (+SEQ_CNT vs +SEQ_COUNT)
  parse called after env already built

unexpected env mode:
  cfg field not mapped from plusarg
  child test skipped super.configure_from_plusargs()

non-replayable failure:
  seed or plusargs not captured in log bundle
systemverilog
function void report_phase(uvm_phase phase);
  super.report_phase(phase);
  `uvm_info("CLI_SUMMARY",
    $sformatf("test=%s seed=%0d seq_count=%0d mode=%s",
      get_type_name(),
      $get_initial_random_seed(),
      cfg.seq_count,
      cfg.mode_name()),
    UVM_NONE)
endfunction

Key takeaways

  • Capture test + seed + plusargs before changing any source.

  • Compare CFG_RESOLVED logs across pass and fail runs first.

  • Most ignored knobs are typos or parse-order mistakes.

Common pitfalls

  • Debugging sequences before verifying CLI and cfg resolution.

  • Fixing tests without re-running the exact failing command line.

  • Assuming simv defaults match base_test apply_defaults().


Deterministic debug toolkit

Keep low-cost CLI diagnostics always enabled in base_test to shorten regression triage loops.

Instrumentation primitives

systemverilog
function void dump_plusarg_matches();
  uvm_cmdline_processor clp = uvm_cmdline_processor::get_inst();
  string args[$];
  clp.get_args(args);
  foreach (args[i])
    `uvm_info("CLI_ARG", args[i], UVM_MEDIUM)
endfunction
bash
# Reproduce exact failing cell
./simv +UVM_TESTNAME=burst_traffic_test \
       +SEQ_COUNT=2000 +MODE=strict \
       +ntb_random_seed=9001 \
       +UVM_VERBOSITY=UVM_MEDIUM

Issue reproduction checklist

  1. Copy exact command line from CI log (test, seed, all plusargs).

  2. Run once at UVM_LOW; confirm CFG_RESOLVED matches expectation.

  3. If knob wrong: grep parser for flag name and mapping function.

  4. If test wrong: verify factory registration and testlist entry.

  5. If env ignores cfg: trace config_db set/get paths.

  6. Only then inspect sequences and scoreboard internals.

diagram
[DEBUG] pass criteria

same command line + same seed
-> same CFG_RESOLVED log
-> same pass/fail outcome

Key takeaways

  • CLI_SUMMARY in report_phase makes post-run audits trivial.

  • dump_plusarg_matches() resolves flag typos in minutes.

  • Exact command-line replay is mandatory before deep debug.

Common pitfalls

  • Tweaking parser while failing seed is not frozen.

  • Relying on memory of plusargs instead of CI artifacts.

  • Enabling UVM_FULL globally before establishing cfg baseline.