用大模型+符号推理优化电路代码,提升性能功耗面积
SymRTLO: Enhancing RTL Code Optimization with LLMs and Neuron-Inspired Symbolic Reasoning
- 结合大模型与符号推理,自动重写电路代码
- 在基准测试中功耗降低43.9%,性能提升62.5%
- 适合芯片设计工程师快速优化复杂电路
寄存器传输级(RTL)代码优化对数字电路的功耗、性能和面积(PPA)至关重要。人工根据综合反馈手动重写虽效果好,但耗时且易出错。现有编译器方法难以处理复杂约束。基于大语言模型(LLM)的方法虽有潜力,但常无法保证生成代码与提示一致。本文提出SymRTLO,一种融合LLM代码重写与符号推理的新型框架。通过检索增强生成(RAG)系统与抽象语法树(AST)模板,确保代码语法规则正确并减少意外行为。提出符号模块用于优化有限状态机(FSM)逻辑,实现细粒度状态合并与部分规格处理,超越传统模式匹配编译器能力。此外,结合形式等价验证与测试驱动验证的快速验证流水线,降低验证复杂度。在RTL-Rewriter基准上使用Synopsys Design Compiler与Yosys实验显示,相比最先进方法,SymRTLO可使功耗降低43.9%、性能提升62.5%、面积减少51.1%。
原文摘要 · Abstract (English)
Optimizing Register Transfer Level (RTL) code is crucial for improving the power, performance, and area (PPA) of digital circuits in the early stages of synthesis. Manual rewriting, guided by synthesis feedback, can yield high-quality results but is time-consuming and error-prone. Most existing compiler-based approaches have difficulty handling complex design constraints. Large Language Model (LLM)-based methods have emerged as a promising alternative to address these challenges. However, LLM-based approaches often face difficulties in ensuring alignment between the generated code and the provided prompts. This paper presents SymRTLO, a novel neuron-symbolic RTL optimization framework that seamlessly integrates LLM-based code rewriting with symbolic reasoning techniques. Our method incorporates a retrieval-augmented generation (RAG) system of optimization rules and Abstract Syntax Tree (AST)-based templates, enabling LLM-based rewriting that maintains syntactic correctness while minimizing undesired circuit behaviors. A symbolic module is proposed for analyzing and optimizing finite state machine (FSM) logic, allowing fine-grained state merging and partial specification handling beyond the scope of pattern-based compilers. Furthermore, a fast verification pipeline, combining formal equivalence checks with test-driven validation, further reduces the complexity of verification. Experiments on the RTL-Rewriter benchmark with Synopsys Design Compiler and Yosys show that SymRTLO improves power, performance, and area (PPA) by up to 43.9%, 62.5%, and 51.1%, respectively, compared to the state-of-the-art methods.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。