Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:fpga:docs:build [04 May 2023 16:06] – Add important note and change title for Tools section Iulia Moldovanresources:fpga:docs:build [28 Mar 2024 10:48] (current) – Mention GitHubIO doc iulia Moldovan
Line 1: Line 1:
 +<note important>We are in the process of migrating our documentation to GitHubIO. This page is outdated. Please check out our latest Build guide at https://analogdevicesinc.github.io/hdl/user_guide/build_hdl.html</note>
 +
 ====== Building HDL ====== ====== Building HDL ======
  
Line 19: Line 21:
   - We are using [[https://git-scm.com/|git]] for version control and [[https://www.gnu.org/software/make/|GNU Make]] to build the projects. Depending on what OS you're using, you have these options:   - We are using [[https://git-scm.com/|git]] for version control and [[https://www.gnu.org/software/make/|GNU Make]] to build the projects. Depending on what OS you're using, you have these options:
  
-++++ For Windows environment |+++++ For Windows environment with Cygwin |
  
 Because GNU Make is not supported on Windows, you need to install [[https://www.cygwin.com/|Cygwin]], which is a UNIX-like environment and command-line interface for Microsoft Windows. You do not need to install any special package, other than **git** and **make**. Because GNU Make is not supported on Windows, you need to install [[https://www.cygwin.com/|Cygwin]], which is a UNIX-like environment and command-line interface for Microsoft Windows. You do not need to install any special package, other than **git** and **make**.
Line 36: Line 38:
 </code> </code>
 <fc #fa8072>Replace the **path_to** string with your path to the installation folder and the **tools version** with the proper one!</fc> <fc #fa8072>Replace the **path_to** string with your path to the installation folder and the **tools version** with the proper one!</fc>
 +
 +++++
 +
 +++++ For Windows environment with WSL |
 +You can also install [[https://learn.microsoft.com/en-us/windows/wsl/install/|WSL]] (Windows Subsystem for Linux) which is both a UNIX-like environment and a command-line interface for Microsoft Windows. In order to be able to access the GUI, WSL2 is recommended. This can be done if we open PowerShell or Windows Command Prompt in Administrator mode. In the link above you can find the installation guide for wsl on windows. 
 +<note>
 +When installing wsl, the Ubuntu distribution will be installed by default
 +</note>
 +If not, after installing wsl, write in the terminal:
 +<code>
 +>wsl --update
 +>wsl --install -d ubuntu
 +</code>
 +If you want to check the version for wsl, you can use the Windows Command Prompt command:
 +<code>
 +>wsl -l -v
 +  NAME      STATE           VERSION
 +* Ubuntu    Running         2
 +</code>
 +If you want to check the version for wsl and Ubuntu, you can use the following commands in Ubuntu:
 +<code>
 +:~$ uname -r
 +5.15.90.1-microsoft-standard-WSL2
 +
 +:~$ lsb_release -a
 +No LSB modules are available.
 +Distributor ID: Ubuntu
 +Description:    Ubuntu 22.04.2 LTS
 +Release:        22.04
 +Codename:       jammy
 +</code>
 +If you want to become root, you can use the following command:
 +<code>
 +:~$ sudo -i
 +[sudo] password for username:
 +root@HYB-0FPP35J6CsI:~# exit
 +logout
 +</code>
 +Here the paths will look like this if the tools will be installed in the Windows file system:
 +<code>
 +export PATH=$PATH:/mnt/path_to/Xilinx/Vivado/202x.x/bin
 +export PATH=$PATH:/mnt/path_to/Xilinx/Vivado_HLS/202x.x/bin
 +export PATH=$PATH:/mnt/path_to/Xilinx/Vitis/202x.x/bin
 +export PATH=$PATH:/mnt/path_to/Xilinx/Vitis/202x.x/gnu/microblaze/nt/bin
 +export PATH=$PATH:/mnt/path_to/Xilinx/Vitis/202x.x/gnu/arm/nt/bin
 +export PATH=$PATH:/mnt/path_to/Xilinx/Vitis/202x.x/gnu/microblaze/linux_toolchain/nt64_be/bin
 +export PATH=$PATH:/mnt/path_to/Xilinx/Vitis/202x.x/gnu/microblaze/linux_toolchain/nt64_le/bin
 +export PATH=$PATH:/mnt/path_to/Xilinx/Vitis/202x.x/gnu/aarch32/nt/gcc-arm-none-eabi/bin
 +export PATH=$PATH:/mnt/path_to/intelFPGA_pro/2x.x/quartus/bin
 +</code>
 +<fc #fa8072>Replace the **path_to** string with your path to the installation folder and the **tools version** with the proper one!</fc>
 +
 +<note important>Before building any project, it is necessary to install the Linux version for Vivado (see [[/resources/fpga/docs/build#How to install Vivado on wsl section|How to install Vivado on wsl section]] ) and Quartus because on the Ubuntu distribution on [[https://learn.microsoft.com/en-us/windows/wsl/install/|WSL]] you cannot run projects on the Windows version of them. When you have to choose the installation path, choose the location where wsl is installed (\\wsl.localhost\Ubuntu\opt). Also, to get the best performance, you must clone your hdl repository in the WSL file system. For example: (\\wsl.localhost\Ubuntu\home\username\hdl) </note>
 +For more information you can consult the following link: [[https://learn.microsoft.com/en-us/windows/wsl/filesystems#file-storage-and-performance-across-file-systems|WSLStorage]].
 +
 +Then the paths will look like this:
 +<code>
 +export PATH=$PATH:/opt/path_to/Xilinx/Vivado/202x.x/bin
 +export PATH=$PATH:/opt/path_to/Xilinx/Vivado_HLS/202x.x/bin
 +export PATH=$PATH:/opt/path_to/Xilinx/Vitis/202x.x/bin
 +export PATH=$PATH:/opt/path_to/Xilinx/Vitis/202x.x/gnu/microblaze/nt/bin
 +export PATH=$PATH:/opt/path_to/Xilinx/Vitis/202x.x/gnu/arm/nt/bin
 +export PATH=$PATH:/opt/path_to/Xilinx/Vitis/202x.x/gnu/microblaze/linux_toolchain/nt64_be/bin
 +export PATH=$PATH:/opt/path_to/Xilinx/Vitis/202x.x/gnu/microblaze/linux_toolchain/nt64_le/bin
 +export PATH=$PATH:/opt/path_to/Xilinx/Vitis/202x.x/gnu/aarch32/nt/gcc-arm-none-eabi/bin
 +export PATH=$PATH:/opt/path_to/intelFPGA_pro/2x.x/quartus/bin
 +</code>
 +<fc #fa8072>Replace the **path_to** string with your path to the installation folder and the **tools version** with the proper one!</fc>
 +
 ++++ ++++
  
Line 50: Line 121:
 </code> </code>
 <fc #fa8072>Replace the **path_to** string with your path to the installation folder and the **tools version** with the proper one!</fc> <fc #fa8072>Replace the **path_to** string with your path to the installation folder and the **tools version** with the proper one!</fc>
 +++++
 +
 +++++ How to install Vivado on WSL |
 +Installing the linux kit for Vivado can be done from Ubuntu:
 +  - Go to the path where the installation kit for Vivado is located.
 +  - Make it executable
 +<code>
 +:~$ chmod +x Xilinx_Vivado installation kit.bin
 +:~$ ./Xilinx_Vivado installation kit.bin
 +</code> 
 +  If you unzip the installation kit in Ubuntu, go to the Xilinx_Vivado installation kit and run .xsetup file. Make sure you have the following libraries installed:
 +<code>
 +:~$ sudo apt-get install locales && sudo localedef -i en_US -f UTF-8 en_US.UTF-8
 +:~$ sudo ./installLibs.sh
 +:~$ sudo apt-get install libxrender1 libxtst6 libxi6
 +</code>
 +
 +You must create a .bashrc file with the paths corresponding to the version of Vivado installed.
 ++++ ++++
  
Line 73: Line 162:
  
 <note> <note>
-Cloning the HDL repository is done now using SSH, because of GitHub security reasons. Check out this documentation on [[https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent|how to deal with SSH keys in GitHub]].+Cloning the HDL repository is done now using SSH, because of GitHub security reasons. Check out this documentation on [[https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent|how to deal with SSH keys in GitHub]]. Both for [[https://www.cygwin.com/|Cygwin]] and [[https://learn.microsoft.com/en-us/windows/wsl/install/|WSL]] it is necessary to create a unique SSH key. If you use WSL,to get the best performance, you must clone your hdl repository in the WSL file system. For example: (\\wsl.localhost\Ubuntu\home\username\hdl)
 </note> </note>
  
Line 156: Line 245:
 You may now use this 'sopcinfo' file as the input to your no-OS and/or Linux build. The 'sof' file is used to program the device. You may now use this 'sopcinfo' file as the input to your no-OS and/or Linux build. The 'sof' file is used to program the device.
  
 +++++ Building an Intel project in WSL - known issues |
 +For a10Soc and s10Soc projects it is very possible to face the following error when you make a build:
 +<note important>
 +Current module quartus_fit was unexpectedly terminated by signal 9. This may be because some system resource has been exhausted, or quartus_fit performed an illegal operation.
 +</note>
 +It can also happen that "**make**" get stuck when synthesizing some ips.
 +This errors may appear because your device does not have enough RAM memory to build your FPGA design. This problem can be solved if it is created a linux Swap file. You can find more information about what a swap file is in the next link:[[https://linuxize.com/post/create-a-linux-swap-file/|SwapFile]]. Depending on the size of the project, more or less virtual memory must be allocated. If you type in the search bar **System Information**, you can see Total Physical Memory and Total Virtual Memory of your system. For example for the AD9213 with s10Soc project, it was necessary to allocate 15 GB of virtual memory, to be able to make a build for the project.
 +To create a swap file you can use the following commands:
 +<code>
 +:~$ sudo fallocate -l "memory size (e.g 1G, 2G, 8G, etc.)" /swapfile
 +:~$ sudo chmod 600 /swapfile
 +:~$ sudo mkswap /swapfile
 +:~$ sudo swapon /swapfile
 +</code>
 +
 +If you want to make the change permanent:
 +<code>
 + in /etc/fstab file type the command:
 +/swapfile swap swap defaults 0 0
 +</code>
 +
 +If you want to deactivate the swap memory:
 +<code>
 +:~$ sudo swapoff -v /swapfile
 +</code>
 +
 +++++
  
 ==== Building a Xilinx project ==== ==== Building a Xilinx project ====
  
-A Xilinx project is built the same way as an 'Intel' project. The only exception is that there are a few 'sub-make(s)' for the library components. In this example, I am building the 'DAQ2' project on the 'ZC706' carrier.+A Xilinx project is built the same way as an 'Intel' project. The only exception is that there are a few 'sub-make(s)' for the library components. The way of building a project in Cygwin and WSL is the same, with small differences. In this example, it is building the 'DAQ2' project on the 'ZC706' carrier.
  
 <code> <code>
Line 257: Line 373:
  
 You may now use this 'hdf' file as the input to your no-OS and/or Linux build. Starting with Vivado 2019.3, output file extension got change from .hdf to .xsa. You may now use this 'hdf' file as the input to your no-OS and/or Linux build. Starting with Vivado 2019.3, output file extension got change from .hdf to .xsa.
 +
 +++++ Building a Xilinx project in WSL - known issues |
 +For some projects it is very possible to face the following error when you make a build:
 +<note important>
 +$RDI_PROG" "$@" crash" 
 +"Killed "$RDI_PROG" "$@"
 +</note>
 +This error may appear because your device does not have enough RAM memory to build your FPGA design. For example, the project AD-FMCDAQ3-EBZ with Virtex UltraScale+ VCU118 (XCVU9P device) requires 20 GB (typical memory) and a peak of 32 GB memory RAM. The next link shows the typical and peak Vivado memory usage per target device:[[https://www.xilinx.com/products/design-tools/vivado/vivado-ml.html#memory|MemoryUsage]].
 +This problem can be solved if it is created a linux Swap file. You can find more information about what a swap file is in the next link:[[https://linuxize.com/post/create-a-linux-swap-file/|SwapFile]]
 +To create a swap file you can use the following commands:
 +<code>
 +:~$ sudo fallocate -l "memory size (e.g 1G, 2G, 8G, etc.)" /swapfile
 +:~$ sudo chmod 600 /swapfile
 +:~$ sudo mkswap /swapfile
 +:~$ sudo swapon /swapfile
 +</code>
 +
 +If you want to make the change permanent:
 +<code>
 + in /etc/fstab file type the command:
 +/swapfile swap swap defaults 0 0
 +</code>
 +
 +If you want to deactivate the swap memory:
 +<code>
 +:~$ sudo swapoff -v /swapfile
 +</code>
 +
 +++++
  
 ====== Tools and Tool versions ====== ====== Tools and Tool versions ======
Line 304: Line 449:
 export PATH=$PATH:/cygdrive/d/Xilinx/Vivado/202x.x/bin:/cygdrive/d/Xilinx/Vitis/202x.x/bin export PATH=$PATH:/cygdrive/d/Xilinx/Vivado/202x.x/bin:/cygdrive/d/Xilinx/Vitis/202x.x/bin
 export PATH=$PATH:/cygdrive/d/intelFPGA_pro/2x.x/quartus/bin64 export PATH=$PATH:/cygdrive/d/intelFPGA_pro/2x.x/quartus/bin64
 +</code>
 +
 +A very good alternative to Cygwin is [[https://learn.microsoft.com/en-us/windows/wsl/install/|WSL]]. The manual changes to your '.bashrc' looks like:
 +
 +<code>
 +export PATH=$PATH:/opt/path_to/Vivado/202x.x/bin:/opt/Vitis/202x.x/bin
 +export PATH=$PATH:/opt/path_to/quartus/bin
 </code> </code>
  
Line 382: Line 534:
 More info on how to generate this files you will find in the [[resources:fpga:docs:build#References|References]] section or on ReadMe.txt file from boot partition. More info on how to generate this files you will find in the [[resources:fpga:docs:build#References|References]] section or on ReadMe.txt file from boot partition.
  
 +++++ How to build the boot image BOOT.BIN in WSL |
 +After obtaining .xsa file, you must be sure that you have done source for Vivado and Vitis. To create boot.bin is recommended to run build_boot_bin.sh in terminal.To do this, the file can be called in the following form:
 +<code>
 +  chmod +x build_boot_bin.sh
 +  usage: build_boot_bin.sh system_top.xsa u-boot.elf [output-archive]
 +</code>
 +
 +You can download the script by accessing the following link: [[https://wiki.analog.com/resources/tools-software/linux-software/build-the-zynq-boot-image|build_boot_bin.sh]].
 +
 +++++
  
 === Make the BOOT.BIN (adi_make::boot_bin) === === Make the BOOT.BIN (adi_make::boot_bin) ===
Line 393: Line 555:
   adi_make::boot_bin   adi_make::boot_bin
 </code> </code>
- 
- 
- 
  
 ====== Building manually ====== ====== Building manually ======
resources/fpga/docs/build.txt · Last modified: 28 Mar 2024 10:48 by iulia Moldovan