cancel
Showing results for 
Search instead for 
Did you mean: 
Newbie
Newbie
553 Views
Registered: ‎12-16-2019

Vivado Automation using Python

Hello,

I have a Python flow where I wish to integrate programming of the Artix FPGA using the Xilinx JTAG Programmer. What could work is having an instance of Vivado running in the backgroung, and having Python call tcl commands at runtime to open hardware, connect to it and then fully / partially reconfigure it depending on the underlying logic. Is there a way to do this?

Thanks,

Jinay Mehta

0 Kudos
6 Replies
Highlighted
Moderator
Moderator
383 Views
Registered: ‎03-16-2017

Re: Vivado Automation using Python

Hi @jinmeh

Can you elaborate on the point - "having Python call tcl commands at runtime to open hardware"? 

Are you looking for tcl commands for it?

Regards,
hemangd

Don't forget to give kudos and mark it as accepted solution if your issue gets resolved.
0 Kudos
Highlighted
Teacher
Teacher
372 Views
Registered: ‎07-09-2009

Re: Vivado Automation using Python

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017_4/ug835-vivado-tcl-commands.pdf
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Highlighted
Newbie
Newbie
353 Views
Registered: ‎12-16-2019

Re: Vivado Automation using Python

Hi @hemangd,

The situation is that I have a Python script which need to reconfigure the FPGA repeatedly. Currently I am using Vivado in batch mode with a TCL script which will open the Hardware Manager and program the FPGA using the bitstream file which is passed as a parameter to the TCL script. Problem here is that each time Vivado is started and shut down, and also the hardware manager is started, which takes a lot of time. If Vivado could remain running in the background and I could just run commands to program the FPGA (on that specific instance of VIvado), it would save a lot of runtime.

Best regards,

Jinay

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
344 Views
Registered: ‎04-16-2012

Re: Vivado Automation using Python

Hi Jinay,

see if the below approach helps:
Call your python script from Vivado tcl shell or tcl script using exec.
i.e., invoke vivado --> open hardware manager --> call your python script to configure the FPGA repeatedly

Thanks,
Vinay
--------------------------------------------------------------------------------------------
Have you tried typing your question in Google? If not you should before posting. Also, MARK this is as an answer in case it helped resolve your query/issue.Give kudos to the post that helped you to find the solution.
0 Kudos
Highlighted
Newbie
Newbie
340 Views
Registered: ‎12-16-2019

Re: Vivado Automation using Python

Hi Vinay,

Thanks a lot for the suggestion, but the Python workflow is handling many other things apart form the FPGA reconfiguration, and hence it is essential that the control remains with the Python tool. Besides, the Python tool is interactive (using a Jupyter frontend).

Assuming that I somehow invoke the Jupyter notebook and Python backend from Vivado (exec), could you please elaborate how the Python should reconfigure the FPGA? Currently I invoke a .sh file with parameters, which in turn starts vivado (./vivado) in batch mode with the .tcl file as a paramerter. As I understand, by invoking my Python flow from Vivado, it would likely open another instance of Vivado and behave just as it is behaving now.

Best regards,

Jinay

0 Kudos
Highlighted
Teacher
Teacher
338 Views
Registered: ‎07-09-2009

Re: Vivado Automation using Python

If you "just" after configuring the FPGa form Python,
then your basically a "processor" talking over JTAG to configure the FPGA.

Have a look at the configuration guides,

https://www.xilinx.com/support/documentation/application_notes/xapp583-fpga-configuration.pdf
https://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf
https://www.xilinx.com/support/documentation/application_notes/xapp058.pdf

what your after is a SVF player and file.
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/69206053/Executing+SVF+player+Linux+Application+on+ZCU102?preview=%2F69206053%2F69304352%2Fpmod.png
http://www.clifford.at/libxsvf/



<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos