Due to the growing complexity of modern Integrated Circuits (ICs), there is a need for automated circuit design methods. Recent years have seen rising research in hardware design language generation to facilitate the design process. In this work, we propose a Verilog generation framework, BetterV, which fine-tunes the large language models (LLMs) on processed domain-specific datasets and incorporates generative discriminators for guidance on particular design demands. The Verilog modules are collected, filtered and processed from internet to form a clean and abundant dataset. Instruct-tuning methods are specially designed to fine-tune the LLMs to understand the knowledge about Verilog. Furthermore, data are augmented to enrich the training set and also used to train a generative discriminator on particular downstream task, which leads a guidance for the LLMs to optimize the Verilog implementation. BetterV has the ability to generate syntactically and functionally correct Verilog, which can outperform GPT-4 on the VerilogEval benchmark. With the help of task-specific generative discriminator, BetterV can achieve remarkable improvement on various electronic design automation (EDA) downstream tasks, including the netlist node reduction for synthesis and verification runtime reduction with Boolean Satisfiability (SAT) solving.
翻译:随着现代集成电路(IC)日益复杂,亟需自动化电路设计方法。近年来,硬件描述语言生成的研究日益增多,以辅助设计流程。本工作提出Verilog生成框架BetterV,该框架在经处理的特定领域数据集上对大型语言模型(LLMs)进行微调,并引入生成式判别器以针对特定设计需求提供指导。我们从互联网收集、过滤并处理Verilog模块,构建了干净且丰富的数据集。为微调LLMs理解Verilog相关知识,专门设计了指令微调方法。此外,通过数据增强扩充训练集,并用于训练面向特定下游任务的生成式判别器,从而引导LLMs优化Verilog实现。BetterV能够生成语法正确且功能正确的Verilog代码,在VerilogEval基准测试上可超越GPT-4。借助任务特定的生成式判别器,BetterV可在多种电子设计自动化(EDA)下游任务中实现显著性能提升,包括用于逻辑综合的网表节点缩减以及基于布尔可满足性(SAT)求解的验证运行时缩减。