How can I establish hardware-in loop implementation of PYNQ-Z2 on MATLAB using filWizard?

Hello, I am trying to connect my Xilinx FPGA board (PYNQ-Z2) from TUL with MATLAB and perform hardware in loop simulation on Simulink. However, I am not able to establish connection between FPGA and MATLAB. Could you please guide me what steps do I need to follow to solve this error.
To stop the test, press "Ctrl+C" in the MATLAB console window.
Starting FPGA-in-the-Loop test ...
Generating FPGA programming file ...Passed
Programming FPGA ...Passed
Running FIL simulation ...Failed
Error:Failed to initialize the RTIOStream library.
(a) Xilinx PYNQ-Z2 FPGA board (b) Shorted JTAG Enable Pins
The configuration that I have done on the "New FPGA Board Wizard" for adding customized boards in MATLAB HDL Coder are as shown below.
For you kind reference, I am using
OS: Ubuntu 22.04.5 LTS OS,
FPGA: Xilinx PYNQ-Z2 (from TUL),
MATLAB Version: R2024b
Vivado Version: 2023.2 (ML Standard)
Any suggestions and support would be greatly appreciated. Thank you in advance for your time and support.

Answers (1)

Please try the following changes in the FPGA board wizard:
  • Clock Frequency: 125MHz
  • Clock Pin number: H16
Also connect the Ethernet port of this board to another Gig Etherner port, e.g. from PC/Switch/Router, using a Ethernet cable, since the Ethernet PHY should be active to generate the PL clock.
Run the validation step again.

5 Comments

Hi YP,
Thank you very much for your quick reply. I tried with above mentioned changes as you have suggested. However, still I am getting the same errors. FYI, I have connected ethernet cable between FPGA and my laptop, but it is not visible on FILWizard block. For you reference, I have attached the screenshots with the above changes made.
I am getting this error as well:
Failed to open Digilent JTAG cable: Did not find any Digilent(R)
JTAG cable. Make sure that the cable is connected to your computer.
Failed to open FTDI JTAG cable: FTD2XX Library path doesn't exist.
Thank you.
can you unplug the ethernet, and try again?
I found in this blog, the author can use 125MHz clock (H16) to drive LED without connecting the ethernet.
https://blog.umer-farooq.com/a-pynq-z2-guide-for-absolute-dummies-part-iii-tick-tock-using-fpga-clock-33a34ef3f51a
Hi YP,
I tried by connecting the ethernet. It did not work as well. Are there any ways to create make my FPGA hardware-in-lopp with matlab.
Thank you,
The FIL test passed for me. I am using the same jumper setting as you did, and Ethernet is not connected. I've attached my zipped board file. It should be the same as yours anyway.
By the way, I am testing on Windows. There could be driver issues on your Ubuntu. Try manually installing the FTDI driver and Adept runtime.
And can you try on a Windows machine?
Hi YP,
Thank you so much for your support. I truly appreciate it. Sure, I will try it on a Windows machine and keep you updated.
Thank you,
Bharat

Sign in to comment.

Products

Release

R2024b

Asked:

on 20 Dec 2024

Commented:

on 28 Feb 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!