[Paper Review] AutoBench: Automatic Testbench Generation and Evaluation Using LLMs for HDL Design
AutoBench is the first LLM-based framework for automatic testbench generation in HDL design, using a hybrid architecture combining Verilog and Python code generation with self-checking mechanisms. It achieves a 57% improvement in testbench pass@1 ratio—3.36× higher than baseline LLMs—by integrating prompt engineering, scenario-based testing, and an automated evaluation framework (AutoEval) for comprehensive quality assessment.
In digital circuit design, testbenches constitute the cornerstone of simulation-based hardware verification. Traditional methodologies for testbench generation during simulation-based hardware verification still remain partially manual, resulting in inefficiencies in testing various scenarios and requiring expensive time from designers. Large Language Models (LLMs) have demonstrated their potential in automating the circuit design flow. However, directly applying LLMs to generate testbenches suffers from a low pass rate. To address this challenge, we introduce AutoBench, the first LLM-based testbench generator for digital circuit design, which requires only the description of the design under test (DUT) to automatically generate comprehensive testbenches. In AutoBench, a hybrid testbench structure and a self-checking system are realized using LLMs. To validate the generated testbenches, we also introduce an automated testbench evaluation framework to evaluate the quality of generated testbenches from multiple perspectives. Experimental results demonstrate that AutoBench achieves a 57% improvement in the testbench pass@1 ratio compared with the baseline that directly generates testbenches using LLMs. For 75 sequential circuits, AutoBench successfully has a 3.36 times testbench pass@1 ratio compared with the baseline. The source codes and experimental results are open-sourced at this link: https://github.com/AutoBench/AutoBench
Motivation & Objective
- Address the inefficiency and manual effort in traditional simulation-based hardware verification, where testbench creation consumes up to 49% of design engineers' time.
- Overcome the low pass rate of direct LLM-generated testbenches by introducing a structured, multi-stage workflow for reliable testbench synthesis.
- Enable end-to-end automation of testbench generation, including stimulus creation and output checking, using only the DUT description as input.
- Develop a comprehensive evaluation framework (AutoEval) to objectively assess testbench quality across multiple metrics.
- Provide open-source code, dataset, and experimental results to support reproducibility and community adoption in EDA automation.
Proposed method
- Propose a hybrid testbench architecture that combines LLM-generated Verilog for DUT stimulation and Python for control logic, enhancing modularity and correctness.
- Implement a five-stage prompt engineering pipeline: (1) DUT specification parsing, (2) scenario identification, (3) test vector generation, (4) code completion with self-checking, and (5) code standardization and debugging.
- Integrate self-checking mechanisms by inserting $fdisplay statements at key timing points to export DUT signals for later validation.
- Apply iterative code refinement via LLM-based debugging and rebooting to improve correctness and reduce syntax or logic errors.
- Design AutoEval, an automated evaluation framework that uses LLMs to score testbenches across multiple dimensions: correctness, coverage, structure, and maintainability.
- Extend an existing benchmark dataset using LLMs to create a diverse, large-scale dataset for training and evaluation of testbench generation models.
Experimental results
Research questions
- RQ1Can LLMs be effectively leveraged to generate complete, executable testbenches for RTL designs without human-written test stimuli or reference signals?
- RQ2How does a structured, multi-stage LLM prompting pipeline improve the pass@1 ratio compared to direct testbench generation?
- RQ3To what extent can a self-checking mechanism embedded in LLM-generated testbenches improve verification reliability and automation?
- RQ4How effective is the proposed AutoEval framework in objectively measuring the quality of LLM-generated testbenches across multiple dimensions?
- RQ5Can the combination of hybrid code generation (Verilog + Python) and iterative refinement significantly reduce error rates in automated testbench synthesis?
Key findings
- AutoBench achieves a 57% improvement in testbench pass@1 ratio compared to direct LLM generation, demonstrating significant gains in reliability and correctness.
- For 75 sequential circuits, AutoBench achieves a 3.36× higher testbench pass@1 ratio than the baseline, indicating strong generalization across complex designs.
- The hybrid testbench architecture—combining Verilog and Python code generation—enables better modularity and control, reducing logic and syntax errors.
- AutoEval successfully evaluates testbench quality across multiple metrics, including correctness, coverage, and structure, enabling objective benchmarking of future frameworks.
- The open-sourced dataset and codebase, extended from prior work using LLMs, provide a scalable foundation for future research in LLM-based EDA automation.
- The iterative self-checking and debugging mechanism in AutoBench significantly improves code quality, reducing the need for manual intervention in testbench development.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.