> For the complete documentation index, see [llms.txt](https://andre-araujo.gitbook.io/yolo-on-pynq-z2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andre-araujo.gitbook.io/yolo-on-pynq-z2/dpu-implementation/creating-the-dpu-3.0.md).

# Creating the DPU 3.0

This part of the project is totally stolen from [Jin-Chen's tutorial](http://www.aiotlab.org/teaching/fpga/DPU%20on%20PYNQ-Z2_Vivado.pdf) on [Aiotlab](http://www.aiotlab.org/teaching/fpga.html). You can also find a [video tutorial](https://www.youtube.com/watch?v=LBbkHADcc1o) in Chinese on how to implement the DPU 3.0 Hardware on the same website.

If you want to skip this part you can find all the Vivado files on the github repository under the DPU implementation folder.&#x20;

***

&#x20;:rotating\_light::construction: Work in progress :construction::rotating\_light:

## Installing Vivado

***

The DPU will be created on the Xilinx suite called Vivado. This is where all the Harware projects are configured to later run on the FPGA. On this case we want to create the DPU with the right architecture to then pass that Hardware to the Zynq7020 which is the PYNQ-Z2 FPGA chip.

For this project we will work with a specific version of **Vivado: 2020.1.**&#x20;

This is so all the files are compatible. The version of DNNDK is quite old and so we have to use all the other tools from around the same year.

The first thing to do is access Xilinx Donwloads page for Vivado on the next link and then go to **Vivado archive** to see older versions.

{% embed url="<https://www.xilinx.com/support/download.html>" %}
Xilinx Vivado Downloads
{% endembed %}

Here you select the version as **2020.1** and then find the link for the installer as: **Vivado HLx 2020.1: All OS installer Single-File Download.**&#x20;

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2FAC7xx2E4WPswfbQPGxJs%2Fimage.png?alt=media&amp;token=e2ccbf7d-2109-4287-9e77-1911134abf2b" alt="" width="551"><figcaption><p>Vivado 2020.1 installer</p></figcaption></figure>

As you can see you need almost 36GB of free space and the download will be long. After that is done, you need to **uncompress the file** and **click on `xsetup.exe`**. The next installation wizzard menu should appear:

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2FQv797jjYsBc3tDUXKQxw%2Fimage.png?alt=media&amp;token=b2deb6b8-b890-46d8-bf4e-9903c380f12d" alt=""><figcaption><p>Welcome Screen</p></figcaption></figure>

You should proceed and agree to the license:

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2FE2MhFBA9fUmhX7tN8WDz%2Fimage.png?alt=media&amp;token=c8cf0cb9-33b4-4a74-8ea4-89ca737a8c35" alt=""><figcaption><p>License Agreement</p></figcaption></figure>

Then you need to select the product as Vivado only:

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2FkzZfznrHhuo7jw32zvyS%2Fimage.png?alt=media&amp;token=a5222fe5-03b5-47b5-9f27-374799b3f917" alt=""><figcaption><p>Product Selection</p></figcaption></figure>

Next will be selected the HL WebPACK product edition as we don't need anything else for this project:

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2F80YDYzizu6lYKopc6WjQ%2Fimage.png?alt=media&amp;token=c25b137b-b49d-461e-b9f9-835c9838e337" alt=""><figcaption><p>Edition Selection</p></figcaption></figure>

To save space on the Disk, I recommend you install the options as on the image below. This will approach the Zynq-7000 family so the PYNQ-Z2 is included.

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2FOFAsYMzbtRmFrJECO2c1%2Fimage.png?alt=media&amp;token=ff549159-fd4c-4568-a7b0-d50170ca137f" alt=""><figcaption><p>Install Options</p></figcaption></figure>

You can then select the desired directory for the installation. I left the default one.

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2FJNapPlZ3ZcjHjAZHRPmv%2Fimage.png?alt=media&amp;token=db4b0255-375a-468c-8cee-c73db3cf0a9a" alt=""><figcaption><p>Destination Directory</p></figcaption></figure>

The installation summary will be presented to the user on the next step:

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2FkpgxBOxZFZpj64cjBe1y%2Fimage.png?alt=media&amp;token=10f5935d-0af7-48eb-9829-256025c89708" alt=""><figcaption><p>Installation Summary</p></figcaption></figure>

Finaly, you press the **install** button to start the process. It should take quite some time to install depending on the computer capabilities. It's quite a demanding program so don't be surprised if it takes more than 1 hour like it did for me.

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2FF94JYRdPJv4G7lX1pUZH%2Fimage.png?alt=media&amp;token=e0095b79-a1c3-4854-a5bc-805c217f5ba9" alt=""><figcaption><p>Installation Progress</p></figcaption></figure>

{% hint style="info" %}
Beaware! During the installation you will be asked to install a driver. You should install it!

![](https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2FJXZUuoTyBXzTnppoACyQ%2Fimage.png?alt=media\&token=c6fcaced-5a6b-475a-9239-0af543a957da)
{% endhint %}

At the end of the installation you will be presented with a small window. You may also need to allow internet access to a Java Virtual Machine installed by Vivado:

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2F4qN4HEmyEPULNUXRvZKX%2Fimage.png?alt=media&amp;token=8f912492-ce95-4f2a-a012-2341d32d93d4" alt=""><figcaption><p>Allow internet access</p></figcaption></figure>

Now we need to give Vivado the PYNQ-Z2 files so it is aware of the board and it's parameters. To do this, you should download this file first:

{% embed url="<https://d2m32eurp10079.cloudfront.net/Download/pynq-z2.zip>" %}
PYNQ-Z2 board files
{% endembed %}

After the download, you have to **uncompress** it and place the **`pynq-z2`** folder on the path **C:\Xilinx\Vivado\2020.1\data\boards\board\_files**.

After all of this is complete, you can open the Vivado short-cut on the Desktop and you will be presente with this menu.

<figure><img src="https://2477548334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjW7iX6UPM2ifyvOJm6AX%2Fuploads%2Fo9kvbVwFzhHaYbga8kq4%2Fimage.png?alt=media&amp;token=6adf5e5a-9611-42e5-91a8-d740f9d342e8" alt=""><figcaption><p>Xilinx Vivado</p></figcaption></figure>

## DPU Vivado Project

***

For now, refer to **page 14 of the** [**Aiotlab tutorial**](http://www.aiotlab.org/teaching/fpga/DPU%20on%20PYNQ-Z2_Vivado.pdf) of the DPU to implement the Vivado project. I will be making the rest of the tutorial here but I'll need to free some disk space, install vivado and make my own screenshots and explanation. Thank you for understanding and Good luck!
