Creating the Vitis IP
In the previous unit on loop optimization, we built and optimized a simple vector multiplier IP core. Before starting, we need to select a set of parameters and package the IP and run the Implementation. You can build the IP manually with the Vitis GUI or via an included script.
Building the Vitis IP with a script
- Navigate to
hwdesign/vector_mult/vmult_vitis. - The script is located in
scripts/build_ip.tcl. If you want you can change the unroll factor for the IP you want to build by modifying the line:# Set the desired unroll factor set uf 4 set sol_name "sol_uf$uf"By default, it is set to
4. - Run the script:
vitis-run --mode hls --tcl scripts/build_ip.tcl - Running the script will take about 1 to 2 minutes.
- The IP should be located in a directory such as
/hwdesign/vector_mult/vmult_vitis/sol_uf4/depending on what unroll factor you used.
Building the IP with the Vitis GUI
- Follow the instructions loop optimization to build the Vitis IP project
- In
include/vmult.hset the parameters:#define PIPELINE_EN 1 // Enables pipelining #define UNROLL_FACTOR 4 // Unrolls loops when > 1 #define MAX_SIZE 1024 // Array size to test #define DATA_FLOAT 1 // Data type: 1= float, 0=intThis will use loop unrolling. But, you can use any parameters you like.
- In the
FLOWpanel, run theC simulationto make sure it works- You should see
Test passed!
- You should see
- Run the C synthesis:
- Still in the
FLOWpanel, selectC synthesis->Settings(the gear box icon). Set the clock to be300 MHz. - Run the
C synthesis
- Still in the
- Next in the
FLOWpanel, run thePackagestep.- Note that you do not need to run
Implementationsince we are not creating a standalone bitstream for the IP – just a IP that can be imported into Vivado.
- Note that you do not need to run
- The IP should be located in
/hwdesign/vector_mult/vmult_vitis/vmult_hls/