The Versal™ AI Engines (AIE) are well suited for vector math operations. One specific application that is worthy of consideration is low-order FIR filters. For low-order symmetric and asymmetric FIR structures, a single AIE can implement multiple filters, each running at the AIE clock rate which can be 1 GHz or more.
This lab provides the entire process of designing a low-pass filter using Python in a Jupyter Notebook environment and deploying it to an AIE, showcasing the filtered results. This lab provides guidelines for coding such a filter in the Vitis™ AI Engine tools: for the experienced programmer it provides a structured approach to code low-order FIR filters. For learners it also provides a background of key concepts such as AIE vectors, AIE APIs, and data flow. The following table shows the specific design steps in each part.
Part | Topic | Description | Environment |
---|---|---|---|
1 | Software Implementation | Generate the Complex Signal Data with High-frequency Noise | Jupyter Notebook |
Designing a Lowpass FIR Filter and Quantization for Hardware Implementation | |||
Plot the Magnitude Response of the Filter | |||
Apply the Filter to Signal Using lfilter and Plot the Original and Software Filtered Signals | |||
2 | Single Kernel Programming | Determine the Design Specifications | AMD Vitis 2022.2 |
Find the Maximum Performance for the Given Data Type | |||
Select the Number of Lanes | |||
Choosing the Proper AIE API for this FIR Application | |||
Set the Sliding Vector Buffers and Parameterize the Sliding Multiplication API | |||
Set the Vector Read and Write API While Tracking the Current Position of Pointer | |||
Putting it All Together -- Kernel Code Analysis | |||
3 | Graph Programming and Performance Analysis | Create the kernel Graph and the test bench | Jupyter Notebook |
Create the AIE C Test Bench | |||
Build the AIE Kernel and Run the AIE Emulation and Compare the AIE and SW Filter Results | |||
Analyze performance and accuracy |
The following design flowchart illustrates the logical relationships between key parameters in the eight design steps outlined in Part 2. For more details please refer to Part 2.
Run the Software implementation in Jupyter lab on Windows or Linux system
Open the Jupyter Notebook: fir_lowpass1
cd $HOME/xup_aie_training/pbl/aie_single_kernel/fir_lowpass/notebook
py -m jupyter lab
Review the input and output reference data file in the following path
$HOME/xup_aie_training/pbl/aie_single_kernel/fir_lowpass/aie/data/
The project will use Makefile files to automate the building process in Vitis.
Build the AIE Component and Run the AIE Emulation
Navigate to the AIE folder and run make all to build the HLS kernel project
cd $HOME/xup_aie_training/pbl/aie_single_kernel/fir_lowpass/aie
make all
Run the AIE Emulation
make aieemu
Analyze the AIE Emulation and compilation results
make analyzer
Check the AIE Emulation result
make get_output
The output files can be found here: $HOME/xup_aie_training/pbl/aie_single_kernel/fir_lowpass/aie/data/output_aie.txt
Open the Jupyter Lab environment
cd $HOME/xup_aie_training/pbl/aie_single_kernel/fir_lowpass/notebook
py -m jupyter lab
Copy the AIE emulation output file back and compare the result by running the Python cells
Copyright© 2023 Advanced Micro Devices