Skip to main navigation Skip to search Skip to main content

VRank: Enhancing Verilog Code Generation from Large Language Models via Self-Consistency

  • Zhuorui Zhao
  • , Ruidi Qiu
  • , Ing Chao Lin
  • , Grace Li Zhang
  • , Bing Li
  • , Ulf Schlichtmann
  • Technical University of Munich
  • National Cheng Kung University
  • Technische Universität Darmstadt
  • University of Siegen

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

6 Scopus citations

Abstract

Large Language Models (LLMs) have demonstrated promising capabilities in generating Verilog code from module specifications. To improve the quality of such generated Verilog codes, previous methods require either time-consuming manual inspection or generation of multiple Verilog codes, from which the one with the highest quality is selected with manually designed testbenches. To enhance the generation efficiency while maintaining the quality of the generated codes, we propose VRank, an automatic framework that generates Verilog codes with LLMs. In our framework, multiple code candidates are generated with LLMs by leveraging their probabilistic nature. Afterwards, we group Verilog code candidates into clusters based on identical outputs when tested against the same testbench, which is also generated by LLMs. Clusters are ranked based on the consistency they show on testbench. To determine the best candidate, Chain-of-Thought is further applied to select the best candidate from the top-ranked clusters. By systematically analyzing diverse outputs of generated codes, VRank reduces errors and enhances the overall quality of the generated Verilog code. Experimental results on the VerilogEval-Human benchmark demonstrate a significant 10.5% average increase in functional correctness (pass@1) across multiple LLMs, demonstrating VRank's effectiveness in improving the accuracy of automated hardware description language generation for complex design tasks.

Original languageEnglish
Title of host publicationProceedings of the 26th International Symposium on Quality Electronic Design, ISQED 2025
PublisherIEEE Computer Society
ISBN (Electronic)9798331509422
DOIs
StatePublished - 2025
Event26th International Symposium on Quality Electronic Design, ISQED 2025 - Hybrid, San Francisco, United States
Duration: 23 Apr 202525 Apr 2025

Publication series

NameProceedings - International Symposium on Quality Electronic Design, ISQED
ISSN (Print)1948-3287
ISSN (Electronic)1948-3295

Conference

Conference26th International Symposium on Quality Electronic Design, ISQED 2025
Country/TerritoryUnited States
CityHybrid, San Francisco
Period23/04/2525/04/25

Keywords

  • Large Language Model
  • Verilog code generation

Fingerprint

Dive into the research topics of 'VRank: Enhancing Verilog Code Generation from Large Language Models via Self-Consistency'. Together they form a unique fingerprint.

Cite this