TB or Not TB: Coverage-Driven Direct Preference Optimization for Verilog Stimulus Generation
1 st Bardia Nadimi, 2 nd Khashayar Filom, 3 rd Deming Chen, 4 th Hao Zheng · 2025
Read TB or Not TB: Coverage-Driven Direct Preference Optimization for Verilog Stimulus Generation by 1 st Bardia Nadimi, 2 nd Khashayar Filom, 3 rd Deming Chen, 4 th Hao Zheng (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-15767.txt.
Introduction
Bardia Nadimi, Khashayar Filom, Deming Chen, and Hao Zheng present a framework that teaches language models to write test stimuli for chip design checks. Checking is the most time-consuming stage of hardware design. Writing good testbenches, code that stimulates a design and checks its responses, is key but labor-intensive. Their method trains the model with preference feedback driven by measured code coverage.
A data set pairs high-quality and low-quality testbenches, labeled by simulation coverage. Coverage-driven preference tuning then pushes the model toward stimuli that exercise more of the design. On a standard benchmark, the framework beat open and commercial baselines. It improved code coverage by up to roughly three quarters over the comparison point.
Catalog record
| CREATOR | 1 st Bardia Nadimi, 2 nd Khashayar Filom, 3 rd Deming Chen, 4 th Hao Zheng |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 33 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2511-15767
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
TB or Not TB: Coverage-Driven Direct Preference Optimization for Verilog Stimulus Generation 1 st Bardia Nadimi, 2 nd Khashayar Filom, 3 rd Deming Chen, 4 th Hao Zheng Abstract With the rapid advancement of Large Language Models (LLMs), there is growing interest in applying them to hardware design and verification. Among these stages, design verification remains the most time-consuming and resource-intensive phase, where generating effective stimuli for the design under test (DUT) is both critical and labor-intensive. We present TB or not TB , a framework for automated stimulus generation using LLMs fine-tuned through Coverage-Driven Direct Preference Optimization (CD-DPO). To enable preference-based training, we introduce PairaNet, a dataset derived from PyraNet that pairs high- and low-quality testbenches labeled using simulation-derived coverage metrics. The proposed CD-DPO method integrates quantitative coverage feedback directly into the optimization objective, guiding the model toward generating stimuli that maximize verification coverage. Experiments on the CVDP CID12 benchmark show that TB or not TB outperforms both open-source and commercial baselines, achieving up to 77.27% improvement in code coverage, demonstrating the effectiveness of Coverage-driven preference optimization for LLM-based hardware verification. † † aftertitle: I Introduction and Motivation Since the introduction of the Transformer architecture [ 1 ] , attention-based models have become central to modern AI. Models such as GPT [ 2 ] , BERT [ 3 ] , and LaMDA [ 4 ] have demonstrated the scalability and versatility of transformers across a wide range of language tasks, solidifying their role as the foundation of contemporary AI systems. Building on these advances, the hardware design and verification community has increasingly explored Large Language Models (LLMs) to automate traditionally manual tasks in Electronic Design Automation (EDA). While early studies explored RTL code generation [ 5 , 6 , 7 , 8 ] and design documentation [ 9 , 10 ] , recent work has shifted to design verification [ 11 , 12 , 13 , 14 , 15 , 16 ] , which remains one of the most critical and resource-intensive stages of the design cycle (often more than half of the project effort). A core bottleneck in verification is generating high-quality stimuli within testbenches to exercise the design under test (DUT) across functional and corner-case scenarios. Manual testbench development is labor-intensive, error-prone, and requires significant expertise to balance coverage goals while avoiding over-constrained tests. Although Automatic Test Pattern Generation (ATPG) automates test pattern generation, it primarily targets manufacturing faults and relies on specific fault models. These challenges have motivated growing interest in LLM-driven verification to accelerate and scale testbench generation while preserving verification quality. Recent research has increasingly explored the use of LLMs to automate hardware design verification, particularly testbench and stimulus generation. LLM4DV [ 14 ] introduced one of the first open-source frameworks for LLM-driven stimulus generation, showing that prompt engineering can achieve coverage competitive with constrained-random testing. AutoBench [ 12 ] extended this direction with a fully automated pipeline that generates and evaluates testbenches from design descriptions using structural and self-checking mechanisms. CorrectBench [ 13 ] further added self-validation and self-correction capabilities, enabling iterative refinement and improving pass rates and coverage. VerilogReader [ 17 ] complemented these efforts by integrating LLMs into a coverage-directed loop that analyzes Verilog code and coverage reports to generate stimuli targeting uncovered behavior. Collectively, these works show a progression in LLM-based hardware verification—from prompt-based stimulus generation (LLM4DV) to automated evaluation (AutoBench), self-correcting refinement (CorrectBench), and coverage-driven feedback integration (VerilogReader). Despite this progress, key limitations remain in robustness, generalization, and the systematic use of quantitative coverage signals during training. These gaps motivate the need for a principled, coverage-driven optimization framework that directly aligns model behavior with verification objectives, as pursued in this work. By combining prompt engineering, fine-tuning, and coverage evaluation via EDA tools, LLMs can be adapted to generate high-quality verification stimuli. When trained with curated datasets and preference-based optimization, these models learn to produce testbenches that meaningfully exercise the DUT while reducing manual effort. This paradigm lowers verification overhead and improves coverage, enabling more scalable and reliable AI-driven verification flows. In this work, we propose a preference-based training framework for automated stimulus generation using LLMs, where the model learns from relative preferences between pairs of outputs rather than absolute rewards, enabling it to identify testbenches that better satisfy verification objectives. Unlike reinforcement learning approaches that rely on continual simulator interaction, our method reformulates the task as supervised preference learning: candidate testbenches are generated and simulated offline, coverage metrics are collected via professional EDA tools, and the model is fine-tuned to distinguish high-coverage from low-coverage samples, thereby learning coverage-driven generation behavior from offline data. This design offers several advantages. First, training is fully GPU-bound and simulator-free (during training), enabling stable and sample-efficient optimization through dense preference supervision. Second, the infrastructure remains lightweight by eliminating online simulation, while decoupling data generation from model optimization allows large-scale parallel simulation for coverage extraction and dataset expansion with minimal overhead. Finally, unlike online RL methods, the preference signals originate from a higher-quality commercial model, providing richer domain knowledge and enabling more effective alignment of the target model with verification objectives. The proposed framework provides a practical and scalable foundation for LLM-driven verification, achieving a balanced trade-off between efficiency, stability, and coverage fidelity. Our results show that preference-based optimization with offline coverage feedback is an effective step toward autonomous testbench generation. This paper makes the following key contributions: 1) We introduce the first framework for automated SystemVerilog stimulus generation that replaces simulator-in-the-loop reinforcement learning with offline supervised preference learning. By simulating testbenches once and storing their coverage metrics, the approach enables fully GPU-bound, scalable, and simulation-free training. 2) We developed a coverage-driven DPO (CD-DPO) framework based on standard DPO [ 18 ] that incorporates quantitative feedback from code, branch, and functional coverage metrics. This guides the model toward generating high-coverage, robust stimuli and links preference optimization with coverage-driven verification goals. 3) We introduce PairaNet 1 1 1 https://huggingface.co/datasets/bnadimi/TB_or_Not_TB , the first open-source dataset for coverage-driven DPO training. Derived from PyraNet, it provides paired testbenches labeled with simulation-based coverage metrics, enabling preference learning from quantitative verification feedback. Its public release supports reproducible, data-driven research in LLM-based hardware verification. 4) Experimental results show that the proposed TB or not TB model achieves up to 77.27% improvement in code coverage compared to the vanilla Qwen3 model and 56.78% improvement compared to Claude Sonnet 3.5 when evaluated on the best result among 20 generations. The remainder of this paper is organized as follows. Section II presents our proposed methodology in detail. Section III reports the experimental results along with ablation studies and finally, Section IV concludes the paper. II Methodology and Dataset This section outlines the proposed stimulus generation framework, reviews the DPO foundations it builds upon, describes the construction of the preference-based dataset, and details the CD-DPO technique incorporating quantitative coverage feedback for improved testbench generation. II-A Overview of the Framework The proposed framework follows a structured pipeline designed for preference-based optimization of testbench generation. As illustrated in Fig. 1 , the process begins with the PyraNet dataset [ 19 ] , which provides the foundational design samples used for dataset curation. We selected PyraNet as the base dataset because it provides a large, diverse collection of hardware