3

Xilinx Vivado can export the content of a *.xpr file (Xilinx Vivado project file) as Tcl. Therefore a Tcl command exists in GUI mode (project mode):

write_project_tcl {C:/.../project/KC705.tcl}

From a version control perspective, it's better to version control such Tcl files instead of *.xpr files, because *.xpr files contain XML with a steadily changing content (IDs, order of files, ...). One could consider *.xpr files as binary or at least not good for merging!

Developers can forget to export their projects via menu: file -> write project tcl or to enter that long Tcl command manually before closing the project in the GUI.

Git offers pre-commit hooks. I would like to create a hook that converts (exports) a *.xpr file to a corresponding project tcl file.

So my question is: How to open and export a *.xpr file (via Tcl?) to a project Tcl file? A Git shall never contain outdated project information, because a developer missed to click export in the menu.

Paebbels
  • 15,573
  • 13
  • 70
  • 139
  • 2
    One could use the `tcl.post` option in Bitstream Settings to write a project Tcl every time one generates a new bitstream.! – Vinay Madapura Oct 12 '17 at 06:24
  • @VinayMadapura That's a good first start. One could add this also to other steps like synthesis and implementation, because at the beginning of a project, a write bitstream might not be available. – Paebbels Oct 12 '17 at 07:03

0 Answers0