arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.19296cs.LGcs.ARcs.PL
收藏

QiMeng-SALV:面向Verilog代码生成的信号感知学习

QiMeng-SALV: Signal-Aware Learning for Verilog Code Generation

State Key Lab of Processors, Institute of Computing Technology, CAS(处理器国家重点实验室,计算技术研究所,中国科学院);University of Chinese Academy of Sciences(中国科学院大学);University of Science and Technology of China(中国科学技术大学)

Yang Zhang, Rui Zhang, Jiaming Guo, Lei Huang, Di Huang, Yunpu Zhao, Shuyao Cheng, Pengwei Jin, Chongxiao Li, Zidong Du, Xing Hu, Qi Guo, Yunji Chen

AI总结:

QiMeng-SALV通过信号感知学习提升Verilog代码生成的准确性与性能,采用信号级优化解决功能奖励不足问题。

摘要:

大规模语言模型(LLMs)的显著进展为Verilog代码生成提供了有前景的机会,这对于自动化电路设计具有重要意义。缺乏有意义的功能奖励阻碍了基于强化学习(RL)的偏好优化,以生成功能正确的Verilog代码。在本文中,我们通过利用功能正确的输出信号代码段来优化RL训练,提出了面向Verilog代码生成的信号感知学习(QiMeng-SALV)。考虑到Verilog代码指定了硬件门和导线的结构互连,因此不同的输出信号是独立的,QiMeng-SALV的关键见解是提取在部分不正确的模块中已验证的信号感知实现,以增强有意义的功能奖励的提取。大致来说,我们通过将生成模块的信号与训练数据中参考模块的信号进行比较,来验证生成模块中信号的功能正确性。然后利用抽象语法树(AST)来识别信号感知代码段,这些代码段可以从错误模块中提供有意义的功能奖励。最后,我们引入了信号感知DPO,该方法在正确的信号级别代码段上进行优化,从而防止来自错误信号的噪声和干扰。所提出的QiMeng-SALV强调了从传统模块级到细粒度信号级优化的范式转变,在Verilog代码生成中解决了功能奖励不足的问题。实验表明,我们的方法在VerilogEval和RTLLM上实现了最先进的性能,7B参数模型的性能与DeepSeek v3 671B模型相当,并显著优于在同一数据集上训练的领先开源模型CodeV。我们的代码可在https://github.com/QiMeng-IPRC/QiMeng-SALV上获得。

英文摘要:

The remarkable progress of Large Language Models (LLMs) presents promising opportunities for Verilog code generation which is significantly important for automated circuit design. The lacking of meaningful functional rewards hinders the preference optimization based on Reinforcement Learning (RL) for producing functionally correct Verilog code. In this paper, we propose Signal-Aware Learning for Verilog code generation (QiMeng-SALV) by leveraging code segments of functionally correct output signal to optimize RL training. Considering Verilog code specifies the structural interconnection of hardware gates and wires so that different output signals are independent, the key insight of QiMeng-SALV is to extract verified signal-aware implementations in partially incorrect modules, so as to enhance the extraction of meaningful functional rewards. Roughly, we verify the functional correctness of signals in generated module by comparing with that of reference module in the training data. Then abstract syntax tree (AST) is employed to identify signal-aware code segments which can provide meaningful functional rewards from erroneous modules. Finally, we introduce signal-aware DPO which is optimized on the correct signal-level code segments, thereby preventing noise and interference from incorrect signals. The proposed QiMeng-SALV underscores the paradigm shift from conventional module-level to fine-grained signal-level optimization in Verilog code generation, addressing the issue of insufficient functional rewards. Experiments demonstrate that our method achieves state-of-the-art performance on VerilogEval and RTLLM, with a 7B parameter model matching the performance of the DeepSeek v3 671B model and significantly outperforming the leading open-source model CodeV trained on the same dataset. Our code is available at https://github.com/QiMeng-IPRC/QiMeng-SALV.

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

↑