Main Content

uvmfTestBenchConfiguration

Configure YAML generation from DPI component generation and its integration with UVMF

Since R2024a

Add-On Required: This feature requires the ASIC Testbench for HDL Verifier add-on.

Description

The uvmfTestBenchConfiguration object controls the creation of a universal verification methodology framework (UVMF) complaint YAML file from the MATLAB®-based DPI components.

Creation

Description

example

c = uvmfTestBenchConfiguration({svdpiConfiguration("uvmf-predictor"),svdpiConfiguration("uvmf-sequence")}) creates a uvmfTestBenchConfiguration object to integrate DPI predictor and sequence components into the UVMF test bench. You can provide the svdpiConfiguration objects in the cell array in any order.

c = uvmfTestBenchConfiguration(testBenchKind,{svdpiObj1,svdpiObj2,...,svdpiObjn}) creates a uvmfTestBenchConfiguration object with the specified testBenchKind, or with the "default" test bench kind if none is specified. Provide any number of svdpiConfiguration objects according to the custom UVMF test bench YAML template.

Properties

expand all

Code Generation

Container of the SystemVerilog DPI configuration objects, specified as a cell array of svdpiConfiguration objects. Use this property to generate and integrate DPI components into UVMF test bench.

Example: {pred, seq}

Data Types: cell array

Name of the build directory under which all the DPI components and YAML files generate, specified as a string.

Example: "C:/myDirectory"

Data Types: string

Test Bench Type Information

Kind of UVMF test bench YAML to generate, specified as "default" or "custom".

  • "default" — Generate a YAML file using the default test bench YAML template. In this kind, you can provide only one predictor component and one sequence component as arguments.

  • "custom" — Generate a YAML file using the custom test bench YAML template that you provide. In this kind, you can provide multiple DPI components that are part of your custom UVMF test bench.

    To differentiate these custom DPI components in your custom UVMF test bench YAML, you can use unique template tags for input agent ports, output agent ports, and transaction vars in this format:

    %<MATLABFunctionName_INPUT_PORTS_DETAILS>,
    %<MATLABFunctionName_INPUT_TRANSACTION_VARS>,
    %<MATLABFunctionName_OUTPUT_PORTS_DETAILS>,
    %<MATLABFunctionName_OUTPUT_TRANSACTION_VARS>

    Where MATLABFunctionName is the name of the MATLAB function for which you want to generate the DPI component.

    To copy the YAML content corresponding to a custom DPI component, the template tag must be in this format:

    %<MATLABFunctionName_DPI_YAML>

    For an example, see Generate YAML from MATLAB Using Custom Template.

Example: "custom"

Data Types: string

List of name and value pairs defined in template file, specified as a cell array of the name-value pairs.

Each template file defines a template dictionary, which declares template-specific variables. Assign values to these variables as a cell array of variable names followed by values.

The template files expand tokens of the form %<Name> with Value. Names and values must be strings or character arrays.

Data Types: cell array

Template file to generate the UVMF test bench YAML, specified as a character vector, string, or cell array.

Example: "C:/myDirectory/customyamltmplt.svt"

Dependencies

To write this property, set the UVMFTestBenchKind property to "custom". Otherwise, this property is read-only.

Data Types: char | string | cell array

Object Functions

generateYAMLforUVMFTestBenchGenerate YAML for complete UVMF test bench using template engine

Examples

collapse all

This example shows how to create a uvmfTestBenchConfiguration object and integrate two svdpiConfiguration objects for MATLAB functions.

Create uvmfTestBenchConfiguration object for the "default" UVMFTestBenchKind to use built-in UVMF test bench YAML template. Integrate svdpiConfiguration object of componentKind="uvmf-predictor" for a MATLAB function, mode_set_controller, and another svdpiConfiguration object of componentKind="uvmf-sequence" for a MATLAB function, mode_set_controller_test.

pred = svdpiConfiguration("uvmf-predictor"); 
pred.MATLABFunctionName = "mode_set_controller";
seq = svdpiConfiguration("uvmf-sequence"); 
seq.MATLABFunctionName = "mode_set_controller_test"; 
uvmfObject = uvmfTestBenchConfiguration({pred, seq});
generateYAMLforUVMFTestBench(uvmfObject);

Create uvmfTestBenchConfiguration object for the "custom" UVMFTestBenchKind to use custom UVMF test bench YAML template, "custom_uvmf_test_bench.svt". Integrate a single svdpiConfiguration object with componentKind="uvmf-sequence".

seq = svdpiConfiguration("uvmf-sequence"); 
seq.MATLABFunctionName = "chip_controller_test";
uvmfTestBenchKind = "custom";
uvmfObject = uvmfTestBenchConfiguration(uvmfTestBenchKind,{seq});
generateYAMLforUVMFTestBench(uvmfObject);

This example shows how to generate the YAML from MATLAB using a custom template.

Configure the UVMF test bench components that you want to include in the test bench. Create and configure the "uvmf-sequence" component.

seq = svdpiConfiguration("uvmf-sequence");
seq.MATLABFunctionName = "mode_set_controller_test";

Create and configure a "uvmf-custom" component.

custom1 = svdpiConfiguration("uvmf-custom");
custom1.MATLABFunctionName = "mode_custom1";

Create and configure another "uvmf-custom" component.

custom2 = svdpiConfiguration("uvmf-custom");
custom2.MATLABFunctionName = "mode_custom2"

Configure the UVMF test bench by passing the previously created test bench components.

uvmfTestBenchKind = "custom";
uvmfObject = uvmfTestBenchConfiguration(uvmfTestBenchKind, ...
{custom1,seq,custom2});

Assign the custom UVMF test bench template file to the uvmfTestBenchConfiguration object.

uvmfObject.UVMFTestBenchYAMLTemplate = 'myroot/custom_test_bench.svt';

Generate the DPI component files along with the UVMF test bench YAML template.

generateYAMLforUVMFTestBench(uvmfObject);

For this example, you can use these template tags in a custom UVMF test bench YAML template:

%<mode_custom1_INPUT_PORTS_DETAILS>, 
%<mode_custom2_INPUT_PORTS_DETAILS>,
%<mode_custom1_INPUT_TRANSACTION_VARS>, 
%<mode_custom2_INPUT_TRANSACTION_VARS>,
%<mode_custom1_OUTPUT_PORTS_DETAILS>, 
%<mode_custom2_OUTPUT_PORTS_DETAILS>,
%<mode_custom1_OUTPUT_TRANSACTION_VARS>, 
%<mode_custom2_OUTPUT_TRANSACTION_VARS>,
%<mode_custom1_DPI_YAML>,
%<mode_custom2_DPI_YAML>

Tips

This object allows you to integrate the DPI components into the UVMF test bench. The UVMF code generator expects you to pass the DPI compilation flags to compile these DPI components. You can extract the DPI compilation flags by building the "info" target of the makefile that you generate using this object.

For example, use this command to build "info" target of the AbsVal_Blk.mk makefile.

make -f AbsVal_Blk.mk info

This log shows the compilation flags to pass to the UVMF code generator.

The figure highlights the compilation flags (CPPFLAGS).

Version History

Introduced in R2024a