MAGE: A Multi-Agent Engine for Automated RTL Code Generation

Yujie Zhao, Hejia Zhang, Hanxian Huang, Zhongming Yu, Jishen Zhao
12/10/2024
cs.ARcs.LG

No official code found. Best implementation: stable-lab/MAGE (135 stars, MIT, last commit 2025-04-11). 1 more below.

Abstract

The automatic generation of RTL code (e.g., Verilog) through natural language instructions has emerged as a promising direction with the advancement of large language models (LLMs). However, producing RTL code that is both syntactically and functionally correct remains a significant challenge. Existing single-LLM-agent approaches face substantial limitations because they must navigate between various programming languages and handle intricate generation, verification, and modification tasks. To address these challenges, this paper introduces MAGE, the first open-source multi-agent AI system designed for robust and accurate Verilog RTL code generation. We propose a novel high-temperature RTL candidate sampling and debugging system that effectively explores the space of code candidates and significantly improves the quality of the candidates. Furthermore, we design a novel Verilog-state checkpoint checking mechanism that enables early detection of functional errors and delivers precise feedback for targeted fixes, significantly enhancing the functional correctness of the generated RTL code. MAGE achieves a 95.7% rate of syntactic and functional correctness code generation on VerilogEval-Human 2 benchmark, surpassing the state-of-the-art Claude-3.5-sonnet by 23.3 %, demonstrating a robust and reliable approach for AI-driven RTL design workflows.

View on arXivView PDF

Code Implementations(2)

stable-lab/MAGECommunity100%
MIT

MAGE: A Multi-Agent Engine for Automated RTL Code Generation

13536C++, PythonNov 22, 20241 years agoMIT
MIT

MAGE: A Multi-Agent Engine for Automated RTL Code Generation

10PythonMay 14, 20251 years agoMIT

Similar Papers

Cite this paper

@article{zhao2024mage,
  title  = {MAGE: A Multi-Agent Engine for Automated RTL Code Generation},
  author = {Yujie Zhao and Hejia Zhang and Hanxian Huang and Zhongming Yu and Jishen Zhao},
  year   = {2024},
  eprint = {2412.07822},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.07822v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2412.07822.svg)](https://codeofpaper.com/paper/2412.07822)

Discussion