arXiv:2610.32597cs.AROct 2026

Manuscript Offprint

arXiv:2610.32597

Automated Multi-Line Bug Repair Using Model Checker Aided LLMs: A Case Study on RISC-V Processors

Debleena Das, Chandan Kumar Jha, Muhammad Hassan, Rolf Drechsler, Ansuman Banerjee, Subhra K. Das, Amlan Chakrabarti

Debleena Das*§, Chandan Kumar Jha†, Muhammad Hassan†‡, Rolf Drechsler†‡, Ansuman Banerjee*, Subhra K. Das¶, Amlan Chakrabarti§

  • Indian Statistical Institute, India, †University of Bremen, Germany, ‡DFKI GmbH, Germany

§ A. K. Choudhury School of Information Technology, University Of Calcutta, India, ¶ Thales India Private Limited, India

Abstract—Functional verification of Register-Transfer Level (RTL) designs has become a critical bottleneck in modern semiconductor development, often consuming the majority of project resources. Debugging, in particular, remains an especially time-consuming task, requiring careful analysis of simulation traces or counterexamples. Recent work has explored applying Large Language Models (LLMs) to RTL debug and repair with great promise. However, the existing approaches typically are for single-line bugs, operate in open-loop, rely heavily on prompts or retrieval, lack scalability, and often produce incorrect fixes. In this paper, we propose a novel automated RTL bug repair methodology that combines LLMs, assertions, and a model checker to provide scalable, trustworthy semantic grounding and formal guarantees. Concretely, the methodology leverages failing assertions to guide the LLM in generating patches for multi-line bugs. Each candidate patch is formally verified using a model checker (JasperGold), ensuring only valid repairs are accepted. We evaluate the efficacy and scalability of our methodology on the BRISC-V RISC-V core using mutation testing, introducing several mutation types, and demonstrate that our methodology can repair up to 98% of single-line RTL bugs and 93% of the multi-line bugs. To the best of our knowledge, this is the first work to show automated, LLM-assisted RTL multi-line bug repair results on a complex RISC-V processor design in a scalable manner.

I. INTRODUCTION

Functional verification of Register-Transfer Level (RTL) designs has emerged as a principal bottleneck in the semiconductor development process, often consuming up to 70% of overall project resources [1], [2]. This growing burden is largely driven by the increasing complexity and functional richness of modern digital systems, which incorporate deep pipelines, multiple interacting sub-systems, and a variety of protocols and timing constraints. As designs scale in size and sophistication, the verification effort required to ensure correctness and safety has grown disproportionately. Among the various verification tasks, debugging, i.e., identifying and correcting functional errors in Hardware Description Language (HDL) code remains particularly time-consuming. It often requires manual analysis of simulation traces or counterexamples, and demands a detailed understanding of both the design intent and implementation [3], [4].

In recent times, Large Language Models (LLMs) have shown success in software engineering tasks such as code generation and automated program repair. This success has motivated research on applying LLMs to hardware design tasks [5], [6], with studies exploring RTL code generation [7]–[9], security bug fixes [10], and syntax error correction [11], [12].

In particular, a number of recent research articles have reported efforts on using LLMs to generate SystemVerilog Assertions (SVAs) from various inputs such as natural-language specifications, source code comments, or even the RTL code itself [13]–[17]. Frameworks like AssertLLM and Spec2Assertion translate design specifications into formal properties, easing the burden of writing assertions manually [18], [19]. Other research has demonstrated iterative, human-in-the-loop flows where feedback from a formal verification tool is used to refine LLM-generated assertions [20], using techniques

Figure

Fig. 1: Workflow of LLM-assisted automated bug repair methodology

like Retrieval Augmented Generation (RAG), Chain-Of-Thought (COT), and agentic frameworks [21], [22]. Although these advances streamline the creation of verification artifacts, they do not directly address the task of repairing a buggy RTL.

There have been recent attempts to repair RTL using LLM-based methods.

AssertSolver [23] trains an LLM on a large synthetic dataset of bugs, failure logs, and fixes, enabling it to predict code patches from a given assertion failure log. These methods can suggest plausible fixes, but rely on a static pre-trained model and perform the repair in a single pass. The HDLdebugger framework introduces a retrieval-augmented fine-tuning approach, and along with HDL documents, the LLM takes the buggy code, its error message, task prompt, and code RAG, and the edit distance between the correct code and the buggy code is their evaluation metric [24]. Other bug-patching strategies [25], [26] employ an iterative “bug closure” process using RAG to incorporate design specifications. If the initially retrieved context is insufficient, these methods repeatedly pull in more specification content or code context and re-prompt the LLM. This iterative method can eventually find a fix for up to 60% of the reported bugs.

While these methods have shown a lot of promise by fixing many of the reported bugs, these works focus on single-line bugs, lack trustworthy semantic grounding in a scalable manner, and typically run open-loop. Hence, the identification and fixes often tend to be plausible but wrong.

Contribution: We propose a novel automated RTL bug repair methodology for both single and multi-line bugs that uses LLMs, assertions, and a model checker to synthesise bug patches on a complex RISC-V processor in a scalable manner. More concretely, the goal is to leverage the semantic structure of assertions and the output of a model checker to build a context for the LLM, so that it can propose an accurate fix. Consequently, it provides a trustworthy grounding and formal guarantees as the model checker provides an objective oracle.

To this end, our methodology is two-fold:

References (32)