TL;DR
AssertionBench is the first comprehensive benchmark designed to evaluate how well Large Language Models (LLMs) can automatically generate hardware assertions—the mathematical "rules" used to verify chip designs. The study reveals that while state-of-the-art models like GPT-4o show promise, even the best models currently fail to produce functionally correct assertions more than 44% of the time, highlighting a significant gap in LLMs' understanding of hardware semantics.
Introduction
In the world of hardware design (think CPUs, GPUs, and SoCs), "assertions" are critical. They are formal logical statements that describe how a circuit should behave (e.g., "if a request is made, a grant must follow within two cycles"). Writing these manually is a slow, error-prone process that requires deep expertise.
While researchers have recently turned to LLMs to automate this task, there hasn't been a standardized way to measure their performance. We didn't know which models were better, if providing more examples helped, or if the models actually "understood" the hardware logic or were just guessing syntax. AssertionBench fills this gap by providing a rigorous framework to test LLMs against real-world hardware designs.
Methodology
The researchers developed an evaluation pipeline that treats LLMs as "assertion generators" using In-Context Learning (ICL).
- Prompting: Models are given a Verilog design and a few "gold standard" examples (1-shot or 5-shot) of assertions.
- Syntax Correction: Because LLMs often struggle with the strict syntax of SystemVerilog Assertions (SVA), the authors used a GPT-3.5-based "Syntax Corrector" to fix minor formatting errors before verification.
- Formal Verification: This is the "ground truth" step. The generated assertions are fed into Cadence JasperGold, an industry-standard formal verification tool. This tool mathematically proves whether an assertion is actually true for the given design or if it's a "hallucination."
Datasets
The paper introduces AssertionBench, which consists of:
- 100 curated Verilog designs sourced from OpenCores, ranging from simple encoders to complex Floating Point Units (FPUs).
- Designs vary in complexity, with some being up to 20x larger than the examples provided in the prompts.
- Formally verified assertions for each design, generated using classical tools like GOLDMINE and HARM to serve as the evaluation baseline.
Key Results
The evaluation across multiple state-of-the-art models revealed several critical insights into the current state of LLM-driven hardware verification.
- Low Accuracy Ceiling: No model surpassed an average of 44% accuracy in generating valid assertions.
- High Failure Rates: Up to 63% of generated assertions were proven false by the formal verification tool (producing a "Counterexample" or CEX).
- Syntactic Errors: Even after correction, up to 33% of assertions remained syntactically invalid, meaning the models couldn't even "speak the language" correctly.
- GPT-4o is the Current Leader: GPT-4o was the most consistent performer, producing the highest fraction of valid assertions and the fewest counterexamples. It showed a 1.2x improvement in valid assertion generation when moving from 1-shot to 5-shot learning.
Discussion and Future Work
The study highlights a significant "Semantic Gap": being proficient in software coding (like Python) does not translate to hardware logic proficiency. Models often fail to capture the underlying logic of a circuit, even when they get the syntax right. Interestingly, more examples didn't always help; LLaMa3-70B actually lost accuracy with 5-shot prompting, likely due to confusion from increased variety in assertion styles.
Future work aims to expand the benchmark's scope to include VHDL and SystemC, as well as deeper temporal assertions and security-focused assertions to detect vulnerabilities like unauthorized data leaks. The next logical step is to explore whether fine-tuning LLMs specifically on hardware description languages (HDLs) can bridge the current accuracy gap.
Summary updated