Skip to content

Commit

Permalink
Merge pull request #40 from Lightsaver7/August-update-2
Browse files Browse the repository at this point in the history
August update 2
  • Loading branch information
Lightsaver7 committed Aug 31, 2023
2 parents 3582fa6 + e4a3c05 commit 892a6a1
Show file tree
Hide file tree
Showing 11 changed files with 705 additions and 88 deletions.
103 changes: 78 additions & 25 deletions active_learning/Chapter3/Oscillators

Large diffs are not rendered by default.

81 changes: 54 additions & 27 deletions active_learning/Chapter3/transistors.rst

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions learn_fpga/3_vivado_env/top.rst
@@ -1,8 +1,8 @@
Vivado FPGA programming environment
Vivado 2020.1 FPGA programming environment
###########################################

.. toctree::
:maxdepth: 1

tutorfpga1.rst
tutorfpga2.rst
tutorfpga2.rst
33 changes: 24 additions & 9 deletions learn_fpga/3_vivado_env/tutorfpga1.rst
@@ -1,14 +1,20 @@
.. _install_Vivado:

######################
Installation of Vivado
######################
##############################
Installation of Vivado 2020.1
##############################

This installation tutorial is intended for anyone who wants to use the FPGA of the Red Pitaya board. You need one of the following on your computer or virtual machine: Ubuntu OS, Linux Mint OS, or WSL (Windows Subsystem for Linux). After that, follow the instructions to install Vivado.
This installation tutorial is intended for anyone who wants to use the FPGA of the Red Pitaya board. You need one of the following on your computer or virtual machine: Ubuntu OS, Linux Mint OS, or Windows with WSL (Windows Subsystem for Linux). After that, follow the instructions to install Vivado 2020.1.

**************
Install Vivado
**************
.. note::

**Why not use an up-to-date Vivado Version?**

The reason is quite simple actually, Red Pitaya software was written for Vivado version 2020.1.

**********************
Install Vivado 2020.1
**********************

Download |Vivado| -Linux Self-Extracting Web Installer (Ubuntu or Linux Mint), or Windows Self Extracting Web Installer (WSL). If you don't have an Xilinx account, you will have to create one. It's free. 

Expand All @@ -21,9 +27,16 @@ Download |Vivado| -Linux Self-Extracting Web Installer (Ubuntu or Linux Mint), o
:width: 50%
:align: center

    - For Windows: Install Vivado as you would any other program, but remember/write down the path to the installation folder; you will need it later. Do not forget to install the libraries at the end of this webpage (through the WSL).
    - For Linux, just follow the installation process below.
---------
Windows
---------

Install Vivado as you would any other program, but remember/write down the path to the installation folder; you will need it later. Do not forget to install the libraries at the end of this webpage (through the WSL).
Refer to Linux installation process from `Installation Wizard <install_wizard>`_ onwards.

---------
Linux
---------

Now you have to run the downloaded file for installation. Open a terminal, go to the downloaded file directory (**cd Downloads/**), and insert the following commands. The first command is to make the file executable, and the second is to run the file.

Expand Down Expand Up @@ -75,6 +88,8 @@ Now the installation process should go through.
:align: center


.. _install_wizard:

It will open this installation wizard. Click Next.

.. figure:: ./../img/Screee3.png
Expand Down
84 changes: 67 additions & 17 deletions learn_fpga/3_vivado_env/tutorfpga2.rst
@@ -1,3 +1,6 @@

.. _create_fpga_project:

####################
Programming the FPGA
####################
Expand Down Expand Up @@ -34,24 +37,72 @@ Alternatively, if you are using Linux or WSL, you can first install git, then mo
Make an FPGA project
********************

Go to the downloaded ZIP location and extract it.
Now open Vivado and using the TCL console navigate to the extracted folder and make a Vivado project.
Go to the downloaded Red Pitaya FPGA Repository ZIP location and extract it to a folder/directory on your computer.


.. tabs::

.. tab:: Linux

Open Vivado and using the TCL console navigate to the extracted folder and make a Vivado project.

.. code-block:: bash
. /opt/Xilinx/Vivado/2020.1/settings64.sh
cd Downloads/
cd RedPitaya-FPGA/
make project PRJ=v0.94 MODEL=Z10
.. figure:: ./../img/Screen9.png
:width: 50%
:align: cente


.. tab:: Windows

On Windows search for **Vivado HLS 2020.1 Command Prompt** and launch it.

Using the command line navigate to the extracted folder and make a Vivado project:

.. code-block:: bash
cd Downloads/
cd RedPitaya-FPGA/
make project PRJ=v0.94 MODEL=Z10
.. figure:: ./../img/Vivado_HLS_console_windows.png
:width: 50%
:align: cente
.. code-block:: bash
cd Downloads/
cd RedPitaya-FPGA/
. /opt/Xilinx/Vivado/2020.1/settings64.sh
make project PRJ=v0.94 MODEL=Z10
.. note::

In order to open a project for models SDRlab 122-16 or SIGNALlab 250-12, you need to specify MODEL=Z20 (SDRlab) or MODEL=Z20_250 (SIGNALlab) as a parameter.
The instructions above are an example for how to create an empty project for STEMlab 125-14. For other boards, please use the flags in the table below. For more information, please refer to |dev_guide_software|.

Table of required build flags for FPGA projects per board

+------------------------------+-------------------------------------------+
| Model | Build flags |
+==============================+=====================+=====================+
| STEMlab 125-10 |br| | PRJ=v0.94 | MODEL=Z10 |
| STEMlab 125-14 |br| | | |
+------------------------------+---------------------+---------------------+
| STEMlab 125-14-Z7020 | PRJ=v0.94 | MODEL=Z20_14 |
+------------------------------+---------------------+---------------------+
| SDRlab 122-16 | PRJ=v0.94 | MODEL=Z20 |
+------------------------------+---------------------+---------------------+
| SIGNALlab 250-12 | PRJ=v0.94_250 | MODEL=Z20_250 |
+------------------------------+---------------------+---------------------+
| STEMlab 125-14 4Ch Z7020 | PRJ=v0.94 | MODEL=Z20_125_4CH |
+------------------------------+---------------------+---------------------+


.. |dev_guide_software| raw:: html

<a href="https://redpitaya.readthedocs.io/en/latest/developerGuide/software/build/fpga/fpga.html#build-fpga-image" target="_blank">Developers Guide Software</a>


.. figure:: ./../img/Screen9.png
:width: 50%
:align: center

For this project, you will only have to edit the **red_pitaya_top.sv** file. Edit the port **led_o** assignment at the beginning of the file. Change the port to **output logic**.

Expand Down Expand Up @@ -105,11 +156,11 @@ Implementation finished. Start writing the bitstream.

The bitstream file **red_pitaya_top.bit** is located in .../prj/v0.94/project/repitaya.runs/impl_1

You have to send this file to your Red Pitaya board. Open a terminal and connect to your Red Pitaya using an SSH connection. Also, enable the read/write operation on the Red Pitaya.
You have to send this file to your Red Pitaya board. Open a terminal and connect to your Red Pitaya using an SSH connection. Also, enable the read/write operation on the Red Pitaya. To establish the connection you can either use your Red Pitaya's IP address or the "rp-xxxxxx.local", where "xxxxxx" are the last six characters of the MAC address.

.. code-block:: bash
ssh root@your Red Pitaya IP
ssh root@rp-xxxxxx.local
redpitaya> rw
Open Terminal and go to the .bit file location.
Expand All @@ -122,19 +173,18 @@ Send the file .bit to the Red Pitaya with the ``scp`` command.

.. code-block:: bash
scp red_pitaya_top.bit root@your Red Pitaya IP:/tmp
scp red_pitaya_top.bit root@rp-xxxxxx.local:/root
Now establish an :ref:`SSH communication <docs:ssh>` with your Red Pitaya and check if you have the copy **red_pitaya_top.bit** in the tmp directory.
Now establish an :ref:`SSH communication <docs:ssh>` with your Red Pitaya and check if you have the copy **red_pitaya_top.bit** in the root directory.

.. code-block:: bash
redpitaya> cd /tmp
redpitaya> ls
Load the **red_pitaya_top.bit** to **xdevcfg** with

.. code-block:: bash
redpitaya> cat /tmp/red_pitaya_top.bit >/dev/xdevcfg
redpitaya> cat /tmp/red_pitaya_top.bit > /dev/xdevcfg
Congratulations, the LED should now be blinking, and the project should be running on the FPGA.

0 comments on commit 892a6a1

Please sign in to comment.