REFORGE: LLM-Assisted RTL Bug Repair with Structured Context and Verification Feedback
Summary
REFORGE is an LLM-assisted RTL bug repair framework that accumulates structured, multi-stage verification evidence (simulation, formal analysis, security re-scan, PPA) across iterations, improving checked repair rates from 32/63 to 51/63 on CirFix and demonstrating that single pass/fail criteria overstate repair success.
View Cached Full Text
Cached at: 11/27/26, 09:33 AM
# LLM-Assisted RTL Bug Repair withStructured Context and Verification Feedback
Source: [https://arxiv.org/html/2611.33748](https://arxiv.org/html/2611.33748)
## REFORGE: LLM\-Assisted RTL Bug Repair with Structured Context and Verification Feedback
Tanvir Hossain\*, Sudipta Paria†, Aidan Gleason Myers†, Swarup Bhunia†, and Tamzidul Hoque\*Affiliation:tanvir@ku\.edu, sudiptaparia@ufl\.edu, myersaidan@ufl\.edu, swarup@ece\.ufl\.edu, hoque@ku\.edu \*Dept\. of EECS, University of Kansas, Lawrence, KS, USA, and†Dept\. of ECE, University of Florida, Gainesville, FL, USA
###### Abstract
Large language models \(LLMs\) can write and repair RTL, but successful compilation or testbench execution does not establish defect removal, behavioral preservation, security, or implementation feasibility\. Existing LLM\-based RTL repair methods often report a single repair rate without retaining separate evidence for these properties, limiting reproducible comparison and integration into hardware design flows\. We presentREFORGE, which, to our knowledge, is the first LLM\-assisted RTL repair framework that maintains and accumulates structured repair evidence across iterations, allowing it to generate fixes that satisfy multiple objectives simultaneously, including functionality, behavioral equivalence, security, and cost efficiency\.REFORGEprofiles buggy RTL, identifies structural and security\-relevant features, localizes failing behavior, and uses verification\-guided diagnosis to generate complete RTL repair variants\. Each variant undergoes syntax checking, simulation, formal analysis, off\-trigger preservation, security re\-scan, and synthesis\-based power, performance, and area analysis\. The framework records verdicts, proof depths, counterexamples, tool availability, and cost measurements, then selects verified variants using source\-, netlist\-, activity\-, and PPA\-level similarity\. We implementREFORGEas a backend\-independent repair\-and\-verification flow and evaluate it in 288 runs across three LLM backends and three benchmark suites\. On CirFix, the proposed context and diagnosis increase runs delivering a checked repair from 32/63 to 51/63, while every configuration repairs the HackDAC OpenTitan defect\. Evidence records also show that a testbench\-only criterion reports 3\.9 times more repairs than the full set of applicable checks, security\-clean outputs may lack functional verification, and different RTL repairs can implement equivalent hardware\. These results show that LLM\-generated RTL repairs require explicit multi\-stage verification evidence rather than a single pass/fail outcome\.
###### Index Terms:
RTL bug repair, large language models \(LLMs\), verification feedback, hardware security, design similarity, robust hardware
This paper has been accepted for publication at DATE 2027\. This is an initial author version\. The final paper will appear in the conference proceedings\.
## IIntroduction
Large language models can generate RTL modules, complete testbenches, and explain unfamiliar hardware\. These capabilities shorten the code development time, but do not reduce the verification burden, which consumes roughly half of an ASIC project\[[1](https://arxiv.org/html/2611.33748#bib.bib29)\]\. LLM\-generated RTL can contain many bugs that update a register under the wrong condition, violate a handshake, or leave a security lock writable\[[2](https://arxiv.org/html/2611.33748#bib.bib21)\]\. Consequently, any design flow that accepts machine\-generated RTL also needs a systematic repair\-and\-verification process\. Previous work, that address this critical need, uses LLMs to generate complete edits for syntax errors and hardware weaknesses\[[3](https://arxiv.org/html/2611.33748#bib.bib3),[4](https://arxiv.org/html/2611.33748#bib.bib9),[5](https://arxiv.org/html/2611.33748#bib.bib30)\]\. We define an*RTL repair variant*as a complete RTL modification for a specific bug\. Generation is only one part of bug\-free RTL repair\. Each variant must also be checked for bug removal, preservation of previously correct behavior, avoidance of masked or newly introduced weaknesses, and implementation cost\.
Existing evaluations often report a repair rate, the fraction of repair attempts that pass a selected test or verification check \(Table[I](https://arxiv.org/html/2611.33748#S2.T1)\)\. This single number can hide important differences in evidence\. For example, a variant may pass simulation while a sequential corner case remains unproved\. A preservation check may not exercise relevant behavior\. PPA cannot be compared without a valid reference\[[6](https://arxiv.org/html/2611.33748#bib.bib24),[7](https://arxiv.org/html/2611.33748#bib.bib26),[8](https://arxiv.org/html/2611.33748#bib.bib25)\]\. The problem is therefore not only to generate a repair, but also to retain the evidence from each check\. A typed record can route a bounded result to deeper verification, reject a regression, or prevent an unchecked result from being reported as success\.
Repeated generation can produce different RTL descriptions that synthesize to functionally equivalent hardware\. Although one verified repair can correct a bug, alternative repairs can help a designer choose a cleaner RTL or a better PPA result\. Implementation diversity, therefore, refers to differences in the synthesized structure or PPA, not the source text alone\. Repair, evidence strength, and implementation diversity must be measured separately\.
These observations motivate three questions\.RQ1: How do structural design context and verification feedback affect LLM\-based generation of RTL repair variants?RQ2: What evidence does each design check provide for an RTL repair variant?RQ3: Do verified RTL repair variants remain different after synthesis and what computational and implementation costs are associated with generating them?
REFORGE
answers these questions by separating proposal, acceptance, and selection\. An LLM proposes variants; simulation, formal, security, and synthesis tools record a separate result for each design check; and a selector compares verified variants at the source, netlist, switching\-activity, and PPA levels\. Three prompt configurations isolate the available evidence:*bare*provides only source and a repair request,*unguided*adds structural context and transformation directions, and*guided*also returns the prior round’s blocking diagnosis\.
This paper makes following major contributions:1Structured variant generation\.We build an iterative flow that generates several repair variants using design structure, transformation choices, and feedback from failed checks\.2Checks across the design flow\.Each variant passes through syntax, simulation, formal, and security checks before it can be reported as a supported repair\.3Evaluation on three repair suites\.We create a hardware\-CWE repair suite and evaluate it alongside CirFix and an external Hack@DAC OpenTitan bug\.4Complete repair tool flow\.The framework connects open\-source and commercial design tools and includes area, timing, and power constraints when implementation evidence is available\. Together, these contributions provide a practical path from generated repair variants to checked RTL suitable for research and design use\.
The remainder of the paper positions the work in Section II, develops the repair framework in Section III, describes the evaluation in Section IV, presents results in Section V, and concludes with implications and limits in Sections VI–VII\.
## IIRelated Work and Research Scope
TABLE I:Supported acceptance evidence in prior RTL work and this paper\. ✓ full, ❍ partial, ✗ absent, – not applicable\.System \(year\)Task
Functional\[\-2pt\]oracle
Bug\[\-2pt\]removal
Behavior\[\-2pt\]preservation
Formal\[\-2pt\]depth
Counterexample\[\-2pt\]feedback
Security\[\-2pt\]check
Security\[\-2pt\]re\-scan
PPA\[\-2pt\]measurement
PPA\[\-2pt\]constraint
Diverse\[\-2pt\]selection
Context\[\-2pt\]reuse
Functional RTL repair, localization, and debuggingCirFix \(2022\)\[[9](https://arxiv.org/html/2611.33748#bib.bib1)\]RS\+M✗✗✗✗✗✗✗✗✗✗RTL\-Repair \(2024\)\[[10](https://arxiv.org/html/2611.33748#bib.bib2)\]RS\+Fk❍❍❍✗✗✗✗✗✗✗RTLFixer \(2024\)\[[3](https://arxiv.org/html/2611.33748#bib.bib3)\]Rsyn\{\}\_\{\\text\{syn\}\}S✗✗✗❍✗✗✗✗✗✗MEIC \(2024\)\[[11](https://arxiv.org/html/2611.33748#bib.bib4)\]RS\+A✗✗✗❍✗✗✗✗✗✗R3A \(2025\)\[[12](https://arxiv.org/html/2611.33748#bib.bib5)\]RS✗✗✗❍✗✗✗✗✗✗Location\-is\-Key \(2025\)\[[13](https://arxiv.org/html/2611.33748#bib.bib11)\]LoS✗✗✗✗✗✗✗✗✗✗Fixbench\-RTL \(2025\)\[[14](https://arxiv.org/html/2611.33748#bib.bib12)\]BS✗✗✗✗❍✗✗✗✗✗BugGen \(2025\)\[[15](https://arxiv.org/html/2611.33748#bib.bib34)\]IS–––❍✗✗✗✗✗✗Quality\-aware generation and optimizationAutoVeriFix \(2025\)\[[16](https://arxiv.org/html/2611.33748#bib.bib33)\]GS✗–✗❍✗✗✗✗✗✗ChipSeek \(2025\)\[[17](https://arxiv.org/html/2611.33748#bib.bib13)\]GS✗–✗❍✗✗✓✗✗❍LLM\-VeriPPA \(2025\)\[[18](https://arxiv.org/html/2611.33748#bib.bib14)\]GS✗–✗❍✗✗✓✗✗✗POET \(2026\)\[[19](https://arxiv.org/html/2611.33748#bib.bib6)\]OS\+F–✓✗❍✗✗✓✗❍✗VeriRAG \(2025\)\[[20](https://arxiv.org/html/2611.33748#bib.bib7)\]RDFT\{\}\_\{\\text\{DFT\}\}F❍✓✗❍✗✗✗✗✗✗Hardware security: repair and detectionCWEAT / HS\-Fix \(2022,’24\)\[[21](https://arxiv.org/html/2611.33748#bib.bib8),[4](https://arxiv.org/html/2611.33748#bib.bib9)\]Rsec\{\}\_\{\\text\{sec\}\}S✗✗✗✗✓❍✗✗✗✗Self\-HWDebug \(2024\)\[[22](https://arxiv.org/html/2611.33748#bib.bib36)\]Rsec\{\}\_\{\\text\{sec\}\}A✗✗✗✗❍✗✗✗✗✗SV\-LLM \(2025\), Agentic Ver\. \(2026\)\[[23](https://arxiv.org/html/2611.33748#bib.bib32)\],\[[24](https://arxiv.org/html/2611.33748#bib.bib31)\]VS✗–✗✗❍✗✗✗✗✗BugWhisperer, LASHED, MARVEL\(2025\)\[[25](https://arxiv.org/html/2611.33748#bib.bib35),[26](https://arxiv.org/html/2611.33748#bib.bib18),[27](https://arxiv.org/html/2611.33748#bib.bib19)\]D–––––✓––––✗This paperRfn\+sec\{\}\_\{\\text\{fn\+sec\}\}S\+F✓✓✓✓✓✓✓✓✓❍
Task:R functional repair, Rsyn\{\}\_\{\\text\{syn\}\}syntax repair, Rsec\{\}\_\{\\text\{sec\}\}security repair, RDFT\{\}\_\{\\text\{DFT\}\}testability repair, G RTL generation, O PPA optimization, D bug detection, Lo bug localization, I bug injection, B benchmark, V verification workflow\.Functional oracle:S simulation, S\+M simulation with manual review, S\+A simulation with runtime assertions, A assertions, F formal equivalence to the*original*design, Fkbounded formal analysis of the failing trace\. Remaining columns are defined below\.
This section positionsREFORGEagainst prior RTL repair, optimization, and security\-analysis work, with emphasis on the evidence used to accept a repair\.
### II\-AAcceptance Evidence in Prior RTL Repair Systems
Prior works differ in both repair generation and acceptance evidence\. Table[I](https://arxiv.org/html/2611.33748#S2.T1)first identifies each task and functional oracle, then compares bug removal, behavioral preservation, formal depth and feedback, security analysis, PPA evaluation, diverse selection, and context reuse\. Diversity denotes verified alternatives that remain distinct after synthesis, allowing designers to compare structural or PPA tradeoffs\.
The first group comprises CirFix, RTL\-Repair, RTLFixer, MEIC, R3A, Location\-is\-Key, Fixbench\-RTL, and BugGen\. Across this group, methods search for edits that pass the supplied testbench, use symbolic synthesis, or iterate with compiler feedback, debugging, and retrieval\[[9](https://arxiv.org/html/2611.33748#bib.bib1),[10](https://arxiv.org/html/2611.33748#bib.bib2),[3](https://arxiv.org/html/2611.33748#bib.bib3),[11](https://arxiv.org/html/2611.33748#bib.bib4),[12](https://arxiv.org/html/2611.33748#bib.bib5)\]\. Contextual prompting has also been studied separately\[[28](https://arxiv.org/html/2611.33748#bib.bib10)\]\. These studies demonstrate LLM\-assisted RTL repair under their respective oracles, but do not jointly report preservation of correct behavior outside the bug\-triggering condition and formal proof depth\. Because CirFix and RTL\-Repair use different oracles, bare prompting serves only as an internal baseline\. Also, CirFix verify the outcomes with only a specific testbench and manual inspections\.
The second group adds implementation evidence\. ChipSeek, LLM\-VeriPPA, and POET report implementation cost\[[17](https://arxiv.org/html/2611.33748#bib.bib13),[18](https://arxiv.org/html/2611.33748#bib.bib14),[19](https://arxiv.org/html/2611.33748#bib.bib6)\], while POET also preserves the original design behavior\. Security studies cover another subset of columns: CWEAT, HS\-Fix, and Self\-HWDebug address repair, whereas SV\-LLM, Agentic Verifier, BugWhisperer, LASHED, and MARVEL emphasize verification or detection\[[21](https://arxiv.org/html/2611.33748#bib.bib8),[4](https://arxiv.org/html/2611.33748#bib.bib9),[22](https://arxiv.org/html/2611.33748#bib.bib36),[23](https://arxiv.org/html/2611.33748#bib.bib32),[24](https://arxiv.org/html/2611.33748#bib.bib31),[25](https://arxiv.org/html/2611.33748#bib.bib35),[26](https://arxiv.org/html/2611.33748#bib.bib18),[27](https://arxiv.org/html/2611.33748#bib.bib19)\]\. Thus, relevant checks exist across prior systems, but no listed system combines functional preservation, security improvement, implementation cost, and diverse selection when accepting a repair\.
### II\-BScope and Terminology
REFORGE
addresses this gap through one verification process that runs the applicable checks and records each result and formal proof depth\. The objective is not an unmatched repair\-rate comparison, but a traceable basis for every acceptance decision\. For each selected candidate, the process records bug removal, preservation depth, security changes, measured cost, and its relation to other candidates\. A candidate is not evidence\-complete while a required check remains unavailable\.
Table[I](https://arxiv.org/html/2611.33748#S2.T1)summarizes system support; it does not guarantee that every candidate reaches the strongest available check\. For evaluation, we use published CirFix and Hack@DAC benchmarks\. For security\-related evaluations, we also manually construct CWE\-buggy RTL designs to create a benchmark for security bugs and their repair using our proposed framework\. A differential security re\-scan compares findings before and after repair\. Removal means that a finding disappears; relocation moves the same weakness to another signal or location, while masking hides it from the detector without removing it\. Cost measurement reports area, delay, and power; a cost gate also requires a valid reference and enforces its budget\. Bounded checks and clean scans remain evidence rather than correctness proofs or security guarantees\. Section[III](https://arxiv.org/html/2611.33748#S3)formalizes these distinctions through the acceptance ladder\.
## IIIProposed Framework
Fig\. 1:TheREFORGErepair flow\. Profiling and failure localization define generation directions; independent repair, preservation, security, and cost checks determine acceptance; failure evidence guides later rounds; and similarity selection retains distinct verified variants\.REFORGE
uses a generate–check–refine loop\. Here, a bug is an RTL error that violates specified functional or security behavior; the scope covers syntax faults, functional control or datapath errors, and rule\-based CWE weaknesses\. The LLM generates complete variants, design checks reject unsupported repairs, and failure evidence guides the next round\. This separation lets the model explore repairs without allowing it to decide acceptance\.
### III\-ARepair Goal and Acceptance Evidence
Given the buggy designDbD\_\{b\}, testbenchTT, and required checksOO,REFORGEgenerates variants and runsOOunder fixed tool configurations\. Fixed inputs and configurations make acceptance repeatable and independent of LLM judgment\.*Acceptance*means selection after every required check passes\. Functional benchmarks may provide a golden designDgD\_\{g\}; security benchmarks provide weakness detectors\. NeitherDgD\_\{g\}nor a ground\-truth repair enters the prompt\. The framework supports any LLM backend and human\- or machine\-writtenDbD\_\{b\}\. Each variant receives a record containing syntax, simulation, formal, security, and synthesis results, together with proof depth, tool status, and measured cost\. Functional verdicts are orderedverified\>bounded\-k\>unchecked\\textsc\{verified\}\{\}\>\\textsc\{bounded\}\{\}\\text\{\-\}k\>\\textsc\{unchecked\}\{\}and security verdicts as clean\>\>clean\-bounded\>\>unchecked, withfailedbelow both\. An unavailable optional check remainsunchecked; an unavailable required check blocks selection\. A selected variant is an*evidence\-complete repair*only when repair and preservation are checked\.
The record additionally provides feedback for subsequent generation rounds\. A candidate receives the score of its highest completed verification stage:
r\(v\)∈\{0,\.1,\.3,\.5,\.6,\.8,\.9,1\},stage\(v\)∈\{fail,syn,sim,B,V,pres,sec,full\}\.\\begin\{gathered\}r\(v\)\\in\\\{0,\.1,\.3,\.5,\.6,\.8,\.9,1\\\},\\\\\[\-2\.0pt\] \\operatorname\{stage\}\(v\)\\in\\\{\\mathrm\{fail,syn,sim,B,V,pres,sec,full\}\\\}\.\\end\{gathered\}\(1\)Each value is a predetermined credit for that stage, increasing along the checking order so later rounds can prefer a direction that advanced further\.
### III\-BProfiling and Structured Variant Generation
Repeated prompts can return the same edit, soREFORGEstructures generation using a profile of clocks, resets, counters, FSMs, memories, arithmetic, handshakes, hierarchy, and security assets\. The profile enables only applicable transformations\. These choices are grouped into five axes: architecture, control, datapath, coding style, and security hardening\. An inapplicable axis becomes\{none\}\\\{\\textit\{none\}\\\}with a recorded reason\. One value from each applicable axis formsz=\(zarch,zctrl,zdp,zstyle,zH\)z=\(z\_\{\\rm arch\},z\_\{\\rm ctrl\},z\_\{\\rm dp\},z\_\{\\rm style\},z\_\{H\}\)\. The vector directs the model to produce a complete repair using a stated change class; it is not an RTL modification\. Candidates share the bug evidence and output contract but explore different strategies\. The grid𝒢=∏aℳa\\mathcal\{G\}=\\prod\_\{a\}\\mathcal\{M\}\_\{a\}contains all directions allowed by the projected menusℳa\\mathcal\{M\}\_\{a\}\. The first round covers this grid before exploiting any one strategy\. Starting from a canonical vector, the next vector maximizes its minimum Hamming distance from the vectors already issued:
z∗=argmaxz∈𝒢∖Zminu∈Z∑a𝟏\[za≠ua\]\.z^\{\*\}=\\arg\\max\_\{z\\in\\mathcal\{G\}\\setminus Z\}\\min\_\{u\\in Z\}\\sum\_\{a\}\\mathbf\{1\}\[z\_\{a\}\\neq u\_\{a\}\]\.\(2\)If\|𝒢\|<N\|\\mathcal\{G\}\|<N, every vector is used before any is repeated, and the run records that the design offers limited directions\. Subsequent rounds adapt the search using observed verification rewards\. Each option starts withBeta\(1,1\)\\mathrm\{Beta\}\(1,1\); rewardrrupdatesα←α\+r\\alpha\\leftarrow\\alpha\+randβ←β\+1−r\\beta\\leftarrow\\beta\+1\-r\. Thompson sampling\[[29](https://arxiv.org/html/2611.33748#bib.bib22)\]is used because it balances choices that produced strong evidence with underexplored choices when few trials are available\. Resampling avoids an observed vector when an unused one exists\.
Prompt anatomy: three configurationsBARE\| minimal request*The Verilog module below has a bug\. Find it and fix it\.*\[numbered buggy RTL\]UNGUIDED\| add context\[structure and security assets\]\[applicable transformations\]\[ranked regions and failing trace\]\[candidate transformation direction\]GUIDED \| add diagnosis\[prior attempt’s blocking gate\]\[region; expected/observed behavior\]\[counterexample, if available\]\[repair hypothesis; repeated failure\]Shared output contract\.Return one complete, self\-contained synthesizable Verilog module preserving the interface: neither a patch fragment nor explanatory prose\.
Fig\. 2:Prompt structure used to generate repair variants\. Fixed text is verbatim; brackets identify data filled and retained by the framework\.Generation also uses failure location\. Replay and switching coverage assign each source region the Ochiai score\[[30](https://arxiv.org/html/2611.33748#bib.bib23)\]s\(e\)=fe/F\(fe\+pe\)s\(e\)=f\_\{e\}/\\sqrt\{F\(f\_\{e\}\+p\_\{e\}\)\}, wherefef\_\{e\}andpep\_\{e\}count failing and passing checks that exercise regionee, andFFis the number of failing checks\. A flat ranking triggers statement\-level analysis\. The prompt then receives the ranked region, its signal cone, and a short failing trace\. These signals localize the observed failure region but are not interpreted as identifying a minimal triggering condition\.
ProposedREFORGEhas three configurations\.*Bare*receives the source and repair request;*unguided*adds the profile, failure evidence, and transformation vector; and*guided*adds the prior candidate’s earliest failed gate, counterexample, and repair hypothesis\. Two repeated failure signatures cause the guidance to revise that hypothesis\. Each configuration returns one complete module\. The framework rejects malformed outputs and permits three syntax\-correction iterations using tool diagnostics\. Algorithm[1](https://arxiv.org/html/2611.33748#alg1)summarizes the same loop: profile and localize, generate, check, select, diagnose, and repeat\.
Algorithm 1Verification\-guided RTL variant generation1:buggy RTL
DbD\_\{b\}; testbench
TT; required checks
OO; prompt configuration
pp; target
NN; round limit
RR; similarity limit
τ\\tau
2:selected repairs
AAwith their recorded evidence
3:
\(P,L\)←ProfileAndLocalize\(Db,T\)\(P,L\)\\leftarrow\\textsc\{ProfileAndLocalize\}\(D\_\{b\},T\)
4:
𝒢←∏aℳa\(P\)\\mathcal\{G\}\\leftarrow\\prod\_\{a\}\\mathcal\{M\}\_\{a\}\(P\); initialize each option as
Beta\(1,1\)\\mathrm\{Beta\}\(1,1\)
5:pool
C←∅C\\leftarrow\\emptyset; selected set
A←∅A\\leftarrow\\emptyset; diagnoses
Δ←∅\\Delta\\leftarrow\\emptyset
6:for
q=1q=1to
RRdo
7:
m←N−\|A\|m\\leftarrow N\-\|A\|⊳\\trianglerightgenerate only the missing variants
8:if
ppis barethen
Zq←mZ\_\{q\}\\leftarrow mcopies of the empty direction
9:elseif
q=1q=1then
Zq←mZ\_\{q\}\\leftarrow mmax\-min directions from
𝒢\\mathcal\{G\}
10:else
Zq←mZ\_\{q\}\\leftarrow mThompson\-sampled, nonrepeated directions
11:endif
12:for all
z∈Zqz\\in Z\_\{q\}do
13:
v←Generate\(Db,P,L,z,Δ,p\)v\\leftarrow\\textsc\{Generate\}\(D\_\{b\},P,L,z,\\Delta,p\)
14:extract one complete module; run at most three syntax repairs
15:
Ev←Check\(v,T,O\)E\_\{v\}\\leftarrow\\textsc\{Check\}\(v,T,O\);
C←C∪\{\(v,Ev,z\)\}C\\leftarrow C\\cup\\\{\(v,E\_\{v\},z\)\\\}
16:update the options in
zzusing
r\(v\)r\(v\)from Eq\. \([1](https://arxiv.org/html/2611.33748#S3.E1)\)
17:endfor
18:
\(A,dmin\)←SelectDiverse\(C,A,N,τ\)\(A,d\_\{\\min\}\)\\leftarrow\\textsc\{SelectDiverse\}\(C,A,N,\\tau\)
19:if
ppis guidedthen
Δ←Diagnose\\Delta\\leftarrow\\textsc\{Diagnose\}earliest failed gates
20:endif
21:stopon target, measured hardware collapse, two stalled rounds, round limit, or budget
22:endfor
23:return
AAwith evidence, depths, tool flags, and stop reason
### III\-CRepair, Preservation, and Security Checks
Four independent checks cover repair, preservation, security, and implementation cost\. Separate verdicts prevent one successful check from hiding a failed or unevaluated result\.
Repair\.The repair check determines whether the candidate eliminates the targeted functional defect\. A testbench failure rejects it outright\. Otherwise, bounded model checking\[[31](https://arxiv.org/html/2611.33748#bib.bib27)\]builds a miter, a construction that searches for an inputxxon which the candidatevvand the golden designggdisagree by depthkk:
∃x,∃t≤k:yv\(x,t\)≠yg\(x,t\)\.\\exists\\,x,\\ \\exists\\,t\\leq k:\\quad y\_\{v\}\(x,t\)\\ \\neq\\ y\_\{g\}\(x,t\)\.\(3\)A solution returns a counterexample and yieldsfailed; no solution excludes disagreement only within the encoded scope\. Checking starts at depth 8 and then usesk=min\(64,2w\+d\)k=\\min\(64,2w\+d\), wherewwis the widest counter or FSM register andddis pipeline depth\. The2w\+d2w\+dterm scales the checking horizon with sequential\-state width and pipeline depth, while the upper bound limits solver cost\.
No mismatch yieldsverifiedfor a state\-free miter andbounded\-kkotherwise\. This schedule is a cost heuristic, not a completeness claim; commercial equivalence results are not part of the reported verdicts\.
Preservation\.The preservation check evaluates whether defect removal modifies behavior that was previously correct in the original design\. A mismatch rejects preservation, while agreement is evidence for those rows alone\. If all observations fail, preservation is marked as not applicable rather than treating an empty comparison set as successful evidence\.
Security:Security rules and assertion templates are derived from MITRE hardware CWE definitions\[[2](https://arxiv.org/html/2611.33748#bib.bib21)\]and instantiated with assets found during profiling or declared by the benchmark\. Static AST rules check missing security\-state resets, debug bypasses, and overlapping address ranges\. Formal assertions check write\-after\-lock and reset behavior, while shadow\-netlist information\-flow tracking checks explicit and implicit flows from secret or privileged state to observable outputs\[[32](https://arxiv.org/html/2611.33748#bib.bib20)\]\. Before\-and\-after findings are*fixed*,*persisted*, or*regressed*; vacuity checks reject fixes that only make a guard unreachable\. A persisted target, regression, lost asset, or masked fix rejects the candidate\.
Implementation cost\.The fourth check measures area, delay, and power by synthesis under shared stimulus\. Each metric must stay within\(1\+ε\)\(1\+\\varepsilon\)of its reference, withε=0\.20\\varepsilon=0\.20here, and below 50 cells, an eight\-cell allowance replaces a percentage bound that a small baseline would destabilize\. A metric without a valid reference remainsuncheckedand cannot support any overhead claim\.
Algorithm 2Evidence\-first diversity selection1:pool
CC; selected
AA; obligations
OO; target
NN; threshold
τ\\tau; view weights
ww
2:updated
AA, dispersion
dmind\_\{\\min\}
3:
E←\{v∈C:vpasses every required check inO\}E\\leftarrow\\\{v\\in C:v\\text\{ passes every required check in \}O\\\}⊳\\trianglerightevidence first
4:if
E=∅E=\\emptysetthen return
\(A,1\)\(A,1\)
5:score each eligible pair on the views
VVit supports⊳\\trianglerightEqs\. \([4](https://arxiv.org/html/2611.33748#S3.E4)\)–\([6](https://arxiv.org/html/2611.33748#S3.E6)\)
6:if
\|E\|≥3\|E\|\\geq 3thendrop any view that separates nothing, agreeing within
10−310^\{\-3\}on most pairs
7:endif
8:renormalize retained
wwand fuse:
S\(i,j\)←∑u∈VwuSu\(i,j\)S\(i,j\)\\leftarrow\\sum\_\{u\\in V\}w\_\{u\}S\_\{u\}\(i,j\)
9:keep earlier selections; if
A=∅A=\\emptyset, seed the most isolated member of
EE
10:while
\|A\|<N\|A\|<Nand
E∖A≠∅E\\setminus A\\neq\\emptysetdo
11:
i∗←argmaxi∈E∖Aminj∈A\(1−S\(i,j\)\)i^\{\*\}\\leftarrow\\arg\\max\_\{i\\in E\\setminus A\}\\min\_\{j\\in A\}\(1\-S\(i,j\)\), the eligible candidate farthest from
AA⊳\\trianglerightEq\. \([7](https://arxiv.org/html/2611.33748#S3.E7)\)
12:if
maxj∈AS\(i∗,j\)\>τ\\max\_\{j\\in A\}S\(i^\{\*\},j\)\>\\tauthen break⊳\\trianglerighttoo close to a selection
13:else
A←A∪\{i∗\}A\\leftarrow A\\cup\\\{i^\{\*\}\\\}
14:endwhile
15:
dmin←mini≠j∈A\(1−S\(i,j\)\)d\_\{\\min\}\\leftarrow\\min\_\{i\\neq j\\in A\}\(1\-S\(i,j\)\), or
11if
\|A\|<2\|A\|<2
16:return
\(A,dmin\)\(A,d\_\{\\min\}\)with retained views and drop reasons
### III\-DSimilarity Views and Selection
Verification determines candidate acceptability but does not establish whether two variants correspond to distinct repair implementations\. Selection, therefore, estimates similarity from five views in\[0,1\]\[0,1\], where 1 denotes indistinguishable\. These views organize verified variants; they do not strengthen a repair verdict\.
Source views\.Lexical fingerprintsHiH\_\{i\}are built from five\-token BLAKE2b hashes by four\-hash winnowing\[[33](https://arxiv.org/html/2611.33748#bib.bib15)\]\. The AST view discards identifiers and literals, then forms pq\-gram bagQiQ\_\{i\}from two ancestor nodes and three adjacent child nodes\[[34](https://arxiv.org/html/2611.33748#bib.bib16)\]\. The two similarities are
slex\(i,j\)=\|Hi∩Hj\|\|Hi∪Hj\|,sast\(i,j\)=2\|Qi∩Qj\|\|Qi\|\+\|Qj\|\.s\_\{\\mathrm\{lex\}\}\(i,j\)=\\frac\{\|H\_\{i\}\\cap H\_\{j\}\|\}\{\|H\_\{i\}\\cup H\_\{j\}\|\},\\qquad s\_\{\\mathrm\{ast\}\}\(i,j\)=\\frac\{2\\,\|Q\_\{i\}\\cap Q\_\{j\}\|\}\{\|Q\_\{i\}\|\+\|Q\_\{j\}\|\}\.\(4\)Thus, renaming leavessasts\_\{\\mathrm\{ast\}\}unchanged, while restructuring lowers it\. A parse failure makes this unavailable for the affected pair\.
Netlist view\.Source\-level differences may be eliminated after synthesis\. Technology\-independent synthesis\[[35](https://arxiv.org/html/2611.33748#bib.bib28)\]therefore produces a labeled cell\-port graph\. Three Weisfeiler–Lehman rounds encode local wiring inϕi\\phi\_\{i\}\[[36](https://arxiv.org/html/2611.33748#bib.bib17)\], while normalized Laplacian eigenvaluesΛi\\Lambda\_\{i\}encode global structure:
snet\(i,j\)=12\[cos\(ϕi,ϕj\)\+e−W\(Λi,Λj\)/σ\]\.s\_\{\\mathrm\{net\}\}\(i,j\)=\\tfrac\{1\}\{2\}\\big\[\\cossim\(\\phi\_\{i\},\\phi\_\{j\}\)\+e^\{\-W\(\\Lambda\_\{i\},\\Lambda\_\{j\}\)/\\sigma\}\\big\]\.\(5\)HereWWis earth\-mover distance\. Spectra are exact below 2,000 nodes and approximated for larger graphs\.
Activity and cost views\.Shared stimulus produces a 32\-bin toggle\-rate histogramhih\_\{i\}\. Activity distance combines its earth\-mover distance with an energy proxy:
dE\(i,j\)=W\(hi,hj\)\+0\.2\|Ei−Ej\|,Ei=∑nαnfanoutn,d\_\{E\}\(i,j\)=W\(h\_\{i\},h\_\{j\}\)\+0\.2\\,\|E\_\{i\}\-E\_\{j\}\|,\\hskip 9\.24994ptE\_\{i\}=\\textstyle\\sum\_\{n\}\\alpha\_\{n\}\\,\\mathrm\{fanout\}\_\{n\},\(6\)where fanout approximates capacitance\. The transforme−dE/σe^\{\-d\_\{E\}/\\sigma\}uses the pool’s median positive distanceσ\\sigma\. The cost view applies the same transform to available, budget\-normalized PPA metrics\. SinceEiE\_\{i\}is not normalized, it may dominate the histogram term in large netlists\.
Combining the views\.Lexical, AST, netlist, activity, and cost views use weights0\.100\.10,0\.200\.20,0\.300\.30,0\.300\.30, and0\.100\.10\. Netlist and activity receive0\.300\.30because they measure synthesized structure and behavior; AST receives0\.200\.20for source structure\. Lexical and cost receive0\.100\.10because lexical variation can arise without structural modification, whereas PPA similarity does not directly characterize functional structure\. These heuristic weights were fixed before the campaign and not tuned\. With at least three variants, a view is dropped if more than half of its pair scores agree within10−310^\{\-3\}; the remaining weights are renormalized intoS\(i,j\)S\(i,j\)\. Selection starts with the most isolated feasible variant and repeatedly chooses
maxi∉Aminj∈A\(1−S\(i,j\)\)\.\\max\_\{i\\notin A\}\\ \\min\_\{j\\in A\}\\ \\big\(1\-S\(i,j\)\\big\)\.\(7\)It admits the variant only if its similarity to every member ofAAis at mostτ\\tau\. The archive is monotone across rounds, even if later pool\-dependent rescaling changes an old score\. Target attainment therefore uses the final minimum distancedmind\_\{\\min\}, not archive size alone\. If a hardware\-level view is excluded, source\-distinct candidates may remain functionally or structurally equivalent after synthesis\. Hence, Section[V](https://arxiv.org/html/2611.33748#S5)uses exact equivalence to audit identical\-cost groups; the proxy itself is not proof of hardware diversity\.
## IVExperimental Setup
TABLE II:Major tools used in the evaluation\.ToolPurposeIcarus VerilogSimulation, testbench replay, and VCD traces\.Slang/VerilatorSystemVerilog syntax and elaboration checks\.YosysOpen\-source synthesis and miter construction\.SymbiYosysBounded formal verification of RTL properties\.Cadence GenusCommercial synthesis and PPA measurement\.Cadence ConformalCommercial logic\-equivalence checking\.OpenSTAOpen\-source static timing analysis\.
The primary campaign crosses three prompt configurations, three backends, and 32 benchmarks, giving 288 runs \(Table[III](https://arxiv.org/html/2611.33748#S4.T3)\(a\)\)\. A subsequent analysis adds 20 guided\-Codexinput\-transformation controls, for 308 manifests and 629 selected variants\. Every run uses seed zero and a nominal 20% cost budget; each round requests only the missing candidates\.Codex\(GPT\-5\.5\),ClaudeSonnet in print mode, and theGrok\-4\.6 CLI without tool access span three model families and two interface styles\. Cadence Genus synthesizes each variant and reports cell area and count, worst\-path delay, and power\.
TABLE III:Primary campaign and outcomes: \(a\) suite limits; \(b\) CWE configured selection; \(c\) Hack@DAC stages; \(d\) CirFix resource use; \(e\) depth of bounded verdicts\.\(a\) Campaign limits SuiteCasesNNτ\\tauRndsCirFix2150\.70†3CWE1030\.851Hack@DAC150\.703
\(b\) CWE configured selection PromptSec\. setTargetClean / failedBare26/271/2776 / 5Unguided27/2715/2765 / 15Guided27/2716/2768 / 12
\(c\) Hack@DAC candidate outcomes BackendPromptGSRDCodexBare111182Unguided7774Guided8885SonnetBare131351Unguided9773Guided111095GrokBare13631Unguided5555Guided5555
\(d\) CirFix resource use BackendPromptTok\. \(M\)Time \(h\)Deliv\.CodexBare0\.7753\.112/21Unguided1\.7504\.018/21Guided1\.8494\.120/21SonnetBare0\.3351\.76/21Unguided0\.8513\.013/21Guided0\.9833\.613/21GrokBare3\.5685\.514/21Unguided3\.47710\.614/21Guided4\.05511\.418/21
\(e\) Depthkkof bounded verdicts Range ofkkRepairPreserv\.k≤9k\\leq 9983110≤k≤3110\\leq k\\leq 31192278k≥32k\\geq 320121
\(a\) Cases is the number of benchmark designs,NNis the target repair count,τ\\tauis the similarity limit, and Rnds is the round limit;†Sonnet CirFix manifests use 0\.85, while Codex/Grok use 0\.70\. CWE ran ten cases but detector conclusions use nine\. \(b\) Security\-clean selection; functional repair is evaluated separately\. \(c\) G generated, S syntax, R repair verified, D delivered; column totals are 82, 72, 57, and 31, matching the pooled manifests\. \(d\) tokens in millions, time in hours\. \(e\) counts by bounded formal depth\.
Benchmarks\.The three suites exercise complementary repair settings\. We use 21 seeded RTL bugs from the published CirFix benchmark\[[9](https://arxiv.org/html/2611.33748#bib.bib1)\]\. We created the CWE suite for security\-repair testing from ten hand\-written RTL examples based on MITRE hardware weaknesses\[[2](https://arxiv.org/html/2611.33748#bib.bib21)\]\. The detector covers nine examples; the missing\-default FSM remains in the 288\-run total but is excluded from security conclusions\. For Hack@DAC, we used a buggy OpenTitan benchmark\. We extracted the affected register\-arbiter logic, replaced package\-specific types, made one equivalent operator rewrite, and added a focused testbench\. The LLM repairs only the affected module\. Across the three suites, inputs are human\-written or human\-seeded, and neither golden RTL nor a ground\-truth repair enters the prompt\. The interface can also accept machine\-generated RTL\.
Controls\.Within a suite, the prompt configurations share tools, oracles, and target sizes; only the prompt evidence changes \(Fig\.[2](https://arxiv.org/html/2611.33748#S3.F2)\)\. One LLM call means sending one prompt to a backend and receiving one response\. Because adaptive stopping changes the number of calls and tokens, the experiment compares complete configurations rather than equal compute\. CWE uses one generation round, so it cannot measure whether feedback helps in a later round\. We added 20 guidedCodexruns to test sensitivity to surface changes: ten rename identifiers and ten alter RTL structure\. We also reselected stored candidates atτ∈\{0\.70,0\.85,1\.0\}\\tau\\in\\\{0\.70,0\.85,1\.0\\\}to measure the similarity\-threshold tradeoff\. Reselection uses no new LLM calls\. We did not repeat the campaign with different similarity weights\.
Reproducibility\.Each run retains its resolved configuration, rendered knowledge pack, generated RTL, per\-tool logs, verdicts, tokens, and wall\-clock time\. One anonymized design example includes rendered prompts, delivered variants, parameters, and evidence\. Potential hallucinations, such as incomplete modules or unsupported constructs, remain in the generated RTL and logs and are rejected when extraction or syntax checking fails\. The logs identify each model family, but they do not contain an exact model snapshot or the provider’s default decoding temperature\. We therefore report these settings as unavailable\.
Tools\.The flow supports both open\-source and commercial EDA tools for syntax checking, simulation, formal verification, synthesis, and PPA analysis\. The major tools used in this evaluation are listed below\. Equivalent tools can be integrated through the same stage interfaces\.
Metrics\.Fornnruns, selected countara\_\{r\}, and final dispersiondrd\_\{r\}, configured deliveryDDand target attainmentHHare
D=1n∑r𝟏\[ar≥1\],H=1n∑r𝟏\[ar=N∧dr≥1−τ\]\.D=\\frac\{1\}\{n\}\\sum\_\{r\}\\mathbf\{1\}\[a\_\{r\}\\geq 1\],\\qquad H=\\frac\{1\}\{n\}\\sum\_\{r\}\\mathbf\{1\}\[a\_\{r\}=N\\ \\land\\ d\_\{r\}\\geq 1\-\\tau\]\.These campaign metrics are reported alongside, never instead of, the typed evidence distribution\. The 63 CirFix observations per prompt configuration represent 21 bugs on three backends rather than 63 independent bugs, and with one seed per configuration every rate reported below is descriptive rather than inferential\.
## VResults
We have evaluated the variants in three steps\. It first measures whether structural context and iterative feedback increase checked repair delivery\. Next, it examines the verification evidence for each selected variant\. Finally, it compares the RTL and synthesized implementations to determine whether generated variants are distinct\.
### V\-ARQ1: Checked Repair Delivery with Context and Feedback
Fig\. 3:CirFix repair outcomes by backend and prompt configuration\. \(a\) Runs producing at least one checked repair; \(b\) runs reaching the full five\-candidate target\. Context and feedback increase checked repair delivery, although five\-variant target attainment is not monotonic\.RQ1
evaluates whether design context and verification feedback help an LLM produce at least one checked repair\. On CirFix, delivery increases from 32/63 runs with bare prompting to 45/63 with structural context and 51/63 with context plus diagnosis \(Fig\.[3](https://arxiv.org/html/2611.33748#S5.F3)\)\. Context identifies relevant RTL structures, while diagnosis reports the check that prevented acceptance in the previous round\. These inputs therefore reduce repeated or unsupported edits\.
The backend results show that the benefit is configuration dependent\. Diagnosis increases solved benchmarks from 18 to 20 forCodexand from 14 to 18 forGrok, whileSonnetremains at 13 of 21\. Guided CirFix also uses 47% more new tokens than bare prompting because adaptive rounds continue when evidence is missing\. Consequently, the results establish an association under the evaluated budgets rather than a compute\-matched causal effect\. The reduction in runs without a checked repair provides hardware designers with more usable candidates and gives future RTL\-repair studies a reproducible comparison point\.
### V\-BRQ2: Verification Evidence for Selected Repairs
RQ2
determines whether each selected variant has sufficient evidence to support a repair claim\. All 430 functional selections have checked repair and preservation results\. Among them, 140 reach an unboundedverifiedrepair verdict, while 290 reachbounded\-kkatk≤20k\\leq 20; preservation reachesk≥32k\\geq 32for 121 variants \(Table[III](https://arxiv.org/html/2611.33748#S4.T3)\(e\)\)\. Thus, a common delivery count can contain different proof strengths\. PPA results provide a second distinction: 236 CirFix variants satisfy the budget, 81 exceed it, and 82 lack a complete cost result\. Hack@DAC has measured PPA but no valid reference report, so an overhead claim remainsunchecked\. A hardware designer can therefore select a variant according to the evidence required by the design rather than according to file count\.
The CWE results further show why functional and security evidence must remain separate\. All 199 selected candidates satisfy the configured differential security check; however, the functional replay does not establish repair or preservation\. Consequently,REFORGErecords their functional status asuncheckedand does not classify them as functionally checked repairs\. The original selection rates of 26/27, 27/27, and 27/27 do not express this difference\.
Table[IV](https://arxiv.org/html/2611.33748#S5.T4)\(b\) explains how stronger checks change the supported claim\. Compilation retains 629 candidates across 44 benchmarks, functional replay retains 430 across 21, unbounded equivalence retains 140 across five, and the cost gate retains 109 across four\. Therefore, functional replay alone reports 3\.9×\\timesmore repairs than the full set of applicable checks\. The remaining entries areuncheckedrather thanfailedwhen a check is unavailable or only a bounded result is present\. This progression provides a consistent basis for comparing repair systems that report evidence at different depths\.
The input\-transformation results examine whether the security outcome depends on the exact RTL text\. In the 30\-run guided\-Codexstudy, a security\-clean candidate appears for 9/10 original designs and 7/10 designs after either identifier renaming or structural perturbation\. Across 90 rescans, the detectors record 53 fixed, 70 persistent, and 8 regressed findings, with no masked finding; one scan may contain multiple findings\. The 70% retained rate after each transformation shows that exact\-text recall is not the only source of successful repairs\. However, the small sample and the uncovered missing\-default FSM limit the strength and scope of this result\.
TABLE IV:Verification outcomes for 629 selected variants across 308 runs: \(a\) verification outcomes; \(b\) variants retained as the required checks are applied\.\(a\) Verification outcomes CheckCirFixCWEH@DVariantsnn39919931Runs deliv\.128/18994/1109/9Repair V/B/U109/290/00/0/19931/0/0Pres\. B/U399/00/19931/0PPA P/F/U236/81/820/0/1990/0/31Sec\. C/CB–/–63/136–/–
\(b\) Criteria applied in sequence CriterionCirFixCWEH@DBugsCompiles, parses3991993144\+\+testbench3990†3121\+\+preservation3990†3121\+\+equivalence1090†315\+\+security scan1090†315\+\+cost gate1090†0†4
†Check not evaluable on that corpus, not failed\. Each row also represents its check class: testbench \(CirFix, MEIC, R3A\), cost gate \(ChipSeek, LLM\-VeriPPA\)\.
### V\-CRQ3: Hardware Equivalence of Generated Variants
RQ3
evaluates whether source\-level variation produces distinct hardware implementations\. Bare prompting never reaches the five\-candidate CirFix target, while unguided and guided prompting reach it in 20/63 and 18/63 runs\. ForCodex, diagnosis increases checked delivery from 18 to 20 benchmarks but reduces target attainment from seven to three\. Verification feedback helps the model correct a rejected edit, but it can also direct later variants toward the same repair\. Unequal compute and theSonnetthreshold discrepancy prevent a causal interpretation\.
The matched case in Fig\.[4](https://arxiv.org/html/2611.33748#S5.F4)illustrates this tradeoff\. Unguided context selects five candidates with finaldmin=0\.348d\_\{\\min\}=0\.348, whereas guided selection ends at 0\.163 because an archived pair is rescored aboveτ\\tau\. A deterministic threshold sweep confirms the expected tradeoff: raisingτ\\taufrom 0\.70 to 0\.85 to 1\.0 increases the mean selected fraction from 78\.9% to 87\.1% to 99\.3%, while the meandmind\_\{\\min\}falls from 0\.653 to 0\.570 to 0\.426\. Thus, target size and dispersion are competing operating points rather than similar success measures\.
Selection diversity is calculated asdmin=mini≠j\(1−S\(i,j\)\)d\_\{\\min\}=\\min\_\{i\\neq j\}\(1\-S\(i,j\)\); a larger value means that the closest pair is less similar\. Because this score combines source and hardware views, exact equivalence determines whether the synthesized variants differ functionally\. A Yosys SAT miter proves all 408 variant pairs from 16 identical\-PPA groups functionally equivalent, with no counterexample or timeout\. In contrast, the netlist view places only 192/372 checkable pairs above 0\.999 similarity\. The combined score therefore measures representation\-level variation, not guaranteed implementation diversity\. Hardware designers and future repair tools should group final candidates by exact equivalence and use the less expensive similarity views only to prioritize comparisons\.
### V\-DResource Cost
Token and wall\-clock costs are important when selecting an iterative\-repair backend\. Table[III](https://arxiv.org/html/2611.33748#S4.T3)\(d\) shows thatCodexandSonnetreuse cached prompt context, whereas theGrokCLI reprocesses the full input for each candidate and feedback round\. Consequently,Grokuses 3\.477–4\.055 million new tokens and 5\.5–11\.4 hours, while the cached interfaces complete in 1\.7–4\.1 hours\. Caching therefore favorsCodexandSonnetfor repeated calls in this workflow; these values describe interfaces, not model capability\.
Fig\. 4:Combined similarity scoreS\(i,j\)S\(i,j\)for one matched CirFix/Codexcase; bold labels and boxed cells identify selected candidates\. The lowerdmind\_\{\\min\}under guided prompting shows that verification feedback can reduce dispersion among selected variants\.
## VIDiscussion and Limitations
### VI\-AVerification Evidence for RTL Repair
REFORGE
applies the same checks to human\-written and machine\-generated RTL\. Acceptance requires bug removal, off\-trigger preservation, security status, and PPA feasibility when a reference is available\. Recorded counterexamples, proof depths, and PPA results allow hardware designers to select evidence appropriate to each design\. All 408 variant pairs within identical\-PPA groups implement the same function, so final variants should be grouped by exact equivalence\. The 199 security\-selected CWE candidates lack checked functional replay; their security results therefore do not establish a functional repair\.
### VI\-BLimitations
Security\.The current repair scope covers syntax faults, functional control or datapath bugs evaluated with a testbench or golden design, and known MITRE CWE weaknesses expressible through configured rules, assertions, and information\-flow checks\.REFORGEmay not detect a new vulnerability outside these definitions\. Future work should detect and localize unknown vulnerabilities and return them to the repair loop\.
Runtime and Token Cost\.Repeated CLI requests consume substantial time and tokens\. Because the evaluatedGrokCLI lacks prompt caching, each round reprocesses fixed context\. Future implementations should cache this prefix, transmit only new feedback, and reuse verification artifacts\.
## VIIConclusion
LLM\-generated RTL repairs require evidence of bug removal, behavioral preservation, security, and implementation cost\.REFORGEcombines structured variant generation with simulation, formal verification, security analysis, synthesis, and evidence\-based selection\. The evaluation covers CirFix, MITRE CWE examples, and a Hack@DAC OpenTitan bug across three backends and prompt configurations\. Context and feedback increase CirFix checked delivery from 32/63 to 51/63 runs\. Among 629 selected variants, 430 have checked functional evidence, while 199 CWE variants retain only security results\. Exact equivalence proves all 408 identical\-PPA pairs functionally identical, showing that RTL variation does not establish hardware diversity\. Counting equivalent variants as separate hardware alternatives would overstate repair diversity and provide no independent implementation choices\. These results give researchers explicit evidence and diversity measures, while hardware designers receive candidates with inspectable verification status\. Future work includes detecting unknown weaknesses, using exact equivalence in selection, and reducing iterative cost through caching and verification reuse\.
## References
- \[1\]\(2022\)2022 Wilson Research Group IC/ASIC functional verification trends\.Technical reportSiemens EDA\.Cited by:[§I](https://arxiv.org/html/2611.33748#S1.p1.1)\.
- \[2\]MITRE Corporation\(2025\)2025 CWE most important hardware weaknesses\.Note:[https://cwe\.mitre\.org/topHW/](https://cwe.mitre.org/topHW/)Cited by:[§I](https://arxiv.org/html/2611.33748#S1.p1.1),[§III\-C](https://arxiv.org/html/2611.33748#S3.SS3.p5.1),[§IV](https://arxiv.org/html/2611.33748#S4.p2.1)\.
- \[3\]Y\. Tsai, M\. Liu, and H\. Ren\(2024\)RTLFixer: automatically fixing RTL syntax errors with large language model\.InProc\. DAC,pp\. 1–6\.External Links:[Document](https://dx.doi.org/10.1145/3649329.3657353)Cited by:[§I](https://arxiv.org/html/2611.33748#S1.p1.1),[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p2.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.5.1.1.1)\.
- \[4\]B\. Ahmad, S\. Thakur, B\. Tan, R\. Karri, and H\. Pearce\(2024\)On hardware security bug code fixes by prompting large language models\.IEEE Trans\. Inf\. Forensics Security19,pp\. 4043–4057\.External Links:[Document](https://dx.doi.org/10.1109/TIFS.2024.3374558)Cited by:[§I](https://arxiv.org/html/2611.33748#S1.p1.1),[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.18.1.1.1)\.
- \[5\]S\. Paria and S\. Bhunia\(2026\)Harnessing the Power of LLMs for Enhancing Hardware Security\.SN Computer Science7\(2\),pp\. 218\.External Links:[Document](https://dx.doi.org/10.1007/s42979-026-04799-8),ISSN 2661\-8907Cited by:[§I](https://arxiv.org/html/2611.33748#S1.p1.1)\.
- \[6\]Z\. Qi, F\. Long, S\. Achour, and M\. Rinard\(2015\)An analysis of patch plausibility and correctness for generate\-and\-validate patch generation systems\.InProc\. ISSTA,pp\. 24–36\.External Links:[Document](https://dx.doi.org/10.1145/2771783.2771791)Cited by:[§I](https://arxiv.org/html/2611.33748#S1.p2.1)\.
- \[7\]F\. Long and M\. Rinard\(2016\)An analysis of the search spaces for generate and validate patch generation systems\.InProc\. ICSE,pp\. 702–713\.External Links:[Document](https://dx.doi.org/10.1145/2884781.2884872)Cited by:[§I](https://arxiv.org/html/2611.33748#S1.p2.1)\.
- \[8\]E\. K\. Smith, E\. T\. Barr, C\. Le Goues, and Y\. Brun\(2015\)Is the cure worse than the disease? overfitting in automated program repair\.InProc\. ESEC/FSE,pp\. 532–543\.External Links:[Document](https://dx.doi.org/10.1145/2786805.2786825)Cited by:[§I](https://arxiv.org/html/2611.33748#S1.p2.1)\.
- \[9\]H\. Ahmad, Y\. Huang, and W\. Weimer\(2022\)CirFix: automatically repairing defects in hardware design code\.InProc\. ASPLOS,pp\. 990–1003\.External Links:[Document](https://dx.doi.org/10.1145/3503222.3507763)Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p2.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.3.1.1.1),[§IV](https://arxiv.org/html/2611.33748#S4.p2.1)\.
- \[10\]K\. Laeufer, B\. Fajardo, A\. Ahuja, V\. Iyer, B\. Nikolić, and K\. Sen\(2024\)RTL\-Repair: fast symbolic repair of hardware design code\.InProc\. ASPLOS,pp\. 867–881\.External Links:[Document](https://dx.doi.org/10.1145/3620666.3651346)Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p2.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.4.1.1.1)\.
- \[11\]K\. Xu, J\. Sun, Y\. Hu, X\. Fang, W\. Shan, X\. Wang, and Z\. Jiang\(2024\)MEIC: re\-thinking RTL debug automation using LLMs\.InProc\. ICCAD,pp\. 1–9\.External Links:[Document](https://dx.doi.org/10.1145/3676536.3676801)Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p2.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.6.1.1.1)\.
- \[12\]Z\. Luo, F\. Cui, K\. Zhou, R\. Guo, M\. Xia, H\. Hou, and Y\. Liang\(2025\)R3A: reliable RTL repair framework with multi\-agent fault localization and stochastic tree\-of\-thoughts patch generation\.Note:arXiv:2511\.20090Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p2.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.7.1.1.1)\.
- \[13\]B\. Yao, N\. Wang, J\. Zhou, X\. Wang, H\. Gao, Z\. Jiang, and N\. Guan\(2025\)Location is key: leveraging LLM for functional bug localization in verilog design\.InProc\. DAC,pp\. 1–7\.External Links:[Document](https://dx.doi.org/10.1109/DAC63849.2025.11133280)Cited by:[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.8.1.1.1)\.
- \[14\]S\. Li, W\. Fu, Y\. Zhao, X\. Guo, and Y\. Jin\(2025\)Fixbench\-RTL: a comprehensive benchmark for evaluating LLMs on RTL debugging\.InProc\. AsianHOST,pp\. 1–6\.External Links:[Document](https://dx.doi.org/10.1109/AsianHOST68425.2025.11370376)Cited by:[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.9.1.1.1)\.
- \[15\]S\. Jasper, M\. Luu, E\. Pan, A\. Tyagi, M\. Quinn, J\. Hu, and D\. K\. Houngninou\(2025\)BugGen: a self\-correcting multi\-agent llm pipeline for realistic rtl bug synthesis\.External Links:2506\.10501,[Link](https://arxiv.org/abs/2506.10501)Cited by:[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.10.1.1.1)\.
- \[16\]Y\. Tan, X\. Meng, Z\. Jiang, and Y\. Lyu\(2025\)AutoVeriFix: automatically correcting errors and enhancing functional correctness in llm\-generated verilog code\.External Links:2509\.08416Cited by:[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.12.1.1.1)\.
- \[17\]Z\. Chen, K\. Chang, Z\. Li, C\. Li, X\. He, C\. Chen, M\. Wang, H\. Xu, Y\. Han, H\. Li, and Y\. Wang\(2025\)ChipSeek: optimizing verilog generation via EDA\-integrated reinforcement learning\.Note:arXiv:2507\.04736Accepted to ACL 2026; revised 2026Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.13.1.1.1)\.
- \[18\]K\. Thorat, J\. Zhao, Y\. Liu, A\. Hasan, H\. Peng, X\. Xie, B\. Lei, and C\. Ding\(2025\)LLM\-VeriPPA: power, performance, and area optimization aware verilog code generation with large language models\.InProc\. MLCAD,pp\. 1–7\.External Links:[Document](https://dx.doi.org/10.1109/MLCAD65511.2025.11189158)Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.14.1.1.1)\.
- \[19\]H\. Ping, P\. Zhang, Z\. Wang, S\. Li, A\. Cheng, W\. Yang, P\. Bogdan, and S\. Nazarian\(2026\)POET: power\-oriented evolutionary tuning for LLM\-based RTL PPA optimization\.Note:arXiv:2603\.19333Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.15.1.1.1)\.
- \[20\]H\. Qi, Y\. Du, L\. Zhang, S\. C\. Liew, K\. Chen, and Y\. Du\(2025\)VeriRAG: a retrieval\-augmented framework for automated RTL testability repair\.Note:arXiv:2507\.15664Also Proc\. ISQED 2026Cited by:[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.16.1.1.1)\.
- \[21\]B\. Ahmad, W\. Liu, L\. Collini, H\. Pearce, J\. M\. Fung, J\. Valamehr, M\. Bidmeshki, P\. Sapiecha, S\. Brown, K\. Chakrabarty, R\. Karri, and B\. Tan\(2022\)Don’t CWEAT it: toward CWE analysis techniques in early stages of hardware design\.InProc\. ICCAD,pp\. 1–9\.External Links:[Document](https://dx.doi.org/10.1145/3508352.3549369)Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.18.1.1.1)\.
- \[22\]M\. Akyash and H\. M\. Kamali\(2024\)Self\-HWDebug: Automation of LLM Self\-Instructing for Hardware Security Verification\.In2024 IEEE Computer Society Annual Symposium on VLSI \(ISVLSI\),Vol\.,pp\. 391–396\.External Links:[Document](https://dx.doi.org/10.1109/ISVLSI61997.2024.00077)Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.19.1.1.1)\.
- \[23\]D\. Saha, S\. Tarek, H\. A\. Shaikh, K\. T\. Hasan, P\. S\. Nalluri, Md\. A\. Hasan, N\. Alam, J\. Zhou, S\. K\. Saha, M\. Tehranipoor, and F\. Farahmandi\(2025\)SV\-llm: an agentic approach for soc security verification using large language models\.External Links:2506\.20415Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.20.1.1.1)\.
- \[24\]S\. Paria and S\. Bhunia\(2026\)Exploring agentic llm paradigms for hardware verification across abstraction levels\.In2026 IEEE 44th VLSI Test Symposium \(VTS\),Vol\.,pp\. 1–5\.External Links:[Document](https://dx.doi.org/10.1109/VTS69484.2026.11563224)Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.20.1.1.1)\.
- \[25\]S\. Tarek, D\. Saha, S\. K\. Saha, and F\. Farahmandi\(2025\)BugWhisperer: fine\-tuning llms for soc hardware vulnerability detection\.In2025 IEEE 43rd VLSI Test Symposium \(VTS\),Vol\.,pp\. 1–5\.Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.21.1.1.1)\.
- \[26\]B\. Ahmad, H\. Pearce, R\. Karri, and B\. Tan\(2025\)LASHED: LLMs and static hardware analysis for early detection of RTL bugs\.arXiv preprint arXiv:2504\.21770\.Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.21.1.1.1)\.
- \[27\]L\. Collini, B\. Ahmad, J\. Ah\-kiow, and R\. Karri\(2025\)MARVEL: multi\-agent RTL vulnerability extraction using LLMs\.arXiv preprint arXiv:2505\.11963\.Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p3.1),[TABLE I](https://arxiv.org/html/2611.33748#S2.T1.2.21.1.1.1)\.
- \[28\]A\. Elnaggar and B\. Tan\(2025\)Adding context to LLM\-guided verilog repair\.InProc\. ISQED,pp\. 1–7\.External Links:[Document](https://dx.doi.org/10.1109/ISQED65160.2025.11014472)Cited by:[§II\-A](https://arxiv.org/html/2611.33748#S2.SS1.p2.1)\.
- \[29\]W\. R\. Thompson\(1933\)On the likelihood that one unknown probability exceeds another in view of the evidence of two samples\.Biometrika25\(3/4\),pp\. 285–294\.External Links:[Document](https://dx.doi.org/10.2307/2332286)Cited by:[§III\-B](https://arxiv.org/html/2611.33748#S3.SS2.p1.2)\.
- \[30\]R\. Abreu, P\. Zoeteweij, and A\. J\. C\. van Gemund\(2007\)On the accuracy of spectrum\-based fault localization\.InProc\. TAICPART\-MUTATION,pp\. 89–98\.External Links:[Document](https://dx.doi.org/10.1109/TAIC.PART.2007.13)Cited by:[§III\-B](https://arxiv.org/html/2611.33748#S3.SS2.p2.1)\.
- \[31\]A\. Biere, A\. Cimatti, E\. M\. Clarke, and Y\. Zhu\(1999\)Symbolic model checking without BDDs\.InProc\. TACAS,pp\. 193–207\.External Links:[Document](https://dx.doi.org/10.1007/3-540-49059-0%5F14)Cited by:[§III\-C](https://arxiv.org/html/2611.33748#S3.SS3.p2.1)\.
- \[32\]W\. Hu, A\. Ardeshiricham, and R\. Kastner\(2021\)Hardware information flow tracking\.ACM Comput\. Surv\.54\(4\),pp\. 1–39\.External Links:[Document](https://dx.doi.org/10.1145/3447867)Cited by:[§III\-C](https://arxiv.org/html/2611.33748#S3.SS3.p5.1)\.
- \[33\]S\. Schleimer, D\. S\. Wilkerson, and A\. Aiken\(2003\)Winnowing: local algorithms for document fingerprinting\.InProc\. ACM SIGMOD,pp\. 76–85\.External Links:[Document](https://dx.doi.org/10.1145/872757.872770)Cited by:[§III\-D](https://arxiv.org/html/2611.33748#S3.SS4.p2.1)\.
- \[34\]N\. Augsten, M\. Böhlen, and J\. Gamper\(2010\)Thepqpq\-gram distance between ordered labeled trees\.ACM Trans\. Database Syst\.35\(1\),pp\. 4:1–4:36\.External Links:[Document](https://dx.doi.org/10.1145/1670243.1670247)Cited by:[§III\-D](https://arxiv.org/html/2611.33748#S3.SS4.p2.1)\.
- \[35\]C\. Wolf\(2016\)Yosys open SYnthesis suite\.Note:[https://yosyshq\.net/yosys/](https://yosyshq.net/yosys/)Cited by:[§III\-D](https://arxiv.org/html/2611.33748#S3.SS4.p3.1)\.
- \[36\]N\. Shervashidze, P\. Schweitzer, E\. J\. van Leeuwen, K\. Mehlhorn, and K\. M\. Borgwardt\(2011\)Weisfeiler–lehman graph kernels\.J\. Mach\. Learn\. Res\.12\(77\),pp\. 2539–2561\.Cited by:[§III\-D](https://arxiv.org/html/2611.33748#S3.SS4.p3.1)\.Similar Articles
REFORGE: A Method for Benchmarking LLMs' Reverse Engineering Capabilities in Decompiled Binary Function Naming
REFORGE is a novel pipeline for benchmarking LLMs' reverse engineering capabilities, specifically for decompiled binary function naming, that addresses reliability issues in binary-to-source alignment under compiler optimization.
How Stable Are LLM-Generated Proofs Under Program Refactoring? A Stress Test for Verifiable Code Generation
This paper introduces RefactorProof, a stress test that derives 458 Lean-certified refactoring variants from VERINA tasks to measure whether LLM-generated proofs remain valid under behavior-preserving program changes. It finds substantial brittleness across reference proofs and specialized provers (DeepSeek-Prover-V2, Goedel-Prover-V2), while noting that most broken proofs can be repaired with small edits.
Refining Over Resampling: Test-Time Self-Correction for LLM Reasoning
A new verifier-free breadth-depth refinement framework improves LLM reasoning at test time by sampling multiple rollouts, iteratively refining each via self-critique, and aggregating with majority voting. It consistently outperforms greedy decoding, majority voting, and verifier-based selection across several math benchmarks and open-weight models.
Fix, Not Just Resample: Bounded Compiler-Guided Repair in Lean 4
A Purdue paper introduces a bounded, online step-level repair module for Lean 4 theorem provers that feeds compiler error messages to a pretrained repair model instead of discarding failed tactics, achieving up to a 32% relative gain in solve rate on the LeanDojo benchmark and nearly doubling performance on Lean Workbook.
Guarded Repair for Harm-Aware Post-hoc Replacement of LLM Mathematical Reasoning
A framework called GuardedRepair is proposed for post-hoc replacement of LLM mathematical reasoning, using selective replacement with safety guards to fix errors while minimizing harm to correct traces. On GSM8K it improves accuracy from 95.60% to 96.89% without breaking correct answers.