Extract AXI/BRAM Data via Jupyter

dedicated to the FPGA topics for all Red Pitaya programmers
Post Reply
sslerose
Posts: 35
Joined: Sat Nov 26, 2022 12:43 am

Extract AXI/BRAM Data via Jupyter

Post by sslerose » Thu Oct 19, 2023 4:31 am

Hello,

I have been working for quite a while now trying to create an FPGA program that takes in data and performs trapezoidal filtration on it. So far I have been able to create a basic GitHub repository that has start-to-finish instructions for making a development machine, generating a block design using a .tcl script, and running everything through the built-in Jupyter Notebook. In essence, a simulated exponentially decaying signal is filtered, and the necessary value from the filter is read by the Notebook program via the GPIO interface as in the Frequency Counter project.

This is a great step, but I would ultimately like to have this GPIO output in conjunction with a graph of the wave displayed using MatPlotLib. I asked this question similarly before (here), but I ultimately did not have much success trying to use Pavel's Alpine system, and I would generally like my program to work on the Red Pitaya OS for simplicities sake. I have done a little compiling of potential solutions that I would like some input on:
  1. I have tried looking through the RP Python Examples, but these seem to require I use an SCPI server which I am not sure I can run custom block designs on.
  2. I also looked through the Jupyter examples but these seem (I say seem as it is not explicitly stated) to require I use the "Classic", "v0.94", or "Mercury" FPGA programs which I am not sure I can add my filters to.
  3. Have one RP take in the signal and perform the filtering and then pass it to another that collects and displays the data using an SCPI server with the Instant Signal Acquisition Python code
  4. Somehow use Pavel's AXI4 Hub and its Python/C dependencies within the built-in Jupyter Notebook (or SCPI server).
If these potential solutions are in fact not possible and I need to change my method of reading out this AXIS data, please let me know. I am really just suggesting these options as the Jupyter Notebook application is the only way that I am familiar with.

Thank you in advance.

juretrn
Posts: 110
Joined: Tue Nov 16, 2021 11:38 am

Re: Extract AXI/BRAM Data via Jupyter

Post by juretrn » Thu Oct 19, 2023 7:51 am

Hi, you can add your cores to a RP project like 0.94 if you wish. To do so, modify our BD script (systemZxx.tcl) to include your cores and connect them to M_AXI_GP0 with an axi_interconnect core.

sslerose
Posts: 35
Joined: Sat Nov 26, 2022 12:43 am

Re: Extract AXI/BRAM Data via Jupyter

Post by sslerose » Thu Oct 19, 2023 4:26 pm

juretrn wrote:
Thu Oct 19, 2023 7:51 am
you can add your cores to a RP project like 0.94 if you wish.
Thank you for the reply juretrn. I am comfortable making these modifications and my only question is if this should be done via SCPI server or the Jupyter Notebook?

User avatar
redpitaya
Site Admin
Posts: 912
Joined: Wed Mar 26, 2014 7:04 pm

Re: Extract AXI/BRAM Data via Jupyter

Post by redpitaya » Fri Oct 20, 2023 11:58 am

Hello sslerose,

With the 2.00-23 OS (latest 2.00 Beta), we added an option to run Python scripts directly in the Red Pitaya Linux (almost the same as C API commands). The scripts are working great, so we are planning on porting the commands to Jupyter Notebook, which will, from now on, also use the 0.94 version of the FPGA (same as the other applications) instead of the outdated Mercury image.

We are in the process of updating the documentation to include the new Python API examples.

sslerose
Posts: 35
Joined: Sat Nov 26, 2022 12:43 am

Re: Extract AXI/BRAM Data via Jupyter

Post by sslerose » Fri Oct 20, 2023 7:43 pm

redpitaya wrote:
Fri Oct 20, 2023 11:58 am
With the 2.00-23 OS (latest 2.00 Beta), we added an option to run Python scripts directly in the Red Pitaya Linux (almost the same as C API commands). The scripts are working great, so we are planning on porting the commands to Jupyter Notebook, which will, from now on, also use the 0.94 version of the FPGA (same as the other applications) instead of the outdated Mercury image.
This is fantastic news, thank you so much for this addition!

sslerose
Posts: 35
Joined: Sat Nov 26, 2022 12:43 am

Re: Extract AXI/BRAM Data via Jupyter

Post by sslerose » Sun Nov 05, 2023 10:46 pm

redpitaya wrote:
Fri Oct 20, 2023 11:58 am
With the 2.00-23 OS (latest 2.00 Beta), we added an option to run Python scripts directly in the Red Pitaya Linux (almost the same as C API commands). The scripts are working great, so we are planning on porting the commands to Jupyter Notebook, which will, from now on, also use the 0.94 version of the FPGA (same as the other applications) instead of the outdated Mercury image.
If I wanted to include my custom modules to operate on a SCPI server or just through the API commands, can I simply edit the v0.94 project? And so long as the beginning and end connections are the same, it shouldn't be an issue?

Also, do you have an approximate timeline for the Jupyter notebook additions?

Thank you in advance!

User avatar
redpitaya
Site Admin
Posts: 912
Joined: Wed Mar 26, 2014 7:04 pm

Re: Extract AXI/BRAM Data via Jupyter

Post by redpitaya » Tue Nov 07, 2023 1:24 pm

From my knowledge the SCPI server is not programmed inside the FPGA, but at C level. The C functions then call and change specific registers to achieve the wanted results.

I do not see a reason why you couldn't modify the existing FPGA (and C) code to add additional functionality to the SCPI server.

I need to confirm this with the team, but the Jupyter Notebook update may already be accessible through a combination of 2.03 Linux and the latest Nightly Build ecosystem:
https://redpitaya.readthedocs.io/en/lat ... tly-builds

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 58 guests