Benchmarking Large Language Models for Automated Verilog RTL Code Generation

Shailja Thakur, Baleegh Ahmad, Zhenxing Fan, Hammond Pearce, Benjamin Tan +3 more
12/13/2022
cs.PLcs.LGcs.SE
benchmark-dataset

Official code: shailja-thakur/VGen (211 stars, Jupyter Notebook, Apache-2.0, last commit 2024-10-17).

Abstract

Automating hardware design could obviate a significant amount of human error from the engineering process and lead to fewer errors. Verilog is a popular hardware description language to model and design digital systems, thus generating Verilog code is a critical first step.

Show full abstract

Emerging large language models (LLMs) are able to write high-quality code in other programming languages. In this paper, we characterize the ability of LLMs to generate useful Verilog. For this, we fine-tune pre-trained LLMs on Verilog datasets collected from GitHub and Verilog textbooks. We construct an evaluation framework comprising test-benches for functional analysis and a flow to test the syntax of Verilog code generated in response to problems of varying difficulty. Our findings show that across our problem scenarios, the fine-tuning results in LLMs more capable of producing syntactically correct code (25.9% overall). Further, when analyzing functional correctness, a fine-tuned open-source CodeGen LLM can outperform the state-of-the-art commercial Codex LLM (6.5% overall). Training/evaluation scripts and LLM checkpoints are available: https://github.com/shailja-thakur/VGen.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
21112Jupyter Notebook, VerilogSep 18, 20222 years agoApache-2.0

Similar Papers

Cite this paper

@article{thakur2022benchmarking,
  title  = {Benchmarking Large Language Models for Automated Verilog RTL Code Generation},
  author = {Shailja Thakur and Baleegh Ahmad and Zhenxing Fan and Hammond Pearce and Benjamin Tan and Ramesh Karri and Brendan Dolan-Gavitt and Siddharth Garg},
  year   = {2022},
  eprint = {2212.11140},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2212.11140}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2212.11140.svg)](https://codeofpaper.com/paper/2212.11140)

Discussion