Main Content

Multiplier promotion threshold

Share smaller multipliers with other larger multipliers by using the resource sharing optimization

Model Configuration Pane: Optimization / Resource sharing

Description

To share smaller multipliers with other larger multipliers by using the resource sharing optimization, specify the multiplier promotion threshold. This threshold specifies the maximum word length by which HDL Coder™ promotes a multiplier for sharing with other multipliers. For example, if you have a multiplier whose input word lengths sum to 28 bits and you want to share that multiplier with another multiplier whose input word lengths sum to 34 bits, subtract the total bits from each other, and set the multiplier promotion threshold to at least as large as the difference. In this example, the difference is 6 bits.

Dependencies

To share multipliers in your design:

  • In the Resource Sharing tab, make sure that you select the Multipliers check box.

  • In the HDL Block Properties for the DUT Subsystem, specify the SharingFactor.

Settings

0 (default)
0

No difference in word length between the multipliers, meaning that HDL Coder shares multipliers that have the same word length.

N, where N is an integer greater than 0

Maximum word length by which HDL Coder promotes a multiplier for sharing with other multipliers. If the difference in word lengths is less than or equal to N, HDL Coder promotes and shares multipliers that have different word lengths.

To determine N:

  • Calculate the sum of the input word lengths for the multipliers that you want to share.

  • Set N to be at least as large as the difference between the summation of input word lengths for the different multipliers.

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 MultiplierPromotionThreshold setting when you generate HDL code for the symmetric_fir subsystem inside the sfir_fixed model by using either of these methods:

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

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

    hdlset_param('sfir_fixed','MultiplierPromotionThreshold',8)
    makehdl('sfir_fixed/symmetric_fir')

Recommended Settings

No recommendations.

Programmatic Use

Parameter: MultiplierPromotionThreshold
Type: integer
Value: integer greater than or equal to 0
Default: 0

Version History

Introduced in R2016b