Browse Source

feat: change folder vivado_project to work_dir

master
Dennis Buchhorn 2 years ago
parent
commit
a39e8d3c6a
3 changed files with 11 additions and 11 deletions
  1. +3
    -3
      README.md
  2. +5
    -5
      scripts/git_wrapper.tcl
  3. +3
    -3
      scripts/write_project_tcl_git.tcl

+ 3
- 3
README.md View File

@ -37,8 +37,8 @@ Vivado is a pain in the ass to source control decently, so these scripts provide
### Workflow
1. 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.
1. When first starting a project, create it in a folder called `work_dir`
(e.g. `PROJECT_NAME/work_dir`). All the untracked files will be under this directory.
2. Place your source files anywhere you want in your project folder
(e.g. `PROJECT_NAME/src`).
@ -57,7 +57,7 @@ Vivado is a pain in the ass to source control decently, so these scripts provide
│ │ ├── *.v
│ │ └── *.vhd
│ └── ...
└── vivado_project/ # Untracked generated files
└── work_dir/ # Untracked generated files
├── project_name.xpr
├── project_name.cache/
├── project_name.hw/


+ 5
- 5
scripts/git_wrapper.tcl View File

@ -3,7 +3,7 @@
# This file provides a basic wrapper to use git directly from the tcl console in
# Vivado.
# It requires the write_project_tcl_git.tcl script to work properly.
# Unversioned files will be put in the vivado_project folder
# Unversioned files will be put in the work_dir folder
#
# Ricardo Barbedo
#
@ -20,7 +20,7 @@ namespace eval ::git_wrapper {
set command [lindex $args 0]
# Change directory project directory if not in it yet
set proj_dir [regsub {\/vivado_project$} [get_property DIRECTORY [current_project]] {}]
set proj_dir [regsub {\/work_dir$} [get_property DIRECTORY [current_project]] {}]
set current_dir [pwd]
if {
[string compare -nocase $proj_dir $current_dir]
@ -44,7 +44,7 @@ namespace eval ::git_wrapper {
# Generate gitignore file
puts "Generate gitignore file"
set file [open ".gitignore" "w"]
puts $file "vivado_project/*"
puts $file "work_dir/*"
puts $file ".Xil/*"
puts $file "*.str"
puts $file "*.log"
@ -67,7 +67,7 @@ namespace eval ::git_wrapper {
puts $file ""
puts $file "- Place source/design files in folder created in the top directory of the repo (e.g. `REPO/src/` or `REPO/design/`)."
puts $file ""
puts $file "- **The `vivado_project` folder will be untracked!**"
puts $file "- **The `work_dir` folder will be untracked!**"
puts $file ""
puts $file "- Wenn you are done, `git add` your source/design files."
puts $file ""
@ -105,7 +105,7 @@ namespace eval ::git_wrapper {
proc wproj {} {
# Change directory project directory if not in it yet
set proj_dir [regsub {\/vivado_project$} [get_property DIRECTORY [current_project]] {}]
set proj_dir [regsub {\/work_dir$} [get_property DIRECTORY [current_project]] {}]
set current_dir [pwd]
if {
[string compare -nocase $proj_dir $current_dir]


+ 3
- 3
scripts/write_project_tcl_git.tcl View File

@ -29,8 +29,8 @@
# 1. The project directory is now relative to the scripts location.
# Project directory was relative to the tcl console current directory.
#
# 2. When recreating a project, the generated files will be put in a "vivado_project" directory
# under the top directory. If "vivado_project" exists already, it will be rewritten.
# 2. When recreating a project, the generated files will be put in a "work_dir" directory
# under the top directory. If "work_dir" exists already, it will be rewritten.
#
# 3. After recreating a project, the tcl console will change directory to the project directory.
#
@ -621,7 +621,7 @@ proc wr_create_project { proj_dir name part_name } {
# set target project directory path if specified. If not, create project dir in current dir.
set target_dir $a_global_vars(s_target_proj_dir)
if { {} == $target_dir } {
set tcl_cmd "create_project \$\{_xil_proj_name_\} \$origin_dir/vivado_project -part $part_name -quiet -force"
set tcl_cmd "create_project \$\{_xil_proj_name_\} \$origin_dir/work_dir -part $part_name -quiet -force"
} else {
# is specified target proj dir == current dir?
set cwd [file normalize [string map {\\ /} [pwd]]]


Loading…
Cancel
Save