{"id":1000,"date":"2019-05-30T16:45:11","date_gmt":"2019-05-30T16:45:11","guid":{"rendered":"http:\/\/stage.wizzdev.pl\/?p=1000"},"modified":"2023-05-26T13:52:31","modified_gmt":"2023-05-26T13:52:31","slug":"fpga_data_transfer_demo_1","status":"publish","type":"post","link":"https:\/\/stage2.wizzdev.pl\/blog\/fpga_data_transfer_demo_1\/","title":{"rendered":"FPGA Data Transfer demo #1"},"content":{"rendered":"
This is the first<\/em> post of a short tutorial series aiming to demonstrate the capabilities of high-speed data transfer using FPGA based platform and an elementary Python application.<\/p>\n FPGA Data Transfer demo<\/strong> is a simple and exemplary project designed for high-speed data acquisition. It integrates Opal Kelly XEM7310 platform (with Xilinx Artix-7 FPGA) as a data generation module and a Python application on a PC (connected via USB3.0) that receives and processes the data. The data is then saved to a file in HDF5<\/strong> format which has been designed for storing and managing large amounts of data (such as time-series) in a hierarchical binary format.<\/p>\n A proposed system with a simple GUI is capable of:<\/p>\n <\/p>\n In this introductory post, we will cover all the required hardware and software elements that will be used within this project. After everything is set up the user will be able to run an example script to check the communication with the board and the possibilities of current hardware setup.<\/p>\n <\/p>\n Hardware<\/strong><\/p>\n Software<\/strong><\/p>\n (registration required, use Web installer like Xilinx recommends, also you may want to deselect other boards to save some disc space . Resulting required disc space should be around 37GB.<\/p>\n This tutorial was tested on Linux Ubuntu 18.04, with Python 3.6<\/em><\/p>\n Additional files needed to perform the test described later in this post:<\/p>\n We recommend cloning or downloading our repository to maintain the file structure.<\/p>\n Note:<\/strong> Before the first run copy your FrontPanel Python API files (_ok.so <\/em>and ok.py<\/em>) into this folder:<\/p>\n \u00a0\u00a0\u00a0\u00a0 fpga_data_transfer_demo<\/span><\/span>\/<\/span>python<\/span>\/<\/span>FrontPanelAPI<\/strong>\/<\/span><\/p>\n <\/p>\n It’s good to know what maximum transfer rate is achievable on your setup and verify whether the application can cope with desired data throughput at the very beginning. To send data we will use Opal Kelly’s provided bulk transfers called Pipes (more info about Opal Kelly Pipes can be found here<\/a>). Transfer rate strongly depends on used buffer and block (for Block-Throttled Pipes) lengths due to the existence of overhead. Usually, the speed increases with buffer length. Its upper limits are also determined by USB hardware capabilities. (remember to change path_to_bitfile to an actual path on your computer!)<\/p>\n The script will perform transfer speed tests for various transfer lengths and buffers. It will print the result to the console. A certain pair of BLOCK_LENGTH and TRANSFER_LENGTH (in bytes) can be also tested by running:<\/p>\n For our setup, with SuperSpeed USB3.0 interface we were able to observe transfer speed up to almost 300MiB\/s using Python. If maximum transfer lengths do not exceed 50MB\/s it may indicate that USB2.0 port is used.<\/p>\n Bear in mind that 340 MiB\/s transfer speed advertised on Opal Kelly’s website was probably measured using C++ application, and in fact, we achieved similar results using their PipeTest.cpp benchmark.\u00a0 Also, these results are taken without any data processing, and the final result for your application may be lower, but hey –\u00a0 its Python!<\/p>\n <\/p>\n In the next posts we will be:<\/p>\n – setting up a project in Vivado and creating a simple FPGA demo application in VHDL,<\/p>\n – writing a Python application to read the data and save them to HDF5 file<\/p>\n – visualizing the data in Python<\/p>\n <\/p>\n We hope you will find our demo project helpful, and in case of any questions feel free to leave a comment!<\/p>\n <\/p>\n\n
Overview<\/h2>\n
What is needed?<\/h2>\n
\n
\n
\n
\n
\n
Checking the transfer capabilities<\/h2>\n
\nTo run the test:<\/p>\n\n
\u00a0\u00a0 python3 pipe_test.py path_to_bitfile\/PipeTest.bit<\/pre>\n
\u00a0\u00a0 python3 pipe_test.py path_to_bit_file pipes<\/strong> BLOCK_LENGTH<\/strong> TRANSFER_LENGTH\r\n<\/strong><\/pre>\n
What’s next?<\/h2>\n