Importing the pynq module is very slow


I have bought a pynq z2 board but I do not plan to use it with python, but from different C++ programs that are then scripted using shell. However, I am currently using python just to load the bitstreams. Unfortunately, simply importing the pynq module (import pynq or from pynq import overlays) takes 6 or 7 seconds, which are added to the execution time of most instantiated processes. I was even considering using it to check which bitstream is currently loaded, but I cannot afford the time it requires.

Is there a way to make the import faster? (Some kind of precompilation or a reduction in the modules loaded.) Otherwise, what could be a potential solution?

Thanks in advance

1 Like