agentleFS
DangoSysDangoSys/skills/debug-verilator/SKILL.md

debug-verilator

Skill1 starsChanged 2 months agoApache-2.0View on GitHub

Diagnose Buckyball small-workload RTL failures, hangs, or BEMU/Verilator differences using diff, itrace, and mtrace. Use after the corresponding BEMU contract is green.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use a small deterministic workload under the intended chip configuration.

    line 8
  2. Distinctive:

    If the run crashes, mismatches, or stops making progress, inspect the first diff discrepancy and itrace/mtrace.

    line 17
  3. Distinctive:

    Use bounded state/handshake diagnostics when traces narrow the failing state but omit the needed internal event.

    line 23
  4. Very specific:

    Use $waveform only as a last resort when diff and execution/memory traces cannot resolve the remaining cycle-level handshake question.

    line 25
  5. Distinctive:

    Keep the first actionable failing instruction.

    line 29
  6. Distinctive:

    Keep reference checking small too.

    line 35
  7. Distinctive:

    Check simulator build identity after another backend builds into the same target directory.

    line 40
  8. Very specific:

    After a targeted fix, repeat the failing case and affected existing small cases with diff.

    line 45
  9. Very specific:

    Prefer project MCP build/simulation tools, polling trace IDs to terminal results.

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Verilator Debugging

Use a small deterministic workload under the intended chip configuration. Confirm its build and BEMU result before investigating RTL. Follow $ball-align for fixes that span ISA, emulator, compiler, RTL, or UVM.

First run and failure localization

  1. Enable diff=true on the first Verilator run, normally with no_wave=true. Build a matching diff-capable simulator. Reuse *_sim only when that binary represents the current RTL and configuration.
  2. If the run crashes, mismatches, or stops making progress, inspect the first diff discrepancy and itrace/mtrace. If needed, re-run the same small case with those trace options enabled. Do not begin by opening a waveform.
  3. Align instruction ID, PC/opcode, ROB/sub-ROB tag, bank identity, address/group, and command completion. Check the producer's writes, consumer's reads, and output packing before forming a timing hypothesis.
  4. Use bounded state/handshake diagnostics when traces narrow the failing state but omit the needed internal event. Remove temporary diagnostics after the fix.
  5. Use $waveform only as a last resort when diff and execution/memory traces cannot resolve the remaining cycle-level handshake question. State that question and inspect only its relevant signals/time interval.

Keep the first actionable failing instruction. Input corruption, missing completion, incorrect accumulation, and a wrong result tag require different fixes; do not patch unverified guesses. A running process alone does not establish progress, and an MCP timeout does not prove that compilation stopped. Inspect the owned job and task state before retrying; avoid overlapping clean/build jobs for one simulator directory.

Keep reference checking small too. Precompute a deterministic mathematical golden at compile time when possible; a tiny accelerator case can otherwise spend most of its RTL execution in a large CPU reference loop. Preserve independent reference semantics when shortening the checker.

Check simulator build identity after another backend builds into the same target directory. An old marker can coexist with a newly linked executable lacking the Verilator runner. For loader/GLIBCXX errors, inspect DRAMSim and SDK library paths before debugging RTL; use the project's simulator-scoped runtime-library selection.

After a targeted fix, repeat the failing case and affected existing small cases with diff. Run existing UVM coverage after RTL is green. Collect pmctrace when hardware performance evidence is needed and distinguish simulator sample indices from cycles.

Prefer project MCP build/simulation tools, polling trace IDs to terminal results. With user-authorized fallback for MCP failure, use nix develop -c bbdev, inspect current help, and retain logs/exit status. Do not run a full model in Verilator.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.