How to use Mercurial for Xilinx Vitis IDE projects

Viewed 450

I have started to develop software under the Vitis IDE from Xilinx and I have found a problem regarding source codes versioning (in my case in Mercurial). The source code in Vitis IDE can be divided into two parts:

  • application code, which is fully controlled by the software developer
  • so called platform code (drivers for peripherals, bsp and os) which is automatically generated based on special hardware dependent xsa file via tcl script.

Based on that I have decided to versioning following files:

  • application source files (.c, .h)
  • xsa file
  • tcl script

So I have created a repository called RESOURCES with following structure:

  • hw_config - contains the xsa file
  • script - contains the tcl script
  • src - contains the source files of the application

Based on the content of RESOURCES repository the tcl script creates Xilinx Vitis workspace in WORKSPACE directory with following structure:

  • application code (uses a copy of src from RESOURCES)
  • platform code

This approach has a serious disadvantage consisting in the fact that the changes in the application source codes are being done in WORKSPACE but only the RESOURCES is under version control. So it is necessary to copy the changes from WORKSPACE into RESOURCES to be able to commit them. I think that this is uncomfortable and error prone. So I have been thinking about some better solution. I have got an idea to prepare some script which will monitor changes in the WORKSPACE and in case any change is noticed it will initiate copying of the content of the WORKSPACE into the RESOURCES. Do you think it is good approach? Thanks in advance for any suggestions.

1 Answers

I also noticed that Vitis currently is crap regarding revision control of source files. In Vivado SDK it was possibly to place source code files in workspace directories under revision control. When I upgraded an existing project to Vitis I noticed that Vitis removes all source files during project creation (with xsct).

But Vitis supports linked source files, as mentioned here: https://forums.xilinx.com/t5/Vitis-Acceleration-SDAccel-SDSoC/Vitis-and-version-control-git/td-p/1063991

But in my current project I have the problem that such a linked GNU linker file (lscript.ld) leads to error during linking.

Related