名前を使用したオブジェクトの取得 - 2022.1 日本語

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

Document ID
UG894
Release Date
2022-06-08
Version
2022.1 日本語

ほとんどのデザインは、階層的に接続されたブロックまたはモジュールで構成されています。ボトムアップ、トップダウン、またはミドルアウトで構築されたデザインのいずれでも、デザイン階層で特定のオブジェクトを検索するのは一般的なタスクです。

図 1. デザイン階層の検索

get_* コマンドでは、デフォルトではデザイン階層の最上位のオブジェクトのみが返されます。current_instance コマンドを使用する前に get_* コマンドを使用すると、デザインの特定の階層インスタンスでデザイン オブジェクトを検索できます。検索範囲をデザインの最上位に戻すには、current_instance コマンドを引数を指定せずに実行します。

名前を使用したオブジェクトの取得 に、最上位にモジュール A および B がインスタンシエートされている例を示します。モジュール A には a1 および a2 階層インスタンスが含まれ、モジュール B には b1 および b2 階層インスタンスが含まれます。a1、a2、b1、および b2 には、それぞれ最下位セル (Unisim インスタンス) が含まれます。

# Set the current instance of the design to module B.
current_instance B 
get_cells * ; # Returns b1 and b2, cells found in the level of the current instance.
get_nets * ; # Returns nets from module B, the current instance.
# Reset the current instance to the top-level of the design.
current_instance 
get_cells * ; # Returns A and B, located at the top-level of the design.

get_* コマンドでは最上位または current_instance で指定した現在のインスタンスのレベルでのみ検索が実行されますが、現在のインスタンスに対する階層インスタンス名を含む検索パターンを指定できます。デフォルトでは、現在のインスタンスはデザインの最上位に設定されています。最上位からインスタンス b1 を参照するには、次のように指定します。

get_cells B/b1 ; # Search the top-level for an instance with a hierarchical name.