このページは機械翻訳を使用して翻訳されました。最新版の英語を参照するには、ここをクリックします。
svdpiConfiguration
アドオンが必要です: この機能には、 ASIC Testbench for HDL Verifierアドオンが必要です。
説明
svdpiConfiguration
オブジェクトは、MATLAB®関数からのユニバーサル検証手法 (UVM) コンポーネントまたは SystemVerilog DPI コンポーネントの作成を制御します。
作成
説明
は、シーケンシャル モジュールのsvdpiObj
= svdpiConfiguration()svdpiConfiguration
オブジェクトを作成します。
は、 svdpiObj
= svdpiConfiguration(ComponentKind
)svdpiConfiguration
で指定された SystemVerilog モジュールまたは UVM コンポーネントのComponentKind
オブジェクトを作成します。
プロパティ
コード生成
CoderConfiguration
— coder.config
オブジェクト
構成オブジェクト
coder.config('dll')
を使用してカスタム構成オブジェクトを指定します。構成オブジェクトのビルド タイプは動的ライブラリとして設定する必要があります。coder.config
(MATLAB Coder)を参照してください。
コンポーネントの情報
ComponentKind
— 生成する SystemVerilog または UVM コンポーネントの種類
'sequential-module'
(既定値) | 'sequential-module-varsize'
| 'combinational-module'
| 'uvm-predictor'
| 'uvm-sequence'
| 'uvm-scoreboard'
| 'custom'
SystemVerilog DPI または UVM コンポーネント生成用の組み込みテンプレートを選択します。'template-name'
として指定します。カスタマイズされたテンプレートの場合は、 'custom'
を指定します。
この構成オブジェクトを通じて、組み込みテンプレート変数の値をオーバーライドできます。オーバーライドの一般的な使用法は、型名の競合を回避して、生成されたコードと既存のテストベンチまたはコンポーネント ライブラリとの互換性を確保することです。
すべてのテンプレートに共通するオーバーライドには次のものがあります。
ComponentTypeName
、TestBenchTypeName
— TGでComponentTypeName
およびTestBenchTypeName
プロパティを設定してデフォルト値をオーバーライドします。svdpiConfiguration
オブジェクト。ComponentPackageTypeName
—svdpiConfiguration
TemplateDictionary
プロパティを設定してデフォルト値をオーバーライドします。
オプションのテンプレート固有のオーバーライド:
UVM シーケンス:
SequenceTransTypeName
、SequencerTypeName
、SequenceCount
、SequenceFlushCount
、ConfigObjTypeName
—svdpiConfiguration
TemplateDictionary
プロパティを設定して、デフォルト値をオーバーライドします。
UVM 予測子:
InputTransTypeName
、OutputTransTypeName
、ConfigObjTypeName
— TGでTemplateDictionary
プロパティを設定してデフォルト値をオーバーライドします。svdpiConfiguration
オブジェクト。
UVM スコアボード:
InputTransTypeName
、OutputTransTypeName
、ConfigObjTypeName
— TGでTemplateDictionary
プロパティを設定してデフォルト値をオーバーライドします。svdpiConfiguration
オブジェクト。
PREDICTOR_INPUTS
、MONITOR_INPUTS
、CONFIG_OBJECT_INPUTS
—addPortGroup
オブジェクト関数を使用して、HDL ポートをグループにマップします。svdpiConfiguration
オブジェクト。
テンプレート エンジンの詳細については、 「 SystemVerilog および UVM テンプレート エンジン 」を参照してください。
ComponentTypeName
— メインモジュールまたはコンポーネントのタイプ名
MATLAB 関数名 (既定値) | string | 文字ベクトル
コンポーネントの型名文字列または文字ベクトルとして指定します。dpigen
関数は、この引数を使用して、生成されたコンポーネントと SystemVerilog パッケージ ファイルに名前を付けます。コンポーネント タイプ名を指定しない場合、コンポーネント タイプ名はMATLAB関数名になります。
TestBenchTypeName
— テストベンチコンポーネントのタイプ名
tb_function
(既定値) | string | 文字ベクトル
tb_function
テストベンチの型名文字列または文字ベクトルとして指定します。dpigen
関数は、この引数を使用して、生成された SystemVerilog テストベンチとその関連ファイルに名前を付けます。コンポーネント タイプ名を指定しない場合、テスト ベンチ タイプ名には MATLABテスト ベンチ関数の名前が使用されます。
以下のコードでは、 dpigen
関数は予測子コンポーネントを生成し、指定されたテストベンチ関数名 (my_tb
) を使用してそのコンポーネントのテストベンチ モジュールを作成します。
c = svdpiConfiguration('uvm-predictor'); dpigen fooBar -testbench my_tb -config c;
そのテストベンチ名をオーバーライドするには、目的の SystemVerilog 名を指定します。この例では、 pulse_framed_tb
として指定されています。
c = svdpiConfiguration('uvm-predictor'); c.TestBenchTypeName = 'pulse_framed_tb'; dpigen fooBar -testbench my_tb -config c;
テンプレート
TemplateDictionary
— テンプレート ファイルで定義された名前と値のペアのリスト
名前と値のペアのセル配列
各テンプレートは、テンプレート固有の変数を宣言するテンプレート ディクショナリを定義します。これらの変数に値を、変数名の後に値が続くセル配列として割り当てます。
テンプレート ファイルは、 %<Name>
という形式のトークンをValue
で展開します。名前と値は文字列または文字配列である必要があります。
ここで、UVM コンポーネントのトランザクション タイプ名や UVM シーケンス コンポーネントのシーケンス カウントなどのデフォルトのテンプレート値をオーバーライドします。例を参照するには、 Override Template Variable Valuesに移動します。
"例:"
c = svdpiConfiguration('uvm-sequence'); c.TemplateDictionary = { 'SequenceCount', '15', 'SequenceFlushCount', '2', };
テンプレート ファイルの次の行:
repeat (%<SequenceCount>)
は次のように置き換えられます。
repeat (15)
PortGroups
— テンプレート ファイルで使用されるポート名のカスタム リストを表示します。
string | 文字ベクトル
この プロパティ は読み取り専用です。
ポート グループは、論理的に一緒に属する、生成されたインターフェイスのセクションを表します。以下に例を示します。
モジュールへのすべての入力は、組み込みテンプレートの
ALL_INPUTS
ポート グループに属します。モニターから発生する UVM スコアボード モジュールへのすべての入力は、UVM スコアボード テンプレートの
MONITOR_INPUTS
ポート グループに属します。スコアボード、シーケンス、またはプレディクターへの構成入力は、
CONFIG_OBJECT_INPUTS
インターフェイスに属します。
ALL_INPUTS
やALL_OUTPUTS
など、いくつかの組み込みグループが存在します。テンプレートはポート グループを利用して、そのグループに固有のラッパー コードを生成します。
ポート グループを変更するには、 addPortGroup
関数またはremovePortGroup
関数をそれぞれ使用します。
たとえば、ポート グループをスコアボードに追加します。
c = svdpiConfiguration('uvm-scoreboard'); addPortGroup(c, 'PREDICTOR_INPUTS', {'PeakSq','Location','FilterOut_re','FilterOut_im'}); addPortGroup(c, 'MONITOR_INPUTS', {'PeakSqImplIn','LocationImplIn',... 'FilterOutImpl_re','FilterOutImpl_im'}); addPortGroup(c, 'CONFIG_OBJECT_INPUTS', 'pErrorPercentThreshold');
テンプレート ファイルの構成オブジェクト定義には、変数のランダム化を可能にする次のコードを含めることができます。
%<BEGIN_FOREACH_PORT CONFIG_OBJECT_INPUTS> %<PORT_RAND_VAR_DECL> %<END_FOREACH_PORT>
ComponentTemplateFiles
— モジュールまたはコンポーネントを生成するときに使用するテンプレート ファイル
cell 配列
モジュールまたはコンポーネントの処理時に使用するテンプレート ファイルへのパス。1 つ以上のテンプレートの cell 配列として指定します。
テンプレート ファイルは、コンポーネントごとに複数のファイルを生成できます。テンプレート ファイルの場所と名前には、絶対パスまたは相対パスを使用できます。相対パスは絶対パスに変換されます。
依存関係
このプロパティを書き込むには、 ComponentKind
プロパティを'custom'
に設定します。それ以外の場合、このプロパティは読み取り専用です。
TestBenchTemplateFiles
— テストベンチを生成するときに使用するテンプレート ファイル
cell 配列
コンポーネントのテストベンチを処理するときに使用するテンプレート ファイルへのパス。文字列または複数のテンプレートの cell 配列として指定します。
テンプレート ファイルは、コンポーネントごとに複数のファイルを生成できます。ファイル名には絶対パスまたは相対パスを使用できます。相対パスは絶対パスに変換されます。
依存関係
このプロパティを書き込むには、 ComponentKind
プロパティを'custom'
に設定します。それ以外の場合、このプロパティは読み取り専用です。
オブジェクト関数
addPortGroup | ポート グループ マッピングをsvdpiConfiguration オブジェクトに追加します |
removePortGroup | svdpiConfiguration オブジェクトからポート グループ マッピングを削除します |
例
MATLAB関数から SystemVerilog DPI コンポーネントを生成
この例では、 HDL Verifier™のデフォルト テンプレートを使用して、 sineWaveGen
関数から SystemVerilog DPI (SVDPI) コンポーネントを生成する方法を示します。
デフォルトのテンプレートを使用して SVDPI モジュールを作成する
デフォルトのテンプレートを使用して構成オブジェクトを作成し、それをdpigen
関数で使用します。生成された SystemVerilog ファイルに注目してください。
sineWaveGen.sv
sineWaveGen_pkg.sv
c=svdpiConfiguration(); dpigen -config c -args {0,0} sineWaveGen
### Generating DPI-C Wrapper /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.c ### Generating DPI-C Wrapper header file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.h ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_pkg.sv from template text. ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen.sv from template text. ### Generating makefiles for: sineWaveGen_dpi Code generation successful.
生成されたモジュールの名前をmyDut
に変更します。生成された SystemVerilog ファイルに注目してください。
マイダット
.sv
マイダット
_pkg.sv
c.ComponentTypeName = 'myDut'; dpigen -config c -args {0,0} sineWaveGen
### Generating DPI-C Wrapper /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.c ### Generating DPI-C Wrapper header file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.h ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/myDut_pkg.sv from template text. ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/myDut.sv from template text. ### Generating makefiles for: sineWaveGen_dpi Code generation successful.
テンプレートを使用して UVM プレディクターを作成する
UVM 予測子テンプレートを使用して構成オブジェクトを作成し、それをdpigen
関数で使用します。生成された SystemVerilog ファイルに注目してください。
predictor_input_trans.sv
predictor_output_trans.sv
sinWave_predictor_pkg.sv
sinWave_predictor.sv
c = svdpiConfiguration('uvm-predictor'); c.ComponentTypeName = 'sinWave_predictor'; dpigen sineWaveGen -config c -args {0,0}
### Generating DPI-C Wrapper /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.c ### Generating DPI-C Wrapper header file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.h ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sinWave_predictor_pkg.sv from template text. ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/predictor_input_trans.sv from template text. ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/predictor_output_trans.sv from template text. ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/predictor_cfgobj.sv from template text.
Warning: Port group 'CONFIG_OBJECT_INPUTS' was found in the template file but contained no ports in its list. Specify the PortGroups list using the svdpiConfiguration object.
Warning: Port group 'CONFIG_OBJECT_INPUTS' was found in the template file but contained no ports in its list. Specify the PortGroups list using the svdpiConfiguration object.
### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sinWave_predictor.sv from template text.
Warning: Port group 'CONFIG_OBJECT_INPUTS' was found in the template file but contained no ports in its list. Specify the PortGroups list using the svdpiConfiguration object.
### Generating makefiles for: sineWaveGen_dpi Code generation successful.
テンプレート変数値を上書きする
ここで、生成された SystemVerilog トランザクション名を変更します。
デフォルトの
predictor_input_trans
をオーバーライドし、名前をsineWaveTrans
に変更します。デフォルトの
predictor_output_trans
をオーバーライドし、名前をsineWaveOut
に変更します。
テンプレート ディクショナリのInputTransTypeName
変数とOutputTransTypeName
変数に新しい値を割り当てるには、 TemplateDictionary
プロパティを設定します。
c.TemplateDictionary = { 'InputTransTypeName','sineWaveTrans', 'OutputTransTypeName','sineWaveOut' }; dpigen sineWaveGen -config c -args {0,0}
### Generating DPI-C Wrapper /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.c ### Generating DPI-C Wrapper header file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.h ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sinWave_predictor_pkg.sv from template text. ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveTrans.sv from template text. ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveOut.sv from template text. ### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/predictor_cfgobj.sv from template text.
Warning: Port group 'CONFIG_OBJECT_INPUTS' was found in the template file but contained no ports in its list. Specify the PortGroups list using the svdpiConfiguration object.
Warning: Port group 'CONFIG_OBJECT_INPUTS' was found in the template file but contained no ports in its list. Specify the PortGroups list using the svdpiConfiguration object.
### Generating source code file /tmp/Bdoc23b_2492649_1044276/tpd2444e94/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sinWave_predictor.sv from template text.
Warning: Port group 'CONFIG_OBJECT_INPUTS' was found in the template file but contained no ports in its list. Specify the PortGroups list using the svdpiConfiguration object.
### Generating makefiles for: sineWaveGen_dpi Code generation successful.
バージョン履歴
R2023a で導入R2023b: シーケンス テンプレートとプレディクター テンプレートは構成ポートをサポートします
CONFIG_OBJECT_INPUTS
ポート グループを追加して、UVM シーケンスまたはプレディクターに構成ポートを追加します。addPortGroup
関数を使用して、設定入力を UVM コンポーネントにマップします。
予測子テンプレートには、 PREDICTOR_INPUTS
およびCONFIG_OBJECT_INPUTS
という 2 つの新しいポート グループがあります。デフォルトでは、 ALL_INPUTS
= PREDICTOR_INPUTS
。CONFIG_OBJECT_INPUTS
またはPREDICTOR_INPUTS
を定義してから、 ALL_INPUTS
= PREDICTOR_INPUTS
+ CONFIG_OBJECT_INPUTS
を定義できます。 $$。
同様に、シーケンス テンプレートには 2 つの新しいポート グループSEQUENCE_INPUTS
とCONFIG_OBJECT_INPUTS
があります。デフォルトでは、 ALL_INPUTS
= SEQUENCE_INPUTS
。CONFIG_OBJECT_INPUTS
またはSEQUENCE_INPUTS
を定義してから、 ALL_INPUTS
= SEQUENCE_INPUTS
+ CONFIG_OBJECT_INPUTS
を定義できます。 $$。
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)