This project explores the use of Large Language Models (LLMs) for automatically generating Verilog testbenches for digital hardware design modules. The goal is to reduce manual effort and speed up the verification process by leveraging AI.
The aim of this project is to use LLMs to generate testbenches for Verilog design modules. In this instance, the selected design is the Stall Unit of a 3-stage pipelined MIPS processor. The testbenches are intended to verify specific behaviors of the Stall Unit.
OriGen: A LoRA fine-tuned adapter on top of DeepSeek Coder 7B. It was the only model that successfully generated complete and clean Verilog testbenches. It demonstrated consistent syntax and structure, though it lacked feature-specific variation in the generated outputs.
Several other open-source LLMs were tested before settling on OriGen:
These models showed limitations either in size, syntax accuracy, or generation completeness. OriGen proved to be the most accessible and performant option under realistic hardware constraints.
Testbenches were generated for these verification features:
This script performs the following:
pip install torch transformers peft acceleratepython stallunit_llm_tb.pyYou must have enough GPU memory (at least 16GB) to run DeepSeek Coder 7B.
!pip install torch transformers peft acceleratePratheek Motamarri
M.S. in Electrical Engineering
Arizona State University
If you have any questions, feel free to reach out to me at pratheek.motamarri@gmail.com
This project is for educational and academic research purposes only.
2 commits
Verilog
61.0%
Python
39.0%
This project explores the use of Large Language Models (LLMs) for automatically generating Verilog testbenches for digital hardware design modules. The goal is to reduce manual effort and speed up the verification process by leveraging AI.
The aim of this project is to use LLMs to generate testbenches for Verilog design modules. In this instance, the selected design is the Stall Unit of a 3-stage pipelined MIPS processor. The testbenches are intended to verify specific behaviors of the Stall Unit.
OriGen: A LoRA fine-tuned adapter on top of DeepSeek Coder 7B. It was the only model that successfully generated complete and clean Verilog testbenches. It demonstrated consistent syntax and structure, though it lacked feature-specific variation in the generated outputs.
Several other open-source LLMs were tested before settling on OriGen:
These models showed limitations either in size, syntax accuracy, or generation completeness. OriGen proved to be the most accessible and performant option under realistic hardware constraints.
Testbenches were generated for these verification features:
This script performs the following:
pip install torch transformers peft acceleratepython stallunit_llm_tb.pyYou must have enough GPU memory (at least 16GB) to run DeepSeek Coder 7B.
!pip install torch transformers peft acceleratePratheek Motamarri
M.S. in Electrical Engineering
Arizona State University
If you have any questions, feel free to reach out to me at pratheek.motamarri@gmail.com
This project is for educational and academic research purposes only.
2 commits
Verilog
61.0%
Python
39.0%