Introduction
The integration of Large Language Models (LLMs) into the software engineering workflow has yielded transformative results, particularly in code generation and debugging. However, the transition of these technologies into the realm of hardware design—specifically the generation of Register-Transfer Level (RTL) code like Verilog—has encountered significant hurdles. Researchers from the Chinese Academy of Sciences and collaborating institutions argue that the current reliance on text-only models is reaching a fundamental limit. Because hardware design is inherently spatial and structural, linear natural language is often an inadequate medium for describing complex circuitry. This paper introduces a multi-modal approach that combines visual diagrams with natural language, demonstrating a substantial leap in the accuracy and efficiency of automated Verilog generation.
The Limitations of Text-Only Hardware Design
In Electronic Design Automation (EDA), the goal is to translate functional requirements into hardware descriptions. While text-only LLMs have become proficient at generating simple modules, they struggle as complexity increases due to three primary factors:
- Spatial Complexity: Describing nested hardware structures, such as a multi-stage processor pipeline, in a purely linear text format is cumbersome and frequently leads to ambiguity.
- Token Inefficiency: Describing the interconnections between $N$ modules in text requires $O(N^2)$ tokens. This "token bloat" consumes the model's context window and increases the likelihood of processing errors. In contrast, a single diagram can convey these relationships instantaneously.
- Misalignment Risk: Without a visual map of the intended architecture, models often "misroute" signals to incorrect ports, failing to maintain the structural integrity of the circuit.
Essentially, attempting to describe a complex circuit using only words is akin to describing a detailed geographic map over a phone call—it is inefficient and highly prone to error.
Methodology: VLMQL and Vision-Language Co-design
To address these limitations, the researchers proposed a Vision-Language Co-design workflow centered around a new framework called VLMQL (Verilog Large Model Query Language). This Python-based framework formalizes multi-modal prompts by allowing users to:
- Define Hardware Tiers: Specify whether the design is gate-level, algorithmic, or a functional block.
- Integrate Visuals: Embed image paths of circuit diagrams directly into the query.
- Set Functional Constraints: Define specific logic requirements in a structured format.
A key component of this methodology is the use of Word Notations. These are labels on visual diagrams (e.g., "ALU," "Register File") that act as anchors, helping the model align its linguistic understanding with specific visual components. The researchers also employed Hierarchical Prompting, testing models with varying levels of information—from simple diagrams to exhaustive specifications—to determine the optimal balance of visual and textual data.
Benchmarking and Datasets
The study introduced a new, open-source benchmark for multi-modal Verilog generation consisting of 30 tasks categorized by complexity:
- Arithmetic Level: Basic units such as adders, multipliers, and dividers.
- Logic Level: Standard controllers including Finite State Machines (FSMs), counters, and multiplexers.
- Advanced Level: Complex architectures such as 5-stage pipelines, systolic arrays, and General Matrix Multiply (GEMM) accelerators.
The researchers evaluated several foundational models on this benchmark, including GPT-4V, GPT-4 (text-only), LLaVA, and LLaMA.
Key Results and Insights
The experimental results highlight the clear advantage of multi-modality in hardware design:
- Performance Leap: GPT-4V, utilizing both text and images, achieved a 71.81% success rate (pass@5) on the benchmark. In comparison, the text-only GPT-4 achieved only 46.88%.
- Syntax and Structure: The inclusion of vision improved syntax success rates from 68.75% to 84.38% for the GPT-4 series. Visual cues acted as "anchors," significantly reducing signal routing errors.
- Open-Source Gains: Smaller models like LLaVA also benefited, with success rates jumping from approximately 13% to nearly 26% when multi-modality was introduced.
- The Multi-modal Synergy: An ablation study confirmed that while vision is powerful, it is not a standalone solution. The "mix input" mode (Text + Image) performed best, suggesting that diagrams provide the structural framework while text provides the necessary functional logic.
Challenges and Future Directions
Despite these advancements, the study identified persistent challenges. Current models show high sensitivity to the complexity of Finite State Machines; as the number of states in an FSM increased from 2 to 9, the success rate eventually dropped to zero. This indicates a significant limitation in the "long-distance" reasoning capabilities of current Vision-Language Models (VLMs).
Future research will focus on improving model performance for high-state-count FSMs, standardizing diagram formats to enhance machine readability, and expanding the benchmark to include diverse hardware architectures such as asynchronous circuits and specialized AI accelerators. By moving beyond natural language, the field of EDA can more effectively leverage AI to manage the inherent spatial complexity of modern hardware design.
Summary updated