ComplexVCoder:一个由 LLM 驱动的用于系统生成复杂 Verilog 代码的框架
摘要
近期的进展表明,大型语言模型(LLM)在生成寄存器传递水平(RTL)代码(如 Verilog)方面展现出巨大的潜力。然而,现有的 LLM-based 框架在准确处理真实世界 RTL 设计的复杂性方面仍面临重大挑战,尤其是大规模且涉及多级模块实例化的设计。为此,我们提出了 ComplexVCoder,一个开源的 LLM 驱动框架,通过增强复杂 Verilog 代码的生成质量和效率来应对上述问题。具体而言,我们引入了两阶段生成机制,利用中间表示(intermediate representation),实现从自然语言描述到复杂 Verilog 设计的更精确和结构化的转换。此外,我们引入了基于规则的对齐方法和基于域的检索增强生成(retrieval-augmented generation, RAG),通过在生成过程中融入相关设计知识,进一步提高合成代码的正确性。为评估 our 方法,我们构建了一个包含 55 个源自真实实现的复杂 Verilog 设计的综合数据集。我们也发布了一个用于系统评估自动生成 RTL 代码质量的开源基准套件,以及 ComplexVCoder 框架本身。实验结果表明,ComplexVCoder 在复杂 Verilog 基准测试中的功能正确性方面,分别比 CodeV 和 RTLCoder 提升了 14.6% 和 22.2%。此外,ComplexVCoder 使用轻量级 32B 模型(Qwen2.5)即可实现与 GPT-3.5 和 DeepSeek-V3 等大规模模型相当的生成性能。
引用
@article{arxiv.2504.20653,
title = {ComplexVCoder: An LLM-Driven Framework for Systematic Generation of Complex Verilog Code},
author = {Jian Zuo and Junzhe Liu and Xianyong Wang and Yicheng Liu and Navya Goli and Tong Xu and Hao Zhang and Umamaheswara Rao Tida and Zhenge Jia and Mengying Zhao},
journal= {arXiv preprint arXiv:2504.20653},
year = {2025}
}
备注
Withdrawn due to an error in the experimental setup that affected the results. A corrected version is in progress