Main Content

Treat Simulink rates as actual hardware rates

Oversampling value based on model rates

Since R2023b

Model Configuration Pane: Global Settings

Description

Use this parameter to let HDL Coder™ automatically set an oversampling value based on your Simulink® model rates and the Target Frequency (MHz) parameter value during HDL code generation.

When you select this parameter, you can make changes to your design data and clock rates without manually calculating and updating the oversampling value. For example, select this parameter if you have complex feedback loops with multiple optimizations enabled for your model and you want the fastest data rate possible while allowing the optimizations to perform.

Dependencies

You must set the Target Frequency (MHz) parameter to a target clock rate greater than 0 to select Treat Simulink rates as actual hardware rates.

Settings

off (default) | on

Default: Off

on

Treat Simulink rates as actual hardware rates and let HDL Coder set an oversampling value automatically. Express your data rate in terms of Simulink model rates and clock rate in terms of the Target Frequency (MHz) parameter. HDL Coder automatically sets an oversampling value based on your data and clock rates during HDL code generation. When you select Treat Simulink rates as actual hardware rates, you cannot change the Oversampling factor parameter.

off

Do not treat Simulink rates as actual hardware rates. You can use the Oversampling factor parameter to manually specify the oversampling value.

Tips

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 use the TreatRatesAsHardwareRates 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', ... 
            'TreatRatesAsHardwareRates','on')
  • Enable the parameter on the model by using hdlset_param, and then generate HDL code by using makehdl.

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

Recommended Settings

No recommended settings.

Programmatic Use

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

Version History

Introduced in R2023b