cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
asbuscemi
Visitor
Visitor
1,459 Views
Registered: ‎08-01-2019

Challenge tracking Vivado Project using tcl script with git

I am struggling to track my Vivado project with git.  I'm attempting to use the tcl script to help track changes but this seems to require an extensive manual process every time I want to check in my project.  

If I understand this process correctly, in order to check my project into git, I need to use the write_project_tcl command to generate the tcl script.  I then need to look at that tcl script for all the source files, copy those source files to a new location with the same folder structure and make sure all those files are added in git.  Then when recreating the Vivado after pulling from git, I have to specify the new origin directory and run the tcl script.  

I tried leaving the source files in the same location and simply adding them to the git repository, but then when running the tcl command to regenerate the Vivado project I get an error saying the project already exists.  If I try to force the overwrite, it deletes my source files and then can't find them.  

Is this the Xilinx recommended process?  I cannot find a straight answer online.  If someone could point me in the right direction I would be most appreciative.

0 Kudos
6 Replies
hemangd
Moderator
Moderator
1,358 Views
Registered: ‎03-16-2017

@asbuscemi 

Let me investigate this query internally and will update you shortly with the outcomes.

Regards,
hemangd

Don't forget to give kudos and mark it as accepted solution if your issue gets resolved.
0 Kudos
asbuscemi
Visitor
Visitor
1,321 Views
Registered: ‎08-01-2019

I do now have a system in place to check in and track my project but it is far from fool-proof.  I wrote a couple bash and tcl scripts to "pack" the project for git and then "unpack" the project after it's been checked out.  I had a lot of trouble making sure everything was in the right place.  There is still a very manual process of ensuring that each file is correctly copied over and added to git.

 

One tip: the origin_dir must be at the same level as the folder the vivado project folder.

This structure worked for me:

[myun@localhost myproject]$ tree
.
├── my_ip
│   └── all_ip_goes_here
├── my_rfsoc_project
│   ├── my_rfsoc_vivado
│   │   ├── my_rfsoc_vivado.xpr
│   │   └── other_vivado_project_folders
│   └── my_rfsoc_vivado.tcl
└── my_rfsoc_src
          └── my_rfsoc_vivado
                    └── my_rfsoc_vivado.srcs
                              └── sources_1
                                       └── imports
                                               └── hdl
                                                        └── my_rfsoc_bd_wrapper.vhd

 

0 Kudos
TomH_BAH
Observer
Observer
1,292 Views
Registered: ‎06-30-2020

My team has a separate repository for standard components, and read those in using a custom tcl script which reads the paths from an input file. Project specific sources are kept in a unique repository where vivado generated files are kept in an ignored directory. IP, constraints, and other sources are in side by side folders, also read in by custom tcl scripts. There's some upfront work, but then there's no hand-moving of anything to check in or recreate a project.

0 Kudos
asbuscemi
Visitor
Visitor
1,288 Views
Registered: ‎08-01-2019

My main question to Xilnx is: why does it have to be so difficult?!  

Good to know that it's possible, this is my first time with the Vivado block design setup as my projects before this have been vhdl/verilog only.  

As long as the top-level wrapper doesn't change, I think I won't have to manually copy things over to check into git, but if I want Vivado to manage that for me, I don't know how to get around that.  

One queston for you: if you are adding new files to the project, do you have to go and manually change the scripts or are the scripts smart enough to figure that out?  Sounds like you would have to update your input file?

0 Kudos
TomH_BAH
Observer
Observer
1,285 Views
Registered: ‎06-30-2020

With regards to the block design, we export that as a tcl script and source it as well. Our setup doesn't lend itself well to write_project_tcl.

The input file would need updated as the sources change, but that can also be automated with a tcl script to read the file sets and export them to a text file.

0 Kudos
ggillett
Contributor
Contributor
1,231 Views
Registered: ‎08-14-2018

Take a look at vivado-git on github. I've only just started using it but it appears to work OK, one problem is that TCL create_project does not add the IP repos configured in the Tool Settings, I suspect this is a Vivado bug. 

Tags (3)