AutoFSM: A Multi-agent Framework for FSM Code Generation with IR and SystemC-Based Testing

Qiuming Luo, Yanming Lei, Kunzhong Wu, Yixuan Cao, Chengjian Liu
12/12/2025
cs.SEcs.MA

No confident code implementation found for this paper.

Abstract

With the rapid advancement of large language models (LLMs) in code generation, their applications in hardware design are receiving growing attention. However, existing LLMs face several challenges when generating Verilog code for finite state machine (FSM) control logic, including frequent syntax errors, low debugging efficiency, and heavy reliance on test benchmarks.

Show full abstract

To address these challenges, this paper proposes AutoFSM, a multi-agent collaborative framework designed for FSM code generation tasks. AutoFSM introduces a structurally clear intermediate representation (IR) to reduce syntax error rate during code generation and provides a supporting toolchain to enable automatic translation from IR to Verilog. Furthermore, AutoFSM is the first to integrate SystemC-based modeling with automatic testbench generation, thereby improving debugging efficiency and feedback quality. To systematically evaluate the framework's performance, we construct SKT-FSM, the first hierarchical FSM benchmark in the field, comprising 67 FSM samples across different complexity levels. Experimental results show that, under the same base LLM, AutoFSM consistently outperforms the open-source framework MAGE on the SKT-FSM benchmark, achieving up to an 11.94% improvement in pass rate and up to a 17.62% reduction in syntax error rate. These results demonstrate the potential of combining LLMs with structured IR and automated testing to improve the reliability and scalability of register-transfer level (RTL) code generation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{luo2025autofsm,
  title  = {AutoFSM: A Multi-agent Framework for FSM Code Generation with IR and SystemC-Based Testing},
  author = {Qiuming Luo and Yanming Lei and Kunzhong Wu and Yixuan Cao and Chengjian Liu},
  year   = {2025},
  eprint = {2512.11398},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.11398v1}
}

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/2512.11398.svg)](https://codeofpaper.com/paper/2512.11398)

Discussion