arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.18326cs.ARcs.AI
收藏

基于分类的LLM自动HDL代码生成

Classification-Based Automatic HDL Code Generation Using LLMs

Technical University of Munich (TUM)(慕尼黑工业大学);University of Siegen(锡根大学);TU Darmstadt(达姆施塔特工业大学);Zhejiang University(浙江大学)

Wenhao Sun, Bing Li, Grace Li Zhang, Xunzhao Yin, Cheng Zhuo, Ulf Schlichtmann

AI总结:

本研究提出一种受人类专家启发的方法,通过LLM分类电路类型并拆分任务为子流程,结合EDA工具与搜索方法,显著提升了HDL代码生成的功能正确性并减少了幻觉。

摘要:

尽管大型语言模型(LLMs)已展现出为数字电路生成硬件描述语言(HDL)代码的能力,但它们仍受幻觉问题的困扰,导致生成错误的HDL代码或误解规范。在本研究中,我们引入一种受人类专家启发的方法,以缓解LLMs的幻觉并提升HDL代码生成的性能。我们首先让LLMs基于规范对电路类型进行分类。然后,根据电路类型,我们将任务拆分为多个子流程,包括信息提取以及使用电子设计自动化(EDA)工具的类人设计流程。此外,我们还采用搜索方法来缓解代码生成中的变异。实验结果表明,我们的方法能显著提升生成Verilog的功能正确性,并减少LLMs的幻觉。

英文摘要:

While large language models (LLMs) have demonstrated the ability to generate hardware description language (HDL) code for digital circuits, they still suffer from the hallucination problem, which leads to the generation of incorrect HDL code or misunderstanding of specifications. In this work, we introduce a human-expert-inspired method to mitigate the hallucination of LLMs and improve the performance in HDL code generation. We first let LLMs classify the type of the circuit based on the specifications. Then, according to the type of the circuit, we split the tasks into several sub-procedures, including information extraction and human-like design flow using Electronic Design Automation (EDA) tools. Besides, we also use a search method to mitigate the variation in code generation. Experimental results show that our method can significantly improve the functional correctness of the generated Verilog and reduce the hallucination of LLMs.

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

↑