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

TL;DR
AutoFSM is a multi-agent framework that enhances FSM code generation from large language models by using a structured IR, SystemC-based testing, and an innovative benchmark, significantly improving accuracy and debugging efficiency.
Contribution
This paper introduces AutoFSM, the first framework integrating IR and SystemC-based testing for FSM code generation, addressing syntax errors and debugging challenges in LLM-based hardware design.
Findings
Up to 11.94% improvement in pass rate over baseline
Up to 17.62% reduction in syntax error rate
First hierarchical FSM benchmark in the field
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. 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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsVLSI and Analog Circuit Testing · Embedded Systems Design Techniques · Software Testing and Debugging Techniques
