Tcl スクリプトの実行 - 2022.1 日本語

Vitis 統合ソフトウェア プラットフォームの資料: エンベデッド ソフトウェア開発 (UG1400)

Document ID
UG1400
Release Date
2022-04-26
Version
2022.1 日本語

Tcl スクリプトは、XSCT コマンドで作成し、インタラクティブまたは非インタラクティブなモードで実行できます。インタラクティブ モードの場合は、XSCT プロンプトでスクリプトを読み込むことができます。次に例を示します。

xsct% source xsct_script.tcl 

非インタラクティブ モードの場合は、launch 引数としてスクリプトを指定すると、そのスクリプトを実行できます。スクリプトに対する引数は、スクリプト名の後に付けます。次に例を示します。

$ xsct xsct_script.tcl [args]

次のスクリプトは、XSCT の使用例を示しています。このスクリプトは、アプリケーションを作成してビルドし、リモートの hw_server に接続し、リモート ホストに接続される Zynq PS を初期化し、ターゲットにアプリケーションをダウンロードして実行します。これらのコマンドは、スクリプトで記述できるほか、インタラクティブに実行することもできます。

# Set Vitis workspace
setws /tmp/workspace
# Create application project
app create -name hello -hw /tmp/wrk/system.xsa -proc ps7_cortexa9_0 -os standalone -lang C -template {Hello World}
app build -name hello hw_server
connect -host raptor-host
# Select a target
targets -set -nocase -filter {name =~ “Arm* #0}
# System Reset
rst -system
# PS7 initialization
namespace eval xsdb {source /tmp/workspace/hw1/ps7_init.tcl; ps7_init}
# Download the elf
dow /tmp/workspace/hello/Debug/hello.elf
# Insert a breakpoint @ main
bpadd -addr &main
# Continue execution until the target is suspended
con -block -timeout 500
# Print the target registers
puts [rrd]
# Resume the target
con