FormalFixer: Intent-Aligned Automated Hardware Repair via Joint Refinement of Specifications, Assertions, and RTL Implementations

Changyuan Yu, Hongce ZhangarXiv 2026

Automated hardware repair is a bit like trying to fix a leaky pipe when you aren't sure if the blueprint is wrong, the plumber made a mistake, or the homeowner just described the problem poorly. In the world of hardware design, this "triple threat" of ambiguity involves the high-level specification, the formal assertions (the rules used to check the design), and the RTL implementation (the actual code).

Traditional repair tools usually assume the rules are perfect and only the code is broken. But in reality, a failed check is often the result of a buggy assertion or a vague specification. Enter FormalFixer, a new framework that jointly refines all three artifacts to ensure they are "intent-aligned."

TL;DR

FormalFixer is an automated hardware repair framework that uses Large Language Models (LLMs) and formal verification to jointly fix buggy RTL code, incorrect assertions, and ambiguous specifications. By treating the original specification as the ultimate authority and iteratively aligning it with verification feedback, it achieves up to an 89% success rate in complex repair scenarios.

What Problem Does This Paper Address?

In Formal Property Verification (FPV), engineers write assertions to prove that their Register-Transfer Level (RTL) code behaves correctly. When an assertion fails, it generates a "counterexample"—a trace showing exactly how the code broke the rule.

However, a failure doesn't tell you where the root cause lies. Is the RTL code buggy? Is the assertion itself written incorrectly? Or is the natural language specification so vague that the engineer misinterpreted it? Existing automated repair methods are "RTL-centric"—they try to patch the code to satisfy the assertions. If the assertion is wrong, the tool will "fix" the code into a state that is also wrong, a problem known as overfitting.

Methods

FormalFixer introduces a multi-stage, "intent-driven" workflow. Instead of jumping straight to patching code, it follows a structured pipeline:

  1. Spec Analyzer: It treats the original natural language spec as the "ground truth." It uses an LLM to mine the RTL and assertions for latent constraints, appending "refined specs" to clarify implicit details (like reset conditions or bit-widths) without overwriting the original intent.
  2. Pre-verification Fixer: Before running expensive formal tools, it proactively fixes "low-hanging fruit"—obvious mismatches between the refined spec and the code or assertions.
  3. Main Repair Loop: This is the core of the system, illustrated in the workflow below:
Fig. 2: Overall workflow of FORMALFIXER. The pipeline first aligns specification and assertion intent, then uses formal verification feedback and CEX cone analysis for iterative RTL repair.

If a property fails during verification, FormalFixer generates a Counterexample (CEX) Cone Graph. This graph traces the logic dependencies back from the point of failure. The Verilog Fixer then uses this structured feedback to generate localized patches. If a patch breaks other properties, the system rolls back and tries again.

Datasets

The authors evaluated FormalFixer on two new benchmarks:

  • SVA-EVAL-HUMAN: 38 cases curated from expert designs.
  • SVA-EVAL-MACHINE: 875 cases where bugs were systematically injected into both the RTL and the assertions using controlled templates.

These datasets are unique because they explicitly include "buggy verification artifacts," forcing the repair tool to decide whether to fix the code or the assertion.

Key Insights and Ideas

  • Preserve the "Source of Truth": By keeping the original specification authoritative and only appending refinements, FormalFixer prevents the LLM from hallucinating new design requirements.
  • Staged Decomposition: The paper proves that fixing assertions before RTL is crucial. If you try to fix both simultaneously in one LLM call, the model often gets "entangled," leading to unstable edits.
  • CEX Cone Graphs are Better than Raw Traces: Providing the LLM with a graph of signal dependencies (the "cone of influence") is much more effective for localization than giving it a long, flat list of signal values over time.
  • Intent Alignment: The "aha moment" here is treating repair as a three-way correspondence check. As shown in the traffic light example below, the tool must align the button signal (Spec), the counter logic (RTL), and the timing property (Assertion) simultaneously.
Fig. 1: Motivating traffic-light example linking specification refine- ment, assertion repair, and RTL repair.

Key Results

Using the GLM-4.7 model, FormalFixer achieved impressive results:

  • 89.47% Pass@5 on the Human dataset.
  • 84.46% Pass@5 on the Machine dataset.
  • Ablation Success: Including the Spec Analyzer improved the pass rate by over 21 percentage points compared to a baseline that only edited code and assertions.
  • Complexity Scaling: While performance is strongest on small-to-medium designs, the tool remains robust as code length increases, though "false negatives" (where a patch passes checks but is semantically wrong) become more frequent in very long designs.

Limitations and Future Work

While FormalFixer is a significant step forward, the authors note a few hurdles:

  • Block-Level Focus: The current benchmarks focus on individual RTL blocks. Scaling to full "System-on-Chip" (SoC) designs with long-horizon architectural defects remains a challenge.
  • Templated Bugs: The assertion bugs in the machine dataset are based on common patterns (like polarity or bit-width errors) but may not capture the full creative variety of human-made mistakes.
  • Future Directions: The team aims to extend the framework to handle multi-bug interactions and larger industrial-scale assertion-error corpora.

Summary updated

Abstract

Functional errors in hardware designs can compromise correctness and security, and must be fixed before tape-out. Formal property verification (FPV) provides strong guarantees by proving or refuting assertions, but a failed assertion is not always evidence of an RTL defect: the failure may also come from a buggy assertion or from a specification that is semantically correct but too ambiguous or incomplete for direct formalization. This creates a practical repair problem that existing RTL-centric methods do not directly address: the repair loop must align specification intent, verification intent, and RTL behavior before deciding which artifact to change. \textsc{FormalFixer} addresses this problem with a multi-stage, intent-aligned repair workflow for Verilog designs with assertions. It preserves the original specification as authoritative ground truth and appends confidence-filtered refinements to clarify implicit constraints. \textsc{FormalFixer} uses both intent mismatch and verifier-generated counterexample cone graphs to guide iterative RTL patching. This workflow explicitly checks specification--assertion--RTL correspondence. Results support intent alignment for FPV-based hardware repair.
BibTeX
@misc{yu2026formalfixer,
  author = {Changyuan Yu and Hongce Zhang},
  title = {{FormalFixer: Intent-Aligned Automated Hardware Repair via Joint Refinement of Specifications, Assertions, and RTL Implementations}},
  year = {2026},
  eprint = {2611.24037},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.24037},
}

Loading related content...

Figure