Main Content

RAM mapping threshold

Specify the minimum RAM size for mapping to block RAMs

Model Configuration Pane: Optimization / General

Description

Specify the minimum RAM size for mapping to block RAMs. HDL Coder™ determines whether to use registers or RAM resources on the FPGA by comparing the RAM size of your design with the RAM mapping threshold that you specify.

You can specify the RAM mapping threshold by using either:

  • A single integer to map any delay or persistent array greater than the threshold bit size to RAM.

  • A string of format MxN that specifies two thresholds where M is the delay length (for delays) or array size (for persistent array variables) and N is the word length or bit width of the data type. Setting both thresholds excludes delays or persistent arrays that inefficiently map to block RAM on your target hardware. For more information, see Use the RAM Mapping Threshold.

Settings

256 (default)

The RAM mapping threshold must be:

  • An integer greater than or equal to zero.

  • A string that has the format MxN, where M is the delay length or array size and N is the word length.

HDL Coder uses the threshold to determine whether or not to map the following elements to block RAMs instead of to registers:

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 set the RAMMappingThreshold to 1024 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', ... 
            RAMMappingThreshold=1024)
  • When you use hdlset_param, you can set the parameter on the model and then generate HDL code using makehdl.

    hdlset_param('sfir_fixed',RAMMappingThreshold=1024)
    makehdl('sfir_fixed/symmetric_fir')

For example, you can set the RAMMappingThreshold to a delay length of 500 cycles and a word length of 50 bits, "500x50", 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', ... 
            RAMMappingThreshold="500x50")
  • When you use hdlset_param, you can set the parameter on the model and then generate HDL code using makehdl.

    hdlset_param('sfir_fixed', RAMMappingThreshold="500x50");
    makehdl('sfir_fixed/symmetric_fir')

Recommended Settings

No recommendations.

Programmatic Use

Parameter: RAMMappingThreshold
Type: integer, string
Value: integer greater than or equal to 0, string of MxN format
Default: 256

Version History

Introduced in R2012b