基于范式的使用大语言模型自动生成HDL代码
Paradigm-Based Automatic HDL Code Generation Using LLMs
AI总结:
本文提出一种基于人类专家启发的范式块方法,通过信息提取、类人设计流程和外部工具集成,并采用两阶段多轮生成工作流,以缓解大语言模型在HDL代码生成中的幻觉问题,显著提升Verilog代码的功能正确性。
摘要:
尽管大语言模型(LLMs)已展示出生成数字电路硬件描述语言(HDL)代码的能力,但它们仍面临幻觉问题,这可能导致生成错误的HDL代码或误解规格说明。在本工作中,我们引入了一种受人类专家启发的方法,以缓解LLMs的幻觉并提升其在HDL代码生成中的性能。我们首先构建专门的范式块,这些块由若干步骤组成,旨在分而治之地处理生成任务,模仿人类专家的设计方法论。这些步骤包括信息提取、类人设计流程以及外部工具的集成。然后,指示LLMs对电路类型进行分类,以便将其与合适的范式块匹配,并执行该块以生成HDL代码。此外,我们提出了一种用于多轮生成的两阶段工作流,旨在在有限的生成和验证轮次内有效提高生成HDL代码的测试台通过率。实验结果表明,我们的方法显著提升了生成的Verilog代码的功能正确性。
英文摘要:
While large language models (LLMs) have demonstrated the ability to generate hardware description language (HDL) code for digital circuits, they still face the hallucination problem, which can result in the generation of incorrect HDL code or misinterpretation of specifications. In this work, we introduce a human-expert-inspired method to mitigate the hallucination of LLMs and enhance their performance in HDL code generation. We begin by constructing specialized paradigm blocks that consist of several steps designed to divide and conquer generation tasks, mirroring the design methodology of human experts. These steps include information extraction, human-like design flows, and the integration of external tools. LLMs are then instructed to classify the type of circuit in order to match it with the appropriate paradigm block and execute the block to generate the HDL codes. Additionally, we propose a two-phase workflow for multi-round generation, aimed at effectively improving the testbench pass rate of the generated HDL codes within a limited number of generation and verification rounds. Experimental results demonstrate that our method significantly enhances the functional correctness of the generated Verilog code
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。