This project demonstrates a novel approach to FPGA design by leveraging Large Language Models (LLMs) to streamline the development process from algorithmic conception to hardware implementation, applied to a pulse detector similar to the example in the HDL Coder Self-Guided Tutorial by MathWorks. The design concepts and implementation details are visually illustrated in the PNG images within this repository.
- MATLAB to HLS C++ Conversion: Automated translation of MATLAB DSP algorithms to HLS C++ using LLMs
- FIR IP Core Integration: Efficient techniques for incorporating optimized FIR IP cores within HLS designs
- Design Space Exploration (DSE): LLM-guided exploration of design alternatives and optimizations
- Automated Visualization: Python scripts for analyzing and visualizing resource usage and timing metrics
- Resource Efficiency: Comparable resource utilization to optimized MATLAB HDL Coder implementations
All project files are organized as follows:
pulseDetector/
├── MATLAB/ # MATLAB reference designs
├── HLS/ # LLM-generated HLS C++ implementations
| ├── origin/ # Origin version generated from MATLAB code
| ├── resource_opt1/ # Merge to a single function
| ├── resource_opt2/ # Use constant filter coefficient
| ├── resource_opt3/ # Replace a complex data filter with three real data filters
│ └── resource_opt4/ # Optimized implementation with FIR IP core
└── Doc/ # Implementation results and comparisons
├── *.png # Visual diagrams of design concepts and workflows
└── reportPrompt.md # Prompt for generating Python code to visualize data
- Vivado HLS (2022.2 or later recommended)
- MATLAB R2023a or later (for reference implementations)
- Python 3.8+ with matplotlib, pandas, and numpy
-
Clone the repository:
git clone https://github.com/rockyco/pulseDetector.git cd pulseDetector
-
Set up Python environment:
python -m pip install -r requirements.txt
-
Configure Vitis HLS paths:
source /path/to/Vitis_HLS/2022.2/settings64.sh
Our LLM-aided approach achieves resource efficiency comparable to the MathWorks HDL Coder implementation:
Metric | LLM-Aided HLS Design | HDL Coder Design |
---|---|---|
DSP Utilization | 194 | 194 |
LUT Utilization | 745 | 407 |
FF Utilization | 7405 | 4528 |
Maximum Frequency | 304 MHz | 265 MHz |
Please refer to these images for a visual understanding of the project's methodology and outcomes:
-
Design transformation workflow from MATLAB to HLS C++
-
Resource utilization comparisons across implementation approaches
- Productivity Gains: LLM assistance significantly reduces development time compared to traditional approaches
- Optimization Knowledge: LLMs can suggest HLS pragmas and optimizations based on design patterns
- IP Core Integration: The hybrid approach of combining HLS with optimized IP cores provides the best balance of development speed and hardware efficiency
- Design Exploration: LLMs facilitate rapid exploration of design alternatives that might otherwise be overlooked
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- MathWorks for the HDL Coder Self-Guided Tutorial
- The Xilinx Vitis HLS team for their comprehensive documentation
- The open-source community for contributions to FPGA design methodologies