SpyGlass CDC
SpyGlass CDC
SpyGlass CDC
SpyGlass-CDC: Combining Structural and Functional Verification Techniques to Improve Effective Clock Domain Crossing Verification
White paper
Atrenta, Inc.
Introduction
Multiple, independent clocks are quintessential in SoCs and other complex ASICs today. In extreme cases, such as in large communications processors, clock domains may number in the thousands. Clock domain crossings pose a growing challenge to chip designers, and constitute a major source of design errors--errors that can easily slip past conventional verification tools and make their way into silicon. When these errors make it into silicon, the costs are high. A single silicon re-spin may cost $10 million and extend time-tomarket by months, greatly reducing the chips market share and profit potential. Even if caught prior to silicon in the late stages of design, a bug may still run up $100,000 or more in redesign costs. Therefore, there is a substantial benefit to identifying and correcting CDC problems in the early stages of the design, at the RTL level, when corrections may be made quickly and at minimal cost (a few hundreds or thousands of dollars). Unfortunately, cycle-based simulation, the mainstay of RTL-stage verification, is not well suited to finding and tracing timing-related errors resulting from CDC problems. Traditional structural analysis tools can help identify potential problem areas, but none offers the kind of comprehensiveness or precision users require. Such tools tend to simultaneously overlook a number of real design errors and over-report a large numbers of false violations. The CDC problem therefore calls for next-generation tools that provide more advanced CDC verification. As this paper describes, these tools must combine a number of techniques-including both structural analysis and functional, assertion-based checks. Only in this way can new tools provide the completeness and accuracy that CDC verification demands.
Atrenta, Inc.
Mux re-circulation scheme
Data loss or corruption: Two-flop synchronizers address the metastability problem, making sure that the values coming out of the synchronizer are in fact stable, but such sync schemes dont by themselves guarantee that the values are correct. For example, when a signal crosses from a domain with a faster clock to a domain with a slower one, the receiving domain may simply miss one or more incoming bits (if the bits fall between sampling intervals on the destination domain). In other circumstances, the correlation between incoming signals may be lost. For example, two signals may be subject to different delays when crossing domains, and even slight differences in latency might cause the signals to fall out of correlation. Additional logic--over and above a basic synchronizer--may therefore be necessary in some situations to maintain data integrity. Techniques include the use of gray coding on buses and data-stretching or handshake methods in fast-to-slow crossings (see below for more explanation).
Simulation is Inadequate
Traditional verification tools such as cycle-based simulators are not intrinsically capable of detecting timing-dependent effects such as metastability and other timing-related CDC errors. And even when simulation does detect a bug stemming from a CDC error, it provides no means of tracing the problem to its source in the RTL.
Solution Requirements
Any comprehensive solution to the CDC problem requires a number of key capabilities:
Atrenta, Inc.
The first task of any CDC verification tool is to identify all of the clock domains on the chip. This requires structural analysis thorough enough to detect derived clocks (clocks derived from other clocks) and muxed clocks (i.e., multiple clock signals muxed together on same path, where the select value determines which clock is actually used). After finding all the domains, the tool should display them in the RTL for the designer to view.
Atrenta, Inc.
Atrenta, Inc.
Quasi-static signals: Certain signals--such as reset and other configuration signals--are quasi-static. That is, they are effectively stable for long periods of time. Such crossings do not require synchronizers in the destination domain, because they are held long enough to be captured by even the slowest clock domains without the risk of metastability. Traditional tools that indiscriminately define all unsynchronized crossings as CDC violations report a number of false violations based on such quasi-static signals. New tools should therefore provide a way of screening such signals from consideration. For example, users could specify which signals and paths the tool should disregard when searching for CDC violations.
Atrenta, Inc.
Memory cores in FIFO synchronizers: Another group of signals that do not require synchronization when crossing domains are those that read from the memory core in a FIFO synchronizer (i.e., FIFOs used specifically for synchronization). Because of the latency between writing to and reading from any given location in the core, such signals are, for all intents and purposes, quasi static and should be excluded from violation reports. Tools should ideally recognize such cores and omit them, or at minimum allow user to waive analysis in these cases. Custom synchronizers: Tools may detect commonly used synchronization structures, such as two-flop or multi-flop synchronizers. But traditional tools may fail to recognize a variety of other approaches--including custom, user-designed synchronizers. Therefore, in addition to having a large pre-defined library of standard synchronization structures, tools should allow users to specify any custom synch structures used in their design. When doing its structural analysis, the tool will then recognize these user-defined elements as valid synchronizers and not mistakenly report such crossings as unsynchronized.
Figure 9: Handshaking synchronization is a commonly used technique that results in numerous false violations
Atrenta, Inc.
Cross-domain fanouts: These are signals transmitted from one flip-flop in the source domain to multiple flop synchronizers in the destination domain. This may result in loss of signal correlation, and is therefore a bad design practice that CDC tools should flag. The correct method for handling this case is to synchronize the signal only in one place, then to fanout the signal after synchronization.
Figure 11: Fanins of multiple signals crossing clock domains can cause glitches
Reconvergence: Yet another design practice that can result in functional errors is reconvergence, where two or more signals from different domains converge on combinational logic after synchronization. Once again, loss of data correlation may result. Tools should automatically detect and flag these violations.
Atrenta, Inc.
Figure 13: FIFOs are a good example where read and write pointers need gray code encryption
Gray code violations: When control buses cross clock domains, there is a danger that slight differences in propagation among the bus wires will cause loss of correlation in multi-bit data. To prevent this, gray coding must be used to ensure that only one bit on a multi-bit bus changes on any given clock cycle. CDC tools should therefore verify correct implementation of gray codes on all buses that cross clock domains. As with handshake protocol checking, this requires formal, assertion-based analysis. It should be done automatically, using implicit checks.
Hold time violations: In cases where a signal crosses from a faster clock domain to slower one, a pulse extender can be used to hold the signal to meet the capture time of the destination domain. CDC tools should therefore be able to 1) recognize fast-to- slow crossings and 2) apply assertion-based analysis to verify that signal hold times are adequate. All of this should be done automatically, with no need for user intervention.
Atrenta, Inc.
10
Figure 14: When signals cross from a fast to a slow clock domain, hold violations can result
Atrenta, Inc.
11
Figure 15: Advanced debugging capabilities are essential for CDC verification
Conclusion
CDC verification can be greatly improved through a combination of capabilities lacking in traditional analysis tools. These capabilities include richer and more flexible structural analysis, along with functional, assertion-based analysis and integrated debugging. These features will allow new-generation tools that simultaneously minimize the false violations over-reported by traditional tools and detect the CDC violations the traditional tools miss. The potential ROI is enormous. By quickly eliminating CDC errors up front at the RTL level, enhanced CDC analysis can save companies millions of dollars in redesign and refabrication costs, cut months of development time and substantially improve the profit potential of products.
About Atrenta
Atrenta Inc. is the leading provider of early design closure solutions to radically improve design efficiency throughout the IC design flow. Customers benefit from Atrenta tools & methodologies to optimize their designs early in the RTL phase for linting, clock domain crossings (CDC), power estimation and reduction, design for test (DFT), constraints generation and validation including timing exceptions, and RTL prototyping. Atrenta optimized RTL delivers up to 30% efficiency gains in the chip integration, implementation & verification phases. Atrenta has over 130 customers, including the world's top 10 semiconductor companies. Think Early Design Closure! Think Atrenta! For further information, visit the Atrenta website at www.atrenta.com, email moreinfo@atrenta.com or call 408-453-3333.