Resource Sharing of Multiply-Add and Other Blocks

This section contains parameters in the HDL Code Generation > Optimization > Resource sharing tab of the Configuration Parameters dialog box. Enable these parameters to save resources on the target device by specifying whether to share Multiply-Add blocks, atomic subsystems, and MATLAB Function blocks in your design.

Share Multiply-Add blocks

Share Multiply-Add blocks with the resource sharing optimization.

Settings

Default: On

On

When resource sharing is enabled, share Multiply-Add blocks with a bit width greater than or equal to Multiply-Add block sharing minimum bitwidth.

Off

Do not share Multiply-Add blocks.

Dependency

  • To share Multiply-Add blocks in your design, in the HDL Block Properties for the DUT Subsystem, specify the SharingFactor.

  • When you specify the Multiply-Add block sharing minimum bitwidth, the code generator shares Multiply-Add blocks that have a bit width greater than or equal to the minimum bit width. The default minimum bit width for sharing Multiply-Add blocks is zero.

Command-Line Information

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

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

For example, you can use the ShareMultiplyAdds 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', ... 
            'ShareMultiplyAdds','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','ShareMultiplyAdds','on')
    makehdl('sfir_fixed/symmetric_fir')

See Also

Multiply-Add block sharing minimum bitwidth

Use this parameter to specify the minimum bit width that is required to share Multiply-Add with the resource sharing optimization.

Settings

Default: 0

0, 1

No minimum bit width for shared Multiply-Add blocks.

N, where N is an integer greater than 1

When resource sharing and Multiply-Add block sharing are enabled, share Multiply-Add blocks with a bit width greater than or equal to N.

Dependency

To share Multiply-Add blocks in your design:

  • In the Resource Sharing tab, make sure that the Multiply-Add blocks check box is selected.

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

Command-Line Information

Property: MultiplierAddSharingMinimumBitwidth
Type: integer
Value: integer greater than or equal to 0
Default: 0

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

For example, you can use the MultiplierAddSharingMinimumBitwidth 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', ... 
            'MultiplierAddSharingMinimumBitwidth',16)
  • When you use hdlset_param, you can set the parameter on the model and then generate HDL code using makehdl.

    hdlset_param('sfir_fixed',MultiplierAddSharingMinimumBitwidth',16)
    makehdl('sfir_fixed/symmetric_fir')

See Also

Share Atomic subsystems

Share atomic subsystems with the resource sharing optimization.

Settings

Default: On

On

When resource sharing is enabled, share atomic subsystems.

Off

Do not share atomic subsystems.

Dependency

To share Atomic Subsystem blocks in your design, in the HDL Block Properties for the parent DUT Subsystem, specify the SharingFactor.

Command-Line Information

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

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

For example, you can use the ShareMultiplyAdds 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', ... 
            'ShareAtomicSubsystems','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','ShareAtomicSubsystems','on')
    makehdl('sfir_fixed/symmetric_fir')

See Also

Share MATLAB Function blocks

Share MATLAB Function blocks with the resource sharing optimization.

Settings

Default: On

On

When resource sharing is enabled, share MATLAB Function blocks.

Off

Do not share MATLAB Function blocks.

Dependency

To share MATLAB Function blocks in your design, in the HDL Block Properties for the parent DUT Subsystem, specify the SharingFactor.

Command-Line Information

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

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

For example, you can use the ShareMATLABBlocks 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', ... 
            'ShareMATLABBlocks','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','ShareMATLABBlocks','on')
    makehdl('sfir_fixed/symmetric_fir')

See Also