Manuscript Offprint

arXiv:2610.03219

Evidence-Guided Repository-Level RTL Repair

Yuxin Du, Juxin Niu, Zhe Jiang, Nan Guan

Yuxin Du 1^{1}, Juxin Niu 1^{1}, Zhe Jiang 2,3^{2,3}, and Nan Guan 1^{1}

1^{1}City University of Hong Kong, Hong Kong, China

2^{2}Southeast University, China

3^{3}National Center of Technology Innovation for EDA, China

Email: yuxindu8-c@my.cityu.edu.hk, juxin.niu@my.cityu.edu.hk, 101013615@seu.edu.cn, nanguan@cityu.edu.hk

Abstract—Repository-level RTL repair must localize a failure that spans files, modules, and clock cycles, then propagate the fix consistently. Existing methods reason over source code, which reveals possible behaviors but not the failed execution, and cannot tell whether a local fix was propagated consistently. We therefore present an evidence-guided framework with three modules. Failure grounding converts a problem statement into a reproduced failing run and a failure anchor. Waveform-guided localization uses a localization toolbox to narrow the observed violation into a candidate mechanism and an evidence trail. Consistency-aware repair and validation then expand that seed into a coordinated patch and replay the same scenario to check that the violation disappears. We conducted experiments on HWE-Bench and achieved better performance than the baseline.

Index Terms—Repository-level RTL repair, waveform analysis, large language models.

Figure

I. INTRODUCTION

Debugging RTL designs consumes much of the effort in chip development [1], [2]. Doing it by hand is tedious [3]. An engineer must trace the bug across files and modules, and every hypothesis needs another test run [4], [5]. Agents suit this task and are already applied to RTL debugging with promising results [6]–[10]. That progress, however, is confined to the module level [11]–[14]. At that level, the design unit and its testbench are supplied. Repository-level RTL bug repair instead takes a repository and a problem statement. The output is a patch that makes the repository pass the fail-to-pass tests. HWE-Bench [15] evaluates general-purpose agents on this setting, but no published method targets it.

RTL debuggers typically trace an observed failure back to its cause and then fix it [16]–[19]. This recipe gets much harder at repository scale. This task differs from small-scale repair in two ways. First, a repository contains many files and modules. The agent therefore needs a long reasoning chain to reach the root cause. That chain also crosses clock cycles. No specification or reference design is available to confirm a candidate cause [20], [21]. Correct localization becomes difficult [22], [23]. Second, repository-level bugs usually span several modules and files. Such a bug is solved only when every affected place is changed consistently. That requirement makes repair hard as well.

These two difficulties have a common cause: the agent lacks grounded evidence. Current debugging methods lean heavily on reasoning over source code. For small-scale RTL debugging, that ability is already strong enough. At repository

Fig. 1. Without cycle-level evidence, the agent tests hypotheses that are consistent with everything it can observe.

scale it stops working. Source code shows every path the design could take, but not the one this failing run took [24]–[26]. Hardware correctness is decided as the state evolves cycle by cycle, so many candidate causes fit everything the agent can read from the repository [27]. The agent can only test one at a time, and the loop does not converge. Figure 1 shows this from a real trajectory. Even after a local cause is found, the agent still lacks a reliable way to tell whether the same failing scenario has been preserved while the violation itself disappears. A patch can remove the observed symptom and still leave stale interfaces, widths, or state updates elsewhere. We therefore shift the approach from reasoning over source code alone to evidence-guided bug repair. The key evidence is the reproduced failing run and its waveform.

We present a framework for this task. It organizes the method into three modules. Failure grounding turns the problem statement into a reproduced failing run and a failure anchor that records the scenario, the observed violation, and the run to replay. Waveform-guided localization then uses a localization toolbox to bound the violation in time, trace active drivers, and lift raw values into design-level semantics, yielding a candidate mechanism plus an evidence trail. Consistency-aware repair and validation finally expand that local seed into a coordinated repository patch and replay the same scenario to check that the violation disappears without breaking the surrounding behavior. Because the framework reuses one observed execution throughout, it grounds both diagnosis and repair checking in what the design actually did.

rather than in source-only reasoning.

We evaluate this framework on HWE-Bench, which poses real problem statements from large RTL repositories and judges each patch by fail-to-pass tests. It collects 417 tasks; 29 OpenTitan cases cannot be adapted to a runnable VCS environment in our setup, so every condition runs over the same 388 tasks. The framework resolves more of them than the baseline for every model we test.

References (36)