Main Content

Pipelining MATLAB Code

Pipelining helps achieve a higher maximum clock rate by inserting registers at strategic points in the hardware to break the critical path. However, the higher clock rate comes at the expense of increased chip area and increased initial latency.

Port Registers

Input and output port registers for modules help partition a larger design so the critical path does not extend across module boundaries. Having a port register at each input and output port is a good design practice for synchronous interfaces. Distributed pipelining does not affect port registers. To insert input or output port registers:

  1. In the HDL Workflow Advisor, select the HDL Code Generation task and select the Optimizations tab.

  2. Enable Register inputs, Register outputs, or both.

Input and Output Pipeline Registers

You can insert multiple input and output pipeline stages. Distributed pipelining can move these input and output pipeline registers to help reduce your critical path within the module. If you insert input and output pipeline stages without applying distributed pipelining, the registers stay at the DUT inputs and outputs.

To insert input or output pipeline register stages:

  1. In the HDL Workflow Advisor, select the HDL Code Generation task and select the Optimizations tab.

  2. For Input pipelining, Output pipelining, or both, enter the number of pipeline register stages.

Operation Pipelining

Operation pipelining inserts one or more registers at the output of a specific expression in your MATLAB® code. If you know a specific expression is part of the critical path, you can add a pipeline register at its output to reduce your critical path.

To learn how to insert a pipeline register at the output of a MATLAB expression, see Pipeline MATLAB Expressions.