MATLAB Examples

Strategy 4: Use Custom Latency

You can use the Latency Strategy for various blocks to specify a custom latency value and absorb the additional delays. Using this strategy can optimize your design for trade-offs between:

  • Clock frequency and power consumption.
  • Oversmapling factor and sampling frequency.

To learn more about the trade-offs and blocks for which you can specify a custom latency, see LatencyStrategy.

Note: When you use the custom latency strategy, make sure that the Subsystem that contains the block for which native floating-point is unable to allocate delays is not a conditional subsystem. That is, the Subsystem must not contain trigger, reset, or enable ports.

To see how using a custom latency can resolve the delay allocation issue, open the model RunningSum_Custom.slx.

The model is similar to the original RunningSum model but does not have the Enable block. Using the Enable block can prevent the custom latency strategy from absorbing delays. Specify a custom latency of one for the Add block. The Add block can then absorb the Unit Delay adjacent to the Add block.

You can now generate HDL code for the CumSum_sl subsystem.