Main Content

Generate HDL Code From Simulink


This page shows you how to generate HDL code from the design described in Design Video Processing Algorithms for HDL in Simulink. You can generate HDL code from the HDL Algorithm subsystem in the model.

To generate HDL code, you must have an HDL Coder™ license.

Prepare Model

Run the visionhdlsetup function to configure the model for HDL code generation. If you started your design using the Vision HDL Toolbox™ Simulink® model template, your model is already configured for HDL code generation.

Generate HDL Code

Right-click the HDL Algorithm block, and select HDL Code > Generate HDL from subsystem to generate HDL using the default settings. The output log of this operation is shown in the MATLAB® Command Window, along with the location of the generated files.

To change code generation options, use the HDL Code Generation section of Simulink Configuration Parameters. For guidance through the HDL code generation process, or to select a target device or synthesis tool, right-click on the HDL Algorithm block, and select HDL Code > HDL Workflow Advisor.

Alternatively, from the MATLAB Command Window, you can call:

makehdl([modelname '/HDL Algorithm'])

Generate HDL Test Bench

You can select options to generate a test bench in Simulink Configuration Parameters or in HDL Workflow Advisor.

Alternatively, to generate an HDL test bench from the command line, call:

makehdltb([modelname '/HDL Algorithm'])

See Also


Related Topics