インテルのみ表示可能 — GUID: mwh1410471025218
Ixiasoft
1.1. ツールコマンド言語
1.2. インテル® Quartus® Prime Tclパッケージ
1.3. インテル® Quartus® Prime Tcl APIのヘルプ
1.4. 終端間デザインフロー
1.5. プロジェクトの作成およびアサインメントの作成
1.6. デザインのコンパイル
1.7. レポート
1.8. タイミング分析
1.9. スクリプト実行の自動化
1.10. その他のスクリプティング機能
1.11. インタラクティブ・モードでの インテル® Quartus® Prime Tclシェルの例
1.12. tclshシェル
1.13. Tclスクリプティングの基礎知識
1.14. Tclスクリプティングの改訂履歴
インテルのみ表示可能 — GUID: mwh1410471025218
Ixiasoft
1.10.5.1. cmdlineパッケージの使用
より堅固で自己文書化されたコマンドライン引数の引渡しには、 インテル® Quartus® Prime開発ソフトウェアに含まれるcmdlineパッケージを使用することができます。cmdlineパッケージは、-<option><value> の形式のコマンドライン引数をサポートしています。
cmdlineパッケージ
package require cmdline
variable ::argv0 $::quartus(args)
set options {
{ "project.arg" "" "Project name" }
{ "frequency.arg" "" "Frequency" }
}
set usage "You need to specify options and values"
array set optshash [::cmdline::getoptions ::argv $options $usage]
puts "The project name is $optshash(project)"
puts "The frequency is $optshash(frequency)"
これらのコマンドをprint_cmd_args.tclという名前のTclスクリプトに保存した場合、次に示すコマンドをコマンドプロンプトで入力したとき、次の出力が表示されます。
スクリプトへのコマンドライン引数の引渡し
quartus_sh -t print_cmd_args.tcl -project my_project -frequency 100MHz
The project name is my_project
The frequency is 100MHz
実質的に、すべての インテル® Quartus® Prime Tclスクリプトは、プロジェクトを開くことを必要とします。プロジェクトを開き、オプションで、次の例のようなコードでリビジョン名を指定することができます。この例では、指定したプロジェクトが存在するかどうかを確認します。存在する場合は、現在のリビジョン、または指定したリビジョンを開きます。
フル機能でプロジェクトを開くための方法
package require cmdline
variable ::argv0 $::quartus(args)
set options { \
{ "project.arg" "" "Project Name" } \
{ "revision.arg" "" "Revision Name" } \
}
array set optshash [::cmdline::getoptions ::argv0 $options]
# Ensure the project exists before trying to open it
if {[project_exists $optshash(project)]} {
if {[string equal "" $optshash(revision)]} {
# There is no revision name specified, so default
# to the current revision
project_open $optshash(project) -current_revision
} else {
# There is a revision name specified, so open the
# project with that revision
project_open $optshash(project) -revision \
$optshash(revision)
}
} else {
puts "Project $optshash(project) does not exist"
exit 1
}
# The rest of your script goes here
このような柔軟性またはエラー・チェックが必要ない場合、次に示すように、単純にproject_openコマンドを使用することもできます。
簡単にプロジェクトを開くための方法
set proj_name [lindex $argv 0]
project_open $proj_name