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.


翻译:大型语言模型(LLM)在寄存器传输级(RTL)设计自动化方面展现出潜力,但直接生成RTL仍难以验证、优化,且难以与基于编译器的硬件设计流程集成。诸如CIRCT等硬件编译器基础设施提供了类型化中间表示、合法性检查和优化通道,然而由于MLIR语法、SSA规范、方言特定操作以及严格的位宽约束,当前LLM难以直接生成原始编译器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。

0
下载
关闭预览

相关内容

编译器(Compiler),是一种计算机程序,它会将用某种编程语言写成的源代码(原始语言),转换成另一种编程语言(目标语言)。
【ETZH博士论文】语言模型编程
专知会员服务
25+阅读 · 2025年6月14日
大型语言模型对齐技术综述:RLHF、RLAIF、PPO、DPO 等
专知会员服务
55+阅读 · 2024年7月24日
如何提示?浙大最新《大型语言模型提示框架》综述
专知会员服务
83+阅读 · 2023年11月23日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
5+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关VIP内容
【ETZH博士论文】语言模型编程
专知会员服务
25+阅读 · 2025年6月14日
大型语言模型对齐技术综述:RLHF、RLAIF、PPO、DPO 等
专知会员服务
55+阅读 · 2024年7月24日
如何提示?浙大最新《大型语言模型提示框架》综述
专知会员服务
83+阅读 · 2023年11月23日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员