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.

52 lines
2.2 KiB

8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
  1. # vivado-git
  2. Trying to make Vivado more git-friendly on Windows.
  3. ### Requirements
  4. - [Git for Windows](https://git-scm.com/download/win)
  5. - Add `C:\Program Files\Git\bin` (or wherever you have your `git.exe`) to your `PATH`
  6. ### Installation
  7. Add `init.tcl` (or append the relevant lines if you already have something in it) along with the `scripts` directory to `%APPDATA%\Roaming\Xilinx\Vivado`.
  8. ### How it works
  9. Vivado is a pain in the ass to source control decently, so these scripts provide:
  10. - A modified `write_project_tcl_git.tcl` script to generate the project script without absolute paths.
  11. - A git wrapper that will recreate the project script and add it before committing.
  12. ### Workflow
  13. 1. When first starting with a project, create it in a folder called `work` (eg. `C:/.../PROJECT_NAME/work`) . All the untracked files will be under this directory.
  14. 2. Place your source files anywhere you want in your project folder (usually in the `C:/.../PROJECT_NAME/src`).
  15. Here is an example of a possible project structure:
  16. ```
  17. PROJECT_NAME
  18. ├── .git
  19. ├── .gitignore
  20. ├── project_name.tcl # Project generator script
  21. ├── src/ # Tracked source files
  22. │ ├── *.v
  23. │ ├── *.vhd
  24. │ └── ...
  25. └── work/ # Untracked generated files
  26. ├── project_name.xpr
  27. ├── project_name.cache/
  28. ├── project_name.hw/
  29. ├── project_name.sim/
  30. └── ...
  31. ```
  32. 3. Initiate the git repository with `git init` on the Tcl Console. This will create the repository, automatically change to your project directory (`C:/.../PROJECT_NAME`), generate the `.gitignore` file and stage it.
  33. 4. Stage your source files with `git add`.
  34. 5. When you are done, `git commit` your project. A `PROJECT_NAME.tcl` script will be created in your `C:/.../PROJECT_NAME` folder and added to your commit.
  35. 6. When opening the project after a cloning, 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 working.