Skip to main content Skip to main navigation


From Bugs to Fixes: HDL Bug Identification and Patching using LLMs and RAG

Khushboo Qayyum; Muhammad Hassan; Sallar Ahmadi-Pour; Chandan Jha; Rolf Drechsler
In: Proceedings of the First IEEE International Workshop on LLM-Aided Design (LAD'24). IEEE International Workshop on LLM-Aided Design (LAD-24), June 28-29, San Jose, USA, 2024.


In this paper, for the first time, we present a methodology that combines Retrieval Augmented Generation (RAG) with Large Language Models (LLM) to help with the identification and patching of Verilog Hardware Descriptive Language (HDL). If the methodology fails to patch a bug, an iterative and systematic bug patching closure technique is used. Additionally, we classify different types of bugs that are found in hardware and assess the performance of our approach for identifying and patching of bugs from each category. We tested our approach on three different OpenTitan designs and found out that our methodology can patch all bugs as long as they are not constant values