カスタム ボタンに引数を追加 - 2023.2 日本語

Vivado Design Suite ユーザー ガイド: Tcl スクリプト機能の使用 (UG894)

Document ID
UG894
Release Date
2023-11-17
Version
2023.2 日本語

カスタム ボタンには、1 つまたは複数の引数を指定できます。引数はオプションです。引数を指定すると、ユーザーがボタンをクリックしたときになウィジェットが開くようになります。引数を定義するには、create_gui_custom_command_arg コマンドを使用します。

構文は次のとおりです。

create_gui_custom_command_arg -command_name <arg> -arg_name <arg>
                               [-default <arg>] [-comment <arg>] [-optional]
                               [-quiet] [-verbose]
Usage: 
  Name      Description
  --------------------------
  -command_name Unique name of the custom command for which an argument is 
                 being created.
  -arg_name   Unique name of the custom command argument to create.
  [-default]   Default value of the custom command argument.
  [-comment]   Comment for the custom command argument.
  [-optional]  Make the custom command argument optional.
  [-quiet]    Ignore command errors
  [-verbose]   Suspend message limits during command execution

次の例では、myButton というボタンに 3 つの引数を作成しています。最後の 2 つの引数はオプションです。

create_gui_custom_command -name "myButton" \
-menu_name "Do something" \
-command "myProc" \
-show_on_toolbar \
-run_proc true
create_gui_custom_command_arg -command_name "myButton" -arg_name "Top_Module" \
  -default "\[lindex \[find_top\] 0\]"
create_gui_custom_command_arg -command_name "myButton" -arg_name "Output_Directory" 
\
  -default "-output_dir report" -optional
create_gui_custom_command_arg -command_name "myButton" -arg_name "Force" \
  -default "-force" -optional