Contenu principal

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

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 the Simulink Configuration Parameters dialog box or in the HDL Workflow Advisor tool.

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

makehdltb([modelname '/HDL Algorithm'])

See Also

Functions

Topics