arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2605.17892cs.AR
收藏

CPPL:一种电路提示编程语言

CPPL: A Circuit Prompt Programming Language

The Chinese University of Hong Kong(香港中文大学);The Chinese University of Hong Kong (Shenzhen)(香港中文大学(深圳));Fudan University(复旦大学)

Shuo Yin, Yihe Wang, Lancheng Zou, Xufeng Yao, Tinghuan Chen, Chen Bai, Zhengrong Wang, Tsung-Yi Ho, Bei Yu

AI总结:

本文提出CPPL,一种通过编译器中介的硬件设计框架,将LLM辅助的硬件生成转化为可静态检查的前端问题,从而提高硬件设计的可靠性、可分析性和后端优化能力。

摘要:

大型语言模型(LLMs)在寄存器传输级(RTL)设计自动化中展现出潜力,但直接生成RTL仍然难以验证、优化和与基于编译器的硬件设计流程集成。硬件编译器基础设施如CIRCT提供了类型中间表示、合法性检查和优化过程,但当前LLMs由于MLIR语法、SSA纪律、方言特定操作和严格的宽度约束而难以生成原始编译器IR。本文提出了CPPL,一种编译器中介的设计框架,将LLM辅助的硬件生成转化为可静态检查的前端问题,而非无约束的RTL文本生成任务。CPPL结合了用于声明模块接口和层次结构的Python前端DSL与CPPL IR,一种基于JSON的电路IR,旨在暴露编译器可见的结构同时仍易于LLM处理。编译器从声明的模块端口推断操作宽度,验证生成的IR,检查层次结构和端口绑定,并确定性地将结果降低到CIRCT以生成可综合的Verilog代码。在RTLLM基准测试中,CPPL在功能正确性上优于直接Verilog和直接CIRCT IR生成,而CIRCT优化减少了后综合AIG节点数量。这些结果表明,编译器中介的接口可以使LLM辅助的硬件设计更加可靠、可分析且适合后端优化。CPPL可在https://github.com/SawyDust1228/CPPL上获得。

英文摘要:

Large language models (LLMs) have shown promise in register-transfer level (RTL) design automation, but direct RTL generation remains difficult to validate, optimize, and integrate with compiler-based hardware design flows. Hardware compiler infrastructures such as CIRCT provide typed intermediate representations, legality checks, and optimization passes, yet current LLMs struggle to emit raw compiler IR because of MLIR syntax, SSA discipline, dialect-specific operations, and strict width constraints. This paper presents CPPL, a compiler-mediated design framework that turns LLM-assisted hardware generation into a statically checkable frontend problem rather than an unconstrained RTL text-generation task. CPPL combines a Python frontend DSL for declaring module interfaces and hierarchy with CPPL IR, a JSON-based circuit IR designed to expose compiler-visible structure while remaining accessible to LLMs. The compiler infers operation widths from declared module ports, validates generated IR, checks hierarchy and port bindings, and deterministically lowers the result to CIRCT for synthesizable Verilog generation. On the RTLLM benchmark, CPPL improves functional correctness over direct Verilog and direct CIRCT IR generation, while CIRCT optimization reduces post-synthesis AIG node counts. These results show that a compiler-mediated interface can make LLM-assisted hardware design more reliable, analyzable, and amenable to backend optimization. CPPL is available at https://github.com/SawyDust1228/CPPL.

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

↑