REFORGE: Evidence-Driven LLM RTL & Verilog Bug Repair Pipeline

REFORGE (arXiv:2611.33748) is a backend-independent LLM RTL repair framework that replaces single testbench pass rates with staged verification evidence: syntax elaboration, simulation, bounded/unbounded miter equivalence, preservation, MITRE hardware CWE re-scans, and synthesis PPA budgets. Testbenches alone over-report repairs by 3.9x.
REFORGE: Evidence-Driven LLM RTL & Verilog Bug Repair Pipeline: REFORGE (arXiv:2611.33748) is a backend-independent LLM RTL repair framework that replaces single testbench pass rates with staged verification evidence: syntax elaboration, simulation, bounded/unbounded miter equivalence, preservation, MITRE hardware CWE re-scans, and synthesis PPA budgets. Testbenches alone over-report repairs by 3.9x. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Exposes 3.9x False Positives: Functional testbenches accepted 430 variants across 21 designs, while full equivalence + security + PPA gates retained 109 verified repairs.
- Boosts CirFix Checked Repairs: Structured RTL profiling and diagnosis raised checked repairs from 32/63 to 51/63 across LLM backends.
- MITRE Hardware CWE Defense: Combines static AST checks, formal write-after-lock assertions, and shadow-netlist information-flow tracking with vacuity checks.
- Synthesis PPA Guardrails: Rejects fixes exceeding (1 + 0.20) area, delay, or power overhead via Yosys/OpenSTA and Cadence Genus/Conformal.
import { createAgent } from '@smoke-monkey/harness';const rtlRepairAgent = createAgent({agentId: 'reforge-verilog-repair',provider: 'openai',model: 'gpt-4o',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function repairRtlModule() {const res = await rtlRepairAgent.run('Profile buggy FSM in src/uart_ctrl.sv, emit diverse RTL candidate patches, ' +'elaborate with slang, run Icarus Verilog replay, check SymbiYosys miter equivalence ' +'to depth k=min(64, 2w+d), and verify OpenSTA PPA remains within +20%.');console.log('RTL Evidence Ledger:', res.summary);}repairRtlModule().catch(console.error);
Watch: Related Video Guides
LLMs in Hardware Verification: Bridging the Complexity Gap
Race Condition in Verilog | Hidden RTL Bug You Must Know
What Is REFORGE? Why Testbench-Only LLM RTL Repair Over-Reports by 3.9x
REFORGE (arXiv:2611.33748, University of Kansas & University of Florida) is a backend-agnostic framework for LLM-assisted RTL repair that tracks structured verification evidence across eight staged verdicts (fail, syn, sim, B, V, pres, sec, full) rather than collapsing outcomes into a single testbench pass rate.
Prior RTL repair agents such as CirFix, RTLFixer, and R3A graded patches primarily on compilation plus testbench simulation. Across 308 evaluation runs generating 629 candidate patches across CirFix, hardware CWE benchmarks, and Hack@DAC OpenTitan defects, REFORGE proved that testbench replay alone claims 3.9x more repairs than actually pass all applicable hardware checks: 629 compiled across 44 benchmarks, 430 passed simulation across 21 benchmarks, 140 achieved unbounded formal equivalence across 5, and only 109 passed the full PPA cost gate.
The Five-Stage Open-Source & Commercial EDA Verification Stack
REFORGE profiles the buggy module to extract structural AST features and security assets, generates diverse candidate patches using AST similarity ($s_{\text{ast}}$) and netlist Wasserstein distances ($s_{\text{net}}$), and validates every candidate through an automated EDA toolchain:
| EDA Tool | Verification Stage | Exact Engineering Criterion |
|---|---|---|
| Slang / Verilator | Syntax & Elaboration | Clean SystemVerilog elaboration with zero latch/width errors |
| Icarus Verilog | Simulation & Preservation | Failing testbench passes + unaffected outputs agree with golden traces |
| Yosys + SymbiYosys | Formal Equivalence Miter | Checks $\exists x, t \le k: y_v(x,t) \ne y_g(x,t)$ starting at 8 up to $k = \min(64, 2w+d)$ |
| CWE Analyzer + IFT | Hardware Security Re-Scan | Static AST rules, formal lock assertions, shadow-netlist IFT + vacuity check |
| OpenSTA / Cadence Genus | Power, Performance & Area | Synthesis area, delay, and power stay within $(1 + 0.20)\times$ reference |
Crucially, vacuity checks reject bogus 'security fixes' that merely make a protected state unreachable, and PPA bounds catch LLM patches that silently duplicate pipelines or blow up timing.
Empirical Results Across CirFix, CWE Suites & Hack@DAC OpenTitan
Adding structured context and verification-guided diagnosis boosted checked repair delivery on CirFix from 32/63 to 51/63 across LLM backends, while every tested configuration repaired the Hack@DAC OpenTitan defect (9/9 runs, 31/31 unbounded verified variants).
| Benchmark Suite | Selected Variants ($n$) | Runs Delivered | Repair Verdict (Verified / Bounded / Unchecked) | Preservation (Bounded / Unchecked) | PPA Gate (Pass / Fail / Unchecked) |
|---|---|---|---|---|---|
| CirFix | 399 | 128 / 189 | 109 V / 290 B / 0 U | 399 B / 0 U | 236 P / 81 F / 82 U |
| Hardware CWE | 199 | 94 / 110 | 0 V / 0 B / 199 U | 0 B / 199 U | 0 P / 0 F / 199 U |
| Hack@DAC OpenTitan | 31 | 9 / 9 | 31 V / 0 B / 0 U | 31 B / 0 U | 0 P / 0 F / 31 U |
On the 30-run identifier-renaming and structural-perturbation robustness study, security-clean repairs held steady at 9/10 on original designs and 7/10 after perturbation, confirming genuine structural reasoning rather than pure memorization.
# Verify Verilog patch syntax, simulation, and bounded formal miter locally
slang --lint-only patched_module.sv && \
iverilog -g2012 -o sim.vvp tb.sv patched_module.sv && vvp sim.vvp && \
sby -f miter_equiv.sbyNever Merge Security-Clean RTL Without Functional Preservation
REFORGE found that all 199 security-clean CWE patches lacked functional equivalence proof if tested only with differential security checks. Always keep functional, security, and PPA verdicts separate in CI ledgers.
Frequently Asked Questions
Q:Why does REFORGE say Verilog testbench pass rates over-report repairs by 3.9x?
Across 44 benchmarks, 430 candidate patches passed functional simulation across 21 benchmarks, yet only 109 satisfied full unbounded formal equivalence and synthesis PPA constraints—a 3.9x gap between simulation pass and full hardware signoff.
Q:How deep does REFORGE run bounded model checking on sequential RTL?
REFORGE starts formal miter checks at depth 8 and scales to k = min(64, 2w + d), where w is the widest counter or FSM register and d is pipeline depth.
Q:Which open-source EDA tools does REFORGE use for verification?
REFORGE uses Slang/Verilator for SystemVerilog elaboration, Icarus Verilog for VCD testbench simulation, Yosys for synthesis and miter construction, SymbiYosys for bounded formal verification, and OpenSTA for static timing analysis.
Q:How much PPA overhead does REFORGE permit for a valid RTL fix?
Area, delay, and power must stay within (1 + 0.20)x of the golden reference (with an 8-cell allowance for tiny baselines under 50 cells).
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.