Skip to content

Instantly share code, notes, and snippets.

@swetland
Created May 12, 2014 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swetland/d79f7cd943e76cfd9127 to your computer and use it in GitHub Desktop.
Save swetland/d79f7cd943e76cfd9127 to your computer and use it in GitHub Desktop.
vivado: refresh user ip
# This assumes that your local IP cores are all in the "user" library
# and that they all live in ip/$name relative to your project directory
# (where myproject.xpr lives)
# load an IP core and bump its version number by 1
proc bump_ip_version { path } {
set fname "${path}/component.xml"
set core [ipx::open_core -set_current false $fname]
set version [get_property VERSION $core]
set parts [split $version "."]
lset parts end [expr [lindex $parts end] + 1]
set newversion [join $parts "."]
puts "${path}: version ${version} -> ${newversion}"
set_property version $newversion $core
ipx::save_core $core
ipx::unload_core $path
}
# try to update all user ip
proc xrefreship { } {
set dir [get_property DIRECTORY [current_project]]
set updatelist {}
foreach cell [get_bd_cells] {
set vlnv [split [get_property VLNV $cell] ":"]
set library [lindex $vlnv 1]
set name [lindex $vlnv 2]
if { $library == "user"} {
bump_ip_version "${dir}/ip/${name}"
lappend updatelist $cell
}
}
update_ip_catalog -rebuild
upgrade_bd_cells $updatelist
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment