Detecting and Fixing Timing Problems

Introduction

The build process automatically starts a timing analysis of the entire FPGA application including the framework for the used platform. In the MATLAB Command Window, the build process outputs links to the results of the analysis.

Depending on your preferences and the build FPGA model, click one of the following links to the results of the timing analysis:

  • Show Timing Report of complete FPGA:

    Opens the Vivado Timing Analyzer to show the results. The Vivado Timing Analyzer shows only the signal paths that are modeled with the HDL library of the AMD Vitis Model Composer. The Vivado Timing Analyzer does not show signal paths that are modeled with Simulink blocks.

  • dSPACE Timing Analyzer:

    Opens the dSPACE Timing Analyzer to show FPGA timing failures independently of the used blockset, including FPGA subsystems based on Simulink blocks (HDL coder subsystems). For more information, refer to Features of the dSPACE Timing Analyzer.


dSPACE Timing Analyzer

The dSPACE Timing Analyzer has the following elements.

Element

Name

Description

1

Status

Shows the result of the timing analysis:

  • Green: Timing passed.

  • Red: Timing failed.

2

Signal paths table

Shows the most critical FPGA signal paths of the built FPGA application:

  • Slack: Timing reserve of the signal paths. Negative values indicate the lack of time.

  • Source: Block at the starting point of the timing path.

  • Destination: Block at the end point of the timing path.

If the Source and Destination blocks of the signal path are <…>/FPGA_SETUP_BL1, the path is in the dSPACE framework. Paths with little slack can be located there. However, the framework should not generate timing errors (Slack < 0 ns) below 70% FPGA utilization.

3

Details pane

Details on the selected path in the signal paths table.

  • Slack: Timing reserve of the signal paths. Negative values indicate the lack of time.

  • Requirement: Maximum possible delay of the signal path.

  • Delay: Sum of logic delay and routing delay.

  • Logic Delay: Delay caused by the block logic.

  • Route Delay: Delay caused by routing of the signal in the FPGA.

4

Path tab

Details on the blocks of the selected signal path.

  • Parent Subsystem: Path to the subsystem that includes all blocks of the selected signal path.

  • Delay: Logic and routing delay of a block in the FPGA model.

  • Block: Path to the block in the FPGA model relative to the parent subsystem.

Tip

Double-click a block to highlight the block in the FPGA model.

5

Report tab

Detailed timing report on the selected signal path.


Vivado Timing Analyzer

The timing analyzer shows the timing paths. The timing analyzer starts with the slowest timing path.

The table shows the 50 signal paths where timing is tightest. To avoid timing errors, you must ensure that the timing is not too tight. If a path delay is greater than the FPGA sample time, the actual path is marked in red.

The following table shows a description of the columns:

Column

Description

Slack

Timing reserve.

Delay

Sum of logic delay and routing delay.

Logic Delay

Delay caused by the logic.

Routing Delay

Delay caused by routing.

Levels of Logic

Number of serial logic operations on the timing path between the source and destination flip-flop.

Source

Flip-flop at the starting point of the timing path.

Destination

Flip-flop at the end point of the timing path.

Source Clock

Clock of the source flip-flop.

Destination Clock

Clock of the destination flip-flop.

Path Constraints

Specifies the clock period in ns.

If the Source and Destination blocks of the signal path are <…>/FPGA_SETUP_BL1, the path is in the dSPACE framework. Paths with little slack can be located there. However, the framework should not generate timing errors (Slack < 0 ns) below 70% FPGA utilization.


Fixing timing problems

Too many levels of logic in a signal path result in long propagation delays, which causes timing problems.

To fix timing problems, you can do the following:

  • Break up your logic into different parts (pipelining). Refer to Pipelining.

  • Analyze and reduce the number of logic levels to be more efficient.

    For example: If the multiplication of signals leads to timing problems, reduce the bit width of the signals, for example, use a 16-bit data type instead of a 32-bit data type. The smaller the bit width, the fewer logic levels are needed.

  • If the time resolution is not critical, you can downsample the clock frequency (multi-cycle paths). Refer to Downsampling.


Pipelining

The following methods can be used for pipelining.

Adding additional latency

Most blocks of the HDL library of the AMD Vitis Model Composer let you add additional latency in the block parameters dialog. The Model Composer usually implements additional latency by adding a shift register at the output of the block. The added shift register is based on flip-flops and breaks up the logic in two timing paths.

Adding additional registers

To break up the logic, you can add an additional registers (flip-flops) to the logic to divide a big logic in two little logics, for example, by adding an AMD Delay block.


Downsampling

The following illustration shows the usual mechanism of downsampled paths. As an example, the combinatorial logic has a latency of 42 ns. The signal path is downsampled from 100 MHz to 20 MHz. You can do this, for example, by adding a AMD Down Sample block at the beginning of the path and an Up Sample block at the end. The added AMD blocks are based on D flip-flops.

For more information, refer to Notes on Using Multicycle Paths.

For the sampling rate, follow generally accepted FPGA design rules to ensure a stable and reliable FPGA application.


Verifying the measures

To verify the measures, you can execute the timing analysis from the FPGA_Setup_BL block dialog before you build the FPGA application. This timing analysis considers only the signal paths that you model with the HDL library of the AMD Vitis Model Composer. If you fix timing errors in these signal paths, you can check if the measures to avoid timing errors are effective.

If you fix timing errors in a signal path using Simulink blocks, you have to build the FPGA application to check if the measures are effective.


More information

For more information on timing analysis and fixing timing problems, refer to https://docs.amd.com/v/u/en-US/dh0006-vivado-design-analysis-and-timing-closure-hub.


Redaction