Main Content

General Optimization Parameters

This page describes configuration parameters that reside in the HDL Code Generation > Optimization > General tab of the Configuration Parameters dialog box. Using the parameters in this section, you can optimize your design for HDL code generation.

Transform non zero initial value delay

Settings

Default: On

On

Transform Delay blocks with nonzero Initial condition in your Simulink® model to Delay blocks with zero Initial condition and some additional logic in the generated HDL code.

By using this transformation, HDL Coder™ can perform optimizations such as sharing, distributed pipelining, and clock-rate pipelining more effectively, and prevent an assertion from being triggered in the validation model.

Off

Do not transform Delay blocks with nonzero Initial condition in your Simulink model.

Command-Line Information

Property: TransformNonZeroInitValDelay
Type: character vector
Value: 'on' | 'off'
Default: 'on'

To set this property, use the functions hdlset_param or makehdl. To view the property value, use the function hdlget_param.

For example, you can set the TransformNonZeroInitValDelay property to on when you generate HDL code for the symmetric_fir subsystem inside the sfir_fixed model using either of these methods.

  • Pass the property as an argument to the makehdl function.

    makehdl('sfir_fixed/symmetric_fir', ... 
            'TransformNonZeroInitValDelay','on')
  • When you use hdlset_param, you can set the parameter on the model and then generate HDL code using makehdl.

    hdlset_param('sfir_fixed','TransformNonZeroInitValDelay','on')
    makehdl('sfir_fixed/symmetric_fir')

See Also

makehdl

Remove Unused Ports

Settings

Default: On

On

Removes ports in your design that are unused from the generated HDL code. This optimization preserves unused ports at the top-level DUT subsystem. All other unused ports are removed from the HDL code.

Off

Do not remove unused ports from the HDL code.

Command-Line Information

Property: DeleteUnusedPorts
Type: character vector
Value: 'on' | 'off'
Default: 'on'

To set this property, use the functions hdlset_param or makehdl. To view the property value, use the function hdlget_param.

For example, you can set the DeleteUnusedPorts property to off when you generate HDL code for the symmetric_fir subsystem inside the sfir_fixed model using either of these methods.

  • Pass the property as an argument to the makehdl function.

    makehdl('sfir_fixed/symmetric_fir', ... 
            'DeleteUnusedPorts','off')
  • When you use hdlset_param, you can set the parameter on the model and then generate HDL code using makehdl.

    hdlset_param('sfir_fixed','DeleteUnusedPorts','on')
    makehdl('sfir_fixed/symmetric_fir')

See Also

Balance delays

When you enable certain optimizations such as pipelining or resource sharing, or specify certain block implementations and generate code, HDL Coder introduces pipeline delays along certain signal paths in your model. By default, the delay balancing is on for the model. HDL Coder detects these pipeline delays introduced along one path and then inserts matching delays on other paths. For more information, see Delay Balancing.

To make sure that the generated model after HDL code generation is functionally equivalent to the original Simulink model, leave this setting enabled. If you disable this setting, HDL Coder generates a warning that numerical differences can occur in the validation model. To fix this warning, run the model check Check delay balancing setting.

Compatibility Considerations

It is not recommended to disable delay balancing for your entire model. The delay balancing model option is removed from the HDL Code Generation > Optimization > General tab of the Configuration Parameters dialog box. For recommendations on delay balancing, see Delay Balancing Considerations. You can still enable this option in the MATLAB command-line interface by using hdlset_param or makehdl commands.

Command-Line Information

Property: BalanceDelays
Type: character vector
Value: 'on' | 'off'
Default: 'on'

To set this property, use the functions hdlset_param or makehdl. To view the property value, use the function hdlget_param.

For example, you can enable the BalanceDelays setting when you generate HDL code for the symmetric_fir subsystem inside the sfir_fixed model using either of these methods.

  • Pass the property as an argument to the makehdl function.

    makehdl('sfir_fixed/symmetric_fir', ... 
            'BalanceDelays','on')
  • When you use hdlset_param, you can set the parameter on the model and then generate HDL code using makehdl.

    hdlset_param('sfir_fixed','BalanceDelays','on')
    makehdl('sfir_fixed/symmetric_fir')

See Also