Avoid re-opening Vivado when chaining vivado comments.
Closed this issue · 2 comments
A new Vivado session is opened every time a vivado sub-command is invoked. This is done to guarantee reproducibility, at the cost of running time: for large projects, re-opening a project is time consuming.
This can avoided, while retaining reproducibility, by a VivadoConsole
wrapper that lazily-constructs the console at the first invocation
The first ingredient required is a mechanism to keep the vivado session open across chained commands, and still compatible with SmartOpen
to retain the option to dump complex commands sequences to file.
The pattern required to implement this is similar to VivadoOpen
(VivadoConsole
context wrapper). The simpler option seems to make it lazy (persistent), i.e. allow the console not to be destroyed if the _lazy
(_persistent
?) constructor parameter is set.
There is a catch thou. Each vivado session as implemented now, creates a separate log and jou file labelled with the session id. If the session is made persistent, this won't be possible. The file names are defined in the vivado command line. The only workaround that comes to mind is to build a log/jou label containing the list of chained commands. This is doable with click
, by using the resultcallback
, but requires some rearrangement in the cli/vivado.py
code (which is not necessarily bad)
Implemented in dev/master