Maximum Computation Latency

What Is Maximum Computation Latency?

The Max computation latency parameter enables you to specify a time budget for HDL Coder™ when performing a single computation. Within this time budget, HDL Coder does its best to optimize your design without exceeding the Max oversampling ratio.

When you set a Max computation latency, N, each Simulink® time step takes N time steps in the implemented design.

The following table shows the possible values for the maximum computation latency and their effect on the design implementation.

Max computation latency value, NDescription
N = 1 (default) or N < 1
  • Design implementation captures the DUT inputs every clock cycle.

  • If maximum oversampling ratio is set to 1, most area optimizations are not possible.

  • If maximum oversampling ratio is greater than 1, coder implements optimizations with local overclocking.

N > 1
  • Design implementation captures the DUT inputs once every N clock cycles, starting with first cycle after reset. DUT outputs are held stable for N cycles.

  • Coder can perform optimizations without oversampling.

  • You cannot set the maximum computation latency to Inf.

Specify Maximum Computation Latency

Using Configuration Parameters Dialog Box

In the Configuration Parameters dialog box, you can specify the maximum computation latency:

  1. In HDL Code Generation > Global Settings, click the Optimization tab.

  2. For Max computation latency, enter the number of cycles HDL Coder can use to implement a computation.

Using HDL Workflow Advisor

In the HDL Workflow Advisor, you can specify the maximum oversampling ratio:

  1. In the HDL Code Generation > Set Code Generation Options > Set Advanced Options task, click the Optimization tab.

  2. For Max computation latency, enter the number of cycles HDL Coder can use to implement a computation.

On the Command Line

On the command line, set the MaxComputationLatency property using makehdl or hdlset_param.

For example, if you know the inputs change at most every 1000 cycles for your DUT subsystem, dut, in your model, mymodel, enter:

hdlset_param ('myModel/dut', 'MaxComputationLatency', 1000)

Maximum Computation Latency Restrictions

The maximum computation latency feature has the following restrictions:

  • You cannot set the maximum computation latency to Inf.

Was this topic helpful?