# Tutorial: using a HLS stream IP with DMA (Part 2: Vivado design)

**URL:** <https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-part-2-vivado-design/3345>\
**Category:** Learn\
**Created:** [November 25, 2021, 4:27pm UTC](https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-part-2-vivado-design/3345 "2021-11-25T16:27:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [November 25, 2021, 4:27pm UTC](https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-part-2-vivado-design/3345/1 "2021-11-25T16:27:23Z")

</div>

This is the second part of a tutorial that will show how to create a HLS IP and use it with an AXI DMA controlled by PYNQ. [Part 1](https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-tutorial-part-1-hls-design/3344) of this tutorial showed how to build the HLS IP. This part 2 shows how to build the hardware and use the IP with PYNQ. [Part 3](https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-part-3-using-the-hls-ip-from-pynq/3346) shows how to use the design with PYNQ.

This tutorial is based on the **v2.7** PYNQ image and will use Vivado **2020.2** (required for PYNQ v2.7).

Vitis HLS **2020.2** will be used to build the HLS IP.

If you are using a different PYNQ version you should be able to follow the same steps in this tutorial, but you should make sure you are using the supported version of Vivado for that PYNQ release.

The **PYNQ-Z2** board was used to test this design.

## Sources

You can find sources for this tutorial in the following [GitHub repository](https://github.com/cathalmccabe/PYNQ_tutorials/tree/master/dma_hls_axis). This includes the exported IP from part 1 of the tutorial, and the Tcl file used to rebuild the Vivado project below, along with the output BIT and HWH files from this part of the tutorial.

## Exported IP

In the first part of the tutorial the IP was exported from HLS to generate a Packaged IP (to IP-XACT format).

You can find the exported IP in a zip file in your project HLS directory inside the HLS project directory in _solution/impl/ip_\*:

You can provide the path of this directory to Vivado, or you can extract the contents of the ZIP file and move them to another location and provide the new path.

On my computer I will move the IP to `G:/xilinx/pynq/tutorial/hls_stream/`.

## Vivado project

The DMA design will be similar to the design used in the previous lab. I will not go through the hardware design in detail. A `dma_axis_ip_example.tcl` file is included in the sources for this project which can be used to rebuild the base part of the Vivado project - it will create a Vivado project, add an IPI block diagram with the Zynq PS7 and associated blocks and an AXI DMA. It will make connections between these blocks, but it will leave the AXI Stream interfaces on the DMA unconnected. The HLS IP will be added and connected to these ports.

### Create the base design

- Open Vivado, change to an appropriate directory and `run source dma_axis_ip_example.tcl` to rebuild the base design that includes the AXI DMA.

 ![base_design](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/b/b5873c37ff80d4347497efe52b1cb8d14740c27b.png)

### Add the HLS IP

- In Vivado in the _Flow Manager_, click on _settings_, expand _IP_, and in the _Repository_ settings, add the path to the HLS IP

 ![ip_repo](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/5/5782a6a407a9f4d1fef50d3d5ce90eea69d8dee9.png)

Vivado will search and identify any packaged IP in subdirectories under the directory you select. Notice in the screenshot I selected the top-level project directory. Vivado will search this repository recursively for any IP and add it to the catalog. I could have selected a lower level subdirectory where the IP exists, or closer to where it exists.

- Add the IP to the IPI block design

 ![add_hls_ip](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/5/555e3d221b720db9b8206f0d31bb682fab767682.png)

 ![hls_ip_added](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/c/c2837fbf2bac6168e43e61684940d940e34ec2b6.png)

- Run block automation to automatically connect the HLS IP’s _AXI control interface_ (s\_axi\_control), the _clock_ (ap\_clk) and the _reset_ (ap\_rst\_n)

- You can then connect the AXI stream interfaces of the HLS IP to the DMA

 ![axis_interfaces](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/6/61fe25e739b5f7476d2559bb37cf5195853541a7.png)

The design is now complete. You can now generate the HDL wrapper, and build the bitstream. There are no external inputs/outputs so we don’t need to add any pin constraints.

Once the bitstream is complete, you can find the HWH and the BIT file and and copy them to your board running PYNQ, as was done in the previous tutorial.

# Summary

In this part of the tutorial you saw how to add the generated HLS IP to a Vivado design and connect it to the DMA. In the [final part](https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-part-3-using-the-hls-ip-from-pynq/3346) of this tutorial you will see how to use the design from PYNQ.

---

<div class="post-metadata">

**Author:** ![fkj1196](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@fkj1196](https://discuss.pynq.io/u/fkj1196)\
**Post date:** [January 9, 2023, 7:08pm UTC](https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-part-2-vivado-design/3345/2 "2023-01-09T19:08:40Z")

</div>

Thank you for your great tutorial!

I downloaded tcl file, opened vivado, and went to tcl console and typed “source dma\_axis\_ip\_example.tcl”

However, there was error message like below

* * *

ERROR: [BD::TCL 103-2012] The following IPs are not found in the IP Catalog:  
xup:hls:example:1.0

Resolution: Please add the repository containing the IP(s) to the project.

* * *

So, I added respository for the example (the hls IP), but there was still same message

In your tutorial, your block diagram seems to be made automatically without the hls IP when typing the command

Is there something that I should do?

---

<div class="post-metadata">

**Author:** ![Jean\_Cauvin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/jean_cauvin/32/4968_2.png) [@Jean\_Cauvin](https://discuss.pynq.io/u/Jean_Cauvin)\
**Post date:** [July 21, 2023, 4:05am UTC](https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-part-2-vivado-design/3345/3 "2023-07-21T04:05:50Z")

</div>

You can unzip the ip xup\_hls\_example\_1\_0 in the github repo, add the IP firstly then run the tcl.

---

<div class="post-metadata">

**Author:** ![seung\_kim](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/seung_kim/32/5117_2.png) [@seung\_kim](https://discuss.pynq.io/u/seung_kim)\
**Post date:** [September 26, 2023, 9:50pm UTC](https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-part-2-vivado-design/3345/4 "2023-09-26T21:50:53Z")

</div>

I have a newbie question:

I sourced tcl script as instructed; " source dma\_axis\_ip\_example\_2022.1.tcl" in the directory where I clone the folder ~/PYNQ\_tutorials/dma\_hls\_axis

Then I got the error:  
namespace: command not found

Command ‘proc’ not found, did you mean:

command ‘proj’ from deb proj-bin (6.3.1-1)  
command ‘pro’ from deb ubuntu-advantage-tools (29.4~20.04)  
command ‘nproc’ from deb coreutils (8.30-3ubuntu2)

How to fix this error?  
" source dma\_axis\_ip\_example.tcl" gives the same error.

I am using Vivado 2022.2 on Ubuntu 20.04.6 LTS

Thanks.

---

<div class="post-metadata">

**Author:** ![seung\_kim](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/seung_kim/32/5117_2.png) [@seung\_kim](https://discuss.pynq.io/u/seung_kim)\
**Post date:** [September 27, 2023, 4:15pm UTC](https://discuss.pynq.io/t/tutorial-using-a-hls-stream-ip-with-dma-part-2-vivado-design/3345/5 "2023-09-27T16:15:17Z")

</div>

I figured it out myself .

After installing vitis 2021.1,

Use:  
Vivado-\>tools-\>run Tcl Script, then select “dma\_axis\_ip\_example\_2022.1.tcl”
