Set HDL Code Generation Options
You can configure HDL code generation settings in Simulink® through the HDL Code tab in the Simulink toolstrip, the Configuration Parameters dialog box, block context menu, or block-specific properties dialog box. While some settings are shared across these workflows, some apply only to specific modeling element, such as an individual Simulink block or subsystem.
HDL Code Tab in Simulink Toolstrip
The Simulink Toolstrip contains contextual tabs that appear only when you need to access them. To access the HDL Code tab, open the HDL Coder app from the Apps tab on the Simulink Toolstrip.

The HDL Code tab provides shortcuts to the HDL code generation options. You can also use this tab to initiate code generation.
Options include:
Workflow Advisor: Open the HDL Workflow Advisor.
HDL Block Properties: Open the HDL-compatible block library in the Simulink Library Browser or open the HDL Block Properties dialog box for a block that you select in your model.
Note
After you open the HDL-compatible block library, to restore the Library Browser to the default view, in the Library Browser, click the
button.HDL Code Advisor: Open the HDL Code Advisor for the model or the selected Subsystem.
Settings: Open the HDL Code Generation pane in the Configuration Parameters dialog box.
Report Options: Open the HDL Code Generation > Report pane.
Remove HDL Configuration from Model: The HDL configuration component is internal data that HDL Coder™ creates and attaches to a model. This component lets you view the HDL Code Generation pane in the Configurations Parameters dialog box, and use the HDL Code Generation pane to set HDL code generation options. To remove the HDL configuration component from a model, select this option. For more information, see Add or Remove the HDL Configuration Component.
Code for: Select the top-level Subsystem or model for which you want to generate HDL code. This option corresponds to the Generate HDL for option in the HDL Code Generation pane of the Configuration Parameters dialog box.
Generate HDL Code: Initiate HDL code generation; equivalent to the Generate HDL Code check box in the HDL Code Generation > Global Settings > Advanced tab of the Configuration Parameters dialog box.
Navigate to Code: Select a block in your model and navigate to the HDL code generated for that block. To use this setting, you must have generated a traceability report.
Open Report: Opens the Code Generation Report if this report exists on the path. Otherwise, this button opens the HDL Check Report.
Generate Testbench: Initiate test bench code generation; equivalent to the Generate Test Bench button in the Configuration Parameters dialog box. To use this button, you must select a subsystem. If you do not select a subsystem in the Code for menu, the Generate Testbench menu option is not available.
If you have HDL Verifier™ installed, you can generate a HDL cosimulation model or a SystemVerilog DPI component.
Share: Generate a protected model that you can share with a third party without revealing the intellectual property of the model.
HDL Code Generation Options in the Configuration Parameters Dialog Box
This image shows the top-level HDL Code Generation pane in the Configuration Parameters dialog box. To open this dialog box, in the Apps gallery, click HDL Coder. The HDL Code tab appears. In the Prepare section, click Settings.

HDL Code Options in Block Context Menu
When you right-click a block, a subsystem, or a model element that HDL Coder supports, the context menu appears. To add HDL Coder app options to the context menu, point to Select Apps and click HDL Coder. The code generator enables items in the HDL Coder app section based on the following:
Block type: For subsystems, the menu enables options specific to subsystems.
Code and traceability status: Options are enabled only when HDL code and traceability information have been generated for the block or subsystem.
Note
You can also access these options from the HDL Code tab in the Simulink Toolstrip. To access this tab, open the HDL Coder app from the Apps tab.
This image shows the HDL Coder app section in the Simulink Context menu for a subsystem.

The table lists the buttons and options available in the HDL Coder app section:
| Button / Option | Action | Availability |
|---|---|---|
HDL Block Properties | Opens the HDL Block Properties dialog box for the block or subsystem. See Set and View HDL Model and Block Parameters. | Available for blocks or subsystems. |
Generate HDL Code | Depending on the selection in the Output section of the HDL Code tab in the HDL Coder app, this button generates either HDL code or an IP core:
| Available only for subsystems. |
Settings | Opens HDL Coder configuration parameter settings. | Available for blocks or subsystems. |
Navigate to Code | Navigates to the generated HDL code. For more information, see Navigate Between Simulink Model and HDL Code by Using Traceability. | Enabled when both code and a traceability report have been generated for the block or subsystem. |
Open Report | Opens the HDL Code generation report options. | Available for blocks or subsystems |
HDL Workflow Advisor | Opens the HDL Workflow Advisor for the subsystem. | Available only for subsystems. |
HDL Block Properties Dialog Box
HDL Coder provides selectable alternate block implementations for many block types. Each implementation is optimized for different characteristics, such as speed or chip area. The HDL Properties dialog box lets you choose the implementation for a selected block.
Most block implementations support a number of implementation parameters that let you control further details of code generation for the block. The HDL Properties dialog box lets you set implementation parameters for a block.
This image shows the HDL Properties dialog box for a block.

There are a number of ways to specify implementations and implementation parameters for individual blocks or groups of blocks. See Set and View HDL Model and Block Parameters.