19 if {[
catch {
package require cmdline} ERROR]} {
20 puts "$ERROR\n If you are running this script on tclsh, you can fix this by installing 'tcllib'"
25 {generate "If set, the VHDL address files will be generated and replaced if already exisiting."}
26 {arg.ext_path "" "Path to external libraries"}
29 set usage "Copy IPBus XML files listed in a XML list file of a project and replace the version and SHA placeholders if they are present in any of the XML files.\nUsage: $argv0 \[-generate\] <project> <destination directory>"
30 set tcl_path [
file dirname [
info script]]
31 set repo_path [
file normalize $tcl_path/../../..]
32 source $tcl_path/../hog.tcl
35 if {[
catch {
array set options [
cmdline::getoptions ::argv $parameters $usage]}] || [
llength $argv] < 2} {
39 set project [
lindex $argv 0]
40 set dst [
lindex $argv 1]
41 if { $options(generate) == 1 } {
46 if { $options(arg.ext_path) == "" } {
49 set ext_path $options(arg.ext_path)
53 set proj_dir $repo_path/Top/$project
54 if {[
llength [glob -nocomplain $proj_dir/list/*.ipb]] > 0 } {
55 if {![
file exists $dst]} {
56 Msg Info "$dst directory not found, creating it..."
60 Msg Error "No .ipb files found in $proj_dir/list/"
65 set sha [
lindex $ret 13]
66 set hex_ver [
lindex $ret 14]