Generate HDL Code from Simulink
Introduction
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
To generate HDL using the default settings, right-click the HDL
Algorithm subsystem, and in the HDL Coder app section
, click the Generate HDL Code
button
. The output log of this operation shows in the
MATLAB® Command Window, along with the location of the generated files.
To change code generation options, use the HDL Code
Generation panes of the Simulink Configuration Parameters dialog box. For guidance through the HDL code
generation process, or to select a target device or synthesis tool, right-click the
HDL Algorithm subsystem, and in the HDL Coder app section
, click the HDL Workflow Advisor button
.
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 the HDL Workflow Advisor tool.
Alternatively, to generate an HDL test bench from the command line, call:
makehdltb([modelname '/HDL Algorithm'])