Metastability due to the connection of signals between different clock domains (CDC (Clock Domain Crossing)) is a problem in today's FPGA designs. Conventional structural verification alone is not effective for verifying CDC signals. This column will be divided into four parts to explain the CDC problem and how to verify it.

 

 

Part 4: How to verify metastable

In my previous column, I explained that verification of metastability is extremely difficult.
This time, I will introduce a tool recommended for verifying the metastability.

 

4-1 Mentor Graphics Questa®CDC

Questa CDC is a tool that supports all three basic elements of CDC validation: structural analysis, protocol validation, and reconvergence validation. Analysis can be performed when the RTL is completed before logic synthesis.

 

4-2 Features of Questa CDC

1. Full CDC can be analyzed in pre-synthesis RTL.

2. CDC's structural analysis results are reported in categories that consider countermeasures.

3. From the RTL, you can view the relevant CDC locations on the schematic.

Four. Assertions can be automatically generated at locations where protocol verification should be performed from the structural analysis results.

Five. Reconvergence verification can be performed by automatically generating a circuit that creates a metastable state.

6. You can validate whether the CDC measures you have taken are effective.

7. If you use a random testbench generation function such as Questa together, you don't need to create a testbench.

8. Comes with a kit to assist with FPGA verification

9. It is a simple and easy-to-use tool.

4-3 Functions of Questa CDC

Introduces the features of Questa CDC.

 

(1) Structural analysis

Analyze structures from RTL and report CDC locations.


If there is no impact even if there is a CDC point, there is no need to modify the RTL. However, structural analysis can result in thousands of error locations, so it is important that the report is easy to analyze with an awareness of countermeasures.

Structural analysis by Questa CDC reports by CDC technology (FIFO/D-MUX/multi-stage FF/HandShake, etc.), by bus/single, and whether or not verification is unnecessary, so if you are not familiar with CDC measures. But I know what to do next. This report is very useful for designers because CDC countermeasures vary depending on the circuit and specifications.

 

Just by looking at the report, you can see that:
・Places without synchronizers
・A place where the synchronizer is not inserted correctly
・There is a synchronizer, but protocol verification is requirement a place
・There is a synchronizer, but protocol verification is unnecessary a place
・Places excluded from verification by the user
・Places that do not require CDC verification, such as configuration circuits

 

 

CDC Summary
================================================== ===========
Violations (8)
-------------------------------------------------- -----------
(3) Single-bit signal does not have proper synchronizer.
(2)
Multiple-bit signals across clock domain boundaries. (1)
Single Source Reconvergence of Synchronizers (2)
Cautions (6)
-------------------------------------------------- -----------
DMUX synchronization. (2)
(4)
Evaluations (8)
-------------------------------------------------- -----------
Single-bit signal synchronized by DFF synchronizer.
Multiple-bit signal synchronized by DFF synchronizer. (4)
FIFO synchronization. (2)
Waived (0)
-------------------------------------------------- -----------
<None>
Proven (4)
-------------------------------------------------- -----------
Single-bit signal synchronized by DFF synchronizer.
Pulse Synchronization (1)
Filtered (0)
-------------------------------------------------- -----------

 

Figure 4-1. CDC report example

 

There is a function to automatically display the CDC part from the RTL as a schematic, which is convenient when analyzing from the contents of the report.

 

 

Figure 4-2. Auto-generated schematic example

 

(2) CDC protocol verification

For protocol verification, where it is difficult to determine whether CDC countermeasures are necessary just by checking the structure, we perform verification by performing logic simulations.

Questa CDC automatically generates a checker (assertion description) for protocol verification, so if you use a logic simulation that supports assertions such as ModelSim® DE or Questa, data can be reliably read from the clock ratio of the sender and receiver. You can verify whether the CDC signal is stable for a period of time that can be transferred.

See here for assertions

 

 

・The tool automatically generates a checker (assertion description) corresponding to each synchronizer.

• Quest's random testbench generation feature enables fully automated verification of protocol errors.

• The checker also includes coverage information so you can track the validity of the testbenches used and the verification progress when using random simulation.

 

Figure 4-3. protocol error

 

(3) CDC reconvergence verification

Reconvergence is difficult to verify. It cannot be verified by normal logic simulation or actual machine.

Questa CDC can verify the impact of CDC reconvergence by intentionally inverting logic as if metastability occurred at clock timing (near miss) where metastability is likely to occur.

 

Figure 4-4. How reconvergence verification works

 

As shown in the figure above, a circuit called a metastability injector is automatically generated and inserted from the structural analysis results of CDC, so by combining it with Questa's random test, metastable tolerance verification can be performed automatically.

In ModelSim, you can use a testbench for functional verification to verify whether or not the output pin is affected by reconvergence by comparing waveforms before and after CDC countermeasures.

 

Mentor Graphics' Questa CDC thus addresses the three fundamental elements required for asynchronous transfer (CDC) verification solutions that are difficult to verify using traditional verification techniques: structural or static CDC analysis; It is a tool that supports both protocol validation and CDC reconvergence validation.

 Learn more about Questa CDC here