Add script for packaging IP from project

Currently just reads the IP configuration
This commit is contained in:
Madeline Busig 2025-11-10 14:13:31 -08:00
parent c242ff9445
commit bdc55177cd
2 changed files with 50 additions and 0 deletions

15
scripts/package_ip.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/bash
THISSCRIPT=$(realpath $0)
PROJECT_ROOT=$(dirname $(dirname $THISSCRIPT))
TCLSCRIPT="$PROJECT_ROOT/tcl/package_ip.tcl"
if [ $# -lt 1 ]; then
echo "Usage: $0 PROJECT_NAME"
exit -1
fi
PROJNAME=$1
$VIVADO_ROOT/bin/vivado -mode batch -source "$TCLSCRIPT" -tclargs "$PROJNAME"

35
tcl/package_ip.tcl Normal file
View File

@ -0,0 +1,35 @@
set gitroot [exec git rev-parse --show-toplevel]
set hogroot "$gitroot/Hog"
puts "Hog root: $hogroot"
puts "Sourcing hog.tcl"
# Using ReadConf
source -notrace "$hogroot/Tcl/hog.tcl"
if { $argc < 1 } {
puts "Usage: vivado -mode batch -source package_ip.tcl -tclargs PROJECT_NAME"
exit -1
}
set proj_name [lindex $argv 0]
puts "Packaging $proj_name"
set proj_dir "$gitroot/Top/$proj_name"
set ip_conf_file "$proj_dir/ip.conf"
puts "Reading configuration file $ip_conf_file"
set ip_conf [ReadConf "$ip_conf_file"]
puts "IP Configuration: $ip_conf"
if { [dict exists $ip_conf main] == 0 } {
puts "No main section in IP configuration!"
exit -2
}
puts "Done"