← ClaudeAtlas

rtl-testbench-disciplinelisted

Write and review hardware testbenches that decide pass or fail by themselves. Covers self-checking structure with scoreboards and error counters, watchdog timeouts, SystemVerilog assertions, functional coverage, constrained random stimulus with reproducible seeds, cocotb testbenches, and UVM agent, phase and sequence structure. Use when writing or reviewing a testbench, a cocotb test, a UVM environment, an SVA property or a covergroup, when a simulation passes but the hardware does not work, when a test hangs or exits zero after failing, or when deciding how much verification a block needs. Not for the design RTL itself, which belongs to rtl-verilog-lint.
Premchand006/AI-assistant-skills · ★ 0 · Testing & QA · score 73
Install: claude install-skill Premchand006/AI-assistant-skills
# Testbenches that can fail A testbench that prints signals for a human to read is a demo. A testbench that decides pass or fail, cannot hang, and says why it failed is a regression test. The gap between them is where "simulation was clean" comes from on a design that does not work. ```bash python3 scripts/check_testbench.py tb/ --fail-on error ``` The checker handles SystemVerilog and cocotb, and looks for testbenches that cannot fail: no assertion or comparison anywhere, no watchdog, an exit status that ignores the result, stimulus racing the clock edge the DUT samples on. ## The five properties **It checks.** Compare against an expected value from a reference model, not against a value copied out of a previous waveform. A scoreboard — a model simple enough to be obviously correct, compared on every transaction — scales past the twenty-case mark where hand-written expected values stop being maintainable. **It counts what it checked.** Zero errors out of zero checks is the most common false pass in hardware verification. Report both, and fail a run where the check count is zero. **It cannot hang.** A watchdog that calls `$fatal` after a bounded time, or `timeout_time` on `@cocotb.test()`. Without it, a DUT that never asserts `done` blocks a CI runner until someone notices. **Its exit status is the result.** `$finish` exits 0, so a failing test that ends in `$finish` is a green build. End failing runs with `$fatal(1)`. In UVM, set `set_report_max_quit_count(1)` so `UV