このページは機械翻訳を使用して翻訳されました。元の英語を参照するには、ここをクリックします。
svdpiConfiguration
アドオンが必要: この機能には ASIC Testbench for HDL Verifier アドオンが必要です。
説明
svdpiConfiguration
オブジェクトは、MATLAB® 関数からのユニバーサル検証方法論 (UVM) コンポーネントまたは SystemVerilog DPI コンポーネントの作成を制御します。
作成
説明
は、シーケンシャル モジュールの svdpiObj
= svdpiConfiguration()svdpiConfiguration
オブジェクトを作成します。
は、svdpiObj
= svdpiConfiguration(ComponentKind
)ComponentKind
で指定された SystemVerilog モジュールまたは UVM コンポーネントの svdpiConfiguration
オブジェクトを作成します。
プロパティ
コード生成
CoderConfiguration
— coder.config
オブジェクト
構成オブジェクト
coder.config('dll')
を使用してカスタム構成オブジェクトを指定します。構成オブジェクトのビルド タイプは、動的ライブラリとして設定する必要があります。coder.config
(MATLAB Coder)を参照してください。
MATLABFunctionName
— MATLAB 関数の名前
文字ベクトル | string
DPI コンポーネントを生成する MATLAB 関数の名前。文字ベクトルまたは文字列として指定されます。
これはオプションのプロパティです。uvmfTestBenchConfiguration
オブジェクトを使用する場合、これがこのオブジェクトに関連付けられた MATLAB 関数名を指定できる唯一の方法です。
例: "funcName"
データ型: char
| string
PortsDataType
— ポート用に生成されたSystemVerilogデータ型
Compatible C Type
| Bit Vector
| Logic Vector
ポートの SystemVerilog データ型を次のいずれかの値として選択します。
CompatibleCType
– ポートに互換性のある C タイプ インターフェースを生成します。BitVector
– ポートのビットベクター型インターフェースを生成します。LogicVector
– ポートのロジックベクター型インターフェースを生成します。
このプロパティの詳細については、-PortsDataType
を参照してください。
依存関係
このプロパティを有効にするには、ComponentKind
プロパティを 'uvmf-predictor'
、'uvmf-sequence'
、または 'uvmf-custom'
に設定します。
InputArgs
— MATLAB関数入力のデータ型とサイズ
cell 配列
MATLAB 関数入力のデータ型とサイズ。セル配列として指定されます。生成された DPI コンポーネントが受け入れる入力タイプを指定します。InputArgs
は、各関数引数のタイプを指定するセル配列です。要素は coder.typeof
を使用して型に変換されます。
このプロパティは、codegen
(MATLAB Coder) 関数の引数 args
と同じ機能を持ちます。
例: {double(0),int8(0)}
依存関係
このプロパティを有効にするには、ComponentKind
プロパティを 'uvmf-predictor'
、'uvmf-sequence'
、または 'uvmf-custom'
に設定します。
コンポーネントの情報
ComponentKind
— 生成するSystemVerilogまたはUVMコンポーネントの種類
'sequential-module'
(既定値) | 'sequential-module-varsize'
| 'combinational-module'
| 'uvm-predictor'
| 'uvm-sequence'
| 'uvm-scoreboard'
| 'custom'
| 'uvmf-sequence'
| 'uvmf-predictor'
| 'uvmf-custom'
'template-name'
として指定された、SystemVerilog DPI または UVM コンポーネント生成用の組み込みテンプレートを選択します。カスタマイズされたテンプレートの場合は、'custom'
を指定します。
この構成オブジェクトを通じて、組み込みテンプレート変数の値をオーバーライドできます。オーバーライドの一般的な用途は、型名の競合を回避することで、生成されたコードと既存のテストベンチまたはコンポーネント ライブラリとの互換性を確保することです。
すべてのテンプレートに共通するオーバーライドは次のとおりです。
ComponentTypeName
、TestBenchTypeName
—svdpiConfiguration
オブジェクトのComponentTypeName
およびTestBenchTypeName
プロパティを設定してデフォルト値を上書きします。ComponentPackageTypeName
—svdpiConfiguration
オブジェクトのTemplateDictionary
プロパティを設定してデフォルト値を上書きします。
オプションのテンプレート固有のオーバーライド:
UVMシーケンス:
SequenceTransTypeName
、SequencerTypeName
、SequenceCount
、SequenceFlushCount
、ConfigObjTypeName
—svdpiConfiguration
オブジェクトのTemplateDictionary
プロパティを設定してデフォルト値を上書きします。
UVM予測:
InputTransTypeName
、OutputTransTypeName
、ConfigObjTypeName
—svdpiConfiguration
オブジェクトのTemplateDictionary
プロパティを設定してデフォルト値を上書きします。
UVM スコアボード:
InputTransTypeName
、OutputTransTypeName
、ConfigObjTypeName
—svdpiConfiguration
オブジェクトのTemplateDictionary
プロパティを設定してデフォルト値を上書きします。
PREDICTOR_INPUTS
、MONITOR_INPUTS
、CONFIG_OBJECT_INPUTS
—addPortGroup
オブジェクト関数をsvdpiConfiguration
オブジェクトと共に使用して、HDL ポートをグループにマップします。
テンプレート エンジンの詳細については、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 シーケンス コンポーネントのシーケンス数などのデフォルトのテンプレート値を上書きします。例を確認するには、テンプレート変数値の上書き に進んでください。
例:
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 つ以上のテンプレートのセル配列として指定されます。
テンプレート ファイルは、コンポーネントごとに複数のファイルを生成できます。テンプレート ファイルの場所と名前には、絶対パスまたは相対パスを使用できます。相対パスは絶対パスに変換されます。
依存関係
このプロパティを書き込むには、ComponentKind
プロパティを 'custom'
に設定します。それ以外の場合、このプロパティは読み取り専用になります。
TestBenchTemplateFiles
— テストベンチを生成するときに使用するテンプレートファイル
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/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.c ### Generating DPI-C Wrapper header file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.h ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_pkg.sv from template text. ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/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/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.c ### Generating DPI-C Wrapper header file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.h ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/myDut_pkg.sv from template text. ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/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/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.c ### Generating DPI-C Wrapper header file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.h ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sinWave_predictor_pkg.sv from template text. ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/predictor_input_trans.sv from template text. ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/predictor_output_trans.sv from template text. ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/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/Bdoc24a_2589924_894856/tpcc27045f/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/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.c ### Generating DPI-C Wrapper header file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveGen_dpi.h ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sinWave_predictor_pkg.sv from template text. ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveTrans.sv from template text. ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/hdlverifier-ex13685125/codegen/dll/sineWaveGen/sineWaveOut.sv from template text. ### Generating source code file /tmp/Bdoc24a_2589924_894856/tpcc27045f/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/Bdoc24a_2589924_894856/tpcc27045f/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)