Investigate and Resolve Non-Absorbable Latency
HDL Coder™ cannot automatically absorb all introduced latency in certain situations. The Delay Balancing report details any latency that is non absorbable.
You can resolve this latency by modifying the model configuration parameters or by changing the model.
Identify Non-Absorbable Latency
Open the HDL_DUT_LINEAR
subsystem in the nonabsorbableDelayExamples
model.
load_system("nonabsorbableDelayExamples.slx"); open_system("nonabsorbableDelayExamples/HDL_DUT_LINEAR")
You can identify non-absorbable latency in the Delay Balancing section of the Code Generation report. Generate HDL code and the HTML code generation report and review the Code Generation report.
makehdl("nonabsorbableDelayExamples/HDL_DUT_LINEAR")
### Working on the model nonabsorbableDelayExamples ### Generating HDL for nonabsorbableDelayExamples/HDL_DUT_LINEAR ### Using the config set for model nonabsorbableDelayExamples for HDL code generation parameters. ### Running HDL checks on the model 'nonabsorbableDelayExamples'. ### Begin compilation of the model 'nonabsorbableDelayExamples'... ### Working on the model 'nonabsorbableDelayExamples'... ### The code generation and optimization options you have chosen have introduced additional pipeline delays. ### The delay balancing feature has automatically inserted matching delays for compensation. ### The DUT requires an initial pipeline setup latency. Each output port experiences these additional delays. ### Output port 1: 31 cycles. ### Output port 2: 31 cycles. ### Working on... GenerateModel ### Begin model generation 'gm_nonabsorbableDelayExamples'... ### Rendering DUT with optimization related changes (IO, Area, Pipelining)... ### Model generation complete. ### Generated model saved at hdlsrc/nonabsorbableDelayExamples/gm_nonabsorbableDelayExamples.slx ### Delay absorption obstacles can be diagnosed by running this script: hdlsrc/nonabsorbableDelayExamples/highlightDelayAbsorption.m ### To clear highlighting, click the following MATLAB script: hdlsrc/nonabsorbableDelayExamples/clearhighlighting.m ### Begin VHDL Code Generation for 'nonabsorbableDelayExamples'. ### Working on nonabsorbableDelayExamples/HDL_DUT_LINEAR/nfp_add_single as hdlsrc/nonabsorbableDelayExamples/nfp_add_single.vhd. ### Working on nonabsorbableDelayExamples/HDL_DUT_LINEAR/nfp_mul_single as hdlsrc/nonabsorbableDelayExamples/nfp_mul_single.vhd. ### Working on nonabsorbableDelayExamples/HDL_DUT_LINEAR/nfp_recip_single as hdlsrc/nonabsorbableDelayExamples/nfp_recip_single.vhd. ### Working on nonabsorbableDelayExamples/HDL_DUT_LINEAR as hdlsrc/nonabsorbableDelayExamples/HDL_DUT_LINEAR.vhd. ### Generating package file hdlsrc/nonabsorbableDelayExamples/HDL_DUT_LINEAR_pkg.vhd. ### Code Generation for 'nonabsorbableDelayExamples' completed. ### Generating HTML files for code generation report at index.html ### Creating HDL Code Generation Check Report HDL_DUT_LINEAR_report.html ### HDL check for 'nonabsorbableDelayExamples' complete with 0 errors, 0 warnings, and 1 messages. ### HDL code generation complete.
In the left pane, click Delay Balancing.
The HDL_DUT_LINEAR
subsystem contains a DUT with 11 cycles of latency caused by a floating-point Add
block. The floating-point Reciprocal_recip
block is a latency absorption blocker, so the 11 cycles of latency introduced before it are non absorbable.
Resolve the Non-Absorbable Latency
You can absorb the non-absorbable latency by changing your model configuration parameters or by changing the model to remove the Reciprocal_recip
block.
Resolve Non-Absorbable Latency by Using the Model Configuration Parameters
To allow latency absorption across latency absorption blockers, set the Pipeline Distribution Priority model configuration parameter to Performance
. Note that this can lead to validation model mismatches during initialization cycles.
makehdl("nonabsorbableDelayExamples/HDL_DUT_LINEAR",'PipelineDistributionPriority','Performance');
### Working on the model nonabsorbableDelayExamples ### Generating HDL for nonabsorbableDelayExamples/HDL_DUT_LINEAR ### Using the config set for model nonabsorbableDelayExamples for HDL code generation parameters. ### Running HDL checks on the model 'nonabsorbableDelayExamples'. ### Begin compilation of the model 'nonabsorbableDelayExamples'... ### Working on the model 'nonabsorbableDelayExamples'... ### The code generation and optimization options you have chosen have introduced additional pipeline delays. ### The delay balancing feature has automatically inserted matching delays for compensation. ### The DUT requires an initial pipeline setup latency. Each output port experiences these additional delays. ### Output port 1: 31 cycles. ### Output port 2: 31 cycles. ### Working on... GenerateModel ### Begin model generation 'gm_nonabsorbableDelayExamples'... ### Rendering DUT with optimization related changes (IO, Area, Pipelining)... ### Model generation complete. ### Generated model saved at hdlsrc/nonabsorbableDelayExamples/gm_nonabsorbableDelayExamples.slx ### Begin VHDL Code Generation for 'nonabsorbableDelayExamples'. ### Working on nonabsorbableDelayExamples/HDL_DUT_LINEAR/nfp_add_single as hdlsrc/nonabsorbableDelayExamples/nfp_add_single.vhd. ### Working on nonabsorbableDelayExamples/HDL_DUT_LINEAR/nfp_mul_single as hdlsrc/nonabsorbableDelayExamples/nfp_mul_single.vhd. ### Working on nonabsorbableDelayExamples/HDL_DUT_LINEAR/nfp_recip_single as hdlsrc/nonabsorbableDelayExamples/nfp_recip_single.vhd. ### Working on nonabsorbableDelayExamples/HDL_DUT_LINEAR as hdlsrc/nonabsorbableDelayExamples/HDL_DUT_LINEAR.vhd. ### Generating package file hdlsrc/nonabsorbableDelayExamples/HDL_DUT_LINEAR_pkg.vhd. ### Code Generation for 'nonabsorbableDelayExamples' completed. ### Generating HTML files for code generation report at index.html ### Creating HDL Code Generation Check Report HDL_DUT_LINEAR_report.html ### HDL check for 'nonabsorbableDelayExamples' complete with 0 errors, 0 warnings, and 0 messages. ### HDL code generation complete.
The Delay Balancing section of the Code Generation report now shows that design delays are fully utilized.
close_system("nonabsorbableDelayExamples/HDL_DUT_LINEAR");
Resolve Non-Absorbable Latency by Modifying Your Design
Alternatively, you can modify the subsystem to resolve non-absorbable latency.
The following subsystem is configured as a black box interface. For more information on implementing black box interfaces in HDL Coder, see hdl.BlackBox
. When you generate HDL code and an HTML code generation report by using the following commands:
open_system("nonabsorbableDelayExamples/HDL_DUT_BLACKBOX"); makehdl("nonabsorbableDelayExamples/HDL_DUT_BLACKBOX",'PipelineDistributionPriority','Numerical Integrity')
You receive an error:
Error using slhdlcoder.HDLCoder/reporterrors For the block "nonabsorbableDelayExamples/HDL_DUT_BLACKBOX/Add" Delay balancing unsuccessful. Cause: An extra 11 cycles of latency introduced by optimizations in the feedback loop cannot be offset using design delays for the loop latency budget. If you are modeling at data rate (high-level description of algorithm without hardware implementation details), refer to the clock-rate pipelining report for more details. If you are modeling at clock rate, consider increasing the latency budget by adding more design delays in the feedback loop. Refer to the delay balancing report for more details. Offending block: nonabsorbableDelayExamples/HDL_DUT_BLACKBOX/Add Error in slhdlcoder.HDLCoder/reportMessages Error in slhdlcoder.HDLCoder/runPIRTransformAndCodegen Error in slhdlcoder.HDLCoder/makehdl Error in privmakehdl Error in makehdl (line 66) privmakehdl(varargin{:}) ^^^^^^^^^^^^^^^^^^^^^^^^
Tthe subsystem is configured as a black box interace, so the 11 cycles of latency introduced before it are non absorbable.
If you move the delays in front of the black box subsystem, the introduced latency is absorbed before the subsystem blocks the delay absorption. The HDL_DUT_BLACKBOX_FIXED
subsystem shows this fix. When you generate HDL code for this updated susbsystem, the Delay Balancing section of the Code Generation report shows that design delays are fully-utilized to absorb latency.
open_system("nonabsorbableDelayExamples/HDL_DUT_BLACKBOX_FIXED") makehdl("nonabsorbableDelayExamples/HDL_DUT_BLACKBOX_FIXED",'PipelineDistributionPriority','Numerical Integrity')
### Working on the model nonabsorbableDelayExamples ### Generating HDL for nonabsorbableDelayExamples/HDL_DUT_BLACKBOX_FIXED ### Using the config set for model nonabsorbableDelayExamples for HDL code generation parameters. ### Running HDL checks on the model 'nonabsorbableDelayExamples'. ### Begin compilation of the model 'nonabsorbableDelayExamples'... ### Working on the model 'nonabsorbableDelayExamples'... ### Working on... GenerateModel ### Begin model generation 'gm_nonabsorbableDelayExamples'... ### Rendering DUT with optimization related changes (IO, Area, Pipelining)... ### Model generation complete. ### Generated model saved at hdlsrc/nonabsorbableDelayExamples/gm_nonabsorbableDelayExamples.slx ### Begin VHDL Code Generation for 'nonabsorbableDelayExamples'. ### Working on nonabsorbableDelayExamples/HDL_DUT_BLACKBOX_FIXED/nfp_add_single as hdlsrc/nonabsorbableDelayExamples/nfp_add_single.vhd. ### Working on nonabsorbableDelayExamples/HDL_DUT_BLACKBOX_FIXED as hdlsrc/nonabsorbableDelayExamples/HDL_DUT_BLACKBOX_FIXED.vhd. ### Generating package file hdlsrc/nonabsorbableDelayExamples/HDL_DUT_BLACKBOX_FIXED_pkg.vhd. ### Code Generation for 'nonabsorbableDelayExamples' completed. ### Generating HTML files for code generation report at index.html ### Creating HDL Code Generation Check Report HDL_DUT_BLACKBOX_FIXED_report.html ### HDL check for 'nonabsorbableDelayExamples' complete with 0 errors, 0 warnings, and 0 messages. ### HDL code generation complete.
close_system("nonabsorbableDelayExamples/HDL_DUT_BLACKBOX_FIXED");