clean up a bit

This commit is contained in:
2025-02-26 22:25:21 +01:00
parent e23f8cb81e
commit 4062fd0bf0
6 changed files with 58 additions and 52 deletions

View File

@ -1,7 +1,7 @@
if {[info exists env(IP_ADDRESS_HW_SERVER)]} {
set ip $env(IP_ADDRESS_HW_SERVER)
set ip $env(IP_ADDRESS_HW_SERVER)
} else {
set ip "localhost"
set ip "localhost"
}
puts "Hardware server IP address: $ip"
connect -url tcp:$ip:3121
@ -28,14 +28,9 @@ puts "Reset target"
# Reset the target
rst
if {![file exists $env(BITSTREAM)]} {
error "The bitstream file '$env(BITSTREAM)' does not exist"
exit 0
}
if {![file exists $env(PS_INIT_SCRIPT)]} {
puts "The ps init tcl script '$env(PS_INIT_SCRIPT)' does not exist"
exit 0
puts "The ps init tcl script '$env(PS_INIT_SCRIPT)' does not exist"
exit 0
}
# Check if BITSTREAM is set and the file exists before programming FPGA
@ -50,7 +45,7 @@ if {[info exists env(BITSTREAM)] && [file exists $env(BITSTREAM)]} {
# Program FPGA
fpga -f $env(BITSTREAM)
} else {
puts "Skipping bitstream programming (BITSTREAM is not set or file does not exist)"
puts "Skipping bitstream programming (BITSTREAM is not set or file does not exist)"
}
puts "Set ps target with device number: $arm_core_0_num"
@ -63,15 +58,12 @@ source $env(PS_INIT_SCRIPT)
ps7_init
ps7_post_config
if {![file exists $env(APP)]} {
puts "The app '$env(APP)' does not exist"
exit 0
}
puts "Set arm core 0 target with number: $arm_core_0_num"
target $arm_core_0_num
puts "Download app $env(APP) to target"
dow $env(APP)
if {[info exists env(APP)] && [file exists $env(APP)]} {
puts "Download app $env(APP) to target"
dow $env(APP)
}
puts "Successful"
puts "Successful"

View File

@ -33,9 +33,7 @@ def main():
required=True,
help="Path to the ps7 initialization TCL file to prepare the processing system.",
)
parser.add_argument(
"-a", "--app", required=True, dest="app", help="Path to the app to program"
)
parser.add_argument("-a", "--app", dest="app", help="Path to the app to program")
parser.add_argument(
"-i",
"--ip",
@ -70,12 +68,13 @@ def main():
print("Error: 'xsct' could not be found after sourcing settings64.sh.")
sys.exit(1)
if not os.path.isfile(args.app):
if args.app and not os.path.isfile(args.app):
print(f"The app '{args.app}' does not exist")
sys.exit(1)
# Export environment variables
os.environ["APP"] = args.app
if args.app:
os.environ["APP"] = args.app
os.environ["IP_ADDRESS_HW_SERVER"] = args.ip
if args.bit:
os.environ["BITSTREAM"] = args.bit