Program two FPGAs in a row

2 ビュー (過去 30 日間)
or ohev shalom
or ohev shalom 2020 年 2 月 24 日
コメント済み: or ohev shalom 2020 年 2 月 25 日
Hello,
I want to program two Xilinx FPGAs one after the other using Matlab's Xilinx HDL Coder.
For example,
filProgramFPGA('Xilinx Vivado','bitfile1',1) %% Program the first FPGA, CHAINPOSITION 1
filProgramFPGA('Xilinx Vivado','bitfile2',2) %% Program the second FPGA, CHAINPOSITION 2
Problem is, Matlab automatically tries to program the second FPGA.
The only workaround I've found is to manually disconnect the second FPGA, program the first FPGA (with the first command), and reconnect & program the second FPGA (with the second command).
Is there a way to choose which FPGA I want to program without having to manually intervene? Something like
choose FPGA#1
filProgramFPGA('Xilinx Vivado','bitfile1',1) %% Program the first FPGA, CHAINPOSITION 1
choose FPGA#2
filProgramFPGA('Xilinx Vivado','bitfile2',2) %% Program the second FPGA, CHAINPOSITION 2
Thanks in advance!
  2 件のコメント
Marc Erickson
Marc Erickson 2020 年 2 月 24 日
The chain position argument is what qualifies which device you are trying to program and so that should be sufficient. I'm glad you have found a workaround. One thing to note is that the MATLAB script uses 1 indexing for chain positions, Vivado uses 0 indexing, so be sure to add 1 if you are basing it on the Vivado indexing.
I don't have a 2 FPGA board on hand, but I do have a ZedBoard which is a multi-device JTAG chain (ARM at first position, FPGA at second position). The filProgramFPGA generates a tcl script that is executed by vivado. I was able to confirm the chain position is used correctly in the generated tcl. If I tried to use the ARM position (argument value of 1) it failed. If I tried to use a non-existant position (e.g. 5) it failed. Only with a chain argument value of 2 did it work.
A couple of things you might try:
Manually connect and program via the Vivado GUI. Open Hardware Manager ; Open target / Open new target... ; Next, Next, Next, Finish. Look at the Hardware Targets and Hardware Devices listed. Select a device and set its programming file. Then click on Program device. Do the same for the second device. If it succeeds you can take the resulting vivado.jou as your script going forward, or you might discover what is going wrong with the MATLAB function.
Manually edit the tcl script generated by filProgramFPGA, "_vivado_program.cmd", to determine which hardware device name it is using for each chain position. Add these lines after open_hw_target:
set hwdev [lindex [get_hw_devices] $chain_position]
puts ${hwdev}
And then execute via:
vivado -mode batch -source vivado_program.cmd
or ohev shalom
or ohev shalom 2020 年 2 月 25 日
Thanks!
I'm using Zybo, which is very similar in this case to the Zedboard (ARM & FPGA), and a second custom board with xilinx FPGA integrated within. I've tried using different chainpositions to program the second board (3 and 4), without success..
The issue is that open_hw automatically opens the connection with Zybo - so I needed to manually disconnect and reconnect to the second board.
The final solution was very close to what you have suggested:
I opened Vivado, and did the whole process through the GUI (open_HW, disconnect Zybo, connect FPGA#2, program device) and copied the tcl command to a new programming file (vivado_program2.cmd)... Finally I used system command to program the second FPGA.
filProgramFPGA('Xilinx Vivado','bitfile1',2) %% Program Zybo
system('vivado -mode batch -source vivado_program2.cmd') %% Program FPGA2

サインインしてコメントする。

回答 (0 件)

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by