Main Content

Balance delays

Ensures that the generated model after HDL code generation is functionally equivalent to the original Simulink model

Since R2020b

Model Configuration Pane: Optimization / General

Description

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.

Settings

On (default) | Off
On

To make sure that the generated model after HDL code generation is functionally equivalent to the original Simulink model, leave this setting enabled.

Off

If you disable this setting, HDL Coder generates a warning that numerical differences can occur in the validation model.

Tips

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.

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')

Recommended Settings

No recommendations.

Programmatic Use

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

Version History

Introduced in R2020b