RuC:HDL无关的规则补全基准生成
RuC: HDL-Agnostic Rule Completion Benchmark Generation
AI总结:
RuC通过语法驱动的方法生成HDL无关的规则补全基准,用于评估模型在RTL开发中的代码理解能力,结果显示提示策略对性能影响显著。
摘要:
大型语言模型(LLMs)在代码相关任务上的性能迅速提升,使其在寄存器传输级(RTL)开发中的整合变得越来越有吸引力。模仿内联代码助手的行为,许多基准测试评估LLMs在代码补全方面的能力,无论是评估整个硬件模块的生成还是模块内单行的补全。然而,这两种方法都缺乏对代码补全样本大小粒度和语法范围的控制能力。为克服这些限制,我们提出了一种语言无关的规则补全(RuC)框架,该框架基于语法驱动、规则可选的基准生成器,能够从一组输入硬件描述源中自动生成RTL代码补全任务。RuC利用目标硬件描述语言(HDL)的语法来屏蔽由语法定义的代码区域,并提示模型使用周围的未屏蔽代码作为上下文来重新生成这些区域,从而实现对领域特定模型代码理解能力的受控且可扩展的评估,从赋值到整个逻辑块的重建。我们使用RuC从Tiny Tapeout shuttle TT07和CVE2 RISC-V核心生成两个SystemVerilog规则补全基准,以展示RuC在广泛设计中的适用性,并在多种设置下比较现代开源LLMs的代码补全能力。结果表明,补全性能强烈依赖于模型类型、被屏蔽区域的语法结构以及提示策略。具体而言,使用Fill-in-the-Middle(FIM)提示策略获得最高分数。这些发现突显了语法驱动、任意粒度基准在评估LLMs在RTL开发工作流程中的能力方面的价值。
英文摘要:
Large Language Models (LLMs) have rapidly improved in performance across code-related tasks, making their integration into Register Transfer Level (RTL) development increasingly attractive. Mimicking the behavior of inline code assistants, many benchmarks evaluate LLMs' capabilities in code completion, either assessing the generation of entire hardware modules or the completion of a single line within a module. However both of these approaches lack the ability to control the granularity of the code-completion sample size and the syntactic range of completions. To overcome these limitations, we present a framework for language-agnostic rule completion (RuC), a grammar-driven, rule-selectable benchmark generator that automatically produces RTL code-completion tasks from a set of input hardware description sources. RuC uses the target Hardware Description Language (HDL) grammar to mask syntactically defined code regions and prompts a model to regenerate them using the surrounding unmasked code as context, enabling a controlled and scalable evaluation of the domain-specific model's code-understanding capabilities, ranging from assignments to the reconstruction of entire logic blocks. We use RuC to generate two SystemVerilog rule-completion benchmarks from the Tiny Tapeout shuttle TT07 and the CVE2 RISC-V core to demonstrate RuC's applicability to a broad range of designs, and conduct a comparative study of the code completion capabilities of modern open-source LLMs across diverse settings. Results indicate that completion performance strongly depends on the model type, the grammatical structure of the masked region, and the prompting strategy. Specifically, the highest scores are obtained with Fill-in-the-Middle (FIM) prompting. These findings highlight the value of grammar-driven, arbitrarily granular benchmarks for meaningful evaluation of LLM capabilities in RTL development workflows.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。