arXiv:2504.19144cs.AIcs.AR2025-04被引 1

针对硬件开发中Chisel代码生成难题,提出可提升语法正确性和设计多样性的专用大模型。

ChiseLLM: Unleashing the Power of Reasoning LLMs for Chisel Agile Hardware Development

  • 构建领域适配数据集,通过提示工程引导模型采用结构化推理路径。
  • 相比基线模型,7B和32B版本语法正确率分别提升18.85%和26.32%。
  • 适合硬件架构师与自动化工具开发者,为敏捷芯片设计提供高效生成能力。

随着领域专用架构(DSA)需求增长,敏捷硬件开发方法(AHDM)日益重要。硬件构造语言(HCL)如Chisel具备高阶抽象特性,是基于HCL的AHDM的理想选择。尽管大语言模型(LLMs)在代码生成方面表现优异,但在Chisel生成任务中仍面临语法正确性与设计多样性挑战。近期推理模型通过测试时扩展显著提升了代码生成能力,但未经过领域适配的模型对Chisel生成帮助有限。本文提出ChiseLLM,包含数据处理与转换、提示引导的推理轨迹合成及领域适配训练。我们从公开的RTL代码资源构建高质量数据集,并通过提示增强方法引导模型采用结构化思维模式。实验表明,ChiseLLM-7B和ChiseLLM-32B模型在语法正确性上分别较基线模型提升18.85%和26.32%,设计多样性能力较基线推理模型提升47.58%。所发布数据集与模型可公开获取,为基于HCL的敏捷硬件开发提供高性能、低成本解决方案,并为未来研究提供有效基准。GitHub仓库:https://github.com/observerw/ChiseLLM

原文摘要 · Abstract (English)

The growing demand for Domain-Specific Architecture (DSA) has driven the development of Agile Hardware Development Methodology (AHDM). Hardware Construction Language (HCL) like Chisel offers high-level abstraction features, making it an ideal language for HCL-Based AHDM. While Large Language Models (LLMs) excel in code generation tasks, they still face challenges with Chisel generation, particularly regarding syntax correctness and design variability. Recent reasoning models have significantly enhanced code generation capabilities through test-time scaling techniques. However, we found that reasoning models without domain adaptation cannot bring substantial benefits to Chisel code generation tasks. This paper presents ChiseLLM, a solution comprising data processing and transformation, prompt-guided reasoning trace synthesis, and domain-adapted model training. We constructed high-quality datasets from public RTL code resources and guided the model to adopt structured thinking patterns through prompt enhancement methods. Experiments demonstrate that our ChiseLLM-7B and ChiseLLM-32B models improved syntax correctness by 18.85% and 26.32% respectively over base models, while increasing variability design ability by 47.58% compared to baseline reasoning models. Our datasets and models are publicly available, providing high-performance, cost-effective models for HCL-Based AHDM, and offering an effective baseline for future research. Github repository: https://github.com/observerw/ChiseLLM

硬件生成代码生成大模型Chisel

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