Saved in:
Bibliographic Details
Main Authors: Zhao, Yang, Huang, Di, Li, Chongxiao, Jin, Pengwei, Song, Muxin, Xu, Yinan, Nan, Ziyuan, Gao, Mingju, Ma, Tianyun, Qi, Lei, Pan, Yansong, Zhang, Zhenxing, Zhang, Rui, Zhang, Xishan, Du, Zidong, Guo, Qi, Hu, Xing
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2407.10424
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915281156177920
author Zhao, Yang
Huang, Di
Li, Chongxiao
Jin, Pengwei
Song, Muxin
Xu, Yinan
Nan, Ziyuan
Gao, Mingju
Ma, Tianyun
Qi, Lei
Pan, Yansong
Zhang, Zhenxing
Zhang, Rui
Zhang, Xishan
Du, Zidong
Guo, Qi
Hu, Xing
author_facet Zhao, Yang
Huang, Di
Li, Chongxiao
Jin, Pengwei
Song, Muxin
Xu, Yinan
Nan, Ziyuan
Gao, Mingju
Ma, Tianyun
Qi, Lei
Pan, Yansong
Zhang, Zhenxing
Zhang, Rui
Zhang, Xishan
Du, Zidong
Guo, Qi
Hu, Xing
contents The design flow of processors, particularly in hardware description languages (HDL) like Verilog and Chisel, is complex and costly. While recent advances in large language models (LLMs) have significantly improved coding tasks in software languages such as Python, their application in HDL generation remains limited due to the scarcity of high-quality HDL data. Traditional methods of adapting LLMs for hardware design rely on synthetic HDL datasets, which often suffer from low quality because even advanced LLMs like GPT perform poorly in the HDL domain. Moreover, these methods focus solely on chat tasks and the Verilog language, limiting their application scenarios. In this paper, we observe that: (1) HDL code collected from the real world is of higher quality than code generated by LLMs. (2) LLMs like GPT-3.5 excel in summarizing HDL code rather than generating it. (3) An explicit language tag can help LLMs better adapt to the target language when there is insufficient data. Based on these observations, we propose an efficient LLM fine-tuning pipeline for HDL generation that integrates a multi-level summarization data synthesis process with a novel Chat-FIM-Tag supervised fine-tuning method. The pipeline enhances the generation of HDL code from natural language descriptions and enables the handling of various tasks such as chat and infilling incomplete code. Utilizing this pipeline, we introduce CodeV, a series of HDL generation LLMs. Among them, CodeV-All not only possesses a more diverse range of language abilities, i.e. Verilog and Chisel, and a broader scope of tasks, i.e. Chat and fill-in-middle (FIM), but it also achieves performance on VerilogEval that is comparable to or even surpasses that of CodeV-Verilog fine-tuned on Verilog only, making them the first series of open-source LLMs designed for multi-scenario HDL generation.
format Preprint
id arxiv_https___arxiv_org_abs_2407_10424
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle CodeV: Empowering LLMs with HDL Generation through Multi-Level Summarization
Zhao, Yang
Huang, Di
Li, Chongxiao
Jin, Pengwei
Song, Muxin
Xu, Yinan
Nan, Ziyuan
Gao, Mingju
Ma, Tianyun
Qi, Lei
Pan, Yansong
Zhang, Zhenxing
Zhang, Rui
Zhang, Xishan
Du, Zidong
Guo, Qi
Hu, Xing
Programming Languages
Artificial Intelligence
The design flow of processors, particularly in hardware description languages (HDL) like Verilog and Chisel, is complex and costly. While recent advances in large language models (LLMs) have significantly improved coding tasks in software languages such as Python, their application in HDL generation remains limited due to the scarcity of high-quality HDL data. Traditional methods of adapting LLMs for hardware design rely on synthetic HDL datasets, which often suffer from low quality because even advanced LLMs like GPT perform poorly in the HDL domain. Moreover, these methods focus solely on chat tasks and the Verilog language, limiting their application scenarios. In this paper, we observe that: (1) HDL code collected from the real world is of higher quality than code generated by LLMs. (2) LLMs like GPT-3.5 excel in summarizing HDL code rather than generating it. (3) An explicit language tag can help LLMs better adapt to the target language when there is insufficient data. Based on these observations, we propose an efficient LLM fine-tuning pipeline for HDL generation that integrates a multi-level summarization data synthesis process with a novel Chat-FIM-Tag supervised fine-tuning method. The pipeline enhances the generation of HDL code from natural language descriptions and enables the handling of various tasks such as chat and infilling incomplete code. Utilizing this pipeline, we introduce CodeV, a series of HDL generation LLMs. Among them, CodeV-All not only possesses a more diverse range of language abilities, i.e. Verilog and Chisel, and a broader scope of tasks, i.e. Chat and fill-in-middle (FIM), but it also achieves performance on VerilogEval that is comparable to or even surpasses that of CodeV-Verilog fine-tuned on Verilog only, making them the first series of open-source LLMs designed for multi-scenario HDL generation.
title CodeV: Empowering LLMs with HDL Generation through Multi-Level Summarization
topic Programming Languages
Artificial Intelligence
url https://arxiv.org/abs/2407.10424