barbedo / vivado-git

A git-friendly Vivado wrapper
Other
214 stars 38 forks source link

Relative path to IP repository dir #11

Open OVGN opened 3 years ago

OVGN commented 3 years ago

Hello!

First, thank you so much for these scripts! They really help me every day at work and home)

I have noticed a small, but annoying issue with IP repo path generation in TCL. As you know, this path is set in Vivado this way: Project Manager - Settings - Project Settings - IP - Repositoty.

My hierarchy:

│
├── My_IP_repo
├── projects
│      ├── project_0
│      ├── project_1
│      │      ├── src
│      │      ├── vivado_project
│      │      ├── project_1.tcl

So, when IP dir in hierarchy is "higher", that the project_1 origin dir, the path in the project_1.tcl remains empty after wproj run.

What I supposed see:

# Set IP repository paths
set obj [get_filesets sources_1]
if { $obj != {} } {
set_property "ip_repo_paths" "${origin_dir}/../../My_IP_repo/" $obj

# Rebuild user ip_repo's index before adding any source files
update_ip_catalog -rebuild
}

What I actually see:

# Set IP repository paths
set obj [get_filesets sources_1]
if { $obj != {} } {
set_property "ip_repo_paths" "" $obj

# Rebuild user ip_repo's index before adding any source files
update_ip_catalog -rebuild
}

Best regards, VGN

motchy869 commented 1 year ago

I encountered the same issue, and avoided the problem by simply commenting out a line in scripts\write_project_tcl_git.tcl.

# Filter out IP repositories outside of the project directory
if { [string first .. $rel_file_path] == 0 } { continue } # Comment out this.

I don't think this is OK for all usecases, but it's enough for me.