Find Feedback Loops

Feedback loops in your Simulink® design can inhibit delay balancing and optimizations such as resource sharing and streaming.

To find feedback loops in your design that are inhibiting optimizations, you can generate and run a MATLAB® script that highlights one or more feedback loops in your original model and the generated model. When you run the script, different feedback loops are highlighted in different colors. The feedback loop highlighting script is saved in the same target folder as the HDL code.

After you generate code, if feedback loops are inhibiting optimizations, the command window shows a link that you can click to highlight feedback loops. If you generate an Optimization Report, the report also contains a link you can click to highlight feedback loops.

The script can highlight feedback loops that are inhibiting the following optimizations:

  • Resource sharing

  • Streaming

  • MATLAB variable pipelining

  • Delay balancing

Using the HDL Workflow Advisor

In the HDL Code Generation > Set Code Generation Options > Set Advanced Options > Diagnostics tab, select Highlight feedback loops inhibiting delay balancing and optimizations.

To customize the script name, enter a file name in the Feedback loop highlighting script file name field.

Using the Configuration Parameters Dialog Box

In the HDL Code Generation > Global Settings > Diagnostics tab, select Highlight feedback loops inhibiting delay balancing and optimizations.

To customize the script name, enter a file name in the Feedback loop highlighting script file name field.

Using the Command Line

To generate a feedback loop highlighting script programmatically, use the HighlightFeedbackLoops and HighlightFeedbackLoopsFile properties with makehdl or hdlset_param.

For example:

  • To generate a feedback loop highlight script for a model, myModel, enter:

    hdlset_param ('myModel', 'HighlightFeedbackLoops', 'on');

  • To generate a feedback loop highlighting script with the file name, myHighlightScript, for a model, myModel, enter:

    hdlset_param ('myModel', 'HighlightFeedbackLoops', 'on');
    hdlset_param ('myModel', 'HighlightFeedbackLoopsFile', 'myHighlightScript');

Remove Highlighting

To turn off highlighting, in Simulink, select Display > Remove Highlighting.

Limitations

Feedback loop highlighting cannot highlight blocks that have names that contain a single quote (').

See Also

|

More About

Was this topic helpful?