You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
3.1 KiB

8 years ago
8 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. # vivado-git
  2. Trying to make Vivado more git-friendly.
  3. ### Requirements
  4. - Tested on Vivado 2019.2
  5. #### Windows
  6. - [Git for Windows](https://git-scm.com/download/win)
  7. - Add `C:\Program Files\Git\bin` (or wherever you have your `git.exe`) to your `PATH`
  8. #### Linux
  9. - Git
  10. ### Installation
  11. Add `Vivado_init.tcl` (or append the relevant lines if you already have
  12. something in it) along with the `scripts` directory to:
  13. - `%APPDATA%\Roaming\Xilinx\Vivado` on Windows
  14. - `~/.Xilinx/Vivado` on Linux
  15. ### How it works
  16. Vivado is a pain in the ass to source control decently, so these scripts provide:
  17. - A modified `write_project_tcl_git.tcl` script to generate the project script
  18. without absolute paths.
  19. - A git wrapper that will recreate the project script and add it before committing.
  20. - A Tcl script (`wproj`) to just create the Tcl project generator script without
  21. using git. This script can be called from the Tcl Console on Vivado.
  22. ### Workflow
  23. 1. When first starting a project, create it in a folder called `vivado_project`
  24. (e.g. `PROJECT_NAME/vivado_project`). All the untracked files will be under this directory.
  25. 2. Place your source files anywhere you want in your project folder
  26. (e.g. `PROJECT_NAME/src`).
  27. Here is an example of a possible project structure:
  28. ```
  29. PROJECT_NAME
  30. ├── .git
  31. ├── .gitignore
  32. ├── project_name.tcl # Project generator script
  33. ├── src/ # Tracked source files
  34. │ ├── design
  35. │ │ ├── *.v
  36. │ │ └── *.vhd
  37. │ ├── testbench
  38. │ │ ├── *.v
  39. │ │ └── *.vhd
  40. │ ├── blockdesign
  41. │ │ ├── ui
  42. │ │ ├── ip
  43. │ │ ├── *.bd
  44. │ │ └── ...
  45. │ └── ...
  46. └── vivado_project/ # Untracked generated files
  47. ├── project_name.xpr
  48. ├── project_name.cache/
  49. ├── project_name.hw/
  50. ├── project_name.sim/
  51. └── ...
  52. ```
  53. 3. Initialize the git repository with `git init` on the Tcl Console. This will
  54. create the repository, automatically change to your project directory
  55. (`PROJECT_NAME`), generate the `.gitignore` file and stage it.
  56. 4. Stage your source files with `git add`.
  57. 5. When you are done, `git commit` your project. A `PROJECT_NAME.tcl`
  58. script will be created in your `PROJECT_NAME` folder and added to your commit.
  59. 6. Afterwards, when opening the project after cloning it, do it by using
  60. `Tools -> Run Tcl Script...` and selecting the `PROJECT_NAME.tcl` file
  61. created earlier. This will regenerate the project so that you can continue to work.
  62. ### Notes
  63. #### Board part repository paths
  64. Only board part repositories inside the project are stored in the project
  65. generator script.
  66. If you have a system wide board part repository, you will need to add it manually
  67. after recreating the project from the Tcl script (e.g. via `Settings --> Board Repository`).