arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.11140cs.PLcs.LGcs.SE
收藏

Verilog RTL代码生成的大语言模型基准测试

Benchmarking Large Language Models for Automated Verilog RTL Code Generation

New York University(纽约大学);University of Calgary(卡尔加里大学)

Shailja Thakur, Baleegh Ahmad, Zhenxing Fan, Hammond Pearce, Benjamin Tan, Ramesh Karri, Brendan Dolan-Gavitt, Siddharth Garg

摘要:

自动化硬件设计可以消除工程过程中的大量人为错误,从而减少错误。Verilog是一种流行的硬件描述语言,用于建模和设计数字系统,因此生成Verilog代码是关键的第一步。新兴的大语言模型(LLM)能够用其他程序设计语言编写高质量的代码。在本文中,我们的LLM生成有用的Verilog的能力的特点。为此,我们在从GitHub和Verilog教科书收集的Verilog数据集上微调了预训练的LLM。我们构建了一个评估框架,包括功能分析测试台和测试Verilog代码的语法生成的不同难度的问题的流程。我们的研究结果表明,在我们的问题场景中,微调导致LLM更能够生成语法正确的代码(总体为25.9%)。此外,在分析功能正确性时,经过微调的开源CodeGen LLM可以超越最先进的商业Codex LLM(总体为6.5%)。培训/评估脚本和LLM检查点可在https://github.com/shailja-thakur/VGen上找到。

英文摘要:

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. 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑