Main Content

Generate HDL Code

You can generate HDL code from subsystems that include blocks supported for HDL code generation, such as the model in Verify Turbo Decoder with Streaming Data from MATLAB. In that example, you can generate HDL code from the HDL Algorithm subsystem.

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

Prepare Model

Run hdlsetup (HDL Coder) to configure the model for HDL code generation. If you started your design using the Wireless HDL Toolbox™ Simulink® model template, your model is already configured for HDL code generation.

Generate HDL Code

Right-click the HDL Algorithm subsystem, and select HDL Code > Generate HDL for 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 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 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 the Simulink Configuration Parameters dialog box or in the HDL Workflow Advisor.

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

makehdltb([modelname '/HDL Algorithm'])

See Also

Functions

Related Topics