Skip to content

LeanHardware: Bringing Formal Assurance to Vibe Hardware Development from Intent to RTL via Lean 4

Wenji Fang, Ziyi Yang, Peichen Xie, Xian Zhang, Ruize Tang, Tianyu Chen, Fan Yang, Jing Wang, Yao Lu, Mengming Li, Wenkai Li, Zhiyuan Yan, Hongce Zhang, Zhiyao Xie

cs.AR

Abstract

As LLMs become increasingly capable of generating RTL, ensuring that AI-generated hardware faithfully implements designer intent remains a fundamental challenge. This requires addressing two correctness gaps: natural-language specifications may not accurately capture intended behavior, and generated RTL may not satisfy the resulting specifications. To address these challenges, we present LeanHardware, a formal-methods-based framework that brings end-to-end assurance to vibe hardware development from designer intent to RTL in two stages. In Stage 1, LeanHardware uses executable LeanSpec models to identify specification uncertainties through concrete execution and clarify intended behavior through designer feedback. In Stage 2, LeanHardware directly generates Verilog, translates it into LeanRTL using a deterministic parser, and constructs Lean-checked refinement proofs against the clarified LeanSpec reference models. Across 329 designs from four benchmarks, LeanHardware achieves 98%, 98%, 94%, and 91% functional correctness on VerilogEval, RTLLM, CVDP, and ChipBench, respectively. With the same backbone LLM, Stage 1 improves RTL correctness from 81.5% to 96.0% on corrected benchmarks, while Stage 2 establishes unbounded refinement proofs for 79.0% and 92.1% of designs against cycle-level and transaction-level specifications, respectively. Our results show that proof-guided correction further improves weaker LLMs, while for stronger LLMs, specification clarification drives most correctness gains and formal proving primarily provides certification.

Create a lesson