arXiv:2606.28409cs.ARcs.AI2026-06

用闭环验证提升C代码转HLS-C的修复成功率

Evidence-Driven LLM Agent for C-to-Synthesizable-C Conversion and Verification

论文配图:Evidence-Driven LLM Agent for C-to-Synthesizable-C Conversion and Verification
图 1 · 摘自论文原文
  • 构建四阶段闭环流程,通过严格证据隔离实现自洽修复
  • 提出PMLC机制,精准定位仿真与联合仿真不一致问题
  • 基于动态修复卡池的查询式检索增强,支持持续进化

硬件高阶综合(HLS)工具链包含编译、C仿真(CSim)、综合和C/RTL联合仿真(CoSim)四个阶段,但多数可编译C程序因不符合合成子集(HLS-C)而失败。现有大语言模型仅覆盖早期阶段,直接输入原始工具日志,导致修复结果脆弱且难以复现。本文将C到HLS-C转换建模为一个在Xilinx Vitis工具上的闭环生成-验证-诊断-修复问题,提出三项核心组件:一是由四阶段验证器闭环控制的端到端协作代理工作流;二是通过日志归一化、AST反向切片与双轨迹仪器化的渐进式错位定位链(PMLC);三是基于类型查询、两阶段证据检索增强(RAG)的自演化家族路由修复卡池。实验表明,该工作流显著优于所有可比的最先进模型。

原文摘要 · Abstract (English)

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.

LLMHLS代码修复闭环验证

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。