Speed and Area Optimizations in HDL Coder - MATLAB & Simulink (original) (raw)

Use area and speed optimizations in HDL Coder™ to save resources and improve the timing of your design on the target FPGA device. The optimizations do not change the functional behavior of your algorithm but can optimize certain resources in your design, introduce latency, or cause difference in sample rates.

You can initially generate HDL code and synthesize your design on your FPGA platform without enabling optimizations. If the design does not meet the timing requirements, you can enable the optimizations and rerun the workflow until your design meets the area and speed requirements. See Basic HDL Code Generation Workflow.

Optimizations in MATLAB HDL Code Generation

To enable optimizations on your MATLAB® code, open the Workflow Advisor from MATLAB. In the Advisor, on the task, enable the settings in the tab.

Optimization tab in the HDL Code Generation Task of the HDL Workflow Advisor

You can enable optimizations at the model level and at the block level. Specify model-level optimizations:

Subsystems in your model inherit the model-level optimization settings. You can change the subsystem level settings in the HDL Block Properties dialog box for the subsystems or by using the hdlset_param function. You can also specify certain additional settings for certain blocks in your model such as adding pipelines at the input and output. This table illustrates various optimizations that are available at the block level and model level.

Optimization Model Level? Subsystem Level? Comments
Delay balancing Yes Yes
RAM mapping Yes No
Adaptive pipelining Yes Yes
Clock rate pipelining Yes Yes
Distributed pipelining Yes Yes
Resource sharing Yes Yes At the model level, you specify the type of resources you want to share such as adders and multipliers. At the block level, you specify theSharingFactor.
Streaming No Yes

To see the effect of the optimizations:

Tip

To effectively use optimizations, change the sample time setting forConstant blocks from Inf to-1.

General Optimizations

Your model can have design delays and pipeline delays. Design delays are delays that you manually add to your model.Pipeline delays are delays that are introduced by pipelining settings specified on the blocks, block implementations such as Newton-Raphson method, native floating-point operators, or speed optimizations. You see these delays in the generated HDL code, generated model, and validation model.

General optimization parameters includes:

Speed Optimizations

Speed optimizations improve the timing of your design on the target FPGA by optimizing the critical path. To identify the critical path, you can run theGeneric ASIC/FPGA workflow for your FPGA device and then annotate the critical path or use the timing reports.

To identify the critical path more quickly and speed up the iterative process of finding and optimizing the critical path, use critical path estimation. You do not have to run synthesis or generate HDL code. Critical path estimation uses static timing analysis with timing data from target-specific timing databases. You see the effect of this optimization in the Critical Path Estimation section of the optimization report. See Critical Path Estimation Without Running Synthesis.

Speed optimizations include:

Area Optimizations

Area optimizations reduce resource usage of your design. Optimizing your design for area can reduce the speed at which your design runs on the FPGA.

Area optimizations include:

See Also

makehdl

Topics