证据驱动的LLM智能体用于C到可综合C的转换与验证
Evidence-Driven LLM Agent for C-to-Synthesizable-C Conversion and Verification
AI总结:
提出一种基于大语言模型的闭环生成-验证-诊断-修复框架,通过四阶段验证器、渐进式不匹配定位链和证据检索增强生成,将C代码转换为HLS可综合C,显著优于现有方法。
摘要:
软件可编译的C程序通常无法完成高级综合(HLS)工具链的四阶段流程——编译、C仿真(CSim)、综合和C/RTL协同仿真(CoSim)——因为HLS只接受C的可综合子集(HLS-C)。然而,现有为HLS代码修复构建的大语言模型(LLM)系统仅覆盖早期流水线阶段,并将原始工具日志直接输入模型,导致修复脆弱且难以复现。我们将C到HLS-C的转换形式化为HLS工具(Xilinx Vitis)上的闭环生成-验证-诊断-修复问题,贡献了三个组件:一个由四阶段验证器在严格证据隔离下闭合的协作智能体端到端工作流;一个渐进式不匹配定位链(PMLC),通过日志规范化、AST反向切片和双迹线插桩定位CSim/CoSim不匹配;以及一个基于类型化查询、两阶段证据RAG,由自演化、族路由的修复卡池支持。实验结果表明,所提出的工作流显著优于所有可比较的最先进模型。
英文摘要:
Software-compilable C programs routinely fail to complete the four-stage pipeline of a high-level synthesis (HLS) toolchain -- compilation, C simulation (CSim), synthesis, and C/RTL co-simulation (CoSim) -- because HLS accepts only a synthesizable subset of C (HLS-C). Yet most existing large language model (LLM) systems built for HLS code repair only cover the early pipeline stages and feed raw tool logs directly to the model, yielding brittle and hard-to-reproduce fixes. We formulate C-to-HLS-C conversion as a closed-loop generation-verification-diagnosis-repair problem on an HLS tool (Xilinx Vitis), contributing three components: an end-to-end workflow of cooperating agents closed by the four-stage verifier under strict evidence isolation; a Progressive Mismatch Localization Chain (PMLC) that localizes CSim/CoSim mismatches through log normalization, AST backward slicing, and dual-trace instrumentation; and a typed-query, two-stage evidence RAG backed by a self-evolving, family-routed repair-card pool. Experimental results show that the proposed workflow substantially outperforms all comparable state-of-the-art models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。