Ricardo Barbedo 94079a71e7 | 4 years ago | |
---|---|---|
scripts | 4 years ago | |
README.md | 4 years ago | |
Vivado_init.tcl | 6 years ago |
Trying to make Vivado more git-friendly.
C:\Program Files\Git\bin
(or wherever you have your git.exe
) to your PATH
Add Vivado_init.tcl
(or append the relevant lines if you already have
something in it) along with the scripts
directory to:
%APPDATA%\Roaming\Xilinx\Vivado
on Windows~/.Xilinx/Vivado
on LinuxVivado is a pain in the ass to source control decently, so these scripts provide:
A modified write_project_tcl_git.tcl
script to generate the project script
without absolute paths.
A git wrapper that will recreate the project script and add it before committing.
A Tcl script (wproj
) to just create the Tcl project generator script without
using git. This script can be called from the Tcl Console on Vivado.
When first starting a project, create it in a folder called vivado_project
(e.g. PROJECT_NAME/vivado_project
). All the untracked files will be under this directory.
Place your source files anywhere you want in your project folder
(e.g. PROJECT_NAME/src
).
Here is an example of a possible project structure:
PROJECT_NAME
├── .git
├── .gitignore
├── project_name.tcl # Project generator script
├── src/ # Tracked source files
│ ├── design
│ │ ├── *.v
│ │ └── *.vhd
│ ├── testbench
│ │ ├── *.v
│ │ └── *.vhd
│ ├── blockdesign
│ │ ├── ui
│ │ ├── ip
│ │ ├── *.bd
│ │ └── ...
│ └── ...
└── vivado_project/ # Untracked generated files
├── project_name.xpr
├── project_name.cache/
├── project_name.hw/
├── project_name.sim/
└── ...
Initialize the git repository with git init
on the Tcl Console. This will
create the repository, automatically change to your project directory
(PROJECT_NAME
), generate the .gitignore
file and stage it.
Stage your source files with git add
.
When you are done, git commit
your project. A PROJECT_NAME.tcl
script will be created in your PROJECT_NAME
folder and added to your commit.
Afterwards, when opening the project after cloning it, do it by using
Tools -> Run Tcl Script...
and selecting the PROJECT_NAME.tcl
file
created earlier. This will regenerate the project so that you can continue to work.
Only board part repositories inside the project are stored in the project generator script.
If you have a system wide board part repository, you will need to add it manually
after recreating the project from the Tcl script (e.g. via Settings --> Board Repository
).