UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Scholar ronnywebers
Scholar
421 Views
Registered: ‎10-10-2014

Which files and folders of an sdk project should be checked into git, and which ones should be ignored

Jump to solution

Currently using 2018.2

The SDK folder contains lots of files and folders, of which some are hidden. Some of these hidden files seem to be important and should better be checked in to git, and some can just cause a lot of headaches when checked into git, and should be ignored. The same goes a bit for visible files too ... 

In other firmware environments, I always could use a rather simple .gitignore file to exclude irrelevant files from git. In SDK this seems to be very complex, and no accurate documentation nor guidance is given by Xilinx.

I did some related posts in the past (2017.2 version), and looked at many others. I recently migrated to 2018.2, hoping that things would have become better when it comes to version control, but I run into the same problems.

Don't tell me too look at these pages in UG782 : Working with Git, the table just doesn't tell me enough.

The best thing I found a bit by accedent, is from the SDK 2015.1 doc : Files to be Placed in Version Control

It's at least far more specific than the table in UG782. However that SDK2015.1 doc page seems no longer to be present in the 2018.2 version of UG782

We need to know exactly which files and folders are needed to be checked into git, and which should be put in the .gitignore, so I can checkout (or recreate) my entire SDK setup (hardware platform, bsp, debug configurations, compiler flags, ...) on another computer through git. That shouldn't be that hard IMHO.

Me and other forum users did some effort in the past to identify which files are needed, and which not, see for example : (SDK 2017.2) revision control guidance for SDK projects

Some useful info on revision control of the .hdf file and hw_platform was given here, but that's about it.

Anyone succesfully doing revision control on sdk projects with git and a .gitignore file?

My current .gitignore file for a project named 'sncp' looks like this:

# --- VIVADO & SDK common ---

# ignore the vivado project
/vivado_proj/*

# folders (and all of their contents) that should always be ignored,
# anywhere in the repo
.Xil/

# file patterns that should always be ignored (journal files, log
# files, dump files that are created upon Vivado/SDK errors)

*.jou
*.log
*.backup.jou
*.backup.log
*.upgrade_log
*.dmp
vivado_pid*
*~

# ignore 'ip_lib' which contains custom IP pulled from bitbucket by the build script
#/ip_lib/

# --- SDK specific ---

# exclude some obscure hidden SDK folders
/sdk/.metadata/
/sdk/webtalk/
/sdk/RemoteSystemsTempFiles/
/sdk/.sdk/

# hw_platform : exclude the entire hw_platform folder, as
# we'll regenerate everything from the .hdf file
# make sure to include the bitstream in the .hdf file when exporting
# from Vivado!
/sdk/design_1_wrapper_hw_platform_0/

# BSP : only keep .cproject, .project, .sdkproject, .system.mss
# and Makefile
# i.e. the ps7_cortexa9_0 lib files are regenerated automatically
/sdk/sncp_bsp/ps7_cortexa9_0/*

# Application : ignored file patterns, exclude Debug & Release folders
/sdk/**/*.o
/sdk/**/*.d
/sdk/**/*.a
/sdk/sncp/Debug/
/sdk/sncp/Release/

My Vivado flow works fine (using tcl script), however recreating the sdk environment from the repo is a nightmare

 

 

** kudo if the answer was helpful. Accept as solution if your question is answered **
1 Solution

Accepted Solutions
Moderator
Moderator
328 Views
Registered: ‎03-25-2019

Re: Which files and folders of an sdk project should be checked into git, and which ones should be ignored

Jump to solution

Hi @ronnywebers,

You are welcome!

Q1: if there is some example / tutorial / ... to get started from? What doc should I have a look at? Vivado has a 'write_project_tcl' command, is there any equivalent command for SDK? Vivado outputs every action you do in the tcl window, is there such window in SDK too? SDK log doesn't really seem to output tcl commands

You can find all the needed XSCT commands related to SDK to create Hardware Platform, BSP, Application ... either in this document or in this link.

Q2:  can everything that you configure in SDK through clicking with the mouse be scripted? for example:

Yes, almost all the thing could be done via XSCT. 

  • project properties (like compiler setting/flags, linker settings/flags, ...i.e. FSBL debug flag, compiler optimisation flags, ...)

Check this.

  • different debug configurations
  • remote targets (like the config for my SmartLynq probe)

Check this.

Q3: aren't we missing things when using the completely scripted path? refering to the 2015.1 doc link above, if we don't include .cproject, .project, .mss files, ... then all modificiations/settings that go into these files must be scripted? For example, when I add an  environment variable, I don't see anything being output in the SDK.log window or so...? Or when I edit the .mss file, these edits should go into the script too then?

Yes, any modification to your BSP project (.mss file modification) should be done via XSCT commands, please check this.

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
3 Replies
Highlighted
Moderator
Moderator
385 Views
Registered: ‎03-25-2019

Re: Which files and folders of an sdk project should be checked into git, and which ones should be ignored

Jump to solution

Hi @ronnywebers,

I think the easiest approach to recreate the SDK environment is to have the following:
- a copy of your HDF file
- a copy of your application source files.
- a TCL script, that create the hardware platform from your HDF file, create the  BSP project from the created hardware platform, configure your BSP, regenerate it, create a new application project, copy the application source files, configure build settings.

So, you should check in only these files.
For your case, checking in the HDF file is not mandatory, as you have already TCL script already checked the Vivado flow in which you can add commands to regenerate the HDF file for you.

 

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
Scholar ronnywebers
Scholar
374 Views
Registered: ‎10-10-2014

Re: Which files and folders of an sdk project should be checked into git, and which ones should be ignored

Jump to solution

thanks @abouassi , I was hoping a .gitignore approach was possible, but it looks like the sdk files and (hidden) folders aren't very friendly to git... The 2015.1 doc seemed to give that a shot here, but when skimming through the forum I can see lot's of people struggling with that.

I want to give your proposal a try ... I guess you mean a .tcl script? Could you please get me started, and tell me :

Q1:  if there is some example / tutorial / ... to get started from? What doc should I have a look at? Vivado has a 'write_project_tcl' command, is there any equivalent command for SDK? Vivado outputs every action you do in the tcl window, is there such window in SDK too? SDK log doesn't really seem to output tcl commands

Q2:  can everything that you configure in SDK through clicking with the mouse be scripted? for example:

  • project properties (like compiler setting/flags, linker settings/flags, ...i.e. FSBL debug flag, compiler optimisation flags, ...)
  • different debug configurations
  • remote targets (like the config for my SmartLynq probe)
  • ...

Q3: aren't we missing things when using the completely scripted path? refering to the 2015.1 doc link above, if we don't include .cproject, .project, .mss files, ... then all modificiations/settings that go into these files must be scripted? For example, when I add an  environment variable, I don't see anything being output in the SDK.log window or so...? Or when I edit the .mss file, these edits should go into the script too then?

** kudo if the answer was helpful. Accept as solution if your question is answered **
Moderator
Moderator
329 Views
Registered: ‎03-25-2019

Re: Which files and folders of an sdk project should be checked into git, and which ones should be ignored

Jump to solution

Hi @ronnywebers,

You are welcome!

Q1: if there is some example / tutorial / ... to get started from? What doc should I have a look at? Vivado has a 'write_project_tcl' command, is there any equivalent command for SDK? Vivado outputs every action you do in the tcl window, is there such window in SDK too? SDK log doesn't really seem to output tcl commands

You can find all the needed XSCT commands related to SDK to create Hardware Platform, BSP, Application ... either in this document or in this link.

Q2:  can everything that you configure in SDK through clicking with the mouse be scripted? for example:

Yes, almost all the thing could be done via XSCT. 

  • project properties (like compiler setting/flags, linker settings/flags, ...i.e. FSBL debug flag, compiler optimisation flags, ...)

Check this.

  • different debug configurations
  • remote targets (like the config for my SmartLynq probe)

Check this.

Q3: aren't we missing things when using the completely scripted path? refering to the 2015.1 doc link above, if we don't include .cproject, .project, .mss files, ... then all modificiations/settings that go into these files must be scripted? For example, when I add an  environment variable, I don't see anything being output in the SDK.log window or so...? Or when I edit the .mss file, these edits should go into the script too then?

Yes, any modification to your BSP project (.mss file modification) should be done via XSCT commands, please check this.

Best regards,
Abdallah
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution