CPU-Eval: Evaluating Large Language Models for CPU Hardware Code Generation

Yuisei Iwata, Yutaka Masuda, Tohru IshiharaarXiv 2026

TL;DR

Large language models are acing standard hardware-coding tests, scoring over 90% on textbook exercises—which makes it look like AI-designed chips are right around the corner. This paper introduces CPU-Eval, a reality-check benchmark that tests whether LLMs can actually write working components inside real, Linux-capable processors. Spoiler: when forced to plug their code into real CPUs and boot actual software, state-of-the-art model performance drops by over 45 percentage points, revealing massive blind spots in code length and language familiarity.

What Problem Does This Paper Address?

To design physical computer chips, engineers don't write Python or C++; they write HDLs (Hardware Description Languages, like SystemVerilog), which describe the actual wiring, logic gates, and timing of circuits at the RTL (Register-Transfer Level).

For the past few years, researchers have measured how well LLMs write hardware code using benchmarks like VerilogEval. There’s just one problem: LLMs have gotten too good at it. Recent systems pass over 90% of VerilogEval’s problems, leaving almost no headroom to measure new breakthroughs. Furthermore, VerilogEval consists mostly of tiny, standalone classroom exercises (averaging just 19 lines of code). Real chip designers rarely build toy circuits in a vacuum; they usually take an existing processor and build complex new submodules to plug into it. Existing benchmarks weren't testing whether LLM-generated hardware actually works when wired into a full, living CPU.

Methods

Instead of testing isolated snippets with simple unit tests, the authors built an end-to-end integration and simulation pipeline that requires zero expensive, proprietary chip-design tools.

Fig. 1. Generation and evaluation process for one of the 339 CPU-Eval problems: (a) CPU-Eval provides the prompt for the arithmetic logic unit (ALU) of the Ibex CPU to an LLM, (b) the LLM generates ibex_alu and CPU-Eval integrates it into Ibex, (c) CPU-Eval executes a test program, and (d) trace comparison locates a functional error.

Here is how a single test works in CPU-Eval:

  1. Rich Specification: The LLM is given a detailed prompt containing official design docs, interface specs, and surrounding code—everything a human engineer would have—and is asked to write one missing CPU submodule (like an Arithmetic Logic Unit or a branch predictor).
  2. Full-CPU Integration: CPU-Eval takes the LLM's generated hardware code, drops it directly into the full open-source CPU, and compiles a simulated hardware model.
  3. Booting Real Software: It runs actual RISC-V assembly/software test suites on the newly assembled CPU, while simultaneously running the exact same software on a "golden" reference simulator (like Spike) that models ideal behavior.
  4. Trace Comparison & Mutation Checking: Rather than just outputting "pass/fail," CPU-Eval compares instruction-by-instruction execution traces (register states, memory writes, cycle counts) to pinpoint the exact instruction where the hardware went off the rails. To make sure the tests themselves weren't letting subtle bugs slip through, the authors injected deliberate bugs into reference designs (like forcing a memory unit to write zeros) and hardened the test suites until every fake bug was caught.

Datasets

The paper introduces CPU-Eval (and compares it against VerilogEval v2 Spec-to-RTL for evaluation; no model training was performed).

The six open-source RISC-V processors that make up CPU-Eval

CPU-Eval comprises 339 problems extracted from six real-world, open-source RISC-V CPUs—including chip families that have actually been fabricated in silicon. They span from tiny 2-stage embedded cores (Ibex) to complex, Linux-capable out-of-order processors (BOOM).

  • Scale: Submodules average 287 lines of code (up to 3,176 lines), dwarfing VerilogEval’s 19-line average.
  • Language Diversity: Beyond standard SystemVerilog (CVA6, VeeR EL2, Ibex), it tests higher-level hardware construction languages: Chisel (BOOM, Rift2Core) and SpinalHDL (VexRiscv).

Key Insights and Ideas

  • High benchmark scores were hiding a massive capability cliff: Because top models were clustered near 90%+ on short VerilogEval exercises, they looked roughly equal—and equally ready for prime time. Putting them in real CPUs blows the spread wide open.
  • Size matters—a lot: As submodule length grows, LLM accuracy plummets, especially for open-weight models. This gives hardware architects a clear, actionable takeaway: if you want LLMs to help build chips, break your architecture down into fine-grained, bite-sized modules.
  • The "Stack Overflow Effect" in hardware languages: Even when controlling for code length, models are vastly better at SystemVerilog than Chisel, and better at Chisel than SpinalHDL. The authors note that Stack Overflow has 3,672 questions for SystemVerilog, 695 for Chisel, and just 13 for SpinalHDL. Niche languages face a steep data-scarcity barrier in AI-assisted chip design.
  • Training data familiarity leaks through: Between two CPUs written in Chisel, Claude Opus 5 performed better across every code-length bracket on the famous BOOM core (2,238 GitHub stars) than on the obscure Rift2Core (41 stars), suggesting flagship models benefit from having seen popular open-source architectures during pretraining.

Key Results

The authors evaluated seven state-of-the-art LLMs—five open-weight models (Gemma 4 31B, gpt-oss-120B, Qwen3.5-397B, DeepSeek-V4.1-Flash, Kimi K2.7 Code) and two flagship commercial models (GPT-5.6 Sol, Claude Opus 5)—measuring pass@1 (the chance a single generated attempt passes all tests):

Fig. 2. Mean pass@1 by source-code length. (a) highlights the near-saturated mean across the two commercial models on VerilogEval v2 S2R. (b) illustrates how pass@1 decreases across models as SystemVerilog submodules in CPU- Eval become longer. (c) and (d) highlight differences in mean pass@1 between the five open-weight and two commercial models for Chisel and SpinalHDL submodules.
  • The Reality Check: Across all seven models, mean pass@1 dropped from 76.48% on VerilogEval v2 down to 31.35% on CPU-Eval—a 45.14 percentage point plunge. Even the best model, Claude Opus 5, dropped from 92.69% to 62.86%.
  • Length Collapse: On SystemVerilog modules, open-weight models averaged a 94.55% pass rate on 1–20 line modules, but collapsed to 1.38% on modules over 500 lines. Commercial models held up better above 500 lines, with GPT-5.6 Sol at 20.21% and Claude Opus 5 at 43.54%.
  • Language Gap: For mid-sized modules (51–100 lines), the two commercial models averaged 80.31% on SystemVerilog, 44.83% on Chisel, and just 6.67% on SpinalHDL. On VexRiscv (SpinalHDL), two open-weight models scored 0.00% across the board.

Limitations and Future Work

The authors do not include a dedicated limitations section, though several boundaries are apparent from their setup:

  • Scope of Evaluation: CPU-Eval strictly tests functional correctness in simulation (does it run software properly?). It does not evaluate physical synthesis metrics—like silicon area, clock frequency, or power consumption—because it deliberately avoids commercial EDA tools to remain open and accessible.
  • Single-Shot Generation: Models were evaluated with low/off reasoning settings and single-prompt sampling (pass@1 and pass@10), rather than multi-turn agentic loops. However, the authors explicitly designed CPU-Eval’s detailed instruction-trace diffs to serve as rich diagnostic feedback for future research into self-repairing hardware agents and reinforcement learning.

Summary updated

BibTeX
@misc{iwata2026cpu,
  author = {Yuisei Iwata and Yutaka Masuda and Tohru Ishihara},
  title = {{CPU-Eval: Evaluating Large Language Models for CPU Hardware Code Generation}},
  year = {2026},
  eprint = {2611.32405},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32405},
}
Figure