Documentation

DPI-C Generation for Simulink Subsystem

Generate SystemVerilog DPI-C component from Simulink® subsystem

You can use a DPI-C component generated from a Simulink subsystem in two ways :

  • Export SystemVerilog DPI-C Component — You can integrate this component into your HDL simulation as a behavioral model. The component generator supports test points and tunable parameters. You can also generate a SystemVerilog test bench that verifies the generated DPI-C component against data vectors from your subsystem. See Generate SystemVerilog DPI-C Component.

  • Generate SystemVerilog DPI-C Test Bench (with HDL Coder™) — Use this test bench to verify your generated HDL code using C code generated from your entire Simulink model, including the DUT and data sources. See Verify HDL Design With Large Data Set Using SystemVerilog DPI Test Bench (HDL Coder).

See DPI-C Component Generation with Simulink. You must have a Simulink Coder™ license to use this feature.

Topics

Generate and Verify a DPI-C Component

DPI-C Component Generation with Simulink

If you have a Simulink Coder license, you can generate SystemVerilog DPI-C components using one of two methods.

SystemVerilog DPI-C Test Benches

Choose between the two types of SVDPI-C test benches.

Generate SystemVerilog DPI-C Component

How to generate a SystemVerilog DPI-C component

Use Generated DPI-C Functions in SystemVerilog

How to export the generated DPI-C component to a SystemVerilog environment

Verify Generated Component Against Simulink Data

Start ModelSim® or Questa®Sim in GUI mode.

Advanced DPI-C Options

Generate Cross-Platform DPI-C Components

Generate a DPI-C component for an operating system different from your MATLAB® host machine.

Customize Generated SystemVerilog Code

Describes how to customize the generated SystemVerilog code

Tune Gain Parameter During Simulation

Generate a DPI-C component that provides tunable access to a parameter.

SystemVerilog DPI-C Component Test Point Access

You can designate internal signals in your model as test points and configure the SystemVerilog DPI-C generator to create one or more access functions.

Verify Generated HDL Code with SystemVerilog DPI Test Bench (requires HDL Coder license)

Verify HDL Design With Large Data Set Using SystemVerilog DPI Test Bench (HDL Coder)

This example shows how to use SystemVerilog DPI test bench for verification of HDL code where a large data set is required.

Generate Test Bench and Enable Code Coverage Using the HDL Workflow Advisor (HDL Coder)

How to generate test bench and code coverage for your HDL code using the HDL Workflow Advisor

Was this topic helpful?