Testbench Expert

Verilog 테스트벤치 작성, 시뮬레이션 실행, 디버깅 시 호출. Trigger on: 'testbench', 'tb', 'simulation', 'iverilog', 'vvp', 'assert', 'stimulus', 'waveform', '시뮬레이션', '검증'.

together2329 4c5fbf2 3 files · 3.0 KB Updated

File contents

Gotchas

  • 모듈을 먼저 read_file/analyze 한 후 테스트벤치 작성 — 포트를 추측하지 말 것
  • 모든 reg 초기화 필수 (clk=0, reset=1) — 미초기화 시 X 전파
  • race condition 방지: stimulus는 @(negedge clk) 또는 #1 지연 후 변경
  • 무한 대기 방지: fork/join_any + timeout 패턴 사용
  • compile: VCS → vcs -full64 -sverilog -o sim tb.sv dut.sv then ./sim; iverilog fallback → iverilog -g2012 -Wall -o sim tb.v dut.v then vvp sim
  • self-checking testbench 권장: expected vs actual 비교

Workflow

  1. read_file(module) → 포트/신호 파악
  2. generate_module_testbench(path, tb_type) 또는 직접 작성
  3. 시뮬레이터 컴파일 → 실행 (VCS 기본, iverilog fallback — simulation.md 참조)
  4. 에러 시 read_lines → replace_in_file → 재컴파일

References (read when needed)

Situation File
TB patterns (basic, AXI, self-checking) patterns.md
Compilation & simulation commands simulation.md

together2329/brian_hw/tree/main/common_ai_agent/skills/testbench-expert commit 4c5fbf2efd

Frequently asked questions

npx skillmds@latest add together2329/testbench-expert