High Level Synthesis (HLS) tools offer rapid hardware design from C code, but their compatibility is limited by code constructs. This paper investigates Large Language Models (LLMs) for refactoring C code into HLS-compatible formats. We present several case studies by using an LLM to rewrite C code for NIST 800-22 randomness tests, a QuickSort algorithm and AES-128 into HLS-synthesizable c. The LLM iteratively transforms the C code guided by user prompts, implementing functions like streaming data and hardware-specific signals. This evaluation demonstrates the LLM's potential to assist hardware design refactoring regular C code into HLS synthesizable C code.
翻译:高级综合(HLS)工具能够通过C代码实现快速硬件设计,但其兼容性受限于代码结构。本文研究利用大语言模型(LLM)将C代码重构为HLS兼容格式。我们通过多个案例研究,使用LLM将NIST 800-22随机性测试、快速排序算法和AES-128的C代码改写为可综合的HLS-C代码。LLM在用户提示引导下迭代转换C代码,实现流式数据传输和硬件专用信号等功能。该评估展示了LLM在辅助硬件设计重构方面,将常规C代码转化为HLS可综合C代码的潜力。