{"slug": "cpu-eval-evaluating-large-language-models-for-cpu-hardware-code-generation", "title": "CPU-Eval: Evaluating Large Language Models for CPU Hardware Code Generation", "summary": "A new benchmark called CPU-Eval, described in a paper accepted as a regular paper at the 2027 Design, Automation and Test in Europe Conference (DATE 2027), evaluates large language models on 339 HDL-generation problems covering six practical RISC-V CPUs. Each problem asks an LLM to generate one submodule in SystemVerilog, Chisel or SpinalHDL; CPU-Eval then integrates the generated code into its CPU, runs the CPU developers' regression test programs, and compares the execution trace against a reference ISA model to pinpoint the instruction and architectural-state update where execution diverges. The six CPUs and their problem counts are BOOM (91), CVA6 (93), Rift2Core (48), VeeR EL2 (71), VexRiscv (16) and Ibex (20).", "body_md": "CPU-Eval is a benchmark of 339 HDL-generation problems for evaluating large\nlanguage models on CPU hardware design. Each problem asks an LLM to generate\none submodule of one of six practical RISC-V CPUs, ranging from small\nembedded cores to Linux-capable out-of-order cores, in SystemVerilog, Chisel\nor SpinalHDL.\nCPU-Eval is described in our paper \"[CPU-Eval: Evaluating Large Language\nModels for CPU Hardware Code Generation](https://arxiv.org/abs/2611.32405),\"\naccepted as a regular paper at the 2027 Design, Automation and Test in Europe\nConference (DATE 2027).\n\nCPU-Eval integrates the generated submodule into its CPU, executes test programs that the CPU developers run in their regression testing, and compares the CPU's execution trace with a reference ISA model. When execution diverges, comparison logs identify the instruction and architectural-state update at the divergence. CPU-Eval extends these tests to detect errors that the original tests miss.\n\n| CPU | Description | HDL | Problems | \n|---|---|---|---|\n| [BOOM](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/cpus/boom/PROBLEMS.tsv) | 64-bit out-of-order, Linux-capable | Chisel | 91 | \n| [CVA6](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/cpus/cva6/PROBLEMS.tsv) | 32/64-bit in-order, Linux-capable | SystemVerilog | 93 | \n| [Rift2Core](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/cpus/rift2core/PROBLEMS.tsv) | 64-bit out-of-order, M/S/U modes | Chisel | 48 | \n| [VeeR EL2](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/cpus/veer_el2/PROBLEMS.tsv) | 32-bit in-order, 4-stage pipeline | SystemVerilog | 71 | \n| [VexRiscv](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/cpus/vexriscv/PROBLEMS.tsv) | 32-bit in-order, FPGA-oriented | SpinalHDL | 16 | \n| [Ibex](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/cpus/ibex/PROBLEMS.tsv) | 32-bit in-order, embedded | SystemVerilog | 20 | \n\nRun the commands from the repository root on x86_64 Linux with network access.\nThe host needs Git, Bash, Python 3.12.3 with venv and pip, SingularityCE or\nApptainer with `build --fakeroot` support, riscv64-unknown-elf GCC 13.2.0 and\nbinutils 2.42.\n\nPrepare an environment for each CPU once. The command builds the container\nimage and test programs in the new directory given by `--output` and keeps\ntemporary build files in `--work-root`:\n\n```\npython3 tools/prepare_environment.py \\\n  --cpu cva6 --output /path/to/environments/cva6 \\\n  --work-root /path/to/image-build-work\n```\n\nSet `--cpu` to `boom`, `cva6`, `ibex`, `rift2core`, `veer_el2` or `vexriscv`. Pass\n`--runtime apptainer` when preparing with Apptainer, or\n`--image /path/to/cva6-eval.sif` to reuse an image built from the same release.\n\nGive [cpus/cva6/alu/SPEC.md](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/cpus/cva6/alu/SPEC.md) to your LLM as the user\nprompt, with no system prompt. Save the response as a UTF-8 text file without\nany reasoning that the API returns in a separate field. The evaluator extracts\nthe code from the response.\n\nEvaluate the answer in the prepared environment:\n\n```\npython3 tools/evaluate_submission.py run \\\n  --problem cva6/alu \\\n  --candidate /path/to/alu-response.txt \\\n  --environment /path/to/environments/cva6 \\\n  --output /path/to/alu-result\n```\n\nEvaluation compiles and runs the LLM-generated code on your machine. Run it in an isolated environment, such as a dedicated virtual machine.\n\nThe command prints the result and, for a failing answer, excerpts from the compiler or comparison logs. It saves the evaluation records in the output directory. To print the result again later, run:\n\n```\npython3 tools/evaluate_submission.py show /path/to/alu-result\n```\n\nRepeat `--candidate FILE` with `run --problem CPU/PROBLEM` to evaluate several\nanswers to one problem. Each occurrence counts as one trial.\n\nThe [Ollama Cloud example](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/examples/ollama-cloud/README.md) generates ten\nanswers for every problem of one CPU. A batch job evaluates many answers for\nthe one CPU given by `--cpu`. Pass each answer as `--candidate PROBLEM=FILE`,\nwhere `PROBLEM` is a problem name in that CPU's `PROBLEMS.tsv` and `FILE` is\nthe saved response:\n\n```\npython3 tools/evaluate_submission.py prepare --cpu cva6 \\\n  --candidate alu=/path/to/alu-response.txt \\\n  --candidate serdiv=/path/to/serdiv-response.txt \\\n  --environment /path/to/environments/cva6 \\\n  --output /path/to/cva6-job\n```\n\nThe [Genkai example](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/examples/genkai/README.md) shows how to submit a prepared\nbatch job and run its problems in parallel. For local evaluation, use `run`\nonce per problem and give each invocation its own output directory.\n\nEach answer receives `PASS` or a `FAIL_*` verdict that names the error in the\nanswer, such as `FAIL_CANDIDATE_COMPILE` or `FAIL_TRACE_MISMATCH`. Only `PASS`\ncounts as correct; for pass@k, count every answer in the sample size.\n`INVALID_*` means that the evaluation stopped before reaching a verdict, for\nexample because memory ran out, and names the cause.\n\nThe repository includes all 339 problem statements. With Git and network access, reconstruct them from the recorded upstream sources and verify them against the included copies:\n\n```\npython3 tools/reconstruct_problem_statements.py --cache /path/to/source-cache\n```\n\n| Location | Contents | \n|---|---|\n| `cpus/` | Problem lists, statements, source and test recipes, and CPU grading tests. | \n| `tools/` | Commands that users run. Their subdirectories hold the programs and container image definitions that these commands and the evaluation jobs use. | \n| `examples/` | Ollama Cloud generation and Genkai job examples. | \n| `LICENSES/` | License texts and upstream notices of the third-party material. | \n\nIf you use CPU-Eval, please cite our paper:\n\n```\n@inproceedings{iwata2027cpueval,\n  title     = {{CPU-Eval}: Evaluating Large Language Models for {CPU} Hardware Code Generation},\n  author    = {Iwata, Yuisei and Masuda, Yutaka and Ishihara, Tohru},\n  booktitle = {2027 Design, Automation \\& Test in Europe Conference (DATE)},\n  year      = {2027},\n  note      = {in press}\n}\n```\n\nThe page numbers and DOI will be added when the DATE 2027 proceedings are published.\n\nThe preprint is available on arXiv:\n\n```\n@misc{iwata2026cpueval,\n  title         = {{CPU-Eval}: Evaluating Large Language Models for {CPU} Hardware Code Generation},\n  author        = {Iwata, Yuisei and Masuda, Yutaka and Ishihara, Tohru},\n  year          = {2026},\n  eprint        = {2611.32405},\n  archivePrefix = {arXiv},\n  primaryClass  = {cs.AR}\n}\n```\n\nCopyright (c) 2026 Ishihara-Masuda-Lab. CPU-Eval's original code and\ndocumentation are licensed under [Apache License 2.0](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/LICENSE).\nThird-party source excerpts, tests and derived material retain their original\nterms. [Third-party notices](https://github.com/next-edge-ai-ishihara/cpu-eval/blob/main/THIRD_PARTY_NOTICES.md) identify the applicable\nattribution and licenses.\n\nThis work is partly supported by JST Research and Development Program for Next-generation Edge AI Semiconductors, Grant Number JPMJES2511.", "url": "https://wpnews.pro/news/cpu-eval-evaluating-large-language-models-for-cpu-hardware-code-generation", "canonical_source": "https://github.com/next-edge-ai-ishihara/cpu-eval", "published_at": "2026-11-30 07:17:38+00:00", "updated_at": "2026-11-30 07:45:11.356607+00:00", "lang": "en", "topics": ["large-language-models", "ai-research", "ai-chips", "developer-tools"], "entities": ["CPU-Eval", "DATE 2027", "BOOM", "CVA6", "Rift2Core", "VeeR EL2", "VexRiscv", "Ibex"], "also_reported_by": [], "takeaway": "CPU-Eval scores LLM-generated CPU submodules by integrating them into six real RISC-V cores and diffing execution traces against a reference ISA model, across 339 problems split BOOM 91, CVA6 93, VeeR EL2 71, Rift2Core 48, Ibex 20 and VexRiscv 16.", "recommendation": {"advice": "Evaluate LLM-generated HDL by compiling and running it inside the real CPU against the developers' regression tests and an ISA reference trace, rather than judging code text alone.", "playbook": "evals-testing", "playbook_url": "https://wpnews.pro/playbooks/evals-testing"}, "alternates": {"html": "https://wpnews.pro/news/cpu-eval-evaluating-large-language-models-for-cpu-hardware-code-generation", "markdown": "https://wpnews.pro/news/cpu-eval-evaluating-large-language-models-for-cpu-hardware-code-generation.md", "text": "https://wpnews.pro/news/cpu-eval-evaluating-large-language-models-for-cpu-hardware-code-generation.txt", "jsonld": "https://wpnews.pro/news/cpu-eval-evaluating-large-language-models-for-cpu-hardware-code-generation.jsonld"}}