Application Specific Workflows

Xilinx Vivado

Put your design into a git repository. Your directory structure should follow this format:

<project_name>
|-- src              // Verilog files go here.
|   `-- constrs_n    // Constraints go here, with suffixes for different constraint sets or runs.
|-- ip               // Xilinx IP goes here.
|-- sim              // Simulation files go here.
`-- build            // Tcl build script and Vivado project lives here.

When starting a local project for the first time, set up this file structure and create your Vivado project in a subfolder in build as <project_name>/build/<project_name>. Do not copy design files into the local Vivado project or create new files in the local project. Keep them in the src, ip, and sim folders. Starting the project with this file structure will make initializing the repository much simpler.

Vivado creates a lot of file clutter in a project that isn’t necessary to include in the repository. To keep the repo neat and easy to manage, only the necessary sources, ip, and simulation files should be included.

A Tcl build script can be used to restore the project to its most recent state. To generate this script:

  1. Select File→Project→Write Tcl… in the Vivado gui with the project open.

  2. Deselect all options/check boxes in the menu that opens.

  3. Save the resulting file <project_name>.tcl to the <project_name>/build folder in the repo. You do not need to make any modifications to this Tcl file.

There may be times when, in creating or adding files to a project, a file or ip is placed in the wrong location. This is usually a result of either selecting “copy files into project” or having an incorrect default ip location and can cause files to be missing after pushing to the remote repository. A way to ensure all files will be pushed to remote is to look over the <project_name>.tcl file and make sure all files to be included to the project have paths beginning with $origin_dir/../[ip|src|sim].

Note

The Vivado project in the build folder should not be added to the repository. Include a .gitignore file in the main project repo with the following lines to exclude it from the repo:

build/<project_name>/ 
build/.Xil/

When cloning or pulling the repo, the project can be recreated in its most recent state by running the <project_name>.tcl file in Vivado. To do this, open the tcl console at the bottom of the Vivado opening screen and cd into the <project_name>/build folder. Then run the tcl build script using Tools→Run Tcl Script. The Vivado project will be created in the <project_name>/build folder.

Note

Any time a new file is added to the project, the Tcl build script must be regenerated. When pulling the repo, it is best practice to delete the current local Vivado project in the <project_name>/build/<project_name> folder. As long as all design files are correctly located in the src, ip, and sim folders, no important project data will be lost. Rerun the Tcl build script to ensure you are working with the most recent project state.

While keeping the local Vivado project is not necessary during day to day development, it is advisable to save archives of the project after significant milestones and mission launches. This ensures that the exact project state is accessible if it is needed later, especially once a mission is in progress.

EtherCAT in TwinCAT

Try this .gitignore file:

# TwinCAT files
*.tpy
*.tclrs
*.compiled-library
*.compileinfo
*.tmc
*.tmcRefac
*.library
*.project.~u
*.tsproj.bak
*.xti.bak
LineIDs.dbg
LineIDs.dbg.bak
_Boot/
_CompileInfo/
_Libraries/

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates