赛灵思系统调试器命令行接口 (XSDB) 提供了可脚本化接口,用于在非交互模式下运行应用。要使用脚本来运行先前示例中的程序,请使用以下命令创建 Tcl 脚本(并为其命名,如 test.tcl)。将脚本作为启动实参传递给 XSDB 即可运行该脚本。
connect -url TCP:xhdbfarmc7:3121
# Select the target whose name starts with Arm and ends with #0.
# On Zynq, this selects “Arm Cortex-A9 MPCore #0”
targets -set -filter {name =~ "Arm* #0"}
rst
fpga ZC702_HwPlatform/design_1_wrapper.bit
loadhw ZC702_HwPlatform/system.xsa
source ZC702_HwPlatform/ps7_init.tcl
ps7_init
ps7_post_config
dow dhrystone/Debug/dhrystone.elf
# Set a breakpoint at exit
bpadd -addr &exit
# Resume execution and block until the core stops (due to breakpoint)
# or a timeout of 5 sec is reached
con -block -timeout 5