generated from maddiebusig/vivado-template-hog
Add script for packaging IP from project
Currently just reads the IP configuration
This commit is contained in:
parent
c242ff9445
commit
bdc55177cd
15
scripts/package_ip.sh
Executable file
15
scripts/package_ip.sh
Executable 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
35
tcl/package_ip.tcl
Normal 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"
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user