arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.14641cs.SEcs.SYeess.SY
收藏

HLSTester:利用大语言模型高效测试高层次综合中的行为差异

HLSTester: Efficient Testing of Behavioral Discrepancies with LLMs for High-Level Synthesis

Kangwei Xu, Bing Li, Grace Li Zhang, Ulf Schlichtmann

AI总结:

本文提出 HLSTester,借助 LLM 生成兼容 HLS 的测试平台、定位关键变量并智能生成与过滤测试输入,以更低人力和时间检测 HLS 电路与 C/C++ 程序间的行为差异。

摘要:

在高层次综合(HLS)中,带有综合指令的 C/C++ 程序被用于生成 FPGA 实现所需的电路。然而,这些实现中特定于硬件且依赖平台的特性,可能导致原始 C/C++ 程序与高层次综合后的电路之间出现行为差异。现有用于测试 HLS 中行为差异的方法仍不成熟,测试流程需要大量人力。为应对这一挑战,我们提出 HLSTester,这是一种大语言模型(LLM)辅助的测试框架,可高效检测 HLS 中的行为差异。为缓解 LLM 的幻觉并提升提示质量,该框架利用原始 C/C++ 程序的测试平台来引导 LLM 生成兼容 HLS 的测试平台,从而有效消除某些与 HLS 工具不兼容的传统 C/C++ 构造。通过在 C/C++ 程序和 HLS 程序中采用后向切片技术定位关键变量,以监测其运行时谱,从而深入分析差异症状。为减少测试时间,本文引入一种测试输入生成机制,将动态变异与基于 LLM 的渐进推理链所提供的洞见相结合。此外,通过对生成的测试输入采用冗余感知过滤技术,跳过重复的硬件测试。实验结果表明,与传统方法以及在相同 HLS 程序上直接使用 LLM 相比,所提出的 LLM 辅助测试框架显著加快了测试流程,同时取得了更高的测试平台仿真通过率。

英文摘要:

In high-level synthesis (HLS), C/C++ programs with synthesis directives are used to generate circuits for FPGA implementations. However, hardware-specific and platform-dependent characteristics in these implementations can introduce behavioral discrepancies between the original C/C++ programs and the circuits after high-level synthesis. Existing methods for testing behavioral discrepancies in HLS are still immature, and the testing workflow requires significant human efforts. To address this challenge, we propose HLSTester, a large language model (LLM) aided testing framework that efficiently detects behavioral discrepancies in HLS. To mitigate hallucinations in LLMs and enhance prompt quality, the testbenches for original C/C++ programs are leveraged to guide LLMs in generating HLS-compatible testbenches, effectively eliminating certain traditional C/C++ constructs that are incompatible with HLS tools. Key variables are pinpointed through a backward slicing technique in both C/C++ and HLS programs to monitor their runtime spectra, enabling an in-depth analysis of the discrepancy symptoms. To reduce test time, a testing input generation mechanism is introduced to integrate dynamic mutation with insights from an LLM-based progressive reasoning chain. In addition, repetitive hardware testing is skipped by a redundancy-aware filtering technique for the generated test inputs. Experimental results demonstrate that the proposed LLM-aided testing framework significantly accelerates the testing workflow while achieving higher testbench simulation pass rates compared with the traditional method and the direct use of LLMs on the same HLS programs.

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

↑