Code Generation
~9 min readUpdated: November 2026

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

REFORGE Multi-Stage Formal Equivalence and Security Verification for LLM RTL Repair

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.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

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.

Key Architectural Takeaways
Quick Implementation Examplereforge-rtl-verifier.ts
reforge-rtl-verifier.tstypescript
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);
Video Guides

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 ToolVerification StageExact Engineering Criterion
Slang / VerilatorSyntax & ElaborationClean SystemVerilog elaboration with zero latch/width errors
Icarus VerilogSimulation & PreservationFailing testbench passes + unaffected outputs agree with golden traces
Yosys + SymbiYosysFormal Equivalence MiterChecks $\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 + IFTHardware Security Re-ScanStatic AST rules, formal lock assertions, shadow-netlist IFT + vacuity check
OpenSTA / Cadence GenusPower, Performance & AreaSynthesis 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 SuiteSelected Variants ($n$)Runs DeliveredRepair Verdict (Verified / Bounded / Unchecked)Preservation (Bounded / Unchecked)PPA Gate (Pass / Fail / Unchecked)
CirFix399128 / 189109 V / 290 B / 0 U399 B / 0 U236 P / 81 F / 82 U
Hardware CWE19994 / 1100 V / 0 B / 199 U0 B / 199 U0 P / 0 F / 199 U
Hack@DAC OpenTitan319 / 931 V / 0 B / 0 U31 B / 0 U0 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.

bash
# 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.sby

Never 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.

Google Search Questions & Answers

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 guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness