Tackle Over-fitting in FPGA designs


Tackle Over-fitting in FPGA designs

Tired of seeing over-fitting or resource utilization error messages like these?

Error (170011): Design contains 873586 blocks of type combinational node. However, the device contains only 854400 blocks.
Error (170048): Selected device has 2713 RAM location(s) of type M20K block. However, the current design needs more than 2713 to successfully fit
ERROR: [DRC UTLZ-1] Resource utilization: LUT as Logic over-utilized in Top Level Design (This design requires more LUT as Logic cells than are available in the target device. This design requires 11827 of such cell types but only 10400 compatible sites are available in the target device.
Error:  Number of 4LUT modules (24289) exceeds the limit (6060) of the selected device.

These are typical over-fitting or resource utilization error messages from Quartus, Vivado and Libero.

New over-fitting feature

The latest over-fitting mitigation feature in InTime can help you select the right Synthesis & Fitter parameters to mitigate these issues.

Mitigations for over-fitting were already present in earlier versions of InTime. This was based on heuristics and rules of thumb derived from existing FPGA vendor literature. In the latest version, InTime now detects correlations between builds that are failing due to over-fitting with specific settings combinations.

For example, it can discern that setting A is correlated to overfitting error X. Therefore, the over-fitting mitigation feature will kick in and flag this setting as well as its value. This prevents setting A from using this value again for this project in future.

How to enable over-fitting adjustments?

Over-fitting adjustments only apply to the InTime Default recipe.

Automatic Detection

Over-fitting detection is an automatic process and is based on two rules; The first is that the reported utilization build has to be more than *100%. The other rule is based on the error messages, which is predefined in InTime.

For any job, adjustments will kick in automatically whenever more than *30% of the parent job's results have over-fitted. (*value is customizable.)

For example, if Job 100 has 20 results and 6 results have over-fitted (30% of 20 results), over-fitting adjustments will automatically take effect for Job 101.

Example of a job showing over-fitted LABs or RAM
Example: A job with more than 30% overfitted results

Manual Switch

The other way is to enable it manually. This may be preferable for scenarios where there is ample slack and we are trying to squeeze that last few % points from the device. To do so, at the Tcl console, simply use the command below to force the overfitting to kick in.

> misc overfit -force

To reset it, run

> misc overfit -reset

To know more about the commands, please refer to the InTime Documentation guide.

What does it do?

Once the above condition is detected, InTime may uncover one or more settings and/or combinations of settings and values that have a high probability of causing over-fitting errors in the design. Then, InTime will exclude such combinations in the strategies for subsequent jobs.

For example, the chart below shows how two settings compare with each other across 144 builds.

Notice that there are zero passing results when the value is "Off" for Auto_Clock_Enable

Every value of "ADV_NETLIST_OPT_SYNTH_WYSIWYG_REMAP" was present in all 144 builds. However, no build compiled successfully when "AUTO_CLOCK_ENABLE_RECOGNITION" was "Off".

This simple plot shows that the probability of over-fitting when "AUTO_CLOCK_ENABLE_RECOGNITION" = "Off" is extremely high (in this dataset). This value should be avoided as the design over-fits every time it is used!

This is a straightforward case for just 1 setting value. It gets complicated when we consider combinations of settings, e.g. Setting A with setting B.

Finally, besides excluding these settings, InTime selects from a pool of curated settings which are known to provide better resource utilization. Dynamically, InTime also analyzes combinations of setting values with high correlation to over-fitting.

How to know if over-fitting is enabled?

Strategies with over-fitting adjustments have a "ovr_" prefix in their names like the ones shown below.

Strategy names with over-fitting prefixes
Strategy names with "ovr" prefixes

You can also see certain messages in the InTime session log such as

SUCCESS   : Setting RETIMING:SYNTH_DESIGN:0 trimmed for overfitting.

Last but not least, note that certain settings and values will affect the timing performance. In such designs, high utilization can easily cause bad placements and other errors, affecting the overall results. However, if your design has ample timing margin, this feature can help avoid undesirable settings and achieve shorter turnaround time and better results.

To find out more, register here to download an evaluation copy of InTime.

Leave a Reply