CDC User
CDC User
CDC User
User Guide
Software Version 10.0c_2
October 2011
This document is for information and instruction purposes. Mentor Graphics reserves the right to make
changes in specifications and other information contained in this publication without prior notice, and the
reader should, in all cases, consult Mentor Graphics to determine whether any changes have been
made.
The terms and conditions governing the sale and licensing of Mentor Graphics products are set forth in
written agreements between Mentor Graphics and its customers. No representation or other affirmation
of fact contained in this publication shall be deemed to be a warranty or give rise to any liability of Mentor
Graphics whatsoever.
MENTOR GRAPHICS MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE.
MENTOR GRAPHICS SHALL NOT BE LIABLE FOR ANY INCIDENTAL, INDIRECT, SPECIAL, OR
CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS)
ARISING OUT OF OR RELATED TO THIS PUBLICATION OR THE INFORMATION CONTAINED IN IT,
EVEN IF MENTOR GRAPHICS CORPORATION HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
RESTRICTED RIGHTS LEGEND 03/97
U.S. Government Restricted Rights. The SOFTWARE and documentation have been developed entirely
at private expense and are commercial computer software provided with restricted rights. Use,
duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the
restrictions set forth in the license agreement provided with the software pursuant to DFARS 227.72023(a) or as set forth in subparagraph (c)(1) and (2) of the Commercial Computer Software - Restricted
Rights clause at FAR 52.227-19, as applicable.
Contractor/manufacturer is:
Mentor Graphics Corporation
8005 S.W. Boeckman Road, Wilsonville, Oregon 97070-7777.
Telephone: 503.685.7000
Toll-Free Telephone: 800.592.2210
Website: www.mentor.com
SupportNet: supportnet.mentor.com/
Send Feedback on Documentation: supportnet.mentor.com/user/feedback_form.cfm
TRADEMARKS: The trademarks, logos and service marks ("Marks") used herein are the property of
Mentor Graphics Corporation or other third parties. No one is permitted to use these Marks without the
prior written consent of Mentor Graphics or the respective third-party owner. The use herein of a thirdparty Mark is not an attempt to indicate Mentor Graphics as a source of a product, but is intended to
indicate a product from, or associated with, a particular third party. A current list of Mentor Graphics
trademarks may be viewed at: www.mentor.com/terms_conditions/trademarks.cfm.
Table of Contents
Chapter 1
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Questa CDC/Formal Verification Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Notational Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mentor Graphics Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
16
17
18
22
Chapter 2
CDC Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Design Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Clock Domains. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Clock Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Metastability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Metastability in Hardware. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Metastability in Standard RTL Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC-FX Injected RTL Simulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synchronizers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Control Signal Synchronizers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Bus Synchronizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ad Hoc Synchronizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reconvergence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verifying Reconvergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Attributes of CDC Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Severity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Promotion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Synchronization Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Signal/Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Schemes with Potential CDC Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Static CDC Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formal CDC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Protocol Checker Promotion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formal Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Status Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
24
25
25
26
26
27
29
30
31
32
34
35
38
39
39
39
40
41
41
42
43
44
45
46
47
49
50
53
Chapter 3
Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-Step Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-Step Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
55
56
57
Table of Contents
57
57
59
60
64
64
66
67
67
68
70
73
76
85
Chapter 4
CDC Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Analysis Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0in_cdc: GUI Debug Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0in_cdc: GUI Project Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Static CDC Verification Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Phase 1. Compiling the Design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Phase 2: Analyzing Clock Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Phase 3: Compiling CDC Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Phase 4: Running GUI Debug. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dynamic CDC Verification Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Protocol Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Questa Formal Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simulation with CDC Protocol Assertions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC-FX Metastability Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Simulation with CDC-FX Metastability Injection. . . . . . . . . . . . . . . . . . . . . . .
Simulation Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compiling with ccl for Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hierarchical CDC Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Basic Hierarchical CDC Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hierarchical CDC Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Waivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Variations on the Hierarchical CDC Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Heterogeneous Instances of Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Control File Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modal CDC Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Use Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specify Modes (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report Mode Runs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mode Verification and Coverage Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Individual Mode Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Viewing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Viewing Incomplete CDC Runs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
87
88
88
91
92
93
93
96
96
104
104
105
107
111
111
113
114
117
118
123
126
128
128
130
132
133
134
134
135
137
137
144
146
Table of Contents
149
149
149
151
152
152
153
157
Chapter 5
CDC-FX Metastability Injection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifying Metastability Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Metastability Windows Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running CDC-FX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_fx_check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Metastability-injected Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simulation Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC-FX PLI Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Verilog Glue Logic Option Impact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
VHDL Glue Logic Option Impact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Metastability Injector Simulation Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Assertion Violations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
159
160
161
165
165
169
170
171
171
173
174
174
Chapter 6
Command Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
async_reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
async_reset_no_sync. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
black_box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
bus_custom_sync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
bus_dff_sync_gated_clk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
bus_four_latch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
bus_shift_reg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
bus_two_dff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
bus_two_dff_phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
combo_logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
custom_sync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
custom_sync_with_crossing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
dff_sync_gated_clk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
dmux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
fanin_different_clks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
fifo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
four_latch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
handshake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
memory_sync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
multi_bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
multi_sync_mux_select. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
no_sync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
port_constraint_mismatch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
177
179
181
184
186
189
191
193
195
197
199
201
203
205
207
208
210
213
218
220
223
225
227
229
231
Table of Contents
pulse_sync. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
reconvergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
redundant. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
series_redundant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
shift_reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
simple_dmux. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
single_source_reconvergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
two_dff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
two_dff_phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Global Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0-In Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0-In Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hierarchical Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Wildcards in Directive Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Directive Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Directives for CDC Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
error_on. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_black_box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_fifo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_fifo_preference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_fx_check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_fx_metastability_window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_fx_timescale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_handshake_preference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_hier_preference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_port_constraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_port_domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_preference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_reconvergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_report_comment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_cdc_synchronizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_constant. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_constant_propagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_mode_control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Directives for Checker Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
checker_firing_keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
create_wire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
default_reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
disable_checker. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
disable_used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
exclude_checker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
include_checker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6
233
235
238
240
242
244
246
251
253
254
254
255
257
257
259
260
262
264
265
268
269
270
271
272
273
274
276
279
286
292
294
296
300
301
304
307
308
310
312
313
314
315
316
317
318
320
321
322
323
Table of Contents
set_checker_action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set_severity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
use_synthesis_case_directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Shell Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vcom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vlog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
verror. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0in_cdc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0in_db2ucdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0in Shell Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
lib2v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cwhelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Protocol/FX Checkers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Standard Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc_dsel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc_fifo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc_glitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc_hamming_distance_one . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc_handshake_data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc_sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc_sync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc_fx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cdc_custom_fx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
324
325
326
327
328
329
332
336
344
346
349
351
353
357
363
364
379
381
383
383
385
389
393
395
398
406
409
412
416
Chapter 7
GUI Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GUI Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GUI Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Window Layouts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Analysis Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Errors/Warnings Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Checks Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Debug Windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Details Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Objects Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Log/Report Browsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Schematics Viewer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Expanding Logic in the Schematic View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Zooming the Schematic View In or Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Source Code Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Waveform Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Saving Waveforms and Waveform Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
419
419
419
423
426
426
427
430
430
431
432
434
434
436
437
438
438
Table of Contents
438
439
440
441
441
441
442
443
443
444
445
446
446
446
448
448
449
450
451
452
Chapter 8
Reports/Logs Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Design Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Clock Group Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User-Specified Clock Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inferred Clock Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ignored Clock Groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mode Design Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General Design Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Detailed Design Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Port Domain Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mode Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Clock Domain Crossing Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CDC Promotion Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Violations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Cautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Evaluations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Waived . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Proven . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Filtered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Custom Synchronization Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Asynchronous Reset Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Asynchronous Reset Synchronizers Detected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User-entered Asynchronous Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Asynchronous Reset with Missing Synchronizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
453
454
454
455
455
457
457
457
458
458
459
461
461
462
462
463
463
464
465
466
467
467
467
468
468
468
Table of Contents
470
471
471
471
472
472
474
Index
Third-Party Information
End-User License Agreement
List of Examples
Example 2-1. Promoted CDC Checkers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 3-1. 0in_sdc_ctrl.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 3-2. SDC Export File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 4-1. Hierarchical Constraints Control File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 4-2. 0in_hier.scr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 4-3. 0in_hier.Makefile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 5-1. 0in_cdc_fx_sim_ctrl.v File Snippet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 5-2. Editing the 0in_cdc_fx_sim_ctrl.v File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 6-1. Single-source Reconvergence Code Snippet. . . . . . . . . . . . . . . . . . . . . . . . . .
Example 6-2. Single-source Reconvergence 0in_cdc.rpt File . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-1. Clock Group Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-2. User-Specified Clock Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-3. Inferred Clock Groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-4. Ignored Clock Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-5. Mode Design Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-6. General Design Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-7. Detailed Design Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-8. Port Domain Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-9. Mode Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-10. User Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-11. CDC Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-12. CDC Promotion Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-13. Violations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-14. Cautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-15. Evaluations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-16. Waived. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-17. Proven . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-18. Filtered. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-19. Custom Synchronization Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-20. Asynchronous Reset Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-21. Asynchronous Reset Synchronizers Detected. . . . . . . . . . . . . . . . . . . . . . . .
Example 8-22. User-entered Asynchronous Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-23. Asynchronous Reset with Missing Synchronizer . . . . . . . . . . . . . . . . . . . . .
Example 8-24. All Transmitting Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-25. Global Directives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-26. Unmatched Global Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-27. Wildcard Expansion for Global Directives . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-28. Global CDC Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 8-29. Default CDC Scheme Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10
48
68
69
119
124
125
166
167
284
284
454
455
455
457
457
457
458
458
459
461
462
462
463
463
464
465
466
467
467
468
468
468
468
470
471
472
472
472
474
List of Figures
Figure 2-1. Clock Domains and Clock Dividers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-2. Asynchronous Clock Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-3. Metastable Flip-Flop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-4. Four Metastability Scenarios. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-5. Synchronizer with Pseudorandom 1-Cycle Delay on Output . . . . . . . . . . . . . . .
Figure 2-6. Metastability Injector for a CDC Data Bus. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-7. Synchronizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-8. Synchronization Scheme. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-9. CDC Checks Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-10. Show Simulation Firings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-11. Simulation Coverage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 2-12. CDC Checks Status Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 3-1. CDC Compilation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 3-2. Design Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 3-3. Preparing the work Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 3-4. modelsim.ini Search Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 3-5. Compiling Design Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-1. Questa CDC Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-2. Static Questa CDC Tool Flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-3. CDC GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-4. Simulation with CDC Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-5. Hierarchical CDC Flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-6. Basic Hierarchical CDC Flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-7. -report_constraints Generates Hierarchical CDC Scripts. . . . . . . . . . . . . . . . . .
Figure 4-8. Waiving a Block-level Violation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-9. Top-level CDC Analysis with CFMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-10. Modes are Inferred Based on the Clock Multiplexing . . . . . . . . . . . . . . . . . . .
Figure 4-11. 0in_cdc Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-12. 0in_cdc Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-13. Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-14. Filter Hierarchy Displayed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-15. Mode for the Clock Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-16. Clock Coloring Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-17. Color Change as the Mode Context Changes . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-18. Modes Have No Clock Tree Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-19. Reload Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 4-20. Some Modes Have Clock Tree Information . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 5-1. Setup and Hold Times for a Register Input. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 5-2. Metastability Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure 5-3. clks_aligned Input to the cdc_fx Checker. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Questa CDC User Guide, v10.0c_2
October 2011
25
25
26
27
28
29
30
30
50
51
52
53
55
57
57
59
59
87
88
89
107
117
119
123
127
130
133
138
139
140
141
142
143
143
147
147
148
160
161
162
11
List of Figures
12
164
165
169
175
284
290
371
372
414
421
421
423
424
424
425
426
427
428
430
431
432
433
434
437
438
448
448
449
450
451
452
List of Figures
13
List of Tables
Table 1-1. Notational Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 1-2. Syntax Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 2-1. Signal Synchronization Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 2-2. Data Synchronization Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 2-3. Signal and Data Synchronization Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 2-4. Potential CDC Problem Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 2-5. CDC Checks Status Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-1. 1-Step Compilation Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-2. vcom Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-3. vlog Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-4. cdc Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-5. Imported SDC Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-6. Exported SDC Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-7. Inferred Clocks and Port Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-8. Unsupported Verilog Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-9. Verilog Design Style Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-10. Supported VHDL Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 3-11. VHDL Design Style Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 4-1. CDC GUI Debug Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 4-2. 0in_cdc Project Mode Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 4-3. CDC Protocol Checkers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 4-4. Simulator Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 4-5. ccl Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 4-6. ILMs vs. CFMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 4-7. Control File Model Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 5-1. CDC Schemes and cdc_fx Checker Promotion . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 6-1. CDC Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 6-2. Global Directives for CDC Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 6-3. Global Directives for Checker Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 6-4. cdc Input Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 6-5. cdc Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table 6-6. Standard Options of a Checker Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
17
18
41
42
43
44
53
56
59
60
65
67
68
68
73
73
76
81
89
91
104
113
114
131
131
167
179
260
315
373
374
384
Chapter 1
Introduction
Welcome to the Questa CDC/Formal Verification suite, a collection of functional analysis
tools from Mentor Graphics. The Questa CDC/Formal Verification suite, along with your
standard HDL simulation environment (for example, the Questa Sim product), provides a
complete, integrated functional verification environment for assertion-based verification of
your complex HDL designs.
The Questa CDC/Formal Verification suite has the following verification tools:
Questa AutoCheck, for analyzing violations of various standard design rules and
common coding practices.
Questa Formal, for static formal analysis of SVA, PSL, OVL and QVL assertions.
Questa CDC, for clock domain crossing analysis, CDC transfer protocol checking and
CDC-FX metastability effects injection.
These tools and the Questa simulator use a common set of front-end utilities to compile and
maintain design and resource libraries. In particular, the Questa AutoCheck, Formal and CDC
tools already are compatible with your simulation environment, if you use the Questa simulator.
The Questa CDC/Formal Verification tools analyze synthesizable logic, so some variance with
simulation is common, but this is not unlike the restrictions for logic synthesis and design
emulation.
Each tool comes with a GUI debugger environment for organizing, waiving and debugging
verification results. These GUI environments are tightly integrated with their analysis tools. All
have a common look-and-feel, as they are based on a common set of GUI widgets (which are
also used for the Questa Sim GUI environment). In addition to tabs and windows for organizing
source data and running the analysis tools, the GUIs have useful analyzer windows such as
language-oriented source code editors, schematic browsers, waveform viewers and finite-statemachine viewers. Since their use models are so similar, once you are familiar with the operation
of one GUI environment, you can easily learn how to run the others.
15
Introduction
Questa CDC/Formal Verification Manuals
16
Release Documents
Questa CDC/Formal Release Notes Bugs fixed in the current release and support
information.
Questa AutoCheck Quick Start Guide Tool flows and methodology for Questa
AutoCheck; syntaxes for commands and directives; and autochecks quick reference.
Questa Formal Quick Start Guide Tool flows and methodology for Questa
Formal; and syntaxes for commands and directives.
Questa CDC Quick Start Guide Tool flows and methodology for Questa CDC;
syntaxes for commands and directives; and CDC schemes quick reference.
Quick References
Questa Assertions Quick Reference Quick reference for OVL and QVL checker
libraries; and SVA coding style examples.
User Guides
Questa AutoCheck User Guide Basics and tool flow for AutoCheck operation;
command and directives reference; autochecks reference; and GUI reference.
Questa Formal User Guide Basics and tool flow for formal analysis and
assertion debug; command and directives reference; and GUI reference.
Questa CDC User Guide Basics and tool flow for static CDC analysis, dynamic
CDC analysis and simulation with CDC-FX metastability injection; command and
directives reference; CDC schemes reference; and GUI reference.
Tutorials
Questa Formal Verilog Tutorial User Guide Formal analysis tutorial using a
Verilog design.
Questa Formal VHDL Tutorial User Guide Formal analysis tutorial using a
VHDL design.
Questa CDC User Guide, v10.0c_2
October 2011
Introduction
Notational Conventions
Questa CDC Verilog Tutorial User Guide Static and dynamic CDC analysis
tutorial using a Verilog design.
Questa CDC VHDL Tutorial User Guide Static and dynamic CDC analysis
tutorial using a VHDL design.
Notational Conventions
This manual uses the notational conventions illustrated in Table 1-1.
Table 1-1. Notational Conventions
Notation
Description
Example
italics
[-depth cycles]
<italics in angle brackets> Italics in angle brackets are used in text Specify the reconvergence
depth: -depth <cycles>.
to distinguish variables from literals
when necessary to reduce confusion.
cdc [-d <design>]
[+define+<define>]...
<angle brackets>
italics underline
Oblique underline font in text indicates See the Questa Sim User
the name of another document.
Guide for details of the
vlog command.
17
Introduction
Online Help
This manual uses the conventions illustrated in Table 1-2 for syntax statements.
Table 1-2. Syntax Conventions
Meta-symbol
Description
Example
...
-ports portID. . .
[ ]
[-module module]
{ }
_pattern
The following replaceable variables in directive syntax statements represent the shown object
types.
signal
variable
constant
string
When specifying a directive from a directive syntax statement, substitute for each meta-variable
an HDL identifier, or an expression enclosed in parentheses, that evaluates to an object of the
corresponding type.
Online Help
Questa CDC/Formal software includes several ways of getting online help:
Shell help
Type -help with any shell command for the syntax of that command. For example:
prompt> vlib -help
Usage: vlib -help
vlib [-short|-dos|-long|-unix] [-archive [-compact <compact>]]
[-unnamed_designs <count>] [{-lock|-unlock} <design>]
[-locklib|-unlocklib] <library_name>
18
Introduction
Online Help
19
Introduction
Online Help
[+error+<message-id>]...
[-sir or -static_input_report]
[-scr or -static_coverage_report]
[-help]
Prepares design files for formal verification.
CW help
The cwhelp 0in shell command displays the syntaxes of the global directives. For
example:
prompt> 0in -cmd cwhelp set_black_box
usage: set_black_box
<name pattern>...
[-dont_use_outputs]
Set module as a black box.
Hover help
When using the GUIs, placing the cursor over certain items displays pop-up text boxes
called hover help. This pop-up information helps you understand the GUI. For
example, hovering over an icon displays a description of the function performed by the
icon (such as zoom in and trace fanin to register or primary port).
Other types of hover help include hovering over a status flag to see the meaning of that
status and hovering over a warning message to see the full details of the message.
20
Introduction
Online Help
InfoHub
The Questa CDC/Formal documentation is available in HTML and PDF forms from the
Questa CDC/Formal InfoHub. Use a web browser to open the InfoHub top page:
install_dir/share/doc/infohubs/index.html
21
Introduction
Mentor Graphics Support
If you have questions about this software release, please log in to SupportNet. You may search
thousands of technical solutions, view documentation, or open a Service Request online at:
http://www.mentor.com/supportnet
If your site is under current support and you do not have a SupportNet login, you may easily
register for SupportNet by filling out the short form at:
http://www.mentor.com/supportnet/quickaccess/SelfReg.do
All customer support contact information can be found on our web site at:
http://www.mentor.com/supportnet/support_offices.html
22
Chapter 2
CDC Basics
Most complex designs have more than one clock. Many of these clocks are asynchronous. For
these designs, the logic clocked by each asynchronous clock forms the clock domain for the
clock. Logic entirely inside a clock domain can be verified with the same approach as that for a
single-clock design. However, problems arise from signals that connect logic in different clock
domains. Signals that cross clock domain boundaries must be properly synchronized, and
they must obey all relevant transfer protocols. The process of verifying these requirements is
called clock domain crossing (CDC) analysis.
But, even properly synchronized CDC signals that obey protocol rules do not guarantee valid
functionality. If any CDC signal does not hold steady during the setup and hold time of its
receiving register, then the register can become metastableits output can settle at random to a
value that is different from the RTL simulated value.
In effect, data values that cross clock domains can be advanced or delayed randomly relative to
RTL simulation. If the receiving logic is not specifically designed to tolerate these metastability
effects, then functional errors can occur. Unfortunately, standard simulation cannot accurately
model metastability in a design. An extension to standard functional verification is needed to
model the effects of metastability in a design. The CDC-FX product does just that; CDC-FX
runs standard simulation with metastability injected into the circuit.
This chapter describes the method of verifying CDC signals using the CDC compiler and
CDC-FX metastability injection. This method combines static CDC analysis, inference of
design intent, assertions from an assertion checker library, simulation, and CDC-FX
metastability injection for a complete CDC verification methodology.
Refer to the CDC-FX Metastability Injection Chapter starting on page 159 for additional
information.
23
CDC Basics
CDC Design Issues
What happens if the CDC signals are changing when the handshake signal indicates they
are stable?
Does the gray-code logic on a multiple bit bus using 2FF synchronization have a bug?
Does the input to a data synchronizer change in two successive clock cycles of the
receiving domain?
What happens when multiple CDC signals are recombined and used together in the
receiving domain?
Problems such as these often do not cause simulations to fail; instead, they commonly manifest
as intermittent post-silicon failures.
To protect against these types of failures (and ensure CDC problems are addressed early in the
design process), you can use the CDC verification methodology that consists of a three-pronged
approach as follows:
24
CDC Basics
Clock Domains
Clock Domains
A clock domain is a section of a design that has a clock asynchronous to (or which has a
variable phase relationship to) another clock in the design. For example, suppose one clock is
derived from another clock through a clock divider. These two clocks have a constant phase
relationship; therefore, the two sections of the design that use these clocks are really part of the
same clock domain (Figure 2-1A). However, suppose two clocks have frequencies of 50 MHz
and 33 MHz. These clocks phase relationships change over time; therefore, they clock two
different clock domains (Figure 2-1B).
Figure 2-1. Clock Domains and Clock Dividers
A
clk
clock divider
clk
clk/2
clk33
clk
clk
clk33
PLL
clk50
clk50
If the primary inputs to a circuit include multiple clocks, then these asynchronous clocks
determine separate clock domains (Figure 2-2A). If the inputs to a circuit are asynchronous to
the circuit itself, then these asynchronous inputs are in separate clock domains (Figure 2-2B).
Clocks are the clock signals of registers and the enable signals of latches (when properly
identified).
Figure 2-2. Asynchronous Clock Domains
clk33
B
a
b
clk33
clk50
clk50
clk
Asynchronous Clocks
clk
Asynchronous Inputs
Clock Groups
All the clocks that are part of the same clock domain constitute a clock group. Hence, clock
groups partition all of the clocks in the design. The clock groups identify the various clock
domains in the design.
25
CDC Basics
Metastability
Metastability
A clock domain crossing (CDC) signal is a signal originating in a clock domain that crosses the
boundary into another domain (whose clock is asynchronous to the original clock) and is then
sampled by a register in that asynchronous clock domain.
When the active edge of a CDC signals transmit clock is too close to the active edge of the
receive registers clock, metastability occurs if data changes within the setup/hold time. With
the TX/RX clock very close, input to the RX register changes within the setup/hold window,
which causes metastability. The registers output settles to an unpredictable value. Metastability
can occur if the clocks are asynchronous, or if they are synchronous but have unpredictable or
drifting skews. Every type of bi-stable storage element is susceptible to metastability. Logic
subject to metastability must be designed to tolerate its effects.
The effects of metastability are unpredictable in hardware as the output signal can settle
randomly to 1 or 0. However, RTL simulation provides predictable results. As a result, RTL
simulation does not accurately model the hardware implementation when metastability is
present. To ensure a circuit design is immune to metastability effects, functional verification
methods must incorporate technology beyond RTL simulation.
To design circuits that tolerate the effects of metastability, you must understand: How registers
in hardware exhibit metastability and how registers function in simulation when the conditions
for metastability are present.
Metastability in Hardware
Registers can go metastable in hardware. Consider the 1-bit CDC signal s that is sampled by the
flip-flop DFF in Figure 2-3 on page 26. Since s comes from a different clock domain, its value
can change at any time with respect to the DFF clock (clk). If the value of s is not held constant
at 0 or 1 during the DFF setup and hold time, then the output (q) might assume an intermediate
voltage for an indeterminate amount of time. Then, q settles randomly to either 0 or 1. The
flip-flop is said to be metastable for that interval.
Figure 2-3. Metastable Flip-Flop
setup and hold time
clk
s
q
DFF
clk
s
q
26
CDC Basics
Metastability
If the simulated input switches value before the simulated clock edge, then the simulated
output switches value at the clock edge.
If the simulated input switches value after the simulated clock edge, then the simulated
output does not switch value.
Therefore, for both setup time and hold time violations, two results are possible as follows:
Figure 2-4 shows the resulting four metastability scenarios. Comparing hardware with RTL
simulation behavior: When a setup time violation occurs, the hardware transition is delayed
randomly by one cycle. When a hold time violation occurs, the hardware transition is advanced
randomly by one cycle.
Note that metastability models can be generalized for multibit registers by treating them as
aggregate single-bit registers.
Figure 2-4. Four Metastability Scenarios
cdc_s
q
R
rx_clk
hardware
matches
simulation
rx_clk
rx_clk
cdc_s
cdc_s
q (sim)
q (sim)
q (hw)
q (hw)
rx_clk
rx_clk
cdc_s
cdc_s
q (sim)
q (sim)
q (hw)
q (hw)
27
CDC Basics
Metastability
q1
R1
q2
R2
clk
R3
q3
$random()
It is incomplete, because it only models two of the four possible metastability scenarios.
Results are difficult to predict, because metastability is introduced into the simulation at
random.
Clock Jitter
Another method of modeling CDC metastability effects in standard RTL simulation is to jitter
the clocks in simulation and see if end-to-end functional simulation still works when the clock
phase relationships change. This method is good for verifying that the design works properly in
the presence of clock jitter and clock skews. But, this method does not completely model CDC
metastability effects.
28
CDC Basics
Metastability
rx_reg
rx_reg
reg
tx_clock
rx_clock
tx_reg
tx_clock
rx_reg
cdc_fx
checker
clocks
monitor
rx_clock
metastability
injector
tx_clock
tx_reg
tx_clock
synchronizer
cdc_fx
checker
rx_clock
rx_reg
reg
clocks
monitor
synchronizer
rx_clock
metastability
injector
The ccl compiler generates the checker logic for running metastability injected simulation. To
do this, it adds metastability injection logic for each affected CDC signal or bus in the following
two parts:
cdc_fx checker
Checkers that monitor conditions that might cause metastability on a CDC bus and
injects metastability at the receiver outputs.
The cdc_fx checkers maintain statistics and corner-case counts for the metastability and CDC
effects modeled by the transformed circuit. The cdc_fx checkers have default-off checks
(cdc_fx) that fire in cycles in which metastability might occur (for use on data buses that are
presumed to be synchronized properly).
See CDC-FX Metastability Injection on page 159 for additional information.
29
CDC Basics
Synchronizers
Synchronizers
Designers generally assume signals are in-band, which means they have a value of either logic 0
or logic 1. Metastable signals can have values that are neither 0 or 1; therefore, they are
considered out-of-band signals. Out-of-band signals have unexpected effects and propagate
unpredictably. To handle CDC signals, designers fence in potentially metastable logic to ensure
logic beyond the fence only needs to handle in-band signals. The logic inside the fence is called
a synchronizer (see Figure 2-7).
Figure 2-7. Synchronizer
out-of-band value
cdc_d
int_d
in-band value
sync logic
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
synchronizer
cdc_d
no combo logic
in path*
int_d
sync logic
rx_clk
tx_clk
Tx Clock Domain
synchronizer
Rx Clock Domain
30
CDC Basics
Synchronizers
Most CDC implementations use one or more synchronizers from a set of popular, wellcharacterized synchronization schemes. These structured synchronizers must follow welldefined connection rules and should obey specific transfer protocols. CDC identifies clock
domains, CDC signals, and structured synchronizers; and it verifies that the structured
synchronizers follow their connection rules. Then, CDC promotes their transfer protocols to
CheckerWare CDC protocol checkers for use with assertion-based simulation and formal
verification.
Any clock domain crossing that does not have a structured synchronizer must be synchronized
by custom logic or software. These ad hoc synchronizers prevent receive registers from
sampling CDC signal values when they are changing. Therefore, the receive register outputs can
never go metastable. For example, an ad hoc synchronizer might use custom logic to control its
receive registers load enable signal, or software might control the loading of a circuits
configuration registers.
Tx Clock
Domain
2DFF synchronizer
cdc_s
int_s
R1
Connection Rules
Logic in cdc_s path must be glitch free
Rx Clock No combinational logic is allowed in
Domain
int_s path
R2
rx_clk
rx_clk
cdc_s
int_s
q
31
CDC Basics
Synchronizers
DMUX Synchronizer
Select control signal from the transmit domain (synchronized by a 2DFF synchronizer) enables
a MUX when the transmit data value is available.
dmux synchronizer
cdc_d
Tx Clock
Domain
tx_sel
rx_sel
2DFF
synchronizer
rx_clk
rx_d
Tx Clock
Domain
cdc_d
tx_addr
wen
tx_clk
32
rx_d_rdy
t setup + t max_propagation_time
async
FIFO
rx_clk
CDC Basics
Synchronizers
Tx
Clock
Domain
d[0]
cdc_d
d[1]
d[2]
2DFF
synchronizer
have a
2DFF
synchronizer
2DFF
synchronizer
rx_clk
Custom Synchronizer
Special-purpose signal or data synchronizer designed, specified, and implemented by the user.
Tx Clock
Domain
cdc_d
custom synchronizer
user-defined
module
Rx Clock
Domain
q
rx_clk
Custom synchronizers can also have clock domain crossings internal to the user-defined
module.
Tx Clock Domain
d
user-defined
module
Rx Clock
Domain
q
rx_clk
tx_clk
custom synchronizer
with internal crossing
33
CDC Basics
Synchronizers
Ad Hoc Synchronizers
Questa CDC reports CDC signals without structured synchronizers and promotes appropriate
CDC protocol checkers to verify ad hoc synchronization in simulation and formal verification.
Tx
Clock
Domain
cdc_d
ad hoc synchronizer
rx_int
rx_clk
34
interval from:
active_rx_clk_edge t setup
to:
active_rx_clk_edge + t hold
CDC Basics
Reconvergence
Reconvergence
Reconvergence is the utilization of separately-propagated correlated information. An example
of reconvergence is information crossing clock domain boundaries that is recombined in the
receive logic.
reconverging signals
tx_sig1
rx_sig1
rx_clk
tx_clk
tx_sig2
rx_sig2
Tx Clock Domain
Rx Clock Domain
d[0]
synchronizer
Rx
Clock
Domain
FSM
S2
next_state
cdc_d
d[1]
synchronizer
S3
synchronizer
d[2]
S1
rx_clk
S4
?
.
Questa CDC User Guide, v10.0c_2
October 2011
35
CDC Basics
Reconvergence
Rx Clock
Domain
cdc_s
int_s
R1
R2
rx_clk
rx_clk
cdc_s
int_s
q
An example of global reconvergence is a set of data items transmitted across a clock domain
boundary through different synchronizers that are combined in the receive clock domain.
Another example of global reconvergence is the transmission of multiple items of information
across a clock domain boundary at different times using the same synchronizer.
Global and local reconvergence problems in CDC circuits are avoided by using proper
synchronizers and good reconvergence schemes. A good implementation ensures information is
always consistent. Either variable delay data cannot be sampled in the receive domain or the
receive domain logic can recover from variable delayed values. In the following example of a
good scheme, an arbiter selects a receive data value when the corresponding asynchronous
FIFO read data value is guaranteed to be ready.
Tx Clock
Domain
Rx Clock
Domain
rx_0
tx_0
async FIFO
synchronizer
tx_1
async FIFO
synchronizer
rx_out
rx_1
sel
rdy_0
arbiter
rdy_1
rx_rdy
rx_clk
Rx Clock
Domain
tx_cmd
async FIFO
synchronizer
rx_cmd
tx_data
async FIFO
synchronizer
rx_data
apply
command
to data
rx_clk
36
CDC Basics
Reconvergence
Knowing which paths are reconvergent CDC paths is important for assessing reconvergence
issues. But for many multiple-clock architectures, the number of reconvergent CDC paths can
be staggering. To help rank paths for assessment, reconvergent paths can be filtered by several
characteristics.
divergence depth
reconvergence depth
synchronizer
synchronizer
synchronizer
Tx Clock Domain
RX Clock Domain
single-source reconvergence paths
The reconvergence depth of a group of reconvergent CDC paths is the sequential depth from the
synchronizers to the reconvergence point. Sometimes, heuristic information about the
functional characteristics of the circuit can specify a reconvergence depth limit for problems to
occur.
General reconvergent CDC paths can start anywhere in the transmit domain. Reconvergent
paths that start at different points can have reconvergence problems. However, single-source
reconvergence pathsthose reconvergent paths that start from the same transmit domain
sourceare characteristically vulnerable to reconvergence issues. Analogous to general
reconvergent CDC paths, each group of single-source reconvergence paths has a sequential
distance (called the divergence depth) from the single source to the synchronizers.
37
CDC Basics
Reconvergence
Verifying Reconvergence
Simulation alone is not sufficient to verify that a circuits hardware implementation tolerates
metastability effects and will operate correctly without reconvergence issues. Normal
simulation does not model metastability robustly and completely misses behavior that can
manifest in the circuits hardware implementation. A multi-faceted approach to CDC
verification is necessary for a high degree of confidence that a particular reconvergence scheme
is a good one.
38
CDC Basics
CDC Schemes
CDC Schemes
The CDC compiler analyzes the design netlist and identifies logic involving CDC signals that
matches various pattern templates. Each occurrence of logic that matches a template is called a
CDC scheme. For example, you might have a 1-bit CDC signal sig from clock domain A being
synchronized by two in-phase D flip-flops in clock domain B. The CDC compiler identifies this
particular clock domain crossing and its synchronization logic.
Classes of CDC schemes with the same functionality are called CDC scheme types (to
distinguish them from individual CDC schemes). For example, the above CDC path with its
synchronization logic is a CDC scheme of the two_dff type.
CDC Schemes starting on page 179 have the detailed data sheets for the CDC schemes.
Severity
Severity is an indicator of the seriousness of the particular logic pattern (CDC scheme). It also
reflects the action you are expected to take. The severity levels are:
Violation
A violation is considered a must-fix problem. For example, an unsynchronized CDC
signal from clock domain A to clock domain B might be a concern, so you might want to
assign severity violations to all of these CDC schemes.
Caution
A caution is considered a valid static scheme, but it has an associated CDC transfer
protocol that should be verified in simulation or by formal verification. Most cautions
have designated CDC protocol checkers that the CDC compiler configures
automatically and promotes for assertion-based verification.
39
CDC Basics
CDC Schemes
Evaluation
An evaluation is a valid CDC scheme that uses an appropriate synchronizer. The
schemes CDC protocol must still be checked.
Proven
A proven scheme is a valid CDC scheme with an associated CDC transfer protocol that
formal CDC analysis has proven cannot be violated. No CDC protocol checkers for the
scheme are promoted for assertion-based verification.
Waived
A waived scheme is a CDC scheme with a CDC transfer protocol that does not require
verification. CDC data for waived schemes are included in the 0in_cdc database, but no
CDC protocol checkers for the scheme are promoted for assertion-based verification.
Promotion
Whenever possible, CDC creates and configures a CDC transfer protocol checker for a scheme.
Most synchronizers have corresponding protocol checkers. The process of identifying a CDC
scheme and creating its protocol checker is called checker promotion. Here, a CDC scheme is
deemed OK from a static perspective. The compiler does not have enough information to
determine whether or not a synchronization problem will occur. The answer depends on the
operating environment of the design.
Promoted checkers can be used during simulation to monitor CDC activity and verify proper
synchronization of CDC signals. They are also used in static and dynamic formal verification.
Use the set_cdc_report global directive (see page 296) to turn off CDC checker promotion for
specific CDC schemes.
40
CDC Basics
CDC Schemes
Signals
Signal synchronization schemes identify single-bit CDC signals with various synchronizers. For
example, a two_dff scheme uses two in-phase D flip-flops clocked in the receive domain as a
synchronizer.
Tx Clock Domain
Rx Clock Domain
tx_sig
rx_sig
DFF
DFF
DFF
rx_clk
tx_clk
Synchronizer
Message
Default
Severity
async_reset
Asynchronous reset
scheme.
ASYNC RESET
evaluation
async_reset_no_sync
none
ASYNC RESET NO
SYNC
violation
dff_sync_gated_clk
caution
four_latch
FOUR LATCH
SYNCHRONIZER
evaluation
no_sync
none
MISSING
SYNCHRONIZER
violation
pulse_sync
Pulse.
PULSE SYNC
evaluation
shift_reg
Shift register.
SHIFT REG
evaluation
two_dff
TWO DFF
SYNCHRONIZER
evaluation
two_dff_phase
TWO DFF
SYNCHRONIZER
OPPOSITE POLARITY
caution
custom_sync
Single-bit custom
synchronizer.
CUSTOM
evaluation
or
violation
41
CDC Basics
CDC Schemes
Data
Data synchronization schemes identify multiple-bit CDC data buses with various synchronizers.
For example, a bus_two_dff scheme uses two in-phase D flip-flops clocked in the receive
domain as a synchronizer.
Tx Clock Domain
tx_data
gray
encoder
Rx Clock Domain
DFF
DFF
DFF
gray
decoder
rx_data
rx_clk
tx_clk
Such a synchronizer is typically used for single-bit signals. When used to synchronize data
buses, this synchronization scheme should only be used to synchronize data buses that are grey
coded (i.e., at most, one bit changes per clock cycle).
Table 2-2 shows the data synchronization scheme types.
Table 2-2. Data Synchronization Schemes
Default
Severity
Scheme
Synchronizer
Message
bus_dff_sync_gated_clk
caution
bus_four_latch
BUS SYNC
evaluation
bus_shift_reg
Shift register.
evaluation
bus_two_dff
BUS SYNC
evaluation
bus_two_dff_phase
BUS SYNC
caution
multi_bits
none
MULTIPLE BITS
violation
bus_custom_sync
Multi-bit custom.
BUS CUSTOM
evaluation
or
violation
42
CDC Basics
CDC Schemes
Signal/Data
Signal/data synchronization schemes identify CDC signals and data buses with various
synchronizers. For example, a DMUX scheme uses two in-phase D flip-flops clocked in the
receive domain to synchronize the select signal to a MUX that selects the CDC data. The CDC
data can be either a single-bit signal or a multiple-bit data bus.
Tx Clock Domain
Rx Clock Domain
tx_data
rx_data
MUX
tx_clk
tx_sel
DFF
DFF
rx_sel
rx_clk
tx_clk
Scheme
Synchronizer
Message
custom_sync_with_cros
sing
Custom.
CUSTOM WITH
CROSSING
evaluation
simple_dmux
Restricted/simple MUX
enable.
SIMPLE_DMUX
caution
dmux
MUX enable.
DMUX
caution
handshake
HANDSHAKE
evaluation
memory_sync
2D array.
MEMORY SYNC
caution
fifo
FIFO.
FIFO
evaluation
multi_sync_mux_select
Multiple MUXs.
MULTIPLE
SYNCHRONIZERS AT
DMUX
caution
43
CDC Basics
CDC Schemes
rx_data
synchronizer
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
Problem
Message
Default
Severity
black_box
BLACK BOX
caution
combo_logic
Combinational logic on a
synchronization path.
COMBO LOGIC
violation
fanin_different_clks
FANIN LOGIC
FROM DIFFERENT
CLOCKS
violation
reconvergence
Reconvergent CDC
signals.
RECONVERGENCE
caution
single_source_reconvergence
Reconvergent CDC
signals from a single
source.
SSR
violation
redundant
REDUNDANT
caution
port_constraint_mismatch
Custom synchronizers
connected in series.
PORT
CONSTRAINT
MISMATCH
violation
series_redundant
Custom synchronizers
connected in series.
SERIES
REDUNDANT
caution
44
CDC Basics
Static CDC Analysis
rx_sig
DFF
DFF
DFF
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
combinational logic
drives input to synchronizer
tx_sig
rx_sig
DFF
DFF
rx_clk
tx_clk
Tx Clock Domain
DFF
Rx Clock Domain
You can redefine the statuses used for the different schemes. For example, you can
make latch synchronization a violation.
3. Verifies certain CDC protocols
If CDC formal verification is enabled, static CDC analysis includes static formal
analysis of certain CDC protocols.
4. Promotes CDC protocol checkers.
Static CDC analysis generates CDC protocol checkers for certain CDC schemes based
on their scheme type, transmit clock, transmit signals, receive clock and receive signals.
45
CDC Basics
Static CDC Analysis
CDC checkers are not promoted for CDC schemes that have severity proven, waived or
filtered. Promoted checkers represent CDC protocols that need assertion-based analysis
by the Questa Formal tools and possibly simulation.
Formal CDC
Formal CDC is an advanced option of static CDC analysis that tries to verify the CDC transfer
protocols of certain CDC schemes using a built-in formal proof engine. Formal CDC analyzes
the fanin logic of these CDC schemes. If formal CDC finds a proof that a CDC schemes
protocol cannot be violated, that scheme is reported as a proven scheme. Since the schemes
synchronization is valid, no protocol checker is promoted for the scheme. If CDC formal
analysis cannot find a proof that the protocol cannot be violated, the result is inconclusive. So,
the associated protocol checker is promoted for verification by the Questa Formal tools or by
simulation. The proportion of time formal CDC spends analyzing protocols is controlled by the
formal CDC effort level:
low > medium > high > maximum
The default formal CDC effort level is low. Running static CDC with a higher formal effort
level can result in additional proven CDC schemes. The formal CDC engine is tuned to analyze
two specific types of CDC protocols: signal stability protocols and gray-coding protocols.
46
dff_sync_gated_clk
four_latch
pulse_sync
shift_reg
two_dff
two_dff_phase
CDC Basics
Static CDC Analysis
Gray-Coding Protocols
Multibit CDC signals (i.e., data buses) can be synchronized by synchronizers typically used for
single-bit signals. However, such synchronization must follow a gray-coding protocol where
only one data bit changes at a time. Formal CDC tries to find proofs for the gray-coding
protocols of the following types of CDC schemes:
bus_dff_sync_gated_clk
bus_four_latch
bus_shift_reg
bus_two_dff
bus_two_dff_phase
The transmit signal remains stable until the synchronizers output register has sampled
the previous value.
This protocol can be checked with the following assertion using simulation with assertions and
formal verification:
The transmit signal must not change for at least N consecutive transmit-clock cycles,
where N is a function of the transmit-clock and receive-clock frequencies.
If this assertion is violated, then a possible counterexample exists in which metastability on the
CDC signal can cause an incorrect result. In this case, the transmitted data is missed by the
receiver logic. In regular simulation (which is not subject to metastability unless it is a
catastrophic violation of the protocol), the signal reaches its goal and the problem is not
detected. However, when using simulation with assertions, an assertion fires. You can then
examine the conditions under which the failure occurs and correct the design problem.
47
CDC Basics
Static CDC Analysis
scheme. If a design cannot violate any of the checkers assertions, then the design obeys the
associated CDC synchronization scheme.
The CheckerWare assertion library includes the set of CDC checkers described in the
CheckerWare Data Book. CheckerWare CDC checkers are available for the common CDC
synchronization schemes. Static CDC analysis identifies the synchronization schemes used for
the CDC signals in the design. Based on the analysis, CDC promotes instances of CheckerWare
CDC checkers depending on the synchronization scheme (although not all schemes have
associated promoted checkers). The promoted checkers validate CDC behavior during
assertion-based verification and are report in the automatically generated output 0in_cdc_ctrl.v
file (see Example 2-1 for a snippet of this file).
Example 2-1. Promoted CDC Checkers
// Synchronized multi-bit variable fifo_0_h.rp_s1
/* 0in cdc_hamming1
-tx_clock mac_clk_in
-tx_var fifo_0_h.rp_gray
-name bus_two_dff_62001
-module demo_top
-inferred */
/* 0in cdc_sample
-tx_var init_done
-rx_var tx_state[0]
-tx_clock cpu_clk_in
-rx_clock core_clk_in
-areset ( ( ! rst) )
-name no_sync_47305
-module demo_top
-inferred */
/* 0in cdc_dsel
-tx_data fstp[7:1]
-rx_data crc_1.scramble
-tx_clock cpu_clk_in
-rx_clock mac_clk_in
-tx_data_select init_done
-rx_data_select init_done_r2
-tx_min P_cpu_clk_mac_clk_tx_min
-areset ( ( ! rst) )
-name dmux_30303
-module demo_top
-inferred */
/* 0in cdc_glitch
-var check_en_r1
-clock mac_clk_in
-name combo_logic_85239
-module demo_top
-inferred */
. . .
48
CDC Basics
Formal Verification
0in_cdc.rpt
Multiple-bit signal across clock domain boundary. (multi_bits)
--------------------------------------------------------------cpu_clk : start : crc_seed[7:1] (/CDC/SRC/demo_top.vhd : 84)
mac_clk : end : crc_1.crc_16 (/CDC/SRC/demo_top.vhd : 565)
(ID:multi_bits_76265)via : crc_1.seed
Formal Verification
Formal verification uses mathematical analysis to verify a designs assertions. It has an
advantage over simulation with assertions as it automatically analyzes complex corner cases
that are difficult to simulate. Whereas a simulated design only covers the state spaces reached
by simulation, formal analysis coverage is exhaustive. CDC checkers are compatible with the
Questa Formal tools: Prove and Confirm. Only a small incremental effort is needed as the
Questa Formal tools use the same configuration files and assertions as assertions in simulation.
A designs individual assertions (including CDC checker assertions) are called formal targets
when they are used as goals that the formal tools try to prove or disprove. Other assertions can
be used as guides for the formal tools to ensure they do not attempt to test illegal behavior.
These assertions are called formal constraints. The CDC checkers assertions are always used
as targets, not constraints.
Prove is a property checker that tries to prove targets cannot be violated. Targets with
inconclusive results are passed to Confirm to attempt to disprove them. These tools disprove a
target assertion by finding a counterexample to the assertion. A counterexample is a legal
stimulus sequence applied to the design that eventually makes the assertion fail (that is, fire).
Counterexamples are also called assertion firings. Refer to the Questa Formal User Guide for
information regarding the Questa Formal tools.
49
CDC Basics
Simulation
Simulation
To simulate a design with CDC checkers, use assertions in simulation and your standard HDL
simulator. During assertions in simulation, the CDC checkers verify the functionality of the
CDC protocols. A violation of a protocol assertion makes the associated CDC checker fire.
To debug assertion firings, use the 0in_cdc viewer. Use the File >Merge Database command to
load the database from the simulation, then from CDC Checks tab, you can browse the data for
assertion firings (Figure 2-9).
Figure 2-9. CDC Checks Simulation Results
To invoke the waveform viewer with the assertion firing from simulation (Figure 2-10) right
click on the Firing in the Transcript window and select Show Firings to display the Firings
window. Select all firings or an individual firing to show the waveform.
50
CDC Basics
Simulation
View the coverage statistics for the simulation from the Design window (Figure 2-11).
51
CDC Basics
Simulation
52
CDC Basics
Status Flags
Status Flags
Status flags give you a quick assessment of the results of CDC verification from the CDC GUI.
The flags help you determine which CDC issues to examine first and they highlight additional
problems you should investigate. Figure 2-12 shows a region of a CDC checks tab in the results
pane of the CDC GUI after a CDC verification session, formal verification and simulation with
the promoted CDC checkers. Entries can have Static status, Prove status and Simulation status
as described in Table 2-5.
Figure 2-12. CDC Checks Status Flags
Description
53
CDC Basics
Status Flags
Description
Inconclusive
CDC schemes protocol is not guaranteed. Formal analysis could
not prove that the protocol cannot be violated.
Evaluated
CDC schemes protocol checker is evaluated in simulation.
Not Promoted
CDC scheme has no protocol checker automatically generated or
the protocol checker is not promoted because the protocol is
proven valid during static CDC analysis.
Waived
CDC schemes severity level is waived.
Filtered
CDC schemes severity level is off.
54
Chapter 3
Compilation
CDC analysis runs on a compiled image of the design logic plus a clock domain model. A set of
design compilation utilities is used to compile the design logic from source files. Then, the CDC
analyzer (cdc) is used to create a clock domain model. If this compilation completes without
error, cdc performs CDC analysis and generates data for the CDC GUI. Two methods can be
used to compile the design and clock domain model, and then perform CDC analysis:
1-Step Compilation
Instead of running the design compilation utilities separately from the cdc command,
add the arguments for design compilation to the cdc invocation. The design is compiled
first (using the design compilation utilities under-the-hood). Then, the clock domain
model is created and CDC analysis is performedall in one step using the cdc
command. This method only works for restricted Verilog designs.
2-Step Compilation
Use the design compilation utilities to create and maintain a compiled design library.
Use the cdc command to compile the clock domain model and run CDC analysis.
Figure 3-1. CDC Compilation Methods
1-Step Compilation
Compile design libraries
and clock domain model
Questa Compilers
and Library
Management Tools
design libraries
Verilog
design
files
clock domain
model
control
files
2-Step Compilation
design
files
Questa Compilers
and Library
Management Tools
design libraries
control
files
clock domain
model
55
Compilation
1-Step Compilation
1-Step Compilation
For the compilation of Verilog-only designs (but not SystemVerilog) you can use the 1-step
compilation method. To do this, add the 1-step compilation arguments (Table 3-1) to the cdc
invocation. The cdc compiler uses the design compilation utilities under-the-hood to compile
the design and stores the compiled design library in the 0in cache. For example:
cdc -d dut -ctrl ctrl.v -f design.f +define+mode=initialized -y ../mylib
See cdc: Clock Domain Crossing Analyzer on page 64 for a description of the cdc command
and clock domain model compilation.
Table 3-1. 1-Step Compilation Options
{Verilog_file | f filelist} [-v95] [+define{+macro[=value}]
[+incdir{+include_dir}] [+libext{+extension}] [y library_dir] [v library_file]
[skip_protected_modules] [skip_protected_code] [ignore_translate_off]
[ignore_synthesis_off] [modelsimini init_file] [dw]
Verilog_file
f filelist
v95
+define{+macro[=value]}
+incdir+dir
+libext{+extension}
y library_dir
v library_file
skip_protected_modules
skip_protected_code
ignore_translate_off
ignore_synthesis_off
dw
56
Compilation
2-Step Compilation
2-Step Compilation
With the 2-step compilation method, first use the design compilation utilities to create and
maintain a compiled version of the design logic. Then, use the cdc command to create the clock
domain model and perform CDC analysis.
vcom
Verilog
design files
VHDL
design files
vlog
vcom
Verilog
design files
VHDL
design files
Library
Utilities
work
vopt/vsim
cdc
csl
0in_autocheck
Questa
Questa
Advanced
Verification
Simulator
0in_prove
0in_confirm
generate
work
generate
./modelsim.ini
defaults file
edit
./modelsim.ini
custom defaults file
57
Compilation
2-Step Compilation
The name work is the default working library. A library statement (for work) is not
needed in the source. The work library is the default destination of compiled design
units. So, the above mapping is not necessary. However, the vmap command generates a
modelsim.ini file in the current run directory. The modelsim.ini file sets the library
mappings used for simulation by vsim and for CDC compilation/analysis by cdc. It also
sets the default values for compiler and simulator arguments. These default values can
be adjusted, which makes the command argument defaults user-configurable.
3. Edit the modelsim.ini default file to adjust the defaults to fit your environment.
prompt> vim modelsim.ini
The vcom and vlog compilers have an array of compilation parameters that control
exactly how source and resource data are compiled. Some of these compilation
parameters can be overridden at compile time by compiler switches. For example, the
-2008 argument to vcom directs the compiler to assume VHDL-2008 semantics when
compiling source files. Compilation parameters that are not overridden with compiler
switches assume the defaults specified in a modelsim.ini file.
modelsim.ini
The vcom/vlog compilers set $MODEL_TECH to the same directory as
$MODEL_TECH_OVERRIDE, if it is defined. Otherwise, they set $MODEL_TECH to the
directory containing the executable software. To ensure compatibility of software tools, you
should run the compilation commands (vlib, vmap, vcom, vlog, etc.) that are located in the
Questa CDC/Formal distribution software. The Questa CDC/Formal distribution versions of
vcom/log set $MODEL_TECH as follows:
set MODEL_TECH zeroin_install_dir/modeltech/plat
The vcom/vlog design compilers and the cdc clock domain analyzer use the search path shown
in Figure 3-4 to find the modelsim.ini file for their compilations.
58
Compilation
2-Step Compilation
$MODEL_TECH/modelsim.ini
$MODEL_TECH/../modelsim.ini
$MGC_HOME/lib/modelsim.ini
vlog/vcom compilers set $MODEL_TECH internally to the install
directory for the tool. For Questa CDC/Formal tools:
zeroin_install_dir/modeltech/plat
vcom/vlog
append/update
work
modelsim.ini
Use vcom to compile VHDL style source files and vlog to compile Verilog style (including
SystemVerilog) source code. These compilers have long lists of arguments, but many options
are used to fine-tune simulation (vsim). Table 3-2 and Table 3-3 show the options that are
relevant to Questa CDC/Formal Verification.
Table 3-2. vcom Syntax
vcom [compile_options] VHDL_file
VHDL_file
VHDL source files.
compile_options
[-work logical_name] [modelsimini init_file]
[-87 | -93 | -2002 | -2008] [-explicit]
[-skipsynthoffregion [-synthprefix keyword]]
[-check_synthesis] [-noindexcheck | -norangecheck | -nocheck]
[-source] [-time] [-mixedsvvh [b | l | r] [i]] [-pslfile vunit_file]
[-lower | -preserve] [-l file] [-quiet] [-nowarn number]
[{-fatal | -error | -warning | -note | -suppress | -msglimit}
msg_number[,msg_number]]
[-f arg_file] [other_vcom_options]
59
Compilation
2-Step Compilation
compile_options
Compile Order
For a Verilog compilation, you can compile almost all compilation units in any order using any
number of invocations of vlog. When cdc and csl load the compiled design, they resolve model
instantiations and external hierarchical references. The one case where order matters is:
SystemVerilog packages must exist for the items they define to be recognized by the scopes in
which they are imported. IEEE Std 1800-2005 LRM
For a VHDL compilation, order matters: you must compile entities/configurations before the
architectures that reference them.
Resource Libraries
A resource library is a pre-compiled parts source for your design. It is typically a static library
supplied by a vendor or another design team, but you also can create your own resource
libraries. Resource libraries are compiled into libraries distinct from work using the same
vlib/vmap and vcom/vlog utilities used for compiling the work design library.
The distribution software includes pre-compiled resource libraries for common uses, located in
<zeroin_install_dir>/modeltech. The [Library] section of the system-level modelsim.ini file
(<zeroin_install_dir>/modeltech/modelsim.ini) shows these resource libraries:
[Library]
std = $MODEL_TECH/../std
ieee = $MODEL_TECH/../ieee
60
Compilation
2-Step Compilation
verilog = $MODEL_TECH/../verilog
vital2000 = $MODEL_TECH/../vital2000
std_developerskit = $MODEL_TECH/../std_developerskit
synopsys = $MODEL_TECH/../synopsys
modelsim_lib = $MODEL_TECH/../modelsim_lib
sv_std = $MODEL_TECH/../sv_std
mtiAvm = $MODEL_TECH/../avm
mtiOvm = $MODEL_TECH/../ovm-2.1
mtiUPF = $MODEL_TECH/../upf_lib
mtiPA = $MODEL_TECH/../pa_lib
floatfixlib = $MODEL_TECH/../floatfixlib
mc2_lib = $MODEL_TECH/../mc2_lib
The [Library] section of the modelsim.ini file shows the library mappings for user-defined
libraries as well. For example, suppose you create a library with the physical location ../shiba
and map this library to the logical name my_shiba.
prompt> vlib ../shiba
prompt> vmap my_shiba ../shiba
If the local run directory does not already have a modelsim.ini file, vmap copies a version of
$MODEL_TECH/../modelsim.ini to the local run directory. Then, vmap updates modelsim.ini
with the new mapping:
prompt> more modelsim.ini
. . .
[Library]
others = $MODEL_TECH/../modelsim.ini
my_shiba = ../shiba
work = work
If you use vmap to map a library to a logical name that is already mapped in the local
modelsim.ini file, the new mapping simply replaces the old mapping. However, if you edit the
local modelsim.ini file and specify two library mappings with the same logical name, the file is
corrupt and you get an error when you try to compile.
The others clause in the [Library] section has a special meaning. If a compiler does not find a
referenced library in the local modelsim.ini file, but the local modelsim.ini file has an others
clause, the compiler checks the [Library] section of the file specified by others. As with library
mappings, only one others clause is allowed in a modelsim.ini file. However, note that the
others clause provides a method for creating a hierarchy of library mappings because the file
referred in an others clause can contain another others clause, and so on.
61
Compilation
2-Step Compilation
so complex that using resource libraries significantly simplify the organization of the design
data. In these cases, you need to use reference libraries. Consider this example:
prompt> vlib work
prompt> vlib asiclib
prompt> vlog -work asiclib and2.v or2.v
-- Compiling module and2
-- Compiling module or2
Top level modules:
and2
or2
prompt> vlog top.v
-- Compiling module top
Top level modules:
top
This example compiles and2 and or2 into the asiclib library and top into work.
When you run vlog to compile the top-level design, the compiler must know the resource
libraries needed to resolve instantiations and the order that these libraries should be searched (in
case multiple libraries contain different versions of the same models). However, instantiation
bindings are not determined during compilation; they are determined when you run cdc or csl.
So, whatever resource libraries and order specified to vlog should match the libraries and order
used by cdc and csl.
Resource libraries are specified with the L library and Lf library options to vlog, cdc and csl.
These utilities use the following search order to resolve each instantiation (and they stop at the
first match):
1. Libraries specified with the Lf option, in the order they appear in the invocation.
2. The current effective uselib library, if specified.
3. Search path specified in the LibrarySearchPath variable of modelsim.ini (as if these
libraries were specified with the L argument).
4. Libraries specified with the L option (searched in the order specified in the invocation).
5. work
6. Library named in the explicit escaped identifier instance name.
62
Compilation
2-Step Compilation
The IEEE library is a library of precompiled synthesis and arithmetic packages specially tuned
to the Questa tools. IEEE contains the following packages: math_complex, math_real,
numeric_bit, numeric_std, std_logic_1164, std_logic_misc, std_logic_textio, std_logic_arith,
std_logic_signed, std_logic_unsigned, vital_primitives and vital_timing. The above clauses
specify that the logical library IEEE is used as a reference library and all declarations in the
std_logic_1164 package are made visible for the scope of the design unit. (For strict IEEE
compliance, the IEEEPURE library contains only the IEEE approved packages.)
Certain libraries are predefined and are visible without explicit specification. The WORK library
is the current target of the compilation. Design units and packages in WORK are visible. The
STD library contains the standard, env and textio packages. Both WORK and STD are
predefined and are visible without explicit specificationas if the design units have the
following statements:
library STD, WORK;
use STD.standard.al
63
Compilation
2-Step Compilation
Some general-purpose FPGA resource libraries are available in synthesizable form. These
libraries are often called formal-friendly because they are usable with formal model checkers
such as Questa Formal and formal equivalence checkers such as FormalPro. They are also
appropriate for the Questa CDC analyzer and other tools that need to synthesize a netlist. Some
FPGA vendors (for example, Altera and Actel) include synthesizable libraries in their standard
design kit installations. Xilinx, however, does not include the synthesizable unisim and simprim
libraries within its standard ISE software installation. Synthesizable resource libraries
(optimized for Questa tools) and other supporting files for two common FPGA library families
are included with the Questa CDC/Formal distribution software in the following directories:
$HOME_0IN/share/fpga_libs/Altera
$HOME_0IN/share/fpga_libs/Xilinx
If the FPGA libraries used for simulation are synthesizable (which is rare except for Verilogonly designs), recompilation of the pre-compiled libraries might not be necessary for CDC
analysis. In all other cases, you must compile an appropriate version of the library source files
for use with Questa CDC. When synthesizable FPGA resource libraries are available, you
should use them instead of the unsynthesizable libraries optimized for simulation.
The VHDL IEEE, STD and SYNOPSYS libraries are pre-compiled and are automatically
recognized by Questa CDC/Formal software. You must compile all other resource libraries
using the vcom/vlog commands on the appropriate FPGA library source files. If you have a
VHDL-only design or if you have a mixed-language design with library elements instantiated in
VHDL, first compile the VHDL component definitions (but not the VHDL models of the library
elements) and then compile the appropriate Verilog library models.
The cdc command performs 1-step compilation if necessary, compiles the clock domain model
and performs CDC analysis. Table 3-4 shows the syntax for the cdc command (the 1-step
compilation options are hidden).
64
Compilation
2-Step Compilation
report_clock
Report only clock domains and exit. Default: perform full CDC
analysis.
report_modes
hier_cdc_options
work work_library
L library | Lf library
cuname comp_unit
cache pathname
control options
reporting options
sdc options
advanced options
65
Compilation
2-Step Compilation
Parallel Sessions
With a compiled work library created with 2-step compilation, you can run multiple cdc
sessions in parallel off the same library. However, to do this, you cannot specify any -ctrl,
-ctrl_list or -vhctrl options. These options cause the control modules and entities to be compiled
and written into the work library during the session, which changes the library and can interfere
with other parallel sessions. The result is one or more of the sessions can fail or can return
unrelated results. When running parallel cdc sessions the work library must remain static.
To work around this limitation, you can pre-compile all control files during Step 1before
running any cdc sessions in parallelusing the vcom and vlog compilers. After compiling the
control modules and entities, you then specify their names using the -ctrl_module option to cdc.
In particular, you can compile different control modules for the various parallel sessions ahead
of time and then just specify the -ctrl_module design units applicable to each particular parallel
session. For example:
prompt> vlog -work MYLIB dut.v
prompt> vlog -work MYLIB common_ctrl.v run1_ctrl.v run2_ctrl.v
plat1> 0in -cmd cdc -od cdc1_results -L MYLIB -d MYLIB.dut \
-ctrl_module MYLIB.common_ctrl -ctrl_module MYLIB.run1_ctrl ...
plat2> 0in -cmd cdc -od cdc2_results -L MYLIB -d MYLIB.dut \
-ctrl_module MYLIB.common_ctrl -ctrl_module MYLIB.run2_ctrl ...
Note
You also can run csl and 0in_autocheck utilities in parallel with each other and with cdc
off the same work library using this method.
In some cases, pre-compiling control files into a main library for all CDC sessions at the same
time is not practical. For example during a hierarchical CDC flow, control modules/entities
might be generated and compiled automatically as each block-level session is started. In such
cases, you can pre-compile the control files for the separate sessions to separate libraries. For
example:
prompt> vlog -work MYLIB dut.v
prompt> vlog -work MYLIB common_ctrl.v
plat1> vlog -work MYLIB_BLK1 blk1_ctrl.v
plat1> 0in -cmd cdc -od cdc_blk1 -L MYLIB -L MYLIB_BLK1 -d MYLIB.dut \
-ctrl_module MYLIB.common_ctrl -ctrl_module MYLIB_BLK1.blk1_ctrl ...
plat2> vlog -work MYLIB_BLK2 blk2_ctrl.v
plat2> 0in -cmd cdc -od cdc_blk2 -L MYLIB -L MYLIB_BLK2 -d MYLIB.dut \
-ctrl_module MYLIB.common_ctrl -ctrl_module MYLIB_BLK2.blk2_ctrl ...
66
Compilation
SDC Data
SDC Data
You can import an SDC file for the CDC compilation. Each supported SDC command is
converted to an equivalent global directive. Similarly, you can export an SDC file at the end of
CDC compilation and analysis. The relevant global directives, the inferred clocks and the
inferred port domains are converted to equivalent SDC commands.
Global Directive
create_clock
set_cdc_clock
create_generated_clock
set_cdc_clock
set_input_delay
set_cdc_port_domain
set_output_delay
set_cdc_port_domain
set_input_transition
set_cdc_port_domain
set_logic_one
set_constant
set_logic_zero
set_constant
set_case_analysis
set_constant
Directly
prompt> 0in -cmd cdc -sdc_in sdc_file ...
The SDC data from sdc_file is converted and used in the CDC compilation.
Indirectly
prompt> 0in -cmd cdc -report_sdc -sdc_in sdc_file ...
prompt> 0in -cmd cdc -ctrl 0in_sdc_ctrl.v ...
The -report_sdc option scans the CDC data and generates a control file (0in_sdc_ctrl.v)
containing the global directive equivalents of the relevant SDC commands in sdc_file
(Example 3-1). The second invocation of cdc runs CDC compilation and analysis with
the converted SDC constraints.
67
Compilation
SDC Data
SDC Command
set_cdc_clock
create_clock
set_cdc_port_domain
set_input_delay
set_cdc_port_domain
set_output_delay
set_constant
set_logic_one, set_logic_zero
set_false_path
SDC Command
create_clock
set_input_delay
set_output_delay
CDC path
set_false_path
68
Compilation
SDC Data
set_output_delay
set_output_delay
set_output_delay
set_output_delay
#
#
#
#
#
set_input_delay
set_input_delay
set_input_delay
set_input_delay
set_input_delay
0
0
0
0
0
0
0
0
0
-clock
-clock
-clock
-clock
[get_clocks
[get_clocks
[get_clocks
[get_clocks
[get_ports
[get_ports
[get_ports
[get_ports
[get_ports
{
{
{
{
{
{
{
{
{
clk
clk
clk
clk
}]
}]
}]
}]
[get_ports
[get_ports
[get_ports
[get_ports
{
{
{
{
q[0]
q[1]
q[2]
q[3]
}]
}]
}]
}]
clk }]
d[0] }]
d[1] }]
d[2] }]
d[3] }]
#####################################################################
# CDC Path Information
#####################################################################
set_false_path -from [get_ports { d }] -to [get_ports { q }]
69
Compilation
Design Style Restrictions
The cdc compiler terminates with an error. You must eliminate the error before cdc can
compile the CDC model.
You have the following ways to manually adjust the compilation of the CDC model of a DUT.
Use the set_cdc_port_domain global directive to identify the clock domains of the I/O
ports of these user-defined black boxes.
The following HDL constructs can impact cdc performance, creating long cdc run times and
high memory consumption.
70
Variable bit-selects and variable shifts on large bit-vectors (greater than 1000 bits) used
in nested for-loop statements.
Large 2-D arrays (greater than 100words) defined in the local scope of a function/task.
Compilation
Design Style Restrictions
You also can specify a user-defined translate_off/synthesis_off keyword using the synthprefix
keyword option to vlog/vcom.
If a design unit is immediately preceded by a translate_off/synthesis_off pragma, the design unit
is black boxed and you get a vopt warning:
** Warning: (vopt-2057): file(line): translate_off pragma active at the
start of entity entity. It BBes the module.
The translate_off/synthesis_off pragmas reset at the end of the design unit. That is, they are
active until the end of the current design unit or until the terminating pragma, whichever comes
first. If a translate_off/synthesis_off block crosses a design unit boundary, the code from the
pragma to the end of the design unit is skipped, but the code in the next design is elaborated
(which is probably not the expected result). When the subsequent translate_on/synthesis_on
pragma is reached, an Ignoring pragma warning is reported.
For example, consider the following:
-- synopsys translate_off
entity bot ...
end entity
arch bot ...
end arch
entity top...
end entity
arch top
u1: bot
end arch
-- synopsys translate_on
Here, the bot entity is back-boxed (and the vopt-2057 warning is reported). But the translate_off
region terminates at the end of the bot entity design unit. The bot and top architectures are not in
any translate_off region. When translate_on is processed, it is reported as an ignored pragma.
71
Compilation
Design Style Restrictions
72
Compilation
Design Style Restrictions
Verilog
The Questa compilers mark objects containing unsupported code as black boxes or if problems
are too severe, cdc terminates with errors. By default, all output signals from a black box (and
all signals in the black box) are treated as primary inputs to the DUT. If possible, use ifdef
directives or remodel the constructs. Table 3-8 shows the unsupported Verilog-95 (-v95) and
Verilog 2005 (default) constructs.
Table 3-8. Unsupported Verilog Constructs
Gates
Statements
Numbers
Reals.
Resets
Ports
Other Constructs
Table 3-9 lists the restrictions on the Verilog design styles enforced by the Questa compilers.
Table 3-9. Verilog Design Style Restrictions
Resets
73
Compilation
Design Style Restrictions
or
always @(posedge_negedge clock or negedge areset)
if (!areset) (. . . )
else (. . . )
Clocks
always Blocks
Combinational Loops
RAMs
RAMs with multiple write clocks are not supported. These are
cdc errors.
UDPs
Race Conditions
74
Compilation
Design Style Restrictions
Blocking Delay
Statements
bind to VHDL
Other Constructs
75
Compilation
Design Style Restrictions
VHDL
Compiler support for IEEE 1076-1993 Standard VHDL Language Reference Manual (LRM)
constructs is shown in Table 3-10. Unless otherwise noted, each construct in the table is
completely supported.
Table 3-10. Supported VHDL Constructs
LRM Section 1
1.1
1.1.1
1.1.1.1
1.1.1.2
1.1.2
1.1.3
1.2
1.2.1
1.2.2
1.3
1.3.1
1.3.2
LRM Section 2
2.1
2.1.1
2.1.1.1
2.1.1.2
2.1.1.3
2.2
2.3
2.3.1
2.3.2
2.4
2.5
2.6
2.7
LRM Section 3
3.1
3.1.1
3.1.1.1
3.1.2
3.1.2.1
3.1.3
3.1.3.1
3.1.4
3.1.4.1
76
not supported
not supported
not supported
not supported
Compilation
Design Style Restrictions
Composite types
Array types
Index constraints and discrete ranges
Record types
Access types
Incomplete type declarations
Allocation and de-allocation of objects
File types
File operations
Declarations
Type declarations
Subtype declarations
Objects
Object declarations
Constant declarations
Signal declarations
Variable declarations
File declarations
Interface declarations
Interface lists
Association lists
Alias declarations
Object aliases
Non-object aliases
Attribute declarations
Component declarations
Group template declarations
Group declarations
Specifications
Attribute specification
Configuration specification
Binding indication
Entity aspect
Generic map and port map aspects
Default binding indication
Disconnection specification
Names
Names
Simple names
Selected names
Indexed names
Slice names
Attribute name
not supported
not supported
not supported
not supported
not supported
not supported
not supported
not supported
not supported
77
Compilation
Design Style Restrictions
78
Expressions
Expressions
Operators
Logical operators
Relational operators
Shift operators
Adding operators
Sign operators
Multiplying operators
Miscellaneous operators
Operands
Literals
Aggregates
Record aggregates
Array aggregates
Function calls
Qualified expressions
Type conversions
Allocators
Static expressions
Locally static primaries
Globally static primaries
Universal expressions
Sequential Statements
Wait statement
Assertion statement
Report statement
Signal assignment statement
Updating a projected output waveform
Variable assignment statement
Array variable assignments
Procedure call statement
If statement
Case statement
Loop statement
Next statement
Exit statement
Return statement
Null statement
not supported
Compilation
Design Style Restrictions
Concurrent Statements
Block statement
Process statement
Concurrent procedure call statements
Concurrent assertion statements
Concurrent signal assignment statements
Conditional signal assignments
Selected signal assignments
Component instantiation statements
Instantiation of a component
Instantiation of a design entity
Generate statements
Scope and Visibility
Declarative region
Scope of declarations
Visibility
Use clauses
The context of overload resolution
Design Units and Their Analysis
Design units
Design libraries
Context clauses
Order of analysis
Elaboration and Execution
Elaboration of a design hierarchy
Elaboration of a block header
The generic clause
The generic map aspect
The port clause
The port map aspect
Elaboration of a declarative part
Elaboration of a declaration
Subprogram declarations and bodies
Type declarations
Subtype declarations
Object declarations
Alias declarations
Attribute declarations
Component declarations
not supported
79
Compilation
Design Style Restrictions
Elaboration of a specification
Attribute specifications
Configuration specifications
Disconnection specifications
Elaboration of a statement part
Block statements
Generate statements
Component instantiation statements
Other concurrent statements
Dynamic elaboration
Execution of a model
Drivers
Propagation of signal values
Updating implicit signals
The simulation cycle
Lexical Elements
Character set
Lexical elements, separators, and delimiters
Identifiers
Basic identifiers
Extended identifiers
Abstract literals
Decimal literals
Based literals
Character literals
String literals
Bit string literals
Comments
Reserved words
Allowable replacements of characters
Predefined Language Environment
Predefined attributes
Package STANDARD
Package TEXTIO
not supported
Unqualified constructs in Table 3-10 are completely supported. Other constructs are qualified as
follows:
not supported
Modules/entities containing constructs identified as not supported are inferred black
boxes.
parse/ignore
Constructs identified as parse/ignore are recognized and do not cause parsing errors,
but no assertion logic is generated for the constructs.
80
Compilation
Design Style Restrictions
Design styles described in Standard for VHDL RTL Synthesis, Section 6.1 Edge Sensitive
Sequential Logic are supported, except as qualified in Table 3-11.
Table 3-11. VHDL Design Style Restrictions
Multiple Clocked Blocks
(unsupported styles)
81
Compilation
Design Style Restrictions
Clock Expressions in
Procedures
wait Statements
Implicit FSMs
Implicit style finite state machines written using multiple wait
statements are not supported. Using a single wait statement with a
valid clocking style (as per the LRM) is supported.
Non-static loops using wait statements
Non-static loops with single-clock wait (usually written as implicit
style state machines using wait statements) are not supported. For
example:
UartTxFunction : Process
begin
TopLoop : loop
wait until rising_edge(clk);
Q <= D;
end loop ;
end process ;
82
Compilation
Design Style Restrictions
Selects
Verilog Configuration
User-defined Resolution
Functions
Tristate Modeling
Direct Z assignment
Tristate logic modeling through direct Z assignment on process
variables and inside subprograms is not supported. Tri-states
modeled through direct Z assignments in concurrent signal
assignments or in processes on signals are supported.
83
Compilation
Design Style Restrictions
RAM/ROM Modeling
CheckerWare Directives
84
Compilation
Design Style Restrictions
Design unit names VHDL design units are treated as they are lower case.
VHDL packages compiled with -mixedsvvh VHDL basic identifiers are treated as
they are lower case,
Ambiguity can occur when binding to a Verilog design unit from VHDL. Here is the procedure
used to select a design unit from a library:
1. If a design unit exists in the library that has the same name in all lower case, use that
design unit.
2. Otherwise, find all design units in the library that have the same case-insensitive name.
If none or multiple design units match, do not use any design unit.
For example, assume VHDL code binds to a Verilog design unit named Test.
Design unit Test matches entity test (in all lower case). Entity test is used.
No design unit is named test (in all lower case). So, the library is searched ignoring case,
which finds the single match TEST. Module TEST is used.
No design unit is named test (in all lower case). So, the library is searched ignoring case,
which finds the multiple matches: Test and TEST. No design unit is used.
85
Compilation
Design Style Restrictions
86
Chapter 4
CDC Analysis
Clock domain crossing (CDC) analysis checks the design, infers clock trees, identifies signals
that cross clock domain boundaries, and detects a variety of synchronization patterns. The
analysis also suggests CDC checkers for possible inclusion in the design instrumentation.
Figure 4-1. Questa CDC Tools
0in_cdc
CDC GUI
interactive
(shell)
or
87
CDC Analysis
CDC Analysis Tools
Questa Compilers
and Library
Management Tools
1-step
compilation
control
files
design libraries
formal model
0in_cdc.db
0in_cdc
GUI
CDC Debug
CDC Checks Viewer
Schematic Browser
Source Code Editor
So, after compiling the design data, the static Questa CDC tool flow consists of running two
tools in sequence:
1. cdc compiles the clock domain model and analyzes CDC data.
2. 0in_cdc displays a suite of GUI tools used to manage and debug the results of CDC
analysis.
88
CDC Analysis
CDC Analysis Tools
Toolbar
Debugging Windows
Design Data
Windows
Analysis
Windows
Shows the results of CDC compilation and analysis. Each CDC scheme
instance has a status flag that indicates the status for the CDC instance (see
Status Flags on page 53). Right-click on a scheme instance to pop up
commands for displaying various debug windows for inspecting the
crossing. Also shows results merged from simulation and formal
verification sessions.
89
CDC Analysis
CDC Analysis Tools
Provides a dynamic view of the design source code for browsing. Code is
tightly linked to the GUI objects, which helps navigate the source code. For
example, right-click on various window objects to show in a source code
editor: an objects declaration, an objects instantiation, an erroneous
construct flagged in the source code, and other types of constructs flagged
in the source code. The source code editor is also linked to the waveform
viewer. As you move the main cursor in the waveform window, the
associated values from the waveform are annotated to the variables in the
source code.
90
CDC Analysis
CDC Analysis Tools
91
CDC Analysis
Static CDC Verification Flow
Since no .db file is specified, the GUI is displayed in project mode (as opposed to GUI debug
mode). Here, you have the same functionality as GUI debug mode, plus additional tools you use
to interactively run design compilation, CDC compilation and other project management
functions. Any time you wish to quit, you can save the project and exit. To continue where you
left off, run 0in_cdc with the project loaded:
prompt> 0in_cdc my_project
When starting a project from scratch, you display and fill out dialogs to set up the details of the
project. However once this is done, running, saving and restarting projects is a simple process.
To get started with a project, you can include many of the design compilation and CDC
compilation arguments as shown in Table 4-2. The information from these arguments is used to
pre-populate various dialogs in the GUI with appropriate valueswhich can save you time
setting up a project. In some cases, if the command-line arguments are complete, you can
specify -run. The 0in_cdc command uses the specified pre-populated arguments to set up the
project, runs a formal verification flow (design compile, CDC compile), and then displays the
project with the CDC analysis results.
92
CDC Analysis
Static CDC Verification Flow
Note that a copy of the system modelsim.ini file (page 58) is copied to the run directory
and the local copy is modified to match the arguments of the vmap command.
4. Compile the design files.
Use vcom to compile the VHDL files and vlog to compile the Verilog/SystemVerilog
files. For example:
prompt> vcom -f pci.f
prompt> vlog dut.v
Check the warnings/errors messages and resolve any problems. To see more information
about a message use the verror command.
prompt> verror -full 2155
MSG_IDX_GLBL_VARS_IN_VERILOG
Global declarations are illegal in Verilog 2001 syntax.
Global declarations are only legal in SystemVerilog. To enable
SystemVerilog you can either use the -sv vlog command line switch
or give the source file a .sv extension.
93
CDC Analysis
Static CDC Verification Flow
Identify clocks characteristics (including which clocks belong to the same clock
groups). See set_cdc_clock on page 265.
Override the default clock groups assigned to DUT or instance ports. See
set_cdc_port_domain on page 279.
Identify signals that should be considered constant for CDC analysis. See
set_constant on page 307.
Identify large memories that are modeled as single sequential elements for CDC
analysis. See set_memory on page 310.
Set the preferences for static CDC analysis. See set_cdc_preference on page 286.
Set severities and promotion properties for CDC scheme types and groups of
schemes. See set_cdc_report on page 296.
Override the classification of various signals and assign them certain CDC
properties. See set_cdc_signal on page 301.
ctrl;
set_cdc_reconvergence -depth 10 -divergence_depth 1
set_cdc_preference -promote_reconvergence
set_cdc_report -scheme series_redundant -severity off
-from *_en -tx_clock tx_clk */
// 0in set_cdc_clock cpu_clk -period 50
// 0in set_cdc_clock core_clk -period 20
// 0in set_cdc_clock mac_clk -period 12
endmodule
If you use the 1-step method of compiling the design, add the 1-step compilation
arguments to the cdc command (as detailed in 1-Step Compilation on page 56). For
example:
prompt> 0in -cmd cdc -d dut -ctrl ctrl.v -report_clock \
-f design.f +define+mode=initialized -y ../mylib
94
CDC Analysis
Static CDC Verification Flow
Clocks are identified correctly clocks not needed for CDC analysis can be
removed from the clock list.
Clock groups are identified correctly clocks can be added and removed from the
different clock groups.
95
CDC Analysis
Static CDC Verification Flow
Ports are assigned to the correct clock domains clock domains of DUT ports are
inferred, but you can override these assignments. Clock domains of black box
outputs must be identified.
CDC signals are classified correctly the type of each CDC signal is inferred, but
you can override these assignments. The CDC signal classification determines
which synchronization schemes are valid for the signals. For example, a data bus can
use a control signal synchronization scheme if it is grey-coded and a CDC signal that
is known to be stable does not require synchronization.
Custom synchronizers must be manually identified so CDC analysis can ignore the
signals synchronized by them.
If you use the 1-step method of compiling the design, add the 1-step compilation
arguments to the cdc command (as detailed in 1-Step Compilation on page 56). For
example:
prompt> 0in -cmd cdc -d dut -ctrl ctrl.v options\
-f design.f +define+mode=initialized -y ../mylib
96
CDC Analysis
Static CDC Verification Flow
97
CDC Analysis
Static CDC Verification Flow
Caution The path is an instance of a CDC scheme that might or might not
be valid. The CDC interface protocol can possibly be violated. A protocol checker
should be used to check the interface logic. If the scheme type promotes protocol
checkers, one is automatically created (unless promotion is specifically turned off
for the scheme).
Evaluation The path is an instance of a valid scheme for the CDC signal.
Proven The path is an instance of a valid scheme for the CDC signal and
the CDC interface protocol cannot be violated.
Typically static CDC verification results show proven schemes even when the CDC
formal engine is not enabled. For these schemes, the clock ratio of TX/RX clock periods
is < 2 (i.e., the path goes from a domain with a slow clock to one with a fast clock).
3. Fix violations.
Carefully examine the violations. To debug a violation, view the schematic (select the
scheme and run Show >Schematic) and view the source code for the violation (run
Show >Source). You must rerun static CDC verification if you change the HDL source.
98
CDC Analysis
Static CDC Verification Flow
99
CDC Analysis
Static CDC Verification Flow
Adjust the crossings selected for filtering using this form. Click on OK to accept the
current filtering. This removes the crossings from the results pane. To un-filter a
crossing entry, select any result and run Filter >By Column, which displays the Filter
CDC Checks dialog again. Select the crossing you want to restore and then use the
Delete (or Modify) button.
100
CDC Analysis
Static CDC Verification Flow
You can save the current filtering settings using the Filter >Export popup command and
restore filtering settings from a saved file using the Filter >Import popup command. This
way, you can organize different groups of CDC issues to help you filter out
extraneous information as you focus on particular hot spots in your CDC analysis.
Filtering can be a valuable tool for implementing targeting strategies in your CDC
analysis methodology.
Save the current filtering directives as a control file.
Filter >Export Directive File.
The global directives in this filters file have the form:
//0in set_cdc_report -scheme scheme ... -severity off
The -severity off option marks the crossing as a filtered CDC instance.
6. Exit the CDC GUI.
File >Quit
7. Re-run CDC compilation/analysis.
Re-run cdc with the two new control files. The ctrl_waived.v file is the control file saved
in step 4. The ctrl_filtered.v file is the control file saved in step 5.
prompt> 0in -cmd cdc -d dut -ctrl ctrl.v options
-ctrl ctrl_waived.v -ctrl ctrl_filtered.v -formal
The above invocation includes the -formal option, which turns on low-level formal
analysis of the promoted CDC protocol assertions.
8. Check static CDC analysis results.
101
CDC Analysis
Static CDC Verification Flow
Results are shown in the CDC Checks window. At this point problems should be fixed,
but some violations might still be flagged. For example, a scheme might have severity
violation, but its CDC transfer protocol is expected to be valid.
Since some schemes are marked with waived severity, the Type field has a new group of
entries:
Schemes with protocols that formal CDC proves are valid are shown with proven status
(formal CDC does not analyze protocols of waived schemes).
9. Create additional CDC attribute profiles to address specific issues.
The default tuning of the CDC attributes provides a balance between performance and
the effort spent to provide a high level of detail. You can adjust the exact balance by
specifying a CDC attribute profile targeted to specific needs. For example, the following
control file creates a profile that has the minimum compute time and memory
consumption. This profile is useful for very large designs, especially when working
iteratively to fine-tune results at early stages of verification.
// ctrl_high_performance.v
//
// High-performance CDC profile
module ctrl_high_performance;
// Turn off reconvergence checking.
// 0in set_cdc_reconvergence -check off
// Turn off exact memory modeling for large memories.
// 0in set_memory -abstract mem1 mem2
// Disable generation of CDC protocol assertions
// 0in set_cdc_report -default_promotion off
//
//
//
/*
For extremely large designs, use a hierarchical CDC verification flow (see Hierarchical
CDC Analysis on page 117).
102
CDC Analysis
Static CDC Verification Flow
The following example control file creates a profile that provides a higher level of detail
in the checking and reporting of CDC data.
// ctrl_high_accuracy.v
//
// High-accuracy CDC profile
module ctrl_high_accuracy;
// Enable divergence checking and set reconvergence checking to
// a greater depth (default is 0). Start with a depth of 1.
// 0in set_cdc_reconvergence -divergence_depth 1 -depth 1
// Enable reconvergence reporting for paths thru
// DMUX synchronizers.
// 0in set_cdc_preference -dmux_as_recon_start
// Enable FIFO and handshake scheme checking:
// 0in set_cdc_preference -fifo_scheme -handshake_scheme
// Report disabled CDC paths.
// 0in set_cdc_preference -filtered_report
// Enable constant propagation through registers with
// non-constant enables
// 0in set_constant_propagation -enable
endmodule // ctrl_high_accuracy
Define all clock periods using set_cdc_clock and turn on formal CDC analysis with
the cdc command-line switch -formal. Start with the default -formal_effort (low).
Turn on reporting of patch to dead-end nodes using the cdc command-line switch
-process_dead_end.
Use modal analysis to check all modes of clocking (see Modal CDC Analysis on
page 133).
103
CDC Analysis
Dynamic CDC Verification Flow
cdc_dsel
cdc_handshake_data
104
CDC Analysis
Dynamic CDC Verification Flow
Checkers for the protocols verified by the formal CDC engine are not promoted, so formal
analysis and simulation do not waste cycles analyzing pre-verified protocols. Standard Questa
CDC checkers can be manually added for cases where the schemes protocols match the
protocols verified by the checkers. Custom assertions checkers can be created for other
situations. Simulation and formal results for these checkers are not imported back into the CDC
GUI, so problems must be debugged in those environments. CDC-FX metastability analysis
also uncovers issues with protocols with inconclusive results.
105
CDC Analysis
Dynamic CDC Verification Flow
run_prove:
0in -od prove -cmd csl -f $(EX_HOME)/source/filelist \
-d demo_top -ctrl $(EX_HOME)/bin/csl_control.v \
-ctrl $(EX_HOME)/static/0in_cdc_ctrl.v
0in_prove +0in_od+prove +0in_dir+prove/0in_cache \
+0in_init+$(EX_HOME)/bin/init.txt +0in_effort+med
prompt> make run_prove
106
Proven The schemes protocol checker was promoted and Prove formal
verification proved the schemes CDC interface protocol cannot be violated.
CDC Analysis
Dynamic CDC Verification Flow
cdc
-compile_assertions
control
files
-work library
vsim
-f 0in_cdc_sim.arg
-f 0in_cdc_sim_vhdl.arg
merge
0in_checksim.db
vcom/vlog
0in_cdc
0in_cdc.db
GUI
vcom/vlog
testbench
files
debugging
environment
Results from these simulations with CDC protocol assertions can be merged back into the CDC
GUI for review and debugging. The following procedure uses the Questa vsim simulator.
1. Set up the design library and compile the design.
For example:
prompt> vlib work
prompt> vmap work work
prompt> vcom dut.vhdl
107
CDC Analysis
Dynamic CDC Verification Flow
prompt> vlog -f 0in_cdc_sim.arg
prompt> vcom -f 0in_cdc_sim_vhdl.arg
5. Run simulation.
Specify the PLI library path for the simulator and the vsim arguments files. For example:
prompt> vsim -c tb -pli $HOME_0IN/lib/lib0InLoadMTIPLI.so \
-f 0in_cdc_sim.arg.vsim -f 0in_cdc_sim.arg.vsimrun \
-do "add log -r /*; run 1000; quit -f"
One new column of status flags is added. The Simulation field shows the status of the
schemes from simulation. The Type field shows the merged statuses for the schemes.
The Simulation field has five types of status flags:
108
CDC Analysis
Dynamic CDC Verification Flow
Schemes with violation severity are promoted. Similarly, protocol assertions that are
activated in simulation (Evaluated) might not be covered in simulation. So, two
additional status flags are possible in the merged status (Type field):
109
CDC Analysis
Dynamic CDC Verification Flow
Use the waveform view, the schematic view and the source code editor to track down
and fix the source of the firings.
Typically, you modify simulation or run CDC protocol checking with additional tests to
ensure complete coverage of the relevant CDC protocol assertions.
110
CDC Analysis
Dynamic CDC Verification Flow
111
CDC Analysis
Dynamic CDC Verification Flow
/* 0in set_cdc_fx_metastability_window
-start 5000 -stop 1000 -rx_clock wr_clk -tx_clock rd_clk */
/* 0in set_cdc_fx_metastability_window
-start 6000 -stop 1000 -rx_clock rd_clk -tx_clock wr_clk */
endmodule
Add the -fx argument, which generates the CDC-FX metastability injection logic.
For example:
prompt> vlib work
prompt> vmap work work
prompt> vcom dut.v
prompt> 0in -cmd cdc -d dut -ctrl dut_ctrl.v fx -ctrl fx_ctrl.v\
-compile_assertions -prefix tb.dut_inst
prompt> vlog -f 0in_cdc_sim.arg
prompt> vcom -f 0in_cdc_sim_vhdl.arg
prompt> vlog tb.v
3. Run simulation.
For example:
prompt> vsim -c tb -pli $HOME_0IN/lib/lib0InLoadMTIPLI.so \
-f 0in_cdc_sim.arg.vsim -f 0in_cdc_sim.arg.vsimrun \
-do "add log -r /*; run 1000; quit -f"
112
CDC Analysis
Dynamic CDC Verification Flow
In this example, the All Bits Metastable cover point shows that 0 out of 8 bits are tested
with metastability injection. Typically, you modify simulation or run additional tests to
ensure complete coverage of the CDC-FX checkers.
Simulation Arguments
Table 4-4 shows additional arguments you can include in your simulator invocation when you
run simulation with CDC protocol checkers and CDC-FX checkers.
Table 4-4. Simulator Arguments
simulator_cmd simulator_args
f sim_arg_file [+0in_no_checksim_db] [+0in_checker_finish_delay+time]
[+define+prefix_0in=prefix] [+0in_db+file] [+0in_firing_limit+limit]
[+0in_signature_limit+limit] [+0in_no_violation_limit] [+0in_firing_keyword+keyword]
[+0in_licq] [+0in_od+output_dir] [+0in_no_statistics] [+0in_covered_report[+file]]
[+0in_simulation_message_limit+limit] [+0in_no_simulation_messages] [version]
[+0in_suppress_fx_name{+name}] [+0in_disable_fx_force] [+0in_random_seed+n]
simulator simulator_args
f sim_arg_file
+0in_no_checksim_db
+0in_checker_finish_delay
+time
+define+prefix_0in=prefix
+0in_db+file
+0in_firing_limit+limit
113
CDC Analysis
Dynamic CDC Verification Flow
+0in_no_violation_limit
+0in_firing_keyword
+keyword
+0in_licq
+0in_od+output_dir
+0in_no_statistics
+0in_covered_report[+file]
+0in_simulation_message_
limit+limit
+0in_no_simulation_
messages
version
+0in_suppress_fx_name
{+name}
+0in_disable_fx_force
+0in_random_seed+n
114
CDC Analysis
Dynamic CDC Verification Flow
fastmod [module]
race_avoid
incr
incremental_firing_db
ac_stats
cuname comp_unit
psl
pslfile_vl
verilog_vunit_file
pslfile_vh vhdl_vunit_file
ovl
ovl_cover
sim
Default simulator: Questa, MTI, VCS, NC-Verilog, or 3-step
{questa | mti | vcs | nc | nc3} NC-Verilog. Default: MTI. The default MTI version is the same
as the vsim executable in the current search path.
full
rel_paths
115
CDC Analysis
Dynamic CDC Verification Flow
use_synthesis_case_
directives
rcd
rcd_file file
rcd_level level
sif simulation_arg_file
unique_names
exit_on_directive_errors
Exits if any checker directive errors are found (after all checkers
have been generated).
verilog_options
vhdl_options
rtl_options
[+skip_modules {+module}]
[+skip_syscalls {+systemcall}]
[skip_protected_modules] [skip_protected_code]
[ignore_translate_off]
reporting_options
[wd working_directory][+nowarn{+messageID}]
[+error{+messageID}
compile_options
116
CDC Analysis
Hierarchical CDC Analysis
BLOCK
intra-block violation
V
intra-block violation
V
top-level violation
ILM
TOP LEVEL
2. Analyze top-level
design.
Debug inter-block
and top-level issues.
ILM
top-level violation
V
ILM
ILM
inter-block violation
ILM
ILM
ILM
ILM
Note
Hierarchical CDC analysis is static analysis only and does not support promotion of
protocol checks or generation of CDC-FX injectors.
Prerequisites
Before running hierarchical CDC, set up the design for CDC analysis as you would for flat CDC
analysis.
1. Compile the source files.
Questa CDC User Guide, v10.0c_2
October 2011
117
CDC Analysis
Hierarchical CDC Analysis
hierarchical constraints
Phase 2
Analyze Blocks
Phase 3
Analyze Top-level Design
118
cdc . . . -hier_cache \
0in_hier/blk1/0in_cache \
0in_hier/blk2/0in_cache \
0in_hier/blk3/0in_cache \
CDC Analysis
Hierarchical CDC Analysis
Note
Hierarchical CDC is a bottom-up verification process where you perform full static
CDC analysis on selected lower-level blocks first, and then run static CDC analysis on
the top level plus the remaining design logic. Questa CDC does not support a top-down
verification process where you run static CDC analysis on the top level first and then run
static CDC analysis on the lower-level blocks. Hierarchical CDC does however support
both top-down and bottom-up creation of block constraints as described in Block
Constraints on page 121.
Block: blk2
Instances: b2
Parameters/Generics: W = 16
Global CDC Preferences
0in set_cdc_preference -promote_reconvergence
119
CDC Analysis
Hierarchical CDC Analysis
//
//
//
//
//
0in
0in
0in
0in
-formal_add_bus_stability -formal_add_recon_stability
set_cdc_fifo_preference -no_read_sync
set_cdc_handshake_preference -check_mux_recirculation
set_constant_propagation -enable
set_cdc_reconvergence -depth 4 -divergence_depth 3
//
//
//
//
//
//
0in
0in
0in
0in
0in
0in
endmodule
To segregate the block-level analysis from that of the other blocks and from the toplevel analysis, the output is directed to a subdirectory of the 0in_hier directory (-od
0in_hier/blk2). The block constraints file (0in_cdc_hier_constraints_blk2_ctrl.v) was
generated in phase 1. The -hier_block argument identifies the block for the block-level
analysis.
2. Run the CDC GUI and verify the CDC analysis.
shell prompt> 0in_cdc 0in_hier/blk2/0in_cdc.db
Verify the CDC checks for the block. Violations represent issues within the block. You
can fix problems with the RTL source code, re-run CDC analysis for the block and
iterate. But, changes to the RTL might affect CDC analysis of other blocks or the top
level design, so use caution. If you do change the source code, you must re-generate
block constraints and re-run block analyses for all hierarchical blocksto ensure the
results are accurate and completebefore you analyze the top-level design.
120
CDC Analysis
Hierarchical CDC Analysis
Top-level CDC analysis builds a model of the top design from the CDC interface models for the
blocks analyzed in phase 2 and from the remaining design logic.
1. Run hierarchical CDC analysis of the top level.
For example:
0in> cdc -d top -od 0in_hier/top -ctrl top_ctrl.v \
-hier_cache 0in_hier/blk1/0in_cache \
0in_hier/blk2/0in_cache \
0in_hier/blk3/0in_cache
The -hier_cache option lists cache directories for the hierarchical blocks. The
0in_hier/blk1, 0in_hier/blk2 and 0in_hier/blk3 directories were specified as the output
directories (-od dir) during the block-level sessions. The name specified for the cache is
0in_cache by default. However, if you change the 0in cache directory name (i.e., using
the -cache option to the 0in shell), the corresponding -hier_cache pathnames must
match.
The top-level CDC analysis detects the crossings not covered by the block-level runs
and the crossings into the portal boundaries of the hierarchical blocks.
2. Run the CDC GUI and verify the CDC analysis results.
shell prompt> 0in_cdc 0in_hier/top/0in_cdc.db
Check the results for the design. At this point, the whole design is available to the GUI
for debugging. Results from the block-level sessions are merged into the top-level
results. However within the blocks, only partial netlist information is available (i.e., only
the level of detail retained in the CDC interface models of the blocks).
Block Constraints
You can create the hierarchical CDC block constraints two ways: propagate them from the
bottom up and propagate them from the top down.
With bottom-up constraints, you manually create the constraints for the individual
blocks. Later, CDC analysis of the top level performs consistency checks that verify the
constraints specified at the top level do not conflict with the constraints propagated up
from the lower levels.
With top-down constraints, you first run a special CDC session on the top level, which
generates hierarchical CDC constraints files for the block-level analyses automatically.
After analyzing the blocks and generating the ILMs, run the top level analysis session,
which performs the consistency checks. This checking provides a sanity check that no
logic or constraints are changed during the hierarchical CDC verification process.
121
CDC Analysis
Hierarchical CDC Analysis
You are developing the design bottom up and the top level is not finalized or is
unsynthesizable. You do not have top-level constraints to push down to the lower levels.
The top level is available, but is too large to process by automatic block-level constraint
generation.
Specify each blocks CDC constraints as a set of global directives in a Verilog hierarchical
constraints module, saved as a CDC control file for the block. To create bottom-up constraints:
1. Manually create a hierarchical CDC constraint file for each block.
Use global directives to specify: clocks, clock groups, constants, port domains and
stable ports.
2. Run hierarchical CDC analysis of the blocks and their constraints.
3. Run hierarchical CDC analysis of the top level.
In addition to finding CDC violations at the top level (and in the remaining logic),
hierarchical CDC analysis of the top level performs consistency checks. These checks
compare constraints used for the blocks with the block constraints propagated down
from the design-level constraints.
Because top-level and block-level constraints are created manually, errors and
mismatches are more likely. You must fix these errors and mismatches for hierarchical
CDC analysis to be accurate. The types of constituency checks are:
122
Clocks Clocks connected to the block ports are the same when analyzing the top
level as they were when analyzing the blocks.
Clock groups Block-level clock groups are the same when analyzing the top level
as they were when analyzing the blocks.
Constants Constants on the block ports are the same when analyzing the top level
as they were when analyzing the blocks.
Port domains Domains of the block ports are the same when analyzing the top
level as they were when analyzing the blocks.
Stable ports Block ports marked stable at the block level are also marked stable at
the top level.
CDC Analysis
Hierarchical CDC Analysis
The top level is finalized, is synthesizable and has its top-level constraints defined.
If not, you must use the bottom-up method of creating block constraints. To create top-down
constraints:
1. Run cdc with the -report_constraints option.
This option runs automatic block-level CDC constraint generation, reports the clock
domain data and quits. The arguments to -report_constraints are the design unit names
of the block instances. For example:
0in> cdc -d top -ctrl top_ctrl.v -report_constraints blk1 blk2 blk3
If the same module/entity is instantiated more than once, CDC constraint generation
handles variations in the top-level connectivity and parameters/generics for the different
instances.
2. Check results.
a. Fix errors and resolve warnings.
b. Check 0in_cdc_design.rpt and ensure the clock groups and port domains are
identified correctly.
c. Check the 0in_cdc_hier_constraints_*_ctrl.v files (if desired). For each block,
check the design unit name, instance name, parameter/generic values and the global
directives.
Each hierarchical constraints module for a block has two parts:
Block specifications
Clock domain analysis of the blocks instances determines the block instances
clocks and clock domains of the blocks ports. These constraints are specified with
123
CDC Analysis
Hierarchical CDC Analysis
0in_cdc_hier_blk1_ctrl.v
0in_cdc_hier_blk2_ctrl.v
0in_cdc_hier_blk3_ctrl.v
0in_hier.scr
0in_hier.Makefile
Phase 2
Analyze Blocks
124
CDC Analysis
Hierarchical CDC Analysis
The scripts are generated so that the output directory specified by the -od 0in shell option
(default: current run directory) for the cdc session is specified as the output directory for the
files generated by the scripts.
0in_hier.scr
The 0in_hier.scr script (see Example 4-2) is a csh script that runs the block-level analyses in
sequence and then runs the top-level analysis:
shell prompt> 0in_hier.scr
output from block-level sessions
output from the top-level session
shell prompt> 0in_cdc 0in_hier/top/0in_cdc.db
125
CDC Analysis
Hierarchical CDC Analysis
set fail = 1
set fail_mode = top
else
set fail_mode = ($fail_mode top)
endif
endif
# Summary
if ($fail == 0) then
echo PASSED
exit 0
else
echo FAILED : $fail_mode
exit -1
endif
0in_hier.Makefile
The 0in_hier.Makefile script (see Example 4-3) is a Makefile that runs the block-level analyses
and the top-level analysis. The make all directive runs these tasks in sequence:
shell prompt> make -f 0in_hier.Makefile all
output from block-level sessions
output from the top-level session
shell prompt> 0in_cdc 0in_hier/top/0in_cdc.db
In addition to the front-to-back flow, the Makefile can be used to run the cdc sessions
individually, for example:
shell prompt> make -f 0in_hier.Makefile blk1
shell prompt> 0in_cdc 0in_hier/blk1/0in_cdc.db
shell prompt> make -f 0in_hier.Makefile blk2
shell prompt> 0in_cdc 0in_hier/blk2/0in_cdc.db
shell prompt> make -f 0in_hier.Makefile blk3
shell prompt> 0in_cdc 0in_hier/blk3/0in_cdc.db
shell prompt> make -f 0in_hier.Makefile top
shell prompt> 0in_cdc 0in_hier/top/0in_cdc.db
The targets of the make commands are the design unit names of the blocks (blk1, blk2 and blk3
in this example) and the DUT name (top).
Example 4-3. 0in_hier.Makefile
## Hierarchical CDC Makefile
##----------------------------------------------------CDC_OD = 0in_hier
CDC_HIER_CMD = "cdc -d top dut.v"
CDC_TOP_CMD = "cdc -d top dut.v"
0IN = 0in
all:BLOCKS top
BLOCKS:blk1 blk2 blk3
126
CDC Analysis
Hierarchical CDC Analysis
Waivers
Waivers are instances of clock-domain crossing schemes that are waived from reporting.
Waiving scheme instances eliminate the noise created by identifying all of the CDC issues
found in the design. By waiving a particular instance of a CDC scheme, you are indicating the
instance is OK (at least for the time being). For example, you might waive an instance of a
missing synchronizer because you know the crossing has no synchronization issues. Each time
you run CDC analysis with waivers identified, only relevant CDC issues are shown in the GUI
CDC Checks window by default, so you do not waste time studying CDC issues that are not
meaningful.
For example, before performing hierarchical CDC analysis, you typically run flat CDC analysis
on the various blocks as they are developed. When you view the results and debug issues, you
typically mark crossings and issues to be waived. These waivers are saved as a CDC control file
from the GUI (sometimes called a waiver file). You can specify this file during later CDC
analysis sessions, to filter out issues already considered.
In a similar way, you can incorporate waivers into the hierarchical CDC flows.
1. After running block-level analysis of a block, run the CDC GUI:
127
CDC Analysis
Hierarchical CDC Analysis
shell prompt> make -f 0in_hier.Makefile blk1
shell prompt> 0in_cdc 0in_hier/blk1/0in_cdc.db
2. Import the waivers file for the block if you have one: File >Import >Directive File.
Previously-created waivers from the block development stage can be applied to the
hierarchical CDC block-level results.
3. Check the existing specifications for each waived instance of a CDC scheme and add
additional waivers as needed. Since you eventually want to roll the waivers up into toplevel analysis, you must ensure the waivers are properly formed for this purpose. To
waive a CDC scheme instance, select the instance and run Create Directive >Waived.
The Set CDC Report dialog is displayed with information pre-filled (Figure 4-8).
Figure 4-8. Waiving a Block-level Violation
Create Directive >Waived
Remove TX/RX
Clock Names
Pre-filled Dialog
Fields
Add Module
Name
Add Comment
The TX Clock and RX Clock fields are blank. Clock names at the block level do not
match the clock signal names at the top level. When they do not match at the top
level, a warning is reported and the waiver is ignored. So, you must leave these fields
blank.
The Module field specifies the module/entity name of the block. This field is often
omitted when developing at the block level, but should be specified so the waiver is
recognized at the top level.
You can set the other fields as desired. When you apply the dialog, a set_cdc_report
-severity waived directive is added to the Directives window.
128
CDC Analysis
Hierarchical CDC Analysis
Since you can run the various block-level sessions in parallel, end-to-end analysis time
is significantly reduced.
All instances of each hierarchical CDC block have the same clock domains, port
domains and parameter/generics settings.
All hierarchical CDC blocks are suitable for block-level CDC analysis.
You have a top-level design you can use to generate the CDC block constraints.
You can work around these assumptions as described in the following sections.
129
CDC Analysis
Hierarchical CDC Analysis
0in_cdc_hier_constraints_blk1_ctrl.v
0in_cdc_hier_constraints_blk2_ctrl.v
0in_cdc_hier_constraints_blk3_ctrl.v
In this example, all instances of blk1 are homogeneous, all instances of blk2 are homogeneous,
and so on. But, if a block has heterogeneous instances, a hierarchical control file is generated for
each homogeneous group of instances of the block. So, if blk1 has two sets of instances that
have different configurations, two hierarchical control files are generated:
0in_cdc_hier_constraints_blk1_0_ctrl.v
0in_cdc_hier_constraints_blk1_1_ctrl.v
During block-level analysis, each of these instance groups must be analyzed separately:
0in> cdc -d top -od 0in_hier/blk1_0 \
-ctrl 0in_cdc_hier_constraints_blk1_0_ctrl.v \
-hier_instance top.U1
0in> cdc -d top -od 0in_hier/blk1_1 \
-ctrl 0in_cdc_hier_constraints_blk1_1_ctrl.v \
-hier_instance top.U3
In this example, blk1 has two heterogeneous groups of instances: (top.U1) and (top.U3). Instead
of specifying the blk1 block with the -hier_block module argument, you specify the
heterogeneous instances with a -hier_instance instances argument. In this example, block-level
analyses of blk1 generate two CDC interface models for use in the top-level analysis:
0in_hier/blk1_0/0in_cache
0in_hier/blk1_1/0in_cache
Tip: The 0in_hier.scr and 0in_hier.Makefile scripts also work for heterogeneous
instances of blocks. For example, make -f 0in_hier.Makefile blk1_0.
When hierarchical blocks are present, 0in_cdc_design.rpt identifies them:
General Design Information
==========================
Number of Black Boxes = 0
Number of Registers
= 145
Number of Latches
= 0
Number of RAMs
= 2
Number of CFM Hierarchical Blocks
Number of ILM Hierarchical Blocks
Number of CDC bits
= 82
= 1
= 1
130
CDC Analysis
Hierarchical CDC Analysis
CDC analysis for the block generates both an ILM model and a CFM model (named
0in_cdc_hier_*_ctrl.v). You also can add the directive to the top-level control file in order to
propagate the directive to the block-level analyses via the hierarchical control files (during the
report constraints step).
Figure 4-9. Top-level CDC Analysis with CFMs
ILM
top-level design
top-level violation
V
previously
analyzed blocks
ILM
ILM
interface
logic model
top-level violation
V
CFM
CFM
file
CFM control
model
inter-block violation
ILM
ILM
ILM
For the blocks that you want to use the control file models, specify the corresponding generated
control files with the -hier_ctrl_file_model option. For example:
0in> cdc -d top -od 0in_hier/top -ctrl top_ctrl.v \
-hier_cache 0in_hier/blk1/0in_cache \
0in_hier/blk2/0in_cache \
-hier_ctrl_file_model blk3 0in_cdc_hier_blk3_ctrl.v
131
CDC Analysis
Hierarchical CDC Analysis
Here, blk1 and blk2 are modeled as ILMs and blk3 is modeled as a CFM. Never specify both an
ILM and a CFM for the same block. Table 4-6 compares the ILM and CFM models and
Table 4-7 shows the limitations of the control file models.
Table 4-6. ILMs vs. CFMs
Interface Logic Model
Internal interface logic model
saved in a block-level cache.
Results are equivalent to
standard (flat) CDC analysis.
User can limit the depth of CDC
analysis.
Blocks can be modules/entities
and instances.
Block logic schematics
available.
Feature
data structure
efficacy
user control
granularity
GUI
Limitation
multiple constraints
non-default parameters
Separate parameter sets for different instances of the block are not
supported. CDC analysis uses the default parameter values for the
block.
reconvergence
promoted checkers
complex schemes
inout ports
Not supported.
set_constant
Slices and bits in the block are not supported for set_constant.
combo fanout
132
CDC Analysis
Modal CDC Analysis
Power optimization idle design blocks can be disabled, and clocks can be gated.
Running CDC analysis on these designs results in a large number of CDC violations. Users are
only interested in a subset of the violations that are relevant to the modes their designs are
intended to operate in. In addition, many users (particularly verification engineers) might not be
aware of the operating modes a design could operate in. A feature to automatically infer all the
operating modes and let the user select the ones their design can operate in helps address this
issue.
Modal analysis enables the user to specify the operating modes, or infer all of the modes, or
allows the user to select the set that is of interest. CDC analysis only generates violations for the
modes selected by the user.
Modal analysis has the following features:
Automatically infer clock domain modes, with capabilities for user specification of
modes.
Allows the user to spawn multiple CDC runs to analyze the circuit in each mode.
The modes are inferred based on the clock multiplexing in the design. For example, for a design
with three clock domains (A, B, and C), if clock domain B can be synchronized to A with a
MUX and the clock domain C can be synchronized to A with a MUX, each with separate
control signals as shown in Figure 4-10, then there are three possible modes that are of interest
for CDC analysis as follows:
1. All asynchronous.
2. A and B grouped into one domain, C a separate domain.
3. A and C grouped into one domain, B a separate domain.
The fourth mode of operation, when all clocks are grouped into one domain (driven by CLKA),
is not of interest to CDC analysis.
133
CDC Analysis
Modal CDC Analysis
To perform the automatic recognition of clock modes, add the -report_modes option to the
CDC command line. With this option, the 0in_cdc_mode_control.v file is automatically created.
This file contains the definition of the inferred modes. The 0in_mode.scr shell script is then
executed to spawn multiple CDC runs to analyze each mode.
The mode control file can be edited to eliminate any modes that are not of interest by adding the
option to the corresponding set_mode global directive in this file. Then CDC can be
rerun with the modified mode control file as an input control file (using the -ctrl option) to
update the run script.
-ignore
The results of all modes can be analyzed together using the CDC GUI. Invoke the CDC GUI
with the following command:
0in_cdc 0in_cdc.db
Use Model
Modal analysis has two approaches as follows:
The basic use model for both approaches is identical. The difference is in the way analysis is
done and reports are generated. These differences are highlighted throughout the flow. Running
modal analysis is a four step process as follows:
134
CDC Analysis
Modal CDC Analysis
The -set option is used to specify constant values in this specific mode. This option needs to
be specified once for each constant value.
The -ignore option is used to specify a mode that does not need to be considered for analysis.
Following is an example:
// Test modes.
// 0in set_mode scan_load -set tm 1'b1 -set scan_en 1'b1
// 0in set_mode scan_test -set tm 1'b1 -set scan_en 1'b0
// Regular operation modes.
// 0in set_mode fast_mode -set tm 1'b0 -set sel 1'b1
// 0in set_mode ignr_mode -set tm 1'b0 -set sel 1'b0 -ignore
This automatically generates the modal script 0in_mode.scr file that you execute (just
0in_mode.scr with no arguments) as follows:
0in_mode.scr
135
CDC Analysis
Modal CDC Analysis
This runs CDC multiple times (one per mode) and creates all of the database files (.db) for each
mode.
For both approaches (user-specified and inferred), the 0in_mode.scr script file is generated (see
page 146). This script contains the steps to run individual mode analysis.
In the presence of user modes, this script runs the user-specified modes only. If the user wishes
to analyze any of the missing modes, then the user needs to run this step again with an updated
control file.
If no user modes are specified, then CDC infers all the operating modes. A control file named
0in_cdc_mode_ctrl.v (see page 145) is automatically generated with directives specifying all
the inferred modes. Details of all the inferred modes are included in the CDC design
0in_cdc_design.rpt report file (see page 145).
If the user modes are specified, then mode inferencing still occurs. The inferred modes are
compared to the user modes to identify any missing or incomplete modes. All errors identified
in the user specified modes are reported in the 0in_cdc_design.rpt report file (see page 145). A
control file named 0in_cdc_mode_ctrl.v (see page 145) is automatically generated with
set_mode global directives for incomplete user modes and inferred modes not specified by the
user.
136
Missing mode This is an inferred mode. For every missing mode, a [hdl-119]
message is generated. A set_mode global directive is generated for this inferred mode
in the 0in_cdc_mode_ctrl.v file.
Ignored mode This user mode is ignored for modal analysis. This is specified by the
user with the -ignore option.
Incomplete mode This user mode is partially specified and needs additional
constants. For each missing constant inferred by the tool, a [hdl-125] warning message
is issued. A set_mode global directive is generated for the corresponding complete
mode in the 0in_cdc_mode_ctrl.v file.
OK This user mode is complete (verified). The user mode may contain additional
signals that were not inferred. These signals are marked as undetected in the mode
information table. The [hdl-124] information messages are issued for each undetected
signal.
CDC Analysis
Modal CDC Analysis
The Modal summary and information tables shown below are printed in the 0in_cdc_design.rpt
file when the cdc -report_modes option is specified.
Modes
=====
-------------------------------------------------------------Mode
Type
Message
-------------------------------------------------------------cdc_mode_0
Questa CDC
Missing mode
mode2
User
Ignored mode
mode3
User
Incomplete mode(missing constant)
mode4
User
OK
mode5
User
OK
mode6
User
Duplicate mode(mode4)
--------------------------------------------------------------
User Modes
=========
Constants in mode2 (Ignored)
---------------------------------------------------Signal
Value
Type
---------------------------------------------------sel1
1'b0
User
sel2
1'b0
User
----------------------------------------------------
Constants in mode4
---------------------------------------------------Signal
Value
Type
---------------------------------------------------sel4[3:2]
2'b10
User
sel5
3'b110
User
----------------------------------------------------
Constants in mode5
---------------------------------------------------Signal
Value
Type
---------------------------------------------------sel1
1'b1
User
sel2
1'b0
User
137
CDC Analysis
Modal CDC Analysis
sel5
3'b101
User (Undetected)
----------------------------------------------------
Inferred Modes
===============
Constants in cdc_mode_0 (Missing)
---------------------------------------------------Signal
Value
---------------------------------------------------sel1
1'b1
sel2
1'b0
sel3
1'b1
----------------------------------------------------
At this point, the user can observe the modes inferred by CDC as well as the modes specified by
the user, even though the CDC run is incomplete (see Viewing Incomplete CDC Runs on
page 147).
The user might be interested in verifying their clock tree first before running CDC analysis. In
this case, the cdc -report_clock option can be used along with report modes. After running
all of the steps, the user can view clock trees for all the modes in the CDC GUI (see Viewing
Incomplete CDC Runs on page 147).
Viewing Results
The results can be viewed using the CDC GUI as follows:
0in_cdc 0in_cdc.db
This command invokes the CDC GUI in the modal state as shown in Figure 4-12 on page 140.
138
CDC Analysis
Modal CDC Analysis
This displays all the violations and their corresponding modes (see the 0in_cdc User Interface
Modal subsection below for detailed information).
139
CDC Analysis
Modal CDC Analysis
If the database is modal, then the CDC Checks view has a mode column (see Figure 4-12) so
that the checks can be grouped and sorted by mode. The clock tree display in the Workspace
pane (see Figure 4-12) also shows an additional mode level of hierarchy.
The filters feature can be used to change the default maximum hierarchy displayed. To do this,
right-click on a signal and select Filters as shown in Figure 4-13. This invokes the Edit
Preferences window as shown in Figure 4-14. Change the Maximum Hierarchy Displayed
number as desired. In this example, the number is changed from 3 to 0.
140
CDC Analysis
Modal CDC Analysis
141
CDC Analysis
Modal CDC Analysis
Because any schematic path displayed from the CDC Checks view is from a specific CDC
modal run, the schematic always retains its mode so that incremental exploring of that
schematic colors itself as per that mode as shown in Figure 4-12 on page 140. The mode for the
schematic path is displayed in the schematics title. In addition, the Path ID signal is displayed
in the schematic title and in the Details pane, which is multi_bits_68424 for this example
(circled in green in Figure 4-12 on page 140).
Note that the bubble help not only displays the usual clock group for a signal, but also the mode
for that clock tree as shown in Figure 4-15.
142
CDC Analysis
Modal CDC Analysis
143
CDC Analysis
Modal CDC Analysis
Now select cdc_mode_1 (5) and observe the signals change color as shown in Figure 4-17.
Figure 4-17. Color Change as the Mode Context Changes
144
CDC Analysis
Modal CDC Analysis
Examples
0in_cdc_mode_ctrl.v File
An example of the automatically generated mode control file (0in_cdc_mode_ctrl.v) is
shown below:
module zin_cdc_mode_ctrl_top;
// Mode: cdc_mode_0
// Clock: TRK
/* 0in set_mode cdc_mode_0
-set TCS 1'b1
*/
// Mode: cdc_mode_1
// Clocks:
//
CLK0
//
RCLK[0]
/* 0in set_mode cdc_mode_1
-set TCS 1'b0
-set I5[1:0] 2'b0
*/
// Mode: cdc_mode_2
// Clocks:
//
CLK0
//
RCLK[1]
/* 0in set_mode cdc_mode_2
-set TCS 1'b0
-set I5[1:0] 2'b1
*/
endmodule
0in_cdc_design.rpt File
A sample mode coverage report file (generated in 0in_cdc_design.rpt) is shown below:
Mode information
================
-------------------------------------------Mode
Type
Information
-------------------------------------------cdc_mode_0
Questa CDC Inferred mode
cdc_mode_1
Questa CDC Inferred mode
cdc_mode_2
Questa CDC Inferred mode
-------------------------------------------User Modes
==========
None
Inferred Modes
==============
Constants in cdc_mode_0
145
CDC Analysis
Modal CDC Analysis
------------------------------------------Signal
Value
------------------------------------------TCS
1'b1
------------------------------------------Constants in cdc_mode_1
------------------------------------------Signal
Value
------------------------------------------TCS
1'b0
I5[1:0]
2'b00
------------------------------------------Constants in cdc_mode_2
------------------------------------------Signal
Value
------------------------------------------TCS
1'b0
I5[1:0]
2'b01
-------------------------------------------
0in_mode.scr File
A sample automatically generated mode script file (0in_mode.scr) is shown below:
#!/bin/csh -f
\rm -fr /modal/0in_mode
mkdir /modal/0in_mode
set cdc_od = /modal/0in_mode
set cdc_cmd = "cdc -d top t0.v"
# Invoke CDC for all the modes.
set fail = 0
set fail_mode = ""
foreach cdc_mode (cdc_mode_0 cdc_mode_1 cdc_mode_2)
# Run CDC for $cdc_mode
0in -od ${cdc_od}/$cdc_mode \
-cmd $cdc_cmd \
-ctrl 0in_cdc_mode_ctrl.v \
-mode $cdc_mode
# Check for failures
if ($status != 0) then
if ($fail == 0) then
set fail = 1
set fail_mode = $cdc_mode
else
set fail_mode = ($fail_mode $cdc_mode)
endif
endif
end
146
CDC Analysis
Modal CDC Analysis
# Cleanup
if ($fail == 0) then
echo PASSED
exit 0
else
echo FAILED : $fail_mode
exit -1
endif
This automatically generates the 0in_mode.scr file, which contains the source code to
generate the modes. In addition, the 0in_mode directory is automatically generated.
However, at this time the directory is empty because the 0in_mode.scr file that generates
the reports for each modal has not been run.
This command invokes the CDC GUI as shown in Figure 4-18 with the Clock tab
selected. Notice in the Workspace window that the modes are not loaded.
147
CDC Analysis
Modal CDC Analysis
148
CDC Analysis
Modal CDC Analysis
Figure 4-20 shows cdc_mode_0 and cdc_mode_1 are now loaded. However,
cdc_mode_2 has not completed running and is not loaded. As the design continues to
run, the user can continue to select File > Reload > Database to load as they
complete running.
Figure 4-20. Some Modes Have Clock Tree Information
149
CDC Analysis
CDC Analysis of FPGAs
The libraries were compiled using the versions of Questa vcom/vlog commands that
match those shipped with the Questa CDC/Formal distribution software.
If these statements are true, skip to Phase 2. If not, compile the FPGA source libraries into
resource libraries. First create a directory to hold the compiled FPGA resource libraries:
prompt> mkdir 0in_libs
Then, set up and compile the FPGA source libraries as illustrated in the following examples. If
FPGA library elements are instantiated in VHDL code, you must compile a resource library for
that. The logical library name for this library has no _ver suffix. If FPGA library elements are
instantiated in Verilog code, you must compile a resource library for that. The logical library
name for this library has a _ver suffix.
Xilinx
unisim
Used for library elements instantiated in VHDL. Compile the VHDL files containing the
component and package declarations from the standard Xilinx simulation library. Then
compile the synthesizable Verilog models of the library. The vlog -convertallparams
option is needed to convert the Verilog parameters to match the generics types in the
VHDL component definitions.
vlib
vmap
vcom
vcom
vlog
150
0in_libs/unisim
unisim 0in_libs/unisim
-work unisim $XILINX/vhdl/src/unisims/unisim_VCOMP.vhd
-work unisim $XILINX/vhdl/src/unisims/unisim_VPKG.vhd
-work unisim -convertallparams \
CDC Analysis
CDC Analysis of FPGAs
$HOME_0IN/share/fpga_libs/Xilinx/ISE/xeclib/unisims/*.v
unisims_ver
Used for library elements instantiated in Verilog. Compile the synthesizable Verilog
models of the Xilinx library.
vlib 0in_libs/unisim
vmap unisims_ver 0in_libs/unisims_ver
vlog -work unisims_ver \
$HOME_0IN/share/fpga_libs/Xilinx/ISE/xeclib/unisims/*.v
simprim
Used for library elements instantiated in VHDL. Compile the VHDL files containing the
component and package declarations from the standard Xilinx simulation library. Then
compile the synthesizable Verilog models of the library. The vlog -convertallparams
option is needed to convert the Verilog parameters to match the generics types in the
VHDL component definitions.
vlib
vmap
vcom
vcom
vlog
0in_libs/simprim
simprim 0in_libs/simprim
-work simprim $XILINX/vhdl/src/simprims/simprim_Vcomponents.vhd
-work simprim $XILINX/vhdl/src/simprims/simprim_Vpackage.vhd
-work simprim -convertallparams \
$HOME_0IN/share/fpga_libs/Xilinx/ISE/xeclib/simprims/*.v
simprims_ver
Used for library elements instantiated in Verilog. Compile the synthesizable Verilog
models of the Xilinx library.
vlib 0in_libs/simprim
vmap simprims_ver 0in_libs/simprims_ver
vlog -work simprims_ver \
$HOME_0IN/share/fpga_libs/Xilinx/ISE/xeclib/simprims/*.v
XilinxCoreLib
Used for library elements instantiated in VHDL. First, run xilinxcorelib_compile.do to
create a filelist (xilinxcorelib_vhdl_analyze_order.f) that specifies the synthesizable
files in the correct compilation order. This script adds $XILINX/vhdl/src/XilinxCoreLib/
to the file names in the source file compile list. Next, compile the VHDL simulation
library files.
vlib 0in_libs/XilinxCoreLib
vmap XilinxCoreLib 0in_libs/XilinxCoreLib
vcom -work XilinxCoreLib -f xilinxcorelib_vhdl_analyze_order.f
151
CDC Analysis
CDC Analysis of FPGAs
XilinxCoreLib_ver
Used for library elements instantiated in Verilog. Compile the Verilog simulation library
files.
vlib 0in_libs/XilinxCoreLib_ver
vmap XilinxCoreLib_ver 0in_libs/XilinxCoreLib_ver
vlog -work XilinxCoreLib_ver $XILINX/verilog/src/XilinxCoreLib/*.v
Altera
If FPGA library elements are instantiated in VHDL code, you must compile a resource library
for that. The logical library name for this library has no _ver suffix. If FPGA library elements
are instantiated in Verilog code, you must compile a resource library for that. The logical library
name for this library has a _ver suffix.
altera_mf
Used for library elements instantiated in VHDL. Compile the VHDL files containing the
component and package declarations from the standard Altera simulation library. Then
compile the synthesizable Verilog models of the library. The vlog +incdir argument is
the include directory for the source files.
vlib 0in_libs/altera_mf
vmap altera_mf 0in_libs/altera_mf
vcom -work altera_mf \
$QUARTUS_ROOTDIR/eda/sim_lib/altera_mf_components.vhd
vlog -work altera_mf \
$HOME_0IN/share/fpga_libs/Altera/quartus/fv_lib/verilog/*.v \
+incdir+$HOME_0IN/share/fpga_libs/Altera/quartus/fv_lib/verilog
altera_mf_ver
Used for library elements instantiated in Verilog. Compile the synthesizable Verilog
models of the Altera library. The vlog +incdir argument is the include directory for the
source files.
vlib 0in_libs/altera_mf_ver
vmap altera_mf_ver 0in_libs/altera_mf_ver
vlog -work altera_mf_ver \
$HOME_0IN/share/fpga_libs/Altera/quartus/fv_lib/verilog/*.v \
+incdir+$HOME_0IN/share/fpga_libs/Altera/quartus/fv_lib/verilog
152
CDC Analysis
CDC Analysis of FPGAs
The -skipsynthoffregion argument directs the compiler to obey synthesis-off regions. These are
regions of code surrounded by synthesis_off/synthesis_on (or translate_off/translate_on)
pragmas. The compiler parses this code to pick up declarations, but otherwise ignores it. One
reason to use -skipsynthoffregion is to ignore VHDL library and use statements for libraries
needed for simulation only.
Rather than using a filelist to compile files with one invocation, you can set up a script to
compile the file one-by-one:
vcom vhdl_file1.vhd -work work
vcom vhdl_file2.vhd -work work
vcom vhdl_file3.vhd -work work -skipsynthoffregion
The following example shows the compiler invocation for a Verilog design:
vlog -f verilog_files.list -work work +incdir+src/verilog
153
CDC Analysis
CDC Analysis of FPGAs
Compiles the target design DUT_top from work using libraries mapped in ./modelsim.ini
(the default mapping file).
prompt> 0in -cmd cdc -d DUT_top -work top_lib -vhctrl cdc_control.vhd \
-modelsimini LibraryMapping.0in
Compiles the target design DUT_top from top_lib using libraries mapped in
LibraryMapping.0in.
Tip: Running cdc on a design can take time. Initial cdc runs are used only to refine the
clock domain model of the design in preparation for compiling and analyzing the CDC
logic. The cdc commands -report_clock option short-circuits the complete cdc
compilation/analysis and stops after identifying the clock domain model characteristics.
You will use this option initially to ensure that the clocks and clock groups are identified
correctly before performing complete compilation of the CDC logic.
Use the following steps to compile a CDC model of the design.
1. Create one or more control files.
A control file is a text file listing a series of 0in global directives (page 260). Global
directives set up operating conditions, define clocks, define black boxes, specify custom
synchronizers, modify reported results, create waivers, and so on. You will apply
significant effort creating and adjusting the control files because this is how you fine
tune CDC analysis. Here is an example control file:
entity cdc_control is
end cdc_control;
architecture ctrl of cdc_control is
begin
-- 0in set_constant scan_mode 0
-- 0in set_cdc_clock CLK_1 -group clk_grp_A -period 4
-- 0in set_cdc_clock CLK_2 -group clk_grp_A -period 8
-- 0in set_cdc_clock CLK_3 -group clk_grp_B -period 11
-- 0in set_cdc_port_domain input_port1 -async
-- 0in set_cdc_port_domain input_port2 -clock CLK_1
-- 0in set_cdc_port_domain -output -clock CLK_2
-- 0in set_cdc_reconvergence -depth 1 -divergence_depth 1
154
CDC Analysis
CDC Analysis of FPGAs
-- 0in set_black_box syncA* cdi_master
-- 0in set_cdc_preference -black_box_empty_module
end ctrl;
In addition to standard CDC global directives, the following directives are particularly
useful for CDC analysis of FPGA designs.
set_constant
Applies a constant value to input ports (and sometimes to internal nodes) so the cdc
compiler can prune irrelevant logic from the design logic and the CDC model. This
technique makes the memory footprint smaller, improves performance and ensures
only relevant results are returned.
set_cdc_reconvergence
Sets the sequential levels that define how deep paths diverge and reconverge to be
considered instances of reconvergence and single_source_reconvergence schemes.
The deeper the analysis, the greater the decrease in performance. Initially, set the
reconvergence depth to 1 and the divergence depth to 1.
set_black_box
Identifies specific modules/entities/architectures as user-defined black boxes. Use
set_cdc_port_domain directives to identify the clock domains for the black boxes
ports (even asynchronous ones) so the logic outside the black box instances can be
analyzed properly. Fanin/fanout logic of ports of user-defined black box instances
that are not assigned port domains is ignored for CDC analysis.
set_cdc_preference -black_box_empty_module
Turns empty modules/entities/architectures into inferred black boxes instead of
treating them as regular models. Some elements in a synthesizable FPGA library are
stubs containing only the port declarations. Specifying the
-black_box_empty_module option makes it easier to identify these elements so you
can add set_cdc_port_domain directives for their ports.
Tip: Hierarchical paths always appear in the report files with . separators (which might
be different from the path separator reported by simulation). Use these exact paths in the
control files as well. When creating control directives that refer to specific signals in the
RTL, cut and paste the exact pathnames from the report files or GUI.
2. Run cdc in report-clocks mode.
For example:
prompt> 0in -cmd cdc -d DUT_top -work work -vhctrl cdc_ctrl.vhd \
-report_clock
The command performs clock analysis and stops. Check the results:
155
CDC Analysis
CDC Analysis of FPGAs
:
:
:
:
2
1
1
0
The command performs clock analysis, compiles the CDC model of the design, runs
CDC analysis, generates reports on the results and generates a database file to load into
the CDC GUI for debugging issues found by static CDC analysis. Among the files
generated by cdc:
156
CDC Analysis
CDC Analysis of FPGAs
0in_cdc.db .db database of the CDC results for loading into the CDC GUI.
Check the inferred port domains (clock domains assigned to the ports). By default,
each input port is assigned to the clock domain of its first fan-in register. Any
primary inputs or outputs that connect to multiple clock domains or are not assigned
to a clock domain are listed. Use set_cdc_port_domain directives to make
adjustments.
b. Check for black boxes.
Black Boxes:
-----------cdi_master ( black_box )
syncA_1
( black_box )
syncA_3
( black_box )
syncA_7
( black_box )
Inferred Black Boxes for unresolved modules
------------------------------------------dut.Di2
( mod )
Internal logic of the black boxes is unknown and in particular, the connectivity
between a black boxs inputs and outputs is unknown. So, black boxes can mask
some CDC problems. Check that the port domains of the user-defined black boxes
(black_box in the report) are all specified.
VITAL models, FPGA library elements that are not synthesizable and design blocks
with unsynthesizable constructs are inferred black boxes (inferred in the report),
unless explicitly specified with set_black_box directives. Check the inferred black
boxes in 0in_cdc.rpt. If an inferred black box affects CDC results, at least one
associated black box CDC scheme is reported:
Black Box Crossing. (black_box)
-----------------------------------------------------------------
157
CDC Analysis
CDC Analysis of FPGAs
tx_clk: start: tx_sig2 (/u/zin/black_box/dut.v : 25)
<clock N/A>: end: dut.Di2 (/u/zin/dut.v: 40)(ID:black_box_12944)
You can declare the black box as a user-defined black box (with set_black_box) and
specify the port domains for the black boxs I/O ports (with set_cdc_port_domain).
The following example directives do this for an Altera dual-port RAM block:
------------------
0in
0in
0in
0in
0in
0in
0in
0in
0in
0in
0in
0in
0in
set_black_box altdpram
set_cdc_port_domain wren -clock inclock -module altdpram
set_cdc_port_domain data -clock inclock -module altdpram
set_cdc_port_domain wraddress -clock inclock -module altdpram
set_cdc_port_domain wraddressstall
-clock inclock -module altdpram
set_cdc_port_domain inclocken -clock inclock -module altdpram
set_cdc_port_domain byteena -clock inclock -module altdpram
set_cdc_port_domain rden -clock outclock -module altdpram
set_cdc_port_domain rdaddress
-clock outclock -module altdpram
set_cdc_port_domain rdaddressstall
-clock outclock -module altdpram
set_cdc_port_domain outclocken
-clock outclock -module altdpram
set_cdc_port_domain q -clock outclock -module altdpram
set_cdc_port_domain aclr -async -module altdpram
You might be able to obtain or write synthesizable models of various black boxed
elements. For example, using the Xilinx CoreGen tool: run Project >Project Options;
select the Generation tab; and set Simulation Files: Structural. Structural models are
synthesizable. Be sure to keep the structural models and behavioral models in different
locations to prevent overwriting previously-generated files.
At this point, debugging CDC issues with the CDC GUI is the same for FPGA-based design as
it is with other designs. See 0in_cdc: GUI Debug Mode on page 88. Also see the chapter
GUI Reference on page 419 for details on the various GUI tools and windows. As you
analyze the CDC results, you will find RTL issues to fix, to waive and to filter out. You might
want to add or change directives in your control file to:
158
CDC Analysis
CDC Analysis of FPGAs
159
CDC Analysis
CDC Analysis of FPGAs
160
Chapter 5
CDC-FX Metastability Injection
Metastability injected simulation is an extension to normal RTL simulation that injects random
metastability into the circuits behavior. CDC-FX metastability injected simulation is similar to
simulation with assertions. But, it uses special CDC-FX checkers to inject metastability into the
circuit during simulation. These checkers also monitor the metastability logic and report
coverage of metastability effects during simulation.
159
thold
rx_clk
stable
unstable
unstable
stable
Metastability Windows
The setup and hold times determine receive clock cycles for which a register can become
metastablebased on the active edge of the receive clock and the value of the signal at the
input port of the register. In hardware, however, this input port switches value after the output
port driving the signal (in the transmit clock domain) switches and the new value propagates to
the input port (in the receive clock domain). This propagation delay (tprop) has the following
physical bounds:
min tprop
tprop
max tprop
Accounting for propagation delay identifies a metastability window relative to each active edge
of the receive clock, as shown in Figure 5-2. A metastability window defined this way assumes
the worst case events as follows:
160
CDC signal propagates as slowly as possible (max tprop) and violates the setup time
(tsetup).
CDC signal propagates as quickly as possible (min tprop) and violates the hold time
(thold).
thold
max tprop
min tprop
start
metastability window
stop
stop = thold - min tprop
The start value is the number of time units before the active edge of the receive clock that the
metastability window opens. The stop value is the number of time units after the active edge
of the receive clock that the metastability window closes.
Except for the default case, the metastability windows are not set automatically by
software. The user sets up metastability windows based on the knowledge of the
hardware technology and characteristics of the design by specifying their start and stop
values. However, the user does not need to specify setup/hold times or propagation
delay ranges.
Each pair of transmit/receive clocks has its own metastability window (either specified
or default). In particular, a receive clock might have multiple windows.
If the duration of a metastability window is sufficiently large, then every active edge of
the corresponding transmit clock falls inside the window. In this case, simulation with
metastability injectors randomly inserts metastability effects every clock cycle the
register changes value.
Metastability windows are used for metastability injected simulation. They have no
counterpart in hardware. In hardware, a changing CDC signal either does or does not
result in the receive register going metastable, and the hardware value either does or
does not agree with the value used in plain simulation.
161
clks_aligned[65:0]
When the assertion compiler instantiates a cdc_fx checker, it also creates clock monitor logic
that determines when the transmit clock is within the metastability window of the receive clock
(for that transmit clock). Whenever this occurs, the receive register is prone to metastability if
its input value also changes in that receive clock cycle. The clks_aligned output from the
clock monitor is used to pass this information to the cdc_fx checker.
The clks_aligned output is a 66-bit value that is 0 throughout normal cycles. When the
clock monitor detects an active transmit clock edge in the corresponding metastability window
of the receive clock edge, one of the clks_aligned bits asserts a pulse that begins at the
second active clock edge and stops at the first subsequent inactive clock edge (see Figure 5-3).
Note the following:
tx_clk
rx_clk
metastability window
Clocks aligned. Transmit clock edge before (or at) receive clock edge.
clks_aligned[0]
tx_clk
rx_clk
metastability window
162
set_cdc_fx_metastability_window
The set_cdc_fx_metastability_window directive specifies a metastability window for one or
more receive register clocks. This global directive is used by the cdc -compile_assertions
command.
set_cdc_fx_metastability_window
-start value -stop value [-tx_clock clock_signal] [-rx_clock clock_signal] [-percent]
Unless the directive include the -percent option, the -start and -stop values specify
metastability using directional time units as follows:
The -start value is the number of time units before the active receive clock edge that
the associated metastability window opens.
The -stop value is the number of time units after the active receive clock edge that the
associated metastability window closes.
If -percent is specified, the -start and -stop values instead are percentages of the receive clock
duty cycle.
If the directive specifies -tx_clock and -rx_clock, then the directive applies to cdc_fx
checkers with these clock pairs. If the directive omits -tx_clock and -rx_clock, then the
directive applies to the remaining cdc_fx checkers. It is an error to specify more than one
directive without the -tx_clock and -rx_clock arguments.
If no set_cdc_fx_metastability_window global directive is specified, then the special
default case described in the next section is followed. However, if at least one
set_cdc_fx_metastability_window global directive is specified, then the default
metastability window configuration has a duration set to 0. In this case, the cdc_fx checkers
not covered by explicit set_cdc_fx_metastability_window directives never inject
metastability. Their cdc_fx checks never fire.
Note the following:
The start time is 25% of the receive clock cycle before the receive clock edge.
The stop time is 10% of the receive clock cycle after the receive clock edge.
163
thold
rx_clk
start = 25%
clock period
stop = 10%
default
metastability
window
For example, if rx_clk has period 100 time units, then the default metastability window is the
same as the window set by the following:
/* 0in set_cdc_fx_metastability_window
-start 25 stop 10 -tx_clock tx_clk -rx_clock rx_clk */
164
Running CDC-FX
The metastability injectors (cdc_fx checkers and metastability detection logic) are instantiated
from cdc_fx checker directives. The user can specify these directives manually, but CDC
paths can be numerous and this process is prone to user error. Instead, use a built-in feature of
the cdc command to automate the process of preparing the design data for the CCL compiler.
Since cdc analyzes CDC paths anyway, it can readily construct the cdc_fx checker directives
for them. Therefore, if the user includes the -fx option to the cdc command, then it generates
a CDC-FX control file (0in_cdc_fx_sim_ctrl.v) that contains cdc_fx checker directives that
can be used with the CCL compiler (see Figure 5-5).
Figure 5-5. CDC Data Flow for Simulation with Metastability
CDC-FX control file
(with set_cdc_fx_check directives)
cdc -fx
0in_cdc_fx_sim_ctrl.v
edit
design checker
files
control
files
ccl
CDC-FX control file
(with set_cdc_fx_metastability_window directives)
simulation with
metastability
Figure 5-5 also shows that part of the data preparation for the CDC-FX analysis is to set up an
optional CDC-FX control file that contains the set_cdc_fx_metastability_window global
directives used to set the metastability windows for the cdc_fx checkers.
set_cdc_fx_check
The set_cdc_fx_check directive turns on specified checks in corresponding cdc_fx checker
directives promoted by the cdc -fx command.
set_cdc_fx_check
[-scheme scheme] [-tx_clock clock_signal] [-rx_clock clock_signal] [-fx]
[-glitch_swallowed] [-glitch_caught]
By default, the glitch_swallowed and glitch_caught checks are off. The cdc_fx checks are on for
multi_bits, dmux, simple_dmux, multi_sync_mux_select, handshake and no_sync schemes;
cdc_fx checks are off for all other schemes.
165
Use the set_cdc_fx_check global directive to force cdc -fx to turn on cdc_fx checkers
checks. The user must specify at least one check to turn on (-fx, -glitch_caught, or
-glitch_ swallowed). The -tx_clock option restricts the directive to those cdc_fx
checkers with the specified transmit clock. The -rx_clock option restricts the directive to
those cdc_fx checkers with the specified receive clock.
The -scheme option restricts the directive to those cdc_fx checkers connected to
synchronizers of the specified type. The set_cdc_fx_check global directive does not support
wildcards.
0in_cdc_fx_sim_ctrl.v
Questa CDC analyzes CDC information. For certain CDC signals and data buses, it formulates
checker directives that instantiate a cdc_fx checker and generates metastability detection logic
for modeling CDC metastability effects during simulation with assertions. These promoted
cdc_fx directives are saved in the zin_cdc_fx_sim_ctrl module in the
0in_cdc_fx_sim_ctrl.v file (see Example 5-1).
The user can edit the 0in_cdc_fx_sim_ctrl.v file to remove unnecessary directives and make
changes that might apply to your design. Then, the user specifies the edited file as a checker
control file when invoking the ccl command, as demonstrated in Example 5-2 on page 167.
Example 5-1. 0in_cdc_fx_sim_ctrl.v File Snippet
//----------------------------------------------------------------// CDC FX Simulation File
// Created Mon Dec 18 14:56:50 2006
//----------------------------------------------------------------//Summary
//------//Count :
Module
//----------------------------------------------------------------//
17 :
demo_top
module zin_cdc_fx_sim_ctrl;
//cpu_clk_in --> mac_clk_in
//ID:two_dff_5840 --> init_done
//----------------------------------------------------------------/* 0in cdc_fx
-tx_reg init_done
-rx_reg init_done_r1
-tx_clock cpu_clk_in
-rx_clock mac_clk_in
-name zin_cdc_fx_sim_init_done_r1_0
-module demo_top
-inferred
*/
//cpu_clk_in --> core_clk_in
//ID:no_sync_47305 --> init_done
166
async_reset
async_reset_no_sync
black_box
custom_sync
bus_custom_sync
memory_sync
reconvergence
redundant
single_source_reconvergence
167
The following situations can cause a cdc_fx checker not to be promoted, or to be promoted with
partial information:
168
Signals from registers with different transmit clocks fan into a receive register.
The tx_reg or rx_reg register is not a real register and custom_fx is not on. For example,
it is a memory or FIFO.
The tx_clk or rx_clk is missing. For example, the transmit register is an asynchronous
input port.
cdc
-compile_assertions
control
files
-work library
vsim
-f 0in_cdc_sim.arg
-f 0in_cdc_sim_vhdl.arg
merge
0in_checksim.db
vcom/vlog
0in_cdc
0in_cdc.db
GUI
vcom/vlog
testbench
files
debugging
environment
Results from metastability-injected simulation can be merged back into the CDC GUI for
review and debugging. The following procedure uses the Questa vsim simulator.
1. Set up the design library and compile the design.
For example:
prompt> vlib work
prompt> vmap work work
prompt> vcom dut.vhdl
169
5. Run simulation.
Specify the PLI library path for the simulator and the vsim arguments files. For example:
prompt> vsim -c tb -pli $HOME_0IN/lib/lib0InLoadMTIPLI.so \
-f 0in_cdc_sim.arg.vsim -f 0in_cdc_sim.arg.vsimrun \
-do "add log -r /*; run 1000; quit -f"
Simulation Arguments
The user can use simulation arguments to suppress metastability injection during simulation
(for individual CDC signals or all CDC signals) and to set the seed for random metastability
injection. The cdc_fx checkers maintain statistics, but metastability is not injected into
simulation.
+0in_suppress_fx_name+name
To suppress metastability injection during simulation for individual signals, specify them with
simulation arguments of the following form:
+0in_suppress_fx_name{+name}
Here, name is the cdc_fx checker name. Wildcards can be used in name. For example,
+0in_suppress_fx_name+tx4_*+tx_data
+0in_disable_fx_force
To suppress metastability injection for all individual signals, specify the following argument:
+0in_disable_fx_force
Refer to Verilog Glue Logic Option Impact on page 171 and VHDL Glue Logic Option
Impact on page 173 for additional information.
170
+0in_random_seed+n
To set the random generator seed for random metastability injection, specify the following
simulation argument:
+0in_random_seed+n
Here, n is a positive (32-bit decimal) integer to use as the seed for the random number
generator. Default: 11449.
$0in_always_invert_metastable_signals ();
Inverts signals when they are metastable.
Refer to Verilog Glue Logic Option Impact on page 171 and VHDL Glue Logic Option
Impact on page 173 for additional information.
$0in_never_invert_metastable_signals ();
Leaves the cdc_fx checkers active, but disables metastability injection.
Refer to Verilog Glue Logic Option Impact on page 171 and VHDL Glue Logic Option
Impact on page 173 for additional information.
$0in_randomly_invert_metastable_signals ();
Randomly injects metastability into CDC signals when they are metastable. This is the default
behavior.
Refer to Verilog Glue Logic Option Impact on page 171 and VHDL Glue Logic Option
Impact on page 173 for additional information.
ZI_NO_CDC_FORCE
171
+0in_disable_fx_force
$0in_never_invert_metastable_signals
ZI_NO_CDC_FORCE Option
This option can only be used during compiling the design. It permanently removes the force
statement. For example,
% vlog +define+ZI_NO_CDC_FORCE test.v
or
% vcs +define+ZI_NO_CDC_FORCE test.v
+0in_disable_fx_force Option
This option can only be used during simulation. It disables the force statements for that specific
simulation run. For example,
% vsim tb \
+0in_disable_fx_force \
-f 0in_sim.arg.vsim \
-pli ${HOME_0IN}/lib/lib0InLoadMTIPLI.so
or
% ./simv +0in_disable_fx_force
$0in_never_invert_metastable_signals Option
This option does not impact the force statements. It only changes the random number generator
during simulation to always produce 0. Hence, the forced values are supposed to be identical to
the original values.
The glue logic can produce data values different from the original RTL specially for Xs. Hence,
this option can result in change in simulation behavior.
172
ZI_NO_CDC_FORCE
+0in_disable_fx_force
$0in_never_invert_metastable_signals
ZI_NO_CDC_FORCE Option
Same behavior as Verilog (see ZI_NO_CDC_FORCE Option on page 172).
+0in_disable_fx_force Option
No impact for VHDL.
$0in_never_invert_metastable_signals Option
Same behavior as Verilog (see $0in_never_invert_metastable_signals Option on page 173).
173
If the design is instrumented with assertions, then plain simulation with assertions
does not violate any assertions.
End-to-end test errors indicate receive logic is not tolerant of CDC metastability
effects.
Assertion failures indicate receive logic is not tolerant of CDC metastability effects.
The cdc_fx checker coverage shows how completely each metastability injector
covers the range of metastability effects during simulation.
The cdc_fx check ensures that the data input to the receive register does not
change in a cycle for which the transmit/receive clock edges align (that is,
metastability is not possible for the corresponding register). The generated cdc_fx
directives for the CDC data buses are automatically included by the tool.
The glitch_caught check ensures that metastability injection does not catch a
glitch if it is not detected by simulation.
Assertion Violations
If metastability injected simulation produces assertion violations (i.e., check firings), then you
can analyze them the same as you do firings from basic simulation with assertions (see
Figure 5-7 on page 175). Use the 0in_cdc viewer to examine details of the check firings and to
display their waveforms. These violations are caused by design defects in the fan-outs of the
receiving registers that make the circuit intolerant of random delays in the transmission of their
driving CDC signals.
174
The cdc_fx checker entries in the .db database provide a variety of information about the
metastability injectors during simulation.
Each cdc_fx checker maintains coverage information about its performance during
simulation. The checker entry in the simulation database (0in_checksim.db) has this
information.
The cdc_fx checkers cdc_fx check fires if the active edge of the transmit clock is in the
metastability window of the receive clock and the transmit data change in this window. These
cycles are candidates for metastability injection. The Metastable Cycles evaluation statistic
increments each cycle this happens. Normally, this is not problematic. The logic in the fan-out
of the receive register is expected to tolerate this situation.
Some design styles have transmitting circuitry that presumes data is stable during cycles when
both clock edges occur in the metastability window. No metastability can occur and the
receiving logic does not need to account for CDC metastability effects. In such cases, you can
use the cdc_fx check to verify the transmit data remains stable when metastability can occur.
Notice in the Checker Report that the -rx_q field identifies the register output from the
original circuit that is replaced in the new circuit (remodeled with the metastability injection
logic) with the rx_q output from the checker. When ccl compiles the design for simulation,
each cdc_fx checker is connected so the output from the transmit register is routed to the
cdc_fx checker and the rx_q output from the checker drives the load from the original receive
register.
For most cycles, the transmit data is latched by the checker and passed through to the rx_q
output when the receive clock activates. This mimics the behavior of the original circuit under
normal simulation.
175
But, when the checker determines it should inject metastability, randomly selected bits of the
rx_q output are inverted. The rx_q output reflects a corrupted value unrelated to the original
transmission. This condition emulates data transmission metastability from crossing clock
domains. The circuit must be immune to these effects.
176
Chapter 6
Command Reference
This command reference consists of five sections:
CDC Schemes
Global Directives
177
Command Reference
Shell Commands
Utilities invoked from the system shell: vlib, vmap, vcom, vlog, verror, vdir, vdel, 0in,
0in_cdc and 0in_db2ucdb.
Protocol/FX Checkers
CDC protocol checkers: cdc_dsel, cdc_fifo, cdc_glitch, cdc_hamming_distance_one,
cdc_handshake_data, cdc_sample and cdc_sync. CDC-FX checkers: cdc_fx and
cdc_custom_fx.
178
Command Reference
CDC Schemes
CDC Schemes
CDC analysis identifies logic patterns relevant to CDC verification. Groups of related patterns
identify specific classes of situations called CDC schemes. Each CDC scheme represents a
specific type of CDC synchronizer architecture or a potential CDC issue. This chapter consists
of the data sheets for the various CDC schemes (see Table 6-1). Each data sheet has the
following information:
Type
Scheme
Default
Severity
ID
Description
TWO DFF
SYNCHRONIZER
two_dff_phase
TWO DFF
SYNCHRONIZER
OPPOSITE
POLARITY
four_latch
FOUR LATCH
SYNCHRONIZER
pulse_sync
PULSE SYNC
Pulse.
evaluation
shift_reg
SHIFT REG
Shift register.
evaluation
dff_sync_gated_clk
async_reset
ASYNC RESET
async_reset_no_sync
violation
no_sync
MISSING
SYNCHRONIZER
violation
Signal
two_dff
Synchronizer
Missing synchronizer
caution
evaluation
179
Command Reference
CDC Schemes
Type
Scheme
ID
Description
Default
Severity
custom_sync
CUSTOM
evaluation or
violation
BUS SYNC
BUS SYNC
bus_four_latch
BUS SYNC
bus_dff_sync_gated_clk
bus_shift_reg
Shift register.
multi_bits
MULTIPLE BITS
bus_custom_sync
BUS CUSTOM
evaluation or
violation
DMUX
MUX enable.
caution
SIMPLE DMUX
MUX enable.
caution
multi_sync_mux_select
MULTIPLE
SYNCHRONIZERS
AT DMUX
Multiple MUXes.
caution
handshake
HANDSHAKE
fifo
FIFO
FIFO.
evaluation
memory_sync
MEMORY SYNC
2D array.
caution
custom_sync_with_crossing
CUSTOM WITH
CROSSING
evaluation
combo_logic
COMBO LOGIC
Combinational logic on a
synchronization path.
violation
reconvergence
Data
bus_two_dff
Synchronizer
bus_two_dff_phase
Signal and
dmux
Data
Synchronizer simple_dmux
Potential
Problem
single_source_reconvergence SSR
180
caution
evaluation
violation
caution
redundant
REDUNDANT
caution
series_redundant
SERIES
REDUNDANT
Custom synchronizers
connected in series
caution
fanin_different_clks
FANIN LOGIC
Fan-in logic from multiple clock violation
FROM DIFFERENT domains.
CLOCKS
black_box
BLACK BOX
caution
Command Reference
async_reset
async_reset
ASYNC RESET: Signal feeds to the asynchronous reset port of the receiving register.
tx_rst
tx_sig
rst
1'b1 DFF
rx_rst
rst
DFF
tx_clk
Tx Clock Domain
rx_clk
Rx Clock Domain
2. ASYNC_RESET scheme that uses an asynchronous reset input to drive the reset pins of
the synchronizer. Synchronizer input is tied high.
always @(posedge rx_clk,negedge tx_sig)
rx domain reset
if (!tx_sig) begin
s0 <= 1b0;
tx_sig
rst
rst
s1 <= 1b0;
s1
1'b1
end
else begin
high
s0 <= 1b1;
tx_clk
rx_clk
s1 <= s0;
end
Evaluations
=================================================================
Asynchronous reset synchronization. (async_reset)
----------------------------------------------------------------tx_clk : start : tx_sig (async_reset1.v : 9)
rx_clk : end : s0 (async_reset1.v : 10) (ID:async_reset_95442)
181
Command Reference
async_reset
3. ASYNC_RESET scheme that uses an asynchronous reset input to drive the reset pins of
the synchronizer. Synchronizer input is tied low.
always @(posedge rx_clk,negedge tx_sig)
rx domain reset
if (tx_sig) begin
s0 <= 1b1;
tx_sig
rx_rst
set
set
s1
s1 <= 1b1;
s0
1'b0
end
else begin
low
s0 <= 1b0;
tx_clk
rx_clk
s1 <= s0;
end
assign rx_rst = s1 | tx_sig;
Evaluations
=================================================================
Asynchronous reset synchronization. (async_reset)
----------------------------------------------------------------tx_clk : start : tx_sig (async_reset1.v : 9)
rx_clk : end : s0 (async_reset1.v : 10) (ID:async_reset_95442)
4. ASYNC_RESET scheme that uses an asynchronous reset input to drive the D input of
the first DFF in the synchronizer and the reset pins of the Rx domain registers.
always
s0
s1
end
assign
rx domain reset
tx_sig
rx_rst
s1
s0
rx_rst = s1 | tx_sig;
tx_clk
rx_clk
Evaluations
=================================================================
Single-bit signal synchronized by DFF synchronizer. (two_dff)
----------------------------------------------------------------tx_clk : start : tx_sig (async_reset3.v : 9)
rx_clk : end : s0 (async_reset3.v : 10) (ID:two_dff_32868)
Asynchronous reset synchronization. (async_reset)
----------------------------------------------------------------tx_clk : start : tx_sig (async_reset3.v : 9)
rx_clk : end : rx_rst (async_reset3.v : 23) (ID: async_reset_)
5. ASYNC_RESET scheme that uses an asynchronous reset input to drive the reset pins of
the synchronizer, the D input of the first DFF in the synchronizer and the reset pins of
the Rx domain registers.
always @(posedge rx_clk,negedge tx_sig)
if (! tx_sig)
{s1, s0} <= 2b00;
else
{s1, s0} <= {s0, tx_sig};
assign rx_rst = s1 & tx_sig;
182
rx domain reset
tx_sig
rst
rst
s0
tx_clk
rx_rst
s1
rx_clk
Command Reference
async_reset
Evaluations
=================================================================
Single-bit signal synchronized by DFF synchronizer. (two_dff)
----------------------------------------------------------------tx_clk : start : tx_sig async_reset4.v : 9)
rx_clk : end : s0 async_reset4.v : 10) (ID:two_dff_32868)
Asynchronous reset synchronization. (async_reset)
----------------------------------------------------------------tx_clk : start : tx_sig async_reset4.v : 9)
rx_clk : end : s0 async_reset4.v : 10) (ID:async_reset_95442)
183
Command Reference
async_reset_no_sync
async_reset_no_sync
ASYNC RESET NO SYNC: Signal that feeds to the asynchronous reset port of the receiving
register has no synchronizer.
tx_sig
missing
reset
synchronizer
rx_sig
1'b1 DFF
rx_clk
tx_clk
Rx Clock Domain
Tx Clock Domain
incorrect
tx_sig
1'b1 DFF
reset
synchronizer
rx_clk
tx_clk
Tx Clock Domain
rx_reset
Rx Clock Domain
rx domain reset
tx_sig
184
din
rst
rx_sig
rx_clk
Command Reference
async_reset_no_sync
Violations
=================================================================
Asynchronous reset does not have proper synchronization.
(async_reset_no_sync)
----------------------------------------------------------------tx_clk : start : tx_sig (test.v : 9)
rx_clk : end : rx_sig (test.v : 9) (ID:async_reset_no_sync_95911)
rst
rx_reset
rst
1'b1
185
Command Reference
black_box
black_box
BLACK BOX: Crossing drives an instance of an inferred black box.
tx_sig
inferred
black box
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
Inferred black boxes are modules/entities containing unsupported constructs, that are not
explicitly declared as black boxes (with the set_black_box directive).
Crossing Type
control signal or data bus
Default Severity
caution
Promoted Checker
none
Examples
1. Following is an example to turn severity to violation:
// 0in set_cdc_report scheme black_box severity violation
2. Following is an example of the paths for a black box crossing (from 0in_cdc.rpt):
Cautions
=================================================================
black Box Crossing. (black_box)
----------------------------------------------------------------clk1 : start : u0.q (/u/black box/dut.v : 41)
<clock N/A>:end: u1.b(/u/bb/dut.v:12)(ID:black_box_5)
via: u0.q
via: u1.b
<clock N/A>: end : u1.c (/u/bb/dut.v : 12)(ID:black_box_53)
via : u0.q
via : u1.c
Following is a directive that identifies the port domains of the inferred black box:
// Black box ports
// 0in set_cdc_port_domain b c -clock clk -module black box_module
186
Command Reference
black_box
With this directive, the port domains of the black box ports are identified in 0in_cdc.rpt:
Cautions
=================================================================
Black Box Crossing. (black_box)
----------------------------------------------------------------clk1 : start : u0.q (/u/bb/dut.v : 41)
clk3: end : u1.b (/u/bb/dut.v : 12)(ID:black_box_52)
via: u0.q
clk3: end : u1.c (/u/bb/dut.v : 12)(ID:black_box_53)
via: u0.q
In this case, the port domain of the driver (u0.q) was set by a set_cdc_port_domain
directive:
// 0in set_cdc_port_domain q -clock clk3
3. Following example shows an instance (BB) of a module (black_box) that cdc has
inferred to be a black box.
rst
instance of an
inferred black box
reset
din0
datain0
dataout
tx_clk
datain1
din1
datain2
din2
din3
datain3
clock
dout
BB
status
statout
rx_clk
By default, the datain inputs are assumed to be in different clock domains. Similarly,
dout and stout are assumed to be in different clock domains. To make static CDC
analysis more accurate and to reduce the clock domain complexity, identify the port
domains of the black box data ports. For example:
//
//
//
//
//
datain0
datain1
datain2
datain3
-async
-async
-clock
-clock
-module black_box
-module black_box
clock -module black_box
clock -module black_box
Note that these are the port domains (not clock domains) for the data ports. Domains are
identified according to the black boxs clock pins (not external clock signals).
187
Command Reference
black_box
Cautions
=================================================================
Multiple-bit signal across clock domain boundary. (multi_bits)
----------------------------------------------------------------rx_clk : start : BB.dataout (black_box.v : 40)
tx_clk : end : dout (black_box.v : 21) (ID:multi_bits_47389)
Black Box Crossing. (black_box)
----------------------------------------------------------------tx_clk : start: din1 (black_box.v : 25)
<clock N/A>: end: BB.datain1 (black_box.v : 40)(ID:black_box_12944)
Cautions
=================================================================
Black Box Crossing. (black_box)
----------------------------------------------------------------tx_clk : start : din0 (black_box.v : 24)
<clock N/A>: end: BB.datain0 (black_box.v : 40)(ID:black_box_48560)
188
Command Reference
bus_custom_sync
bus_custom_sync
BUS_CUSTOM: Multiple-bit signal synchronized by custom CDC synchronizer.
gray
encoder
tx_data
tx_clk
custom
synchronizer
rx_data
gray
decoder
rx_clk
Tx Clock Domain
Rx Clock Domain
Custom synchronizers are instances of modules declared as custom synchronizers with the
set_cdc_synchronizer custom directive. The bus_custom_sync scheme identifies multiple-bit
custom synchronizers where the clock domain crossing is external to the synchronizer itself.
Crossing Type
data bus
Default Severity
evaluation (if all the ports are specified with set_cdc_port_domain) or violation.
Promoted Checker
none
Examples
1. Following is an example to specify the cust_sync module with clock pin clk as a custom
synchronizer:
//0in set_cdc_synchronizer custom -module cust_sync
//0in set_cdc_port_domain d -async -clock clk -module cust_sync
189
Command Reference
bus_custom_sync
tx_data
rx_data
din
dout
syncA
clk
data
tx_clk
rx_clk
Evaluations
=================================================================
Multiple-bit signal synchronized by Custom CDC Scheme: syncA
(bus_custom_sync)
----------------------------------------------------------------tx_clk : start : tx_data (bus_custom_sync.v : 21)
rx_clk : end : S.din (bus_custom_sync.v : 29)
(ID:bus_custom_sync_5359)
Custom synchronizers are considered inferred black boxes for CDC analysis, so you
must specify their port information:
/* 0in set_cdc_port_domain -input din -async -clock rx_clk
-module syncA */
/* 0in set_cdc_port_domain -output dout -clock rx_clock
-module syncA */
Potential Problem
CDC analysis does not promote a checker for this scheme. You should implement a transfer
protocol checking scheme using one or more checkers.
190
Command Reference
bus_dff_sync_gated_clk
bus_dff_sync_gated_clk
BUS DFF GATED SYNC: Multiple-bit signals synchronized with DFF synchronizer with
gated clock.
tx_data
DFF
rx_data
DFF
en_rx_clk
tx_clk
rx_clk
Tx Clock Domain
Rx Clock Domain
Synchronization using two flip-flops is a standard method of synchronizing a 1-bit signal, but
one of the flip-flops is clocked by a gated version of the receive clock.
Crossing Type
multiple-bit data bus
Default Severity
caution
Promoted Checker
cdc_hamming_distance_one
(cdc_hamming1)
Examples
1. Following is an example to turn severity to evaluation:
/* 0in set_cdc_report -scheme bus_dff_sync_gated_clk
-severity evaluation */
3. Bus 2 DFF synchronizer has one FF clocked by a gated version of the Rx clock.:
//gated Rx clock
assign gclk = rx_clk & en;
// 1st flip-flop triggered by
// the gated clock
always @(posedge gclk)
sync1 <= tx_reg;
tx_reg
tx_clk
sync1
gclk
en
sync2
rx_clk
191
Command Reference
bus_dff_sync_gated_clk
Cautions
=================================================================
Multiple-bits signals synchronized with DFF synchronizer with gated
clock. (bus_dff_sync_gated_clk)
----------------------------------------------------------------tx_clk : start : tx_reg (test2.v : 12)
rx_clk : end : sync1 (test2.v : 12)(ID:bus_dff_sync_gated_clk_8918)
192
Command Reference
bus_four_latch
bus_four_latch
BUS SYNC: Multiple-bit signal synchronized by latch synchronizer.
tx_data
gray
encoder
rx_data
latch
latch
latch
latch
latch
tx_clk
gray
decoder
rx_clk
Tx Clock Domain
Rx Clock Domain
*/
193
Command Reference
bus_four_latch
Potential Problem
Four-latch synchronization of a data bus assumes the bus is gray-coded. Any data buses that
cross clock domains that are not gray-coded should be identified as requiring complete data
synchronization. Any of these crossings synchronized by four-latch synchronizers should be
flagged as violations. To set these schemes to violations, use the set_cdc_report directive.
/* 0in set_cdc_report -scheme bus_four_latch
-tx_clock clk_a -severity violation */
194
Command Reference
bus_shift_reg
bus_shift_reg
SHIFT REG: Multiple-bit signal synchronized by shift-register synchronization.
tx_data
rx_data
shift register
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
Examples
1. Following is an example to turn severity to violation:
// 0in set_cdc_report scheme bus_shift_reg severity violation
*/
195
Command Reference
bus_shift_reg
sync[0]
synchronized data
tx_data
[0]
tx_clk
shift register
sync[1]
rx_clk
Evaluations
=================================================================
Multiple-bit signal synchronized by shift-register synchronizer
(bus_shift_reg)
----------------------------------------------------------------tx_clk : start : tx_data (bus_shift_reg.v : 10)
rx_clk : end : sync[0] (bus_shift_reg.v : 19 (ID:bus_shift_reg_99229)
196
Command Reference
bus_two_dff
bus_two_dff
BUS SYNC: Multiple-bit signal synchronized by DFF synchronizer.
gray
encoder
tx_data
rx_data
DFF
DFF
gray
decoder
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
tx_reg
tx_clk
sync1
sync2
rx_clk
197
Command Reference
bus_two_dff
Evaluations
=================================================================
Multiple-bit signal synchronized by DFF synchronizer. (bus_two_dff)
----------------------------------------------------------------tx_clk : start : tx_reg (bus_two_dff.v : 11)
rx_clk : end : sync1 (bus_two_dff.v : 11) (ID:bus_two_dff_8942)
5. Bus 2 DFF synchronizer with enable. CDC analysis only recognizes this instance as a
bus_two_dff scheme if set_cdc_preference -allow_enable_in_sync is specified.
reg [width-1:0] tx_reg, rx_reg;
reg [width-1:0] sync1, sync2;
enable
tx_reg
sync1
sync2
EN
EN
always @(posedge rx_clk)
if (enable)
begin
tx_clk
rx_clk
sync1 <= tx_reg; // 1st FF
sync2 <= sync1; // 2nd FF
end
Evaluations
=================================================================
Multiple-bit signal synchronized by DFF synchronizer. (bus_two_dff)
----------------------------------------------------------------tx_clk : start : tx_reg (bus_two_dff_en.v : 11)
rx_clk : end : sync1 (bus_two_dff_en.v : 11) (ID:bus_two_dff_8942)
Potential Problem
The 2DFF synchronization of a data bus assumes the bus is gray-coded. Any data buses that
cross clock domains that are not gray-coded should be identified as requiring complete data
synchronization. Any of these crossings synchronized by 2DFF synchronizers should be
flagged as violations. To set these schemes to violations, use the set_cdc_report directive.
/* 0in set_cdc_report -scheme bus_two_dff
-tx_clock clk_a -severity violation */
Notes
If you use a DFF synchronization scheme that has more than two flip-flops, then you can get
CDC analysis to recognize the scheme by specifying a set_cdc_synchronizer global directive.
For example, the following global CDC directive identifies 4 DFF synchronizers as valid
two_dff schemes for CDC paths from the tx_clk domain to the rx_clk domain:
/* 0in set_cdc_synchronizer dff -level 4
-tx_clock tx_clk -rx_clock rx_clk */
198
Command Reference
bus_two_dff_phase
bus_two_dff_phase
BUS SYNC: Multiple-bit signal synchronized by DFF synchronizer and multiple-bit signal
synchronized by DFF of opposite clock polarity.
gray
encoder
tx_data
rx_data
DFF
tx_clk
DFF
gray
decoder
rx_clk
Tx Clock Domain
Rx Clock Domain
Synchronization using two opposite polarity flip-flops reduces the time the signal takes to settle.
When using this synchronization scheme, be sure the MTBF is acceptable.
When used to synchronize a data bus, the bus should be gray-coded (i.e., have hamming
distance 1), which assures that only one bit of data changes in any cycle, and the data should
change only at the frequency of the receiving domain.
Crossing Type
multiple-bit data bus
Default Severity
caution
Promoted Checker
cdc_hamming_distance_one (cdc_hamming1)
Examples
1. Following is an example to turn severity to evaluation:
// 0in set_cdc_report scheme bus_two_dff_phase severity evaluation
2. Bus 2 DFF phase synchronizer has one FF clocked by a clock with the opposite polarity
of the Rx clock:
reg [width-1:0] tx_reg, rx_reg;
reg [width-1:0] sync1, sync2;
tx_reg
sync1
sync2
rx_clk
199
Command Reference
bus_two_dff_phase
3. Bus 2 DFF phase synchronizer with enables has one FF clocked by a clock with the
opposite polarity of the Rx clock. CDC analysis only recognizes this instance as a
bus_two_dff_phase scheme if set_cdc_preference -allow_enable_in_sync is specified.
reg [width-1:0] tx_reg, rx_reg;
reg [width-1:0] sync1, sync2;
always @(negedge rx_clk)
if (enable) sync1 <= tx_reg;
always @(posedge rx_clk)
if (enable) sync2 <= sync1;
enable
tx_reg
tx_clk
EN sync1 EN
sync2
rx_clk
Cautions
=================================================================
Multiple-bits signal synchronized by DFF of opposite clock polarity.
(bus_two_dff_phase)
----------------------------------------------------------------tx_clk : start : tx_reg (test.v : 11)
rx_clk : end : sync1 (test.v : 11) (ID:bus_two_dff_phase_57873)
Potential Problems
1. Synchronization of a data bus using two opposite polarity DFFs assumes the bus is
gray-coded.
200
Command Reference
combo_logic
combo_logic
COMBO LOGIC: Combinational logic before synchronizer.
combinational logic
tx_data
rx_data
synchronizer
tx_clk
Tx Clock Domain
rx_clk
Rx Clock Domain
201
Command Reference
combo_logic
din
tx_sig
tx_clk
s1
DFF
s2
DFF
rx_clk
Violations
=================================================================
Combinational logic before synchronizer. (combo_logic)
----------------------------------------------------------------tx_clk : start : tx_reg (combo_logic.v : 8)
rx_clk : end : sync1 (combo_logic.v : 8) (ID:combo_logic_57762)
Base Type : TWO DFF SYNCHRONIZER
The report for this violation shows the base type CDC scheme identified by CDC
analysis (TWO DFF SYNCHRONIZER). To remove this violationand instead report
the crossing as a 2DFF schemeyou can specify that din is stable. That is, it is properly
synchronized in the Rx domain:
// 0in set_cdc_signal din -stable
202
Command Reference
custom_sync
custom_sync
SINGLE-BIT CUSTOM SYNC: Single-bit signal synchronized by custom CDC synchronizer.
tx_sig
custom
synchronizer
tx_clk
Tx Clock Domain
rx_sig
rx_clk
Rx Clock Domain
Custom synchronizers are instances of modules declared as custom synchronizers with the
set_cdc_synchronizer custom directive. The custom_sync scheme identifies single-bit custom
synchronizers where the clock domain crossing is external to the synchronizer itself.
Crossing Type
control signal
Default Severity
violation or evaluation (if input port is asynchronous)
Promoted Checker
none (or cdc_sync/cdc_hamming1 if specified with set_cdc_protocol)
Examples
1. Following is an example to specify the cust_sync module with clock pin clk as a custom
synchronizer:
//0in set_cdc_synchronizer custom -module cust_sync
//0in set_cdc_port_domain d -async -clock clk -module cust_sync
203
Command Reference
custom_sync
data
tx_sig
din
dout
rx_sig
syncA
clk
rx_clk
Custom synchronizers are considered inferred black boxes for CDC analysis, so you
must specify their port information:
/* 0in set_cdc_port_domain -input din -async -clock rx_clk
-module syncA */
/* 0in set_cdc_port_domain -output dout -clock rx_clock
-module syncA */
Potential Problem
CDC analysis does not automatically promote a checker for this scheme. You can provide a
transfer protocol checking scheme using the set_cdc_protocol directive.
204
Command Reference
custom_sync_with_crossing
custom_sync_with_crossing
CUSTOM WITH CROSSING: Custom CDC synchronizer with an internal clock domain
crossing.
custom synchronizer
tx_data
rx_data
rx_clk
tx_clk
Tx Clock Domain
internal crossing
Rx Clock Domain
Custom synchronizers are instances of modules declared as custom synchronizers with the
set_cdc_synchronizer custom directive. The custom_sync_with_crossing scheme identifies
custom synchronizers where the clock domain crossing is internal to the synchronizer itself. To
identify this type of custom synchronizer, you must identify a transmit clock port and a receive
clock port using the set_cdc_port_domain directive for the custom synchronizer module. Every
other signal/data port must be identified with either a transmit clock or a receive clock. If a port
is identified as an -async port, the synchronizer is reported as a simple custom_sync scheme.
Crossing Type
control signal or data bus
Default Severity
evaluation
Promoted Checker
none
Examples
1. Custom synchronizer module with crossing:
RST_A
IN
CLKA
//
//
//
//
//
0in
0in
0in
0in
0in
SYNC_VX
RST_B
OUT
CLKB
205
Command Reference
custom_sync_with_crossing
data
tx_sig
tx_clk
din
dout
rx_sig
syncC
rclk
tclk
rx_clk
Evaluations
=================================================================
Custom synchronization with internal crossing.
(custom_sync_with_crossing)
----------------------------------------------------------------tx_clk: start: S.din (test2.v: 35)
rx_clk: end: S.dout (test2.v: 35)(ID:custom_sync_with_crossing_9661)
Custom synchronizers are considered inferred black boxes for CDC analysis, so you
must specify their port information:
// 0in set_cdc_port_domain din -tx_clock tclk -module syncC
// 0in set_cdc_port_domain dout -rx_clock rclk -module syncC
Potential Problem
CDC analysis does not promote a checker for this scheme. You should implement a transfer
protocol checking scheme using one or more checkers.
206
Command Reference
dff_sync_gated_clk
dff_sync_gated_clk
DFF GATED SYNC: DFF synchronizer with gated clock.
tx_sig
tx_clk
DFF
DFF
rx_sig
en_rx_clk
rx_clk
Tx Clock Domain
Rx Clock Domain
207
Command Reference
dmux
dmux
DMUX: DMUX synchronization.
tx_data
MUX
rx_data
tx_clk
tx_sel
DFF
tx_clk
Tx Clock Domain
DFF
rx_sel
rx_clk
Rx Clock Domain
Synchronization using a DMUX scheme is a standard method of synchronizing a data bus (or a
control signal). The control signal can be synchronized by any of the following signal
synchronizers: bus_dff_sync_gated_clk, bus_four_latch, bus_shift_reg, bus_two_dff,
bus_two_dff_phase or two_dff_phase, dff_sync_gated_clk, four_latch. shift_reg, two_dff,
pulse_sync and custom.
Note
The physical design of the MUX logic (that controls the path from the Tx register to the
Rx registers) must not allow glitches at the input to an Rx register when the Tx register
changes value.
The DMUX scheme is similar to the SIMPLE_DMUX scheme. A SIMPLE_DMUX scheme is
a strict version of MUX synchronization logic that requires a receive register, a MUX and
feedback from the receiver to the MUX. A DMUX scheme is a generalized version of a MUX
synchronization circuit. The MUXing logic can be any combinational logic and a feedback path
from the Rx domain is not needed.
Crossing Type
synchronized control signal
Default Severity
caution
Promoted Checker
cdc_dsel
208
Command Reference
dmux
Examples
1. Following is an example to turn severity to evaluation:
// 0in set_cdc_report -scheme dmux -severity evaluation
rx_data
tx_data
4b1111
tx_clk
tx_sel
MUX
s1
DFF
DFF
rx_sel
rx_clk
Cautions
=================================================================
DMUX synchronization. (dmux)
----------------------------------------------------------------tx_clk : start : tx_data (dmux.v : 9)
rx_clk : end : rx_data (dmux.v : 6) (ID:dmux_39152)
Synchronizer ID : two_dff_44468
Evaluations
=================================================================
Single-bit signal synchronized by DFF synchronizer. (two_dff)
----------------------------------------------------------------tx_clk : start : tx_sel (dmux.v : 10)
rx_clk : end : DMUX.s1 (dmux.v : 22) (ID:two_dff_44468)
209
Command Reference
fanin_different_clks
fanin_different_clks
FANIN LOGIC FROM DIFFERENT CLOCKS: Fan-in logic from multiple clock domains.
sig_c
sig_a
synchronizer
clock_c
clock_a
Clock Domain A
Clock Domain C
sig_b
clock_b
Clock Domain B
Fan-in logic for the input to a synchronizer must be synchronized to a single transmit clock
domain for CDC analysis to properly identify the synchronization scheme. CDC analysis
reports a FANIN LOGIC FROM DIFFERENT CLOCKS scheme if it finds two unsynchronized
signals from different clock domains in the fan-in logic of the input to a synchronizer.
For some cases, the signals from one domain are constant during normal operation. For
example, the fan-in logic from one of the domains might consist of test MUXes or configuration
logic. In some other cases, signals from one domain are marked as stable. How these cases are
handled depends on the how many signals are in the fanin of the crossing:
Otherwise, if one signal has -severity off, then both signals are two individual
combo_logic crossings. One signal is reported as a violation and the other is filtered.
If the remaining signals start from the same domain, the crossing is reported as an
instance of a combo_logic scheme.
If the remaining signals start from more than one domain, the crossing is reported as
an instance of a fanin_different_clks scheme.
Command Reference
fanin_different_clks
signals appear in the CDC report. The fanin_different_clks scheme is reported as the
scheme detected for the remaining signal. When setting signals stable:
CDC analysis assumes fan-in logic from a different clock domain is combo logic if
the remaining signals are from the same domain.
CDC analysis assumes a CDC signal has a valid synchronizer scheme if it is the only
remaining signal after filtering the stable signals. The filtered signals also are
reported as using the scheme.
Stable signals are reported in the CDC report if you specify set_cdc_preference filtered_report.
Crossing Type
control signal or data bus
Default Severity
violation
Promoted Checker
cdc_glitch
Examples
1.
clock domain A
sig_a
MUX
sig_b
synchronizer
clock_a
clock_b
clock domain B
test_sel
tsel
clock_test
The above logic has a fanin_different_clks violation. To remove this violation, set
test_sel in the TEST clock domain to the constant 1'b0:
// 0in set_constant test_sel 1'b0
211
Command Reference
fanin_different_clks
2. Following is an example of reporting for fan-in logic from different clock domains:
Violations (1)
------------------------------------------Fan-in logic from different clock domain (1)
===========================================
Fan-in logic from different clock domain
------------------------------------------clk3: end: u1.q(t8.v: 30)
clk1: start: u0.q(t8.v: 30)
via: u0.q
via: u1.d
clk2: u5.q(t8.v: 30)
via: u5.q
via: u1.d
tx1_sig
DFF
tx1_clk
sync1
sync0
DFF
rx_clk
tx2_sig
tx2_clk
212
Command Reference
fifo
fifo
FIFO: FIFO Synchronization.
write address
synchronizer
fifo_empty
rd_clock
waddr_gray
gray to binary
waddr
wr_data
raddr
memory
raddr_gray
gray to binary
rd_data
fifo_full
wr_clock
rd_clock
read address
synchronizer
wr_clock
FIFO write
clock domain
FIFO read
clock domain
By default, memories with read and write clocks are reported as memory_sync or multi_bits
CDC schemes. Specifying the set_cdc_preference global directive with the -fifo_scheme option
directs CDC static analysis to identify FIFO synchronization schemes like that shown above as
FIFO schemes. FIFO synchronization is used to pass data between clock domains without
synchronizing the data. However, to prevent FIFO overflow, transmit logic must know when
the FIFO is full and to prevent FIFO underflow, the receive logic must know when the FIFO is
empty. Transmit and receive logic calculates the number of entries in the FIFO from the read
and write address pointers. In the FIFO synchronization scheme, the gray-coded values of the
address pointers are synchronized to the clock domains of the opposite logic (read address
pointer is synchronized to the transmit domain and the write address pointer is synchronized to
the receive domain).
By default, CDC static analysis identifies as FIFO schemes those schemes that have different
combinations of binary and gray-coded address pointers, as shown below:
binary to gray
waddr_gray
write address
synchronizer
fifo_empty
rd_clock
waddr
raddr
wr_data
memory
rd_data
fifo_full
wr_clock
read address
synchronizer
wr_clock
FIFO write
clock domain
rd_clock
raddr_gray
binary to gray
FIFO read
clock domain
213
Command Reference
fifo
The templates CDC static analysis uses to detect FIFO schemes can be adjusted using the
set_cdc_fifo_preference global variable (see page 269).
The memories used in the FIFO schemes can be multidimensional arrays but they must be
modeled as abstract memories (see set_memory on page 310). The memories also can be
specified using register/latch files (see set_cdc_fifo on page 268).
Crossing Type
data bus
Default Severity
evaluation
Promoted Checkers
Examples
1. Following is an example to turn severity to caution:
// 0in set_cdc_preference -fifo_scheme
// 0in set_cdc_report scheme fifo severity caution
2. In the following CDC report entry, the two synchronizers are the read and the write
pointer synchronizers:
Cautions
=================================================================
FIFO synchronization. (fifo)
----------------------------------------------------------------sys_clk : start : inst_m1dsi_al_0.crs_async_fifo_0.data_q
(/ASIC/lib/src/async_fifo_rtl.vhd : 34)
tx_byte_hs_clk : end inst_m1dsi_al_0.crs_async_fifo_0.data2_q
(/ASIC/lib/src/async_fifo_rtl.vhd : 37) (ID:fifo_85752)
Read Synchronizer ID : bus_two_dff_48297
Write Synchronizer ID : bus_two_dff_55880
214
Command Reference
fifo
3. RAM-based FIFO synchronizer. CDC analysis only recognizes this instance as a fifo
scheme if set_cdc_preference -fifo_scheme is specified.
reg [2:0] wr_sync1, wr_sync2,
reg [2:0] rd_sync1, rd_sync2;
reg [2:0] Mem [7:0];
always @(posedge wr_clk) begin
Mem [wr_addr] <= wr_data;
rd_sync1 <= rd_addr ;
rd_sync2 <= rd_sync1;
full <=
((wr_addr+1)==rd_sync2)?1:0;
end
full
rd_sync2
rd_sync1
wr_clk
wr_data
wr_addr
rd_addr
memory
rd_data
rd_clk
Also, the clock domains of the address pointers are identified explicitly:
// 0in set_cdc_port_domain wr_addr -clock wr_clk
// 0in set_cdc_port_domain rd_addr -clock rd_clk
215
Command Reference
fifo
4. Register-file based FIFO synchronizer. CDC analysis only recognizes this instance as a
fifo scheme if set_cdc_preference -fifo_scheme is specified. Also, to detect the register
file:
// 0in set_cdc_fifo Mem1 Mem2 Mem3 Mem4
reg [2:0] wr_sync1, wr_sync2,
reg [2:0] rd_sync1, rd_sync2;
always @(posedge wr_clk) begin
case (wr_addr)
3d0: Mem1[0] <= wr_data;
3d1: Mem1[1] <= wr_data;
3d2: Mem2[0] <= wr_data;
3d3: Mem2[1] <= wr_data;
3d4: Mem3[0] <= wr_data;
3d5: Mem3[1] <= wr_data;
3d6: Mem4[0] <= wr_data;
3d7: Mem4[1] <= wr_data;
endcase
rd_sync1 <= rd_addr ;
rd_sync2 <= rd_sync1;
full <=
((wr_addr+1)==rd_sync2)?1:0;
end
full
rd_sync2
rd_sync1
wr_clk
wr_data
wr_addr
rd_addr
memory
rd_data
rd_clk
wr_sync1
wr_sync2
empty
216
Command Reference
fifo
wr_clk : start : Mem2[1] (fifo2.v : 12) (ID:fifo_12948)
rd_clk : end : rd_data (fifo2.v : 6)
Read pointer synchronizer ID : bus_two_dff_18726
Write pointer synchronizer ID : bus_two_dff_646
wr_clk : start : Mem3[0] (fifo2.v : 13) (ID:fifo_78480)
rd_clk : end : rd_data (fifo2.v : 6)
Read pointer synchronizer ID : bus_two_dff_18726
Write pointer synchronizer ID : bus_two_dff_646
wr_clk : start : Mem3[1] (fifo2.v : 13) (ID:fifo_78484)
rd_clk : end : rd_data (fifo2.v : 6)
Read pointer synchronizer ID : bus_two_dff_18726
Write pointer synchronizer ID : bus_two_dff_646
wr_clk : start : Mem4[0] (fifo2.v : 14) (ID:fifo_19728)
rd_clk : end : rd_data (fifo2.v : 6)
Read pointer synchronizer ID : bus_two_dff_18726
Write pointer synchronizer ID : bus_two_dff_646
wr_clk : start : Mem4[1] (fifo2.v : 14) (ID:fifo_19732)
rd_clk : end : rd_data (fifo2.v : 6)
Read pointer synchronizer ID : bus_two_dff_18726
Write pointer synchronizer ID : bus_two_dff_646
Multiple-bit signal synchronized by DFF synchronizer. (bus_two_dff)
----------------------------------------------------------------rd_clk : start : rd_addr (fifo2.v : 5)
wr_clk : end : rd_sync1 (fifo2.v : 10) (ID:bus_two_dff_18726)
wr_clk : start : wr_addr (fifo2.v : 5)
rd_clk : end : wr_sync1 (fifo2.v : 10) (ID:bus_two_dff_646)
217
Command Reference
four_latch
four_latch
FOUR LATCH SYNCHRONIZER: Single-bit signal synchronized by latch synchronizer.
tx_sig
rx_sig
latch
latch
latch
latch
rx_clk
tx_clk
Rx Clock Domain
Tx Clock Domain
Synchronization using four latches is a standard method of synchronizing a 1-bit signal. The
end Rx signal for the synchronizer is the first latch in the synchronizer.
Crossing Type
1-bit signal
Default Severity
evaluation
Promoted Checker
cdc_sync
Examples
1. Following is an example to turn severity to caution:
// 0in set_cdc_report -scheme four_latch -severity caution
4. Four-latch synchronizer:
always @ (*)
if (rx_clk) begin
sync1 <= tx_sig;//
sync3 <= sync2; //
end
else begin
sync2 <= sync1; //
rx_sig <= sync3;//
end
218
1st latch
3rd latch
tx_sig
tx_clk
rx_sig
rx_clk
2nd latch
4th latch
Command Reference
four_latch
Evaluations
=================================================================
Single-bit signal synchronized by latch synchronizer. (four_latch)
----------------------------------------------------------------tx_clk : start : tx_sig (four_latch.v : 8)
rx_clk : end : sync1 (four_latch.v : 8) (ID:four_latch_51294)
via : sync1
219
Command Reference
handshake
handshake
HANDSHAKE: Handshake synchronization.
MUX recirculation
Tx Clock Domain
ack-tx path
Rx Clock Domain
en
DEST FSM
SRC FSM
rx_clk
tx_clk
handshake loop
acknowledge synchronizer
request synchronizer
Specifying the set_cdc_preference global directive with the -handshake_scheme option directs
CDC static analysis to identify DMUX synchronization schemes like that shown above as
HANDSHAKE CDC schemes. Like DMUX synchronization, handshake synchronization uses a
synchronized select signal to enable a data MUX to pass through data to the receive clock
domain. Handshake synchronization has additional synchronization of the receive data MUX
select signal back to the transmit clock domain as feedback into the select logic. This roundtrip synchronizer circuit automatically resets the receive domain MUX select signal. The
enable signal to the transmit data MUX select also activates the receive data MUX select via the
round-trip synchronizer.
Crossing Type
data bus
Default Severity
evaluation
Promoted Checkers
220
Command Reference
handshake
Examples
1. Following is an example to turn severity to caution:
// 0in set_cdc_preference -handshake_scheme
// 0in set_cdc_report -scheme handshake -severity caution
2. In the following CDC report entry, the two synchronizers are the two 2DFF
synchronizers in the round-trip synchronizer circuit.
Cautions
=================================================================
Handshake synchronization. (handshake)
----------------------------------------------------------------ClkO : start : DMUXInLtch (Sync_ReqAck.v: 107)
ClkR : end : DMUXOutLtch (Sync_ReqAck.v: 114)(ID:handshake_21466)
Synchronizer ID : two_dff_17913
Synchronizer ID : pulse_sync_28075
Request Signal: ReqInO
Acknowledge Signal: AckIn
221
Command Reference
handshake
ack_synced
req
ack
req_synced
enable
din
tx_clk
en
tx_data
en
data flow
rx_data
rx_clk
222
Command Reference
memory_sync
memory_sync
MEMORY SYNC: Memory Synchronization.
rd_data
memory
rd_clk
Wr Clock Domain
Rd Clock Domain
CDC synchronization using a 2D array (for example, a memory element used as a FIFO) is a
standard method of synchronizing CDC signals or data buses. CDC analysis detects CDC
crossings to and from memory, but the analysis cannot verify proper synchronization
configuration and does not promote a transfer protocol checker to verify proper synchronization
operation.
Crossing Type
control signal or data bus
Default Severity
caution
Promoted Checker
none
Examples
1. Following is an example to turn severity to evaluation:
// 0in set_cdc_report scheme memory_sync severity evaluation
Mem
rd_data
wr_clk
rd_clk
wr_addr
rd_addr
223
Command Reference
memory_sync
Potential Problem
The CDC compiler currently does not perform read/write analysis, and misses the condition
where the read and write addresses are equal, which could result in unreported memory
write-through errors. Adding checkers to guard against this condition is suggested. The
compiler issues a warning (hdl105) whenever it finds an instance of a memory_sync scheme.
224
Command Reference
multi_bits
multi_bits
MULTIPLE BITS: Multiple-bit signal across clock domain boundary.
additional logic
driven by signal
tx_data
DFF
DFF
rx_data
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
tx_data
rx_data
missing
synchronizer
tx_clk
Tx Clock Domain
rx_clk
Rx Clock Domain
An unsynchronized CDC data bus in most cases should be a static violation. Similarly, a CDC
data bus synchronized using a 2DFF synchronizer should not drive any logic from the wire
connecting the two flip-flops. However, some data buses from test or configuration logic might
be constant or ad hoc synchronous with the receive clock domain. Similarly, test or
configuration logic driven by the wire connecting the two flip-flops of a 2DFF synchronizer
might also be constant or ad hoc synchronous with the receive clock domain. The severity of
these crossing schemes are typically set to caution.
Crossing Type
multibit data bus
Default Severity
violation
Promoted Checker
cdc_sample
225
Command Reference
multi_bits
*/
tx_bus
tx_clk
rx_bus
rx_clk
Violations
=================================================================
Multiple-bit signal across clock domain boundary. (multi_bits)
----------------------------------------------------------------tx_clk : start : tx_bus (multi_bits.v : 11)
rx_clk : end : rx_bus (multi_bits.v : 11) (ID:multi_bits_2760)
226
Command Reference
multi_sync_mux_select
multi_sync_mux_select
MULTIPLE SYNCHRONIZERS AT DMUX: MUX select fan-in contains more than one
synchronizer.
tx_data
MUX
DFF
rx_data
rx_sel
tx_sel1
DFF
DFF
rx_clk
tx_clk
tx_sel2
DFF
DFF
Tx Clock Domain
Rx Clock Domain
In most cases, if a MUX select is used to synchronize a signal or data bus, then the MUX select
fan-in should not have more than one synchronizer. However, some synchronization schemes
are tolerant of this type of synchronization scheme. In this case, the two synchronizers
reconverge at the MUX select. So, a reconvergence scheme is reported in addition to the
multi_sync_mux_select scheme.
This crossing type is also reported for multiply-synchronized signals in the fanin of an enable.
Crossing Type
control signal or data bus
Default Severity
caution
Promoted Checker
cdc_sample
Promoted CDC-FX Checker
cdc_fx check is on by default.
Examples
1. Following is an example to turn severity to evaluation:
/* 0in set_cdc_report -scheme multi_sync_mux_select
-severity evaluation */
227
Command Reference
multi_sync_mux_select
-severity evaluation -promotion off */
DFF
s1_sel1
DFF
s2_sel1
rx_clk
tx_clk
s_sel2[1]
tx_sel2
shift register
MUX
rx_data
tx_data
228
Command Reference
no_sync
no_sync
MISSING SYNCHRONIZER: Single-bit signal does not have proper synchronizer.
additional logic
driven by signal
tx_sig
DFF
DFF
rx_sig
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
tx_sig
rx_sig
missing
synchronizer
tx_clk
Tx Clock Domain
rx_clk
Rx Clock Domain
An unsynchronized CDC signal is typically a static violation, but if such a crossing terminates
at a black box module or RAM, the default severity is reported as caution (because
synchronization might occur in the black box). Similarly, a CDC signal synchronized using a
2DFF synchronizer that drives logic from the wire connecting the two flip-flops is reported as a
static violation by default.
Some signals from test or configuration logic might be constant or ad hoc synchronous with the
receive clock domain. Also, test or configuration logic driven by the wire connecting the two
flip-flops of a 2DFF synchronizer might also be constant or ad hoc synchronous with the
receive clock domain. The severity of these crossing schemes are typically set to caution.
Crossing Type
1-bit signal
Default Severity
violation or caution
Promoted Checker
cdc_sample
229
Command Reference
no_sync
-severity caution -module dut
*/
*/
tx_sig
tx_clk
rx_sig
rx_clk
Violations
=================================================================
Single-bit signal does not have proper synchronizer. (no_sync)
----------------------------------------------------------------tx_clk : start : tx_sig (no_sync.v : 9)
rx_clk : end : rx_sig (no_sync.v : 9) (ID:no_sync_59042)
230
Command Reference
port_constraint_mismatch
port_constraint_mismatch
PORT CONSTRAINT MISMATCH: Signal connected to a port of a custom synchronizer is in
a clock domain that is not allowed by the custom synchronizers port constraints.
illegal Tx clock domain for port
tx_sig
custom
port synchronizer
constraint
tx_clk
Tx Clock Domain
port
constraint
tx_clk
rx_clk
Rx Clock Domain
illegal Rx clock domain for port
illegal Tx clock
domain for port
tx_sig
rx_sig
illegal Rx clock
domain for port
custom synchronizer
with crossing
Tx Clock Domain
rx_sig
port
constraint
rx_clk
Rx Clock Domain
A CDC port constraint identifies all clock domains allowed for signals connected to instances of
the port. A port constraint is specified using the set_cdc_port_constraint directive. Currently
port constraints are supported only for design units that are custom synchronizers (i.e.,
identified with the set_cdc_synchronizer custom directive).
Custom Synchronizer
For a standard custom synchronizer, you can specify a CDC port constraint on any of its signal
and data bus input ports. The constraint can specify allowed clock domains for signals
connected to it, allowed clock domains for the signal that clocks the port, or both. You also can
specify allowed pairs of clock domains for instances of the port: one for the signal connected to
the port and one for signal that clocks the port. A constrained port of an instance of the design
unit has a port constraint mismatch if one of the following holds:
The signal connected to the port is not from an allowed transmit clock domain for the
port.
The signal clocking the port is not from an allowed receive clock domain for the port.
The domain of the transmit signal and the domain of the receive clock signal are not an
allowed clock domain pair for the port.
231
Command Reference
port_constraint_mismatch
Crossing Type
control signal or data bus
Default Severity
violation
Promoted Checker
none
Examples
1. Following is an example to turn severity to evaluation for port constraint mismatches for
custom synchronizers in module prk:
/* 0in set_cdc_report -scheme port_constraint_mismatch
-from write_test
-severity evaluation -module prk */
232
Command Reference
pulse_sync
pulse_sync
PULSE SYNC: Pulse Synchronization.
rx_sig
tx_sig
DFF
DFF
DFF
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
DFF
DFF
DFF
tx_clk
Tx Clock Domain
rx_clk
Rx Clock Domain
Crossing Type
1-bit signal
Default Severity
evaluation
Promoted Checker
cdc_sync
Examples
1. Following is an example to turn severity to caution:
// 0in set_cdc_report scheme pulse_sync severity caution
233
Command Reference
pulse_sync
234
Command Reference
reconvergence
reconvergence
RECONVERGENCE: Reconvergence of synchronizers.
reconverging signals
sig1
tx_sig1
rx_sig
tx/rx_clk
sig2
tx_sig2
Reconvergence occurs when the fan-in of a flip-flop includes two separately synchronized CDC
signals from a different clock domain. The synchronizers can be any of the following:
bus_dff_sync_gated_clk, bus_four_latch, bus_shift_reg, bus_two_dff, bus_two_dff_phase or
two_dff_phase, dff_sync_gated_clk, four_latch. shift_reg, two_dff, pulse_sync and custom.
Reconvergence of two signals might result in synchronization problems. When multiple bits
reconverge, their relative timing is unpredictable. Logic that receives these signals should
account for potential cycle skewfor example, by using a hamming encoding scheme for
signals in the receiving domain. For signals that have large guard times between changes, this
encoding happens naturally.
If it is not feasible to either design receiving logic that accounts for the potential cycle skew or
encode the signals, then you should group the signals and transfer them as a group using a
synchronized MUX enable (as used for multiple-bit data signals). To force CDC analysis to
recognize reconvergence schemes that start from a dmux, simple_dmux or
multi_sync_mux_select scheme, specify set_cdc_preference -dmux_as_recon_start (page 286).
Crossing Type
multiple control signals or data buses
Default Severity
caution
Promoted Checker
cdc_hamming1 (if enabled, see set_cdc_preference on page 286).
235
Command Reference
reconvergence
Examples
1. Following is an example to disable reporting of all reconvergence points originating in
the tx_clk domain:
/* 0in set_cdc_report -scheme reconvergence
-severity off -tx_clock tx_clk */
*/
in1
[1]
tx1
[0]
shift_reg_sync[0]
reconvergence point
shift_reg_sync[1]
shift register
rx_clk
tx_clk
in2
tx2
two_dff_sync
temp
DFF
236
dout
DFF
Command Reference
reconvergence
Violations
=================================================================
Reconvergence of synchronizers. (reconvergence)
----------------------------------------------------------------rx_clk : end : dout (reconvergence.v : 5) (ID:reconvergence_78116)
rx_clk : start : shift_reg_sync (reconvergence.v : 10)
(Synchronizer ID:shift_reg_39969)
rx_clk : start : two_dff_sync (reconvergence.v : 9)
(Synchronizer ID:two_dff_74368)
The following code shows the reconvergence point and the two synchronizers on the
reconverging paths.
// Tx signals
always @ (posedge tx_clk) begin
tx_data1 <= din1;
tx_data2 <= din2;
end
// bus two_dff synchronizer
always @ (posedge rx_clk) begin: two_dff
reg [3:0] temp;
temp <= tx_data1;
two_dff_sync <= temp;
end
// shift_reg synchronizer
always @ (posedge rx_clk) begin: shift_reg
shift_reg_sync <= {shift_reg_sync[3:0], tx_data2};
end
// reconvergence point (depth 1)
always @ (posedge rx_clk) begin
rx1 <= two_dff_sync;
rx2 <= shift_reg_sync[7:4];
dout <= rx1 - rx2;
end
[7:4]
shift_reg_sync[3:0]
shift_reg_sync[7:4]
in1
rx2
rx_clk
tx_clk
temp
in2
tx_data2 DFF
two_dff_sync
DFF
rx1
dout
Violations
=================================================================
Reconvergence of synchronizers. (reconvergence)
----------------------------------------------------------------rx_clk : end : dout (test4.v : 5) (ID:reconvergence_78116)
rx_clk : start : shift_reg_sync (test4.v : 10)
(Synchronizer ID:bus_shift_reg_96629)
rx_clk : start : two_dff_sync (test4.v : 9)
(Synchronizer ID:bus_two_dff_9116)
237
Command Reference
redundant
redundant
REDUNDANT: Redundant synchronization.
rx_sig1
synchronizer
tx_sig
tx_clk
Tx Clock Domain
rx_clk
synchronizer
rx_sig2
Rx Clock Domain
Redundant synchronizers are multiple synchronizers in the same clock domain that synchronize
the same CDC signal. The values of the rx_sig1 and rx_sig2 signals might not match, because of
metastability. If these separately synchronized signals are in the fan-in of the same flip-flop,
then a reconvergence problem might exist. But, even if they are not, redundant synchronizers
create extra logic that can be eliminated by splitting the signals after they are synchronized.
Crossing Type
multiple control signals or data buses
Default Severity
caution
Promoted Checker
none
Example
1. Following is an example to disable reporting of redundant synchronizers on *_en signals
from the tx_clk domain:
/* 0in set_cdc_report -scheme redundant
-severity off -from *_en -tx_clock tx_clk
238
*/
Command Reference
redundant
sh_reg[0]
tx_sig
shift_reg.sh_reg
[0]
tx_clk
shift_reg
rx_clk
redundantly synchronized
signals
two_dff.s1
Violations
=================================================================
Redundant synchronization. (redundant)
----------------------------------------------------------------tx_clk: start: tx_sig (redundant.v: 4) (ID:redundant_87696)
rx_clk: end: shift_reg.sh_reg (redundant.v : 20)
(Synchronizer ID:shift_reg_71323)
rx_clk: end: two_dff.s1 (redundant.v: 12)
(Synchronizer ID:two_dff_17946)
239
Command Reference
series_redundant
series_redundant
SERIES REDUNDANT: Custom synchronizers connected in series.
Tx synchronizer
Rx synchronizer
rx_sig
tx_sig
custom
synchronizer
custom
synchronizer
rx_clk
tx_clk
Tx Clock Domain
Rx Clock Domain
240
*/
Command Reference
series_redundant
tx_data
cust_sync_A
tx_clk
cust_sync_B
rx_clk
241
Command Reference
shift_reg
shift_reg
SHIFT REG: Shift-register synchronization.
tx_sig
rx_sig
shift register
tx_clk
Tx Clock Domain
rx_clk
Rx Clock Domain
Crossing Type
1-bit signal
Default Severity
evaluation
Promoted Checker
cdc_sync
Examples
1. Following is an example to turn severity to caution:
// 0in set_cdc_report scheme shift_reg severity caution
242
*/
Command Reference
shift_reg
tx_sig
[7]
tx_clk
shift register
shift_reg_sync[8]
rx_clk
Evaluations
=================================================================
Shift-register synchronization. (shift_reg)
----------------------------------------------------------------tx_clk : start : tx_sig (shift_reg.v : 10)
rx_clk : end : shift_reg.shift_reg_sync[1] (shift_reg.v : 19)
(ID:shift_reg_99229)
243
Command Reference
simple_dmux
simple_dmux
SIMPLE_DMUX: Simple MUX enable.
tx_data
MUX
rx_data
tx_clk
tx_sel
DFF
DFF
rx_sel
tx_clk
Tx Clock Domain
rx_clk
Rx Clock Domain
The simple DMUX scheme is a restricted version of the general DMUX scheme. For the
general scheme, the fanin logic of the Rx signal can contain any logic and the synchronized
control signal can use any logic to turn off the Tx signal (not just a MUX). The control signal
can be synchronized by any of the following signal synchronizers: bus_dff_sync_gated_clk,
bus_four_latch, bus_shift_reg, bus_two_dff, bus_two_dff_phase or two_dff_phase,
dff_sync_gated_clk, four_latch. shift_reg, two_dff, pulse_sync and custom.
The simple DMUX scheme has the following restrictions:
No combo logic is between select output from the synchronizer and the MUX.
Note
The physical design of the MUX logic (that controls the path from the Tx register to the
Rx registers) must not allow glitches at the input to an Rx register when the Tx register
changes value.
Crossing Type
synchronized control signal and muxed data bus
Default Severity
caution
244
Command Reference
simple_dmux
Promoted Checker
cdc_dsel
rx_data
tx_data
MUX
tx_clk
tx_sel
s1
DFF
DFF
rx_sel
rx_clk
Cautions
=================================================================
Simple DMUX synchronization. (simple_dmux)
----------------------------------------------------------------tx_clk : start : tx_data (simple_dmux.v : 9)
rx_clk : end : rx_data (simple_dmux.v : 6) (ID:simple_dmux_44768)
Synchronizer ID : two_dff_44468
245
Command Reference
single_source_reconvergence
single_source_reconvergence
SSR: Single-source reconvergence of synchronizers.
reconverging signals
single source
tx/rx_clk
clk
Reconvergence occurs when the fan-in of a flip-flop includes two separately synchronized CDC
signals from a different clock domain. Single-source reconvergence is the special case where
reconverging signals in the receive domain originate from the same signal in the transmit
domain. Reconvergent signals might result in synchronization problems, but large designs can
have large numbers of reconvergence paths. Single-source reconvergence paths are more likely
to cause design problems than reconvergence paths from unrelated sources, so they can be given
a higher priority when resolving issues of reconvergence.
Static CDC analysis reports single-source reconvergence paths as both reconvergence violations
and SSR violations. The set_cdc_reconvergence (page 294) global directive adjusts two
parameters used to determine how extensive static CDC analysis of reconvergence paths should
be:
depth
Maximum number of sequential levels in the receive domain from the synchronizers to
the reconverging paths. The depth is used to limit analysis of reconverging paths (both
single-source and separate-source).
divergence depth
Maximum number of sequential levels in the transmit domain from the flip-flops driving
the synchronizers backwards to the single source. The depth is used to limit analysis of
single-source reconverging paths.
246
Command Reference
single_source_reconvergence
Default Severity
violation
Promoted Checker
cdc_hamming1 (if enabled, see set_cdc_preference on page 286).
Examples
1. Following is an example to disable reporting of single-source reconvergence points
originating in the tx_clk domain:
/* 0in set_cdc_report -scheme single_source_reconvergence
-severity off -tx_clock tx_clk */
3. Following is an example to change the reconvergence depth to 4 and enable singlesource reconvergence reporting with a divergence depth of 5:
// 0in set_cdc_reconvergence -depth 4 -divergence_depth 5
4. Following examples change the reconvergence depth and and enable single-source
reconvergence reporting:
// 0in set_cdc_reconvergence -depth 1 -divergence_depth 2
depth = 1
divergence depth = 2
synchronizer
synchronizer
synchronizer
Tx Clock Domain
Rx Clock Domain
reported single-source
reconvergence paths
247
Command Reference
single_source_reconvergence
// 0in set_cdc_reconvergence -depth 2 -divergence_depth 1
depth = 2
divergence
depth = 1
synchronizer
synchronizer
synchronizer
Tx Clock Domain
reported single-source
reconvergence paths
Rx Clock Domain
The following code shows the divergence and reconvergence points and the two
synchronizers on the reconverging paths.
// divergence point
always @ (posedge tx_clk)
ctrl <= ci0 | ci1 ;
// two_dff synchronizer
always @ (posedge rx_clk) begin: two_dff
reg temp;
temp <= ctrl;
two_dff_sync <= temp;
end
// shift_reg synchronizer
always @ (posedge rx_clk) begin: shift_reg
shift_reg_sync <= {shift_reg_sync[0], ctrl};
end
// reconvergence point
always @ (posedge rx_clk)
dout <= two_dff_sync ^ shift_reg_sync[1];
divergence point
[1]
ctrl
[0]
shift_reg_sync[0]
reconvergence point
shift_reg_sync[1]
shift register
rx_clk
tx_clk
divergence depth = 0
248
dout
DFF
DFF
two_dff_sync
Command Reference
single_source_reconvergence
Single Source Reconvergence of synchronizers.
(single_source_reconvergence)
----------------------------------------------------------------rx_clk : end : dout (single_source_reconvergence.v : 5)
(ID:single_source_reconvergence_41397)
rx_clk: start: shift_reg_sync(single_source_reconvergence.v : 10)
(Synchronizer ID:shift_reg_97221)
rx_clk : start : two_dff_sync (single_source_reconvergence.v : 9)
(Synchronizer ID:two_dff_44733)
tx_clk : diverge : ctrl (single_source_reconvergence.v : 8)
The following code shows the divergence and reconvergence points and the two
synchronizers on the reconverging paths.
// divergence point
always @ (posedge tx_clk) begin
diverge <= diverge + 1;
tx_data1 <= din + diverge;
tx_data2 <= ~diverge;
end
// 1 level to sync
// 0 levels to sync
// 0 levels to sync
// two_dff synchronizer
always @ (posedge rx_clk) begin: two_dff
reg [3:0] temp;
temp <= tx_data1;
two_dff_sync <= temp;
end
// bus_shift_reg synchronizer
always @ (posedge rx_clk) begin: shift_reg
shift_reg_sync <= {shift_reg_sync[3:0], tx_data2};
end
// reconvergence point
always @ ( posedge rx_clk )
dout <= two_dff_sync - shift_reg_sync[7:4];
divergence point
diverge
[7:4]
[3:0]
tx_data2
shift_reg_sync[3:0]
bus shift
register
reconvergence point
shift_reg_sync[7:4]
rx_clk
tx_clk
din
dout
+
tx_data1
divergence depth = 1
DFF
DFF
two_dff_sync
249
Command Reference
single_source_reconvergence
Single Source Reconvergence of synchronizers.
(single_source_reconvergence)
----------------------------------------------------------------rx_clk : end : dout (single_source_reconvergence.v : 5)
(ID:single_source_reconvergence_84301)
rx_clk: start: shift_reg_sync (single_source_reconvergence.v : 10)
(Synchronizer ID:bus_shift_reg_96629)
rx_clk : start : two_dff_sync (single_source_reconvergence.v : 9)
(Synchronizer ID:bus_two_dff_9116)
tx_clk : diverge : diverge (single_source_reconvergence.v : 8)
250
Command Reference
two_dff
two_dff
TWO DFF SYNCHRONIZER: Single-bit signal synchronized by DFF synchronizer.
tx_sig
rx_sig
DFF
DFF
tx_clk
Tx Clock Domain
rx_clk
Rx Clock Domain
Examples
1. Following is an example to turn severity to caution:
// 0in set_cdc_report scheme two_dff severity caution
3. Example promoted transfer protocol checker for the two_dff synchronization scheme:
/* 0in cdc_sync
-tx_var mtr.fifo_rd -tx_clock pci_clk
-tx_min `P_pci_clk_cpu_clk_tx_min
-name cdc_sync_0 -module cpu_top
-inferred */
tx_sig
tx_clk
s1
s0
DFF
DFF
rx_clk
Evaluations
=================================================================
Single-bit signal synchronized by DFF synchronizer. (two_dff)
----------------------------------------------------------------tx_clk : start : tx_sig (two_dff.v : 9)
rx_clk : end : s0 (two_dff.v : 10) (ID:two_dff_32868)
251
Command Reference
two_dff
tx_sig
EN
EN
s0
tx_clk
enable
s1
rx_clk
Evaluations
=================================================================
Single-bit signal synchronized by DFF synchronizer. (two_dff)
----------------------------------------------------------------tx_clk : start : tx_sig (two_dff.v : 9)
rx_clk : end : s0 (two_dff.v : 10) (ID:two_dff_32868)
Notes
If you use a DFF synchronization scheme that has more than two flip-flops, then you can get
CDC analysis to recognize the scheme by specifying a set_cdc_synchronizer directive
(page 304). For example, the following CDC global directive identifies 4 DFF synchronizers as
valid two_dff schemes for CDC paths from the tx_clk domain to the rx_clk domain:
/* 0in set_cdc_synchronizer dff -level 4
-tx_clock tx_clk -rx_clock rx_clk */
252
Command Reference
two_dff_phase
two_dff_phase
TWO DFF SYNCHRONIZER OPPOSITE POLARITY: Single-bit signal synchronized by DFF
of opposite clock polarity.
tx_sig
rx_sig
DFF
tx_clk
Tx Clock Domain
DFF
rx_clk
Rx Clock Domain
Synchronization using two opposite polarity flip-flops has a reduced time for rx_sig to settle.
When using this synchronization scheme, be sure the MTBF is acceptable.
Crossing Type
1-bit signal
Default Severity
caution
Promoted Checker
cdc_sync
Example
1. Following is an example to turn severity to caution:
// 0in set_cdc_report -scheme two_dff_phase -severity caution
2. 2DFF phase synchronizer has one FF clocked by a clock with the opposite polarity of
the Rx clock:
always @(negedge rx_clk)
sync1 <= tx_sig; // 1st FF
always @(posedge rx_clk)
sync2 <= sync1; // 2nd FF
tx_sig
tx_clk
sync1
sync2
rx_clk
Cautions
=================================================================
Single-bit signal synchronized by DFF of opposite clock polarity.
(two_dff_phase)
----------------------------------------------------------------tx_clk : start : tx_sig (two_dff_phase.v : 9)
rx_clk : end : s0 (two_dff_phase.v : 10) (ID:two_dff_phase_42446)
253
Command Reference
Global Directives
Global Directives
Global directives configure and control the Questa CDC/Formal tools. This section has
descriptions of the use of primitives and wildcards in global directives, followed by data sheets
for the global directives.
0-In Comments
To use global directives, you place them inside 0-In comments in control files. A control file is a
text file containing a Verilog module or VHDL design unit.
Note
Global directives specified outside a Verilog module or VHDL design unit are
ignored.
0-In comments have a similar structure as generic HDL comments, but start with the identifier
0in. You can include multiple directives in the same 0-In comment, if you separate them by
semicolons. Everything within a 0-In comment is meaningful to the Questa compilers. The
contents are interpreted as one or more directives. You cannot include a 0-In comment inside an
HDL comment.
The Questa compilers read two types of 0-In comments:
*/
254
Command Reference
Global Directives
0-In Primitives
Expressions in 0-In directives are HDL expressions that can include 0-In primitives.
Expressions represent signals derived from other signals or expressions that evaluate to signals.
0-In primitives can refer to signals or expressions that evaluate to signals, including other
primitives. Expressions can combine HDL expressions and 0-In primitives using HDL
operators and parentheses for grouping. 0-In primitives are expressions. Expressions in
directives must be enclosed in parentheses. The 0-In primitives are: $0in_rising_edge,
$0in_falling_edge, $0in_0_to_1, $0in_1_to_0, $0in_delay, and $0in_spy. The
$0in_rising_edge and $0in_falling_edge primitives use Verilog posedge/negedge semantics,
which accounts for transitions involving X. The $0in_0_to_1 and $0in_1_to_0 primitives do not
account for transitions involving X.
$0in_0_to_1(expression [,clock])
clock
sig
($0in_0_to_1(sig, clock))
$0in_1_to_0(expression [,clock])
clock
sig
($0in_1_t0_0(sig, clock))
$0in_rising_edge(expression [,clock])
Signal that asserts when expression
transitions from 0 to 1/X or from X
to 1. The signal de-asserts when
sig_a
expression transitions again or at
the active edge of the clock,
($0in_rising_edge(sig_a, clock)) whichever comes first.
clock
sig_b
($0in_rising_edge(sig_b, clock))
sig_c
($0in_rising_edge(sig_c, clock))
255
Command Reference
Global Directives
$0in_falling_edge(expression [,clock])
Signal that asserts when expression
transitions from 1 to 0/X or from X
to 0. The signal de-asserts when
sig_a
expression transitions again or at
($0in_falling_edge(sig_a, clock)) the active edge of the clock,
whichever comes first.
clock
sig_b
($0in_falling_edge(sig_b, clock))
sig_c
($0in_falling_edge(sig_c, clock))
($0in_delay(sig, n, clock))
$0in_spy(name [, number])
Using $0in_spy simplifies the file list, which can reduce the runtime and memory footprint.
This primitive allows specifying hierarchical names that might be outside of the file list given to
the compiler. The representation is a signal whose name is name and whose bit-width is number
(default 1). The compiler does not try to resolve this signal in the file list, and prints it out "as is"
in the checker logic.
For example,
// 0in set_reset -default $0in_spy(top.rst)
Assumes that top.rst signal is 1 bit and hooks up to the resets of checkers, even if top is not
given in the filelist. Compare this with the following:
// 0in set_reset -default top.rst
This results in a warning/error with an unresolved signal on top.rst if the module top is not
given in the filelist. Following is another example:
// 0in one_hot -var $0in_spy(tb.u0.a.b.c, 8) -clock clk
256
Command Reference
Global Directives
This puts a one_hot checker on an 8-bit tb.u0.a.b.c signal even if the compiler does not find it in
the file list. If tb.u0.a.b.c does not exist or is not 8 bits wide, the simulator generates an error or
reports width-mismatch warnings.
The primitive peeks a signed signal into an unsigned vector. For example,
$0in_spy(a.b.c, w);
is mapped to
wire [w-1:0] sg_123 = a.b.c;
Hierarchical Paths
Directives in a control file that do not specify a -module argument (i.e., at the top level) specify
signals with the complete hierarchical paths. Directives in a control file that specify a -module
argument or set_clock/set_reset directives in a module/architecture (i.e., at a lower level)
specify signals relative to the local module/architecture.
Example 1
// G1 is the top level; m1_dut is an instance of M1
//0in set_constant G1.F1[0].I0.F2[0].m1_dut.x 1b1 -module M1
Generates a warning because it specifies an absolute path for x. The directive is skipped.
Example 2
// G1 is the top level; m1_dut is an instance of M1
//0in set_constant x 1b1 -module M1
Matches
G1.F1[0].I0.F2[0].m1_dut.x
257
Command Reference
Global Directives
Example 1
G1.*.*.F3[0].*.clk* 1b0
Matches the following specifications. In this example, the bold * matches multiple
hierarchical levels.
G1.F1[6].I1.F3[0].m1_dut.clk1
G1.F1[6].I1.F3[0].m2_dut.clk2
G1.F1[6].I1.F3[0].sync_dut.clk2
G1.F1[6].I1.F3[0].sync_dut.dmux_dut.clk
G1.F1[6].I1.F3[0].sync_dut.dmux_dut.dff.clk
Example 2
G1.*
Matches all signals below G1 (i.e., any signal with a hierarchy depth > 0 from G1).
Example 3
G1.*.*.*
Matches all signals with a hierarchy depth > 3 from G1, such as:
G1.F1[6].I1.F3[2].m2_dut.int_x
G1.F1[6].I1.F3[2].m2_dut.mem_in
G1.F1[6].I1.F3[2].sync_dut.bus_in
Example 4
See the CDC Settings Report to see how wildcards are expanded, for example:
*****************************************************************
Section D: Wildcard Expansion for Global Directives
*****************************************************************
Wildcards for set_cdc_port_domain directive
----------------------------------------------------------------File mixed1_ctrl.v : Line 2
*in* matches
vhdl_inst.in1
vhdl_in
v2k_in
Wildcards for set_cdc_signal directive
----------------------------------------------------------------File mixed1_ctrl.v : Line 6
vhdl_inst.*c_enum matches
vhdl_inst.rec_enum
258
Command Reference
Global Directives
Directive Order
Directive order is important in processing directives (especially directives with wildcard
arguments). Directives are processed in order and directives that conflict with preceding
directives are completely or partially skipped. For the following example, module moda has
inputs in1, in2, in3 and in4:
// 0in set_cdc_port_domain -clock clk_a -module moda in1
// 0in set_cdc_port_domain -clock clk_b -module moda in2
// 0in set_cdc_port_domain -clock clk_c -module moda -input *
Since the last directive matches in1 and in2 (which were assigned in the previous directives), it
generates the following warnings:
Warning : Multiple clocks defined for
[File .../dut_ctrl.v, Line
[File .../dut_ctrl.v, Line
: Port will be ignored in the
Warning : Multiple clocks defined for
[File .../dut_ctrl.v, Line
[File .../dut_ctrl.v, Line
: Port will be ignored in the
The directives assign in1 to clk_a domain, in2 to clk_b domain, and in3/in4 to clk_c domain
which is probably the intended resultso you do not need to modify the directives. But,
suppose you swap the directive order as shown in the following specification:
// 0in set_cdc_port_domain -clock clk_c -module moda -input *
// 0in set_cdc_port_domain -clock clk_a -module moda in1
// 0in set_cdc_port_domain -clock clk_b -module moda in2
The first directive assigns all input ports (in1/in2/in3/in4) to clk_c domain. The second directive
produces the following warning:
Warning : Multiple clocks defined for
[File .../dut_ctrl.v, Line
[File .../dut_ctrl.v, Line
: Port will be ignored in the
The second and third directives are completely vacuous and are totally ignored, which is
certainly not what you intended. Here, you must modify the order of the directives (or remove
the second and third directives).
259
Command Reference
Directives for CDC Analysis
Directive
Description
Wildcard Args
Clocks and
Domains
set_cdc_clock
clock
-module
set_cdc_port_domain
port
-same_clock
-combo_path
-module
set_cdc_port_constraint
set_reset
set_cdc_signal
set_cdc_preference
CDC
Analysis
signal
-module
CDC
Schemes
260
set_mode
-set signal
set_mode_control
error_on
set_cdc_synchronizer
set_cdc_report
Command Reference
Directives for CDC Analysis
Type
Directive
Description
Wildcard Args
set_cdc_fifo_preference
register
-module
Checker
Promotion
set_cdc_protocol
CDC-FX
Netlist
Generation
-module
set_cdc_fx_timescale
set_cdc_fx_check
set_black_box
module
set_memory
mem
-module
set_constant
261
Command Reference
error_on
error_on
Changes the conditions for returning an error.
Syntax
error_on
[-inferred {black_box | clock | reset | control_point}]
[-unspecified clock_waveform] [-abstracted memory] [-warning_limit limit]
-unspecified clock_waveform
Return an error if the compiler encounters a clock without a waveform specification. A
waveform specification is a set_clock directive with the following form:
//0in set_clock clk2 -period 30 -waveform 0 15
which specifies the value -waveform 0 10 by default. This option is ignored by cdc.
-abstracted memory
Return an error if any memory is abstracted (even when it is specifically abstracted with the
set_memory -abstract directive). Ignored by cdc.
-warning_limit limit
Return an error when the number of warnings exceeds limit. Ignored by 0in_autocheck and
csl. Default: no warning limit.
Description
Sets additional conditions for which the tool (cdc, csl or 0in_autocheck) returns errors. The
-inferred, -unspecified and -abstracted options change the severities of their associated
instances from warnings to errors. The -warning_limit option returns an error when the number
of warnings exceeds the warning limit.
An error prevents the flow from proceeding to the analysis phase, whereas warnings do not.
262
Command Reference
error_on
Examples
Example 1
// 0in error_on -inferred black_box -abstracted memory
Errors out if a black box is inferred (for example, if an unsupported construct is in the design
unit). Errors out if a memory is abstracted.
263
Command Reference
set_black_box
set_black_box
Identifies modules/entities as black boxes.
Syntax
set_black_box module [-dont_use_outputs]
module
Module/entity names or wildcard patterns.
-dont_use_outputs
Questa Formal argument ignored for CDC.
Description
The cdc compiler skips netlist elaboration of black boxes and their children. Typically
modules/entities declared as user-defined black boxes contain unsupported constructs so the
compiler would infer them as black boxes anyway. However, CDC analysis treats inferred and
user-defined black box modules differently:
264
Ports asynchronous with the defined clocks should be identified as such using the
-async argument.
A black_box scheme (with caution severity by default) is reported for each input.
Command Reference
set_cdc_clock
set_cdc_clock
Specifies clocks with their characteristics and redefines the clock domains.
Syntax
set_cdc_clock clock_signal
[[posedge] [negedge] [waveform risingTime fallingTime] [period value] [virtual]
[mode mode] [group group]
| ignore | remove]
[-jitter_percent number] [module module_pattern]
clock_signal
Clock signal names or wildcard patterns. Clock signals can be primary ports or hierarchical
paths to clock signals. Clock signals can be individual bits of clock vectors.
-posedge
Clock signals have positive active edges. Default: -posedge.
-negedge
Clock signals have negative active edges.
-period value
Clock period in time units. This value is used to calculate directive parameters for promoted
checkers.
-virtual
Clock signals are virtual clocks used to identify clocks from ports that do not exist in the
DUT. For example, specify -virtual for a port associated with a clock that is not an input to
the design.
-mode mode
Mode for which this directive applies when running modal analysis. The directive is skipped
unless you are running CDC modal analysis in the specified mode. Default: directive is
recognized in all modes and for non-modal CDC analysis.
-group group
Clock group containing the specified clocks. All specified clocks are considered to be in the
clock domain corresponding to the group. You can specify multiple set_cdc_clock global
directives with the same -group name (for example, to identify clocks in the same domain
that have different clock characteristics). Default: specified clocks are associated with a
single unnamed default clock group.
265
Command Reference
set_cdc_clock
-ignore
Add the specified clocks to the list of ignored clocks. Typical usage is to run cdc
-report_clock to identify the clocks in the design. Then, use set_cdc_clock -ignore to mark
specific clocks to be ignored. Registers in the domains of ignored clocks are not used in
CDC analysis. So, marking superfluous clocks as ignored can help improve performance.
The 0in_cdc_design.rpt reports Ignore Clock Tree section lists the clocks marked as
ignored. If both -ignore and -group are specified, the named clocks are added to the
specified clock group and all clocks in that group are added to the list of ignored clocks.
Default: specified clocks are added to the specified (or default) clock group.
-remove
Remove clock_signals from the clock tree. Default: specified clocks are added to the
specified (or default) clock group.
-jitter_percent number
Proportion of the clock cycle that clock edges can jitter. The percent must be <100. Used to
calculate tx_min:
jitter
rx_clk_period 1 + -----------
100
tx_min = int(------------------------------------------------------------------) + 1
jitter
tx_clk_period 1 -----------
100
Default: jitter = 0.
rx_clk_period
tx_min = int(---------------------------------) + 1
tx_clk_period
-module module_pattern
Clock signal names are specified relative to the module matching module_pattern. If
multiple modules match module_pattern, then the matching clock_signals in the matching
modules are grouped in the same clock group. Default: clock signal names are hierarchical
from the top level.
Description
Specifies clocks with their characteristics and redefines clock domains. You must specify a
clock signal pattern that matches at least one clock signal and no two set_cdc_clock global
directives can specify the same clock. Clocks can be bits of multiple-bit variables.
The set_cdc_clock directives without the -module option are processed in the order of entries in
the control file. Then the set_cdc_clock directives with the -module option are processed in the
order of entries in the control file. Wildcard matches do not take precedence over exact
matches.
266
Command Reference
set_cdc_clock
Examples
module cdc_ctrl;
// 0in set_cdc_clock U0.clk U1.clk -period 100 -group A
// 0in set_cdc_clock U0.clk[2] U1.clk[2] -period 50 -group A
endmodule
clkA
clkB
clkC -ignore
clkD -ignore
Design has four clocks (clkA, clkB, clkC, and clkD), but user wants to restrict analysis to
crossings between clkA and clkB. The clkC and clkD clocks are ignored. Only crossings
between clkA and clkB are reported in 0in_cdc.rpt.
module ctrl;
// 0in set_cdc_clock clk* -group G1
endmodule
The wildcard pattern clk* is expanded and matching signals are added to the G1 clock
group. The list of wildcard expanded signals are reported in 0in_cdc_setting.rpt:
Wildcards for set_cdc_clock directive
----------------------------------------------------------------File t11_ctrl.v : Line 3
----------------------------------------------------------------clk* matches
clk1
clk2
// 0in set_cdc_clock clkA -virtual
// 0in set_cdc_port_domain sigA -clock clkA
sigA
clk_B
clkA
DUT
Example of virtual clocks. Signal sigA is associated with clock clkA (which is outside
the DUT).
Questa CDC User Guide, v10.0c_2
October 2011
267
Command Reference
set_cdc_fifo
set_cdc_fifo
Identifies FIFOs for fifo scheme recognition from register files and latch files.
Syntax
set_cdc_fifo
register_pattern [module module_pattern] [mode mode]
register_pattern
Name pattern for the FIFO registers (or latches).
module module_pattern
Name pattern for the modules containing the registers to match. Default: top module.
mode mode
Mode to which the FIFO identification belongs. Default: all modes.
Description
Identifies FIFOs defined in register files (or latch files) for analysis of FIFO synchronization
schemes.
Examples
//0in set_cdc_fifo -module reg_file_fifo_* reg*
268
Command Reference
set_cdc_fifo_preference
set_cdc_fifo_preference
Sets preferences for FIFO CDC schemes, if they are enabled in CDC static analysis.
Syntax
set_cdc_fifo_preference
[-no_write_sync] [-no_read_sync] [-multiple_write_syncs] [-multiple_read_syncs]
-no_write_sync
Reports as fifo schemes those memory_sync schemes that are FIFO schemes without a write
address synchronizer. Default: such schemes are reported as memory_sync schemes.
-no_read_sync
Reports as fifo schemes those memory_sync schemes that are FIFO schemes without a read
address synchronizer. Default: such schemes are reported as memory_sync schemes.
-multiple_write_syncs
Reports all write address synchronizers and promotes cdc_hamming_distance_one checkers
for them. Default: if the FIFO scheme has multiple write address synchronizers, only one of
them is reported.
-multiple_read_syncs
Reports all read address synchronizers and promotes cdc_hamming_distance_one checkers
for them. Default: if the FIFO scheme has multiple read address synchronizers, only one of
them is reported.
Description
Changes the template used to detect fifo CDC schemes.
269
Command Reference
set_cdc_fx_check
set_cdc_fx_check
Turns on/off cdc_fx checkers checks.
Syntax
set_cdc_fx_check
[-scheme scheme] [-tx_clock clock_signal] [-rx_clock clock_signal] [-fx]
[-glitch_swallowed] [-glitch_caught]
-scheme scheme
The -scheme option restricts the directive to those cdc_fx checkers connected to
synchronizers of the specified type
-tx_clock clock
The -tx_clock option restricts the directive to those cdc_fx checkers with the specified
transmit clock.
-rx_clock clock
The -rx_clock option restricts the directive to those cdc_fx checkers with the specified
receive clock.
Description
The -fx option to cdc generates CDC-FX checkers with metastability injection logic. The CDCFX checkers have three checks: fx, glitch_swallowed and glitch_caught. By default, the fx
checks are on for multi_bits, dmux, simple_dmux, multi_sync_mux_select, handshake and
no_sync schemes. For other CDC schemes the fx checks are default off. For all schemes, the
glitch_swallowed and glitch_caught checks are default off.
Use the set_cdc_fx_check directive to override these default switches. For example, to turn on
the fx, glitch_swallowed and glitch_caught checks for all instances of the dmux scheme:
set_cdc_fx_check -scheme dmux -fx -glitch_swallowed -glitch_caught
To turn off all FX checks (yet still perform metastability injection) for all instances of the dmux
scheme:
set_cdc_fx_check -scheme dmux
270
Command Reference
set_cdc_fx_metastability_window
set_cdc_fx_metastability_window
Sets the metastability window for the CDC-FX clocks.
Syntax
set_cdc_fx_metastability_window
{-start value -stop value [-percent] | -small | -medium | -large}
[-tx_clock clock_signal] [-rx_clock clock_signal]
-start value
Number of time units (or percent of the window duration) before the active receive clock
edge that the associated metastability window opens.
-stop value
Number of time units (or percent of the window duration) after the active receive clock edge
that the associated metastability window closes. Cannot be negative.
-percent
The -start and -stop values are percentages of the Rx clock, (rather than absolute numbers).
-tx_clock clock_signal
If the directive specifies -tx_clock and -rx_clock, then the directive applies to cdc_fx
checkers with these clock pairs. If the directive omits -tx_clock and -rx_clock, then the
directive applies to the remaining cdc_fx checkers. It is an error to specify more than one
directive without the -tx_clock and -rx_clock arguments.
-rx_clock clock_signal
If the directive specifies -tx_clock and -rx_clock, then the directive applies to cdc_fx
checkers with these clock pairs. If the directive omits -tx_clock and -rx_clock, then the
directive applies to the remaining cdc_fx checkers. It is an error to specify more than one
directive without the -tx_clock and -rx_clock arguments.
Description
Sets the metastability window for the CDC-FX clocks. See set_cdc_fx_metastability_window
on page 163 for additional information. You can specify the metastability window as a
percentage of the Rx clock rather than an absolute value.
Example
Following is an example of setting the metastability window as a percentage:
// 0in set_cdc_fx_metastability_window -start 10 -stop 5 -percent
In this example, start is 10% of the Rx clock and stop is 5% of the Rx clock.
271
Command Reference
set_cdc_fx_timescale
set_cdc_fx_timescale
Sets the timescale for CDC-FX logic.
Syntax
set_cdc_fx_timescale unit/precision
unit
Time unit (in ns, ps or fs).
precision
Precision (in ns, ps or fs).
Description
By default, the timescale at the end of the testbench files is used for CDC-FX logic. Use
set_cdc_fx_timescale to override the default.
Example
set_cdc_fx_timescale 1ns/10ps
272
Command Reference
set_cdc_handshake_preference
set_cdc_handshake_preference
Sets preferences for handshake CDC schemes, if they are enabled in CDC static analysis.
Syntax
set_cdc_handshake_preference
[req_unsync] [ack_unsync] [skip_ack_tx_path]
[check_mux_recirculation] [handshake_effort {medium | high}]
Tx Clock Domain
ack-tx path
Rx Clock Domain
MUX recirculation
en
DEST FSM
SRC FSM
rx_clk
tx_clk
handshake loop
acknowledge synchronizer
request synchronizer
req_unsync
Reports handshake schemes that do not have a synchronizer for the request path in the
handshake loop.
ack_unsync
Reports handshake schemes that do not have a synchronizer for the acknowledge path in the
handshake loop.
-skip_ack_tx_path
Reports handshake schemes that do not have a connection from the acknowledge path of the
handshake loop to the Tx logic.
-check_mux_recirculation
Only reports handshake schemes that include a MUX recirculation path from the receiver.
Description
Changes the template used to detect handshake CDC schemes. Handshake schemes are
distinguished from simple MUX schemes when a set_cdc_preference directive specifies the
-handshake_scheme option. The set_cdc_handshake_preference options select the elements of
the logic template used to identify handshake schemes.
Questa CDC User Guide, v10.0c_2
October 2011
273
Command Reference
set_cdc_hier_preference
set_cdc_hier_preference
Sets preferences for hierarchical CDC analysis.
Syntax
set_cdc_hier_preference [-ctrl_file_models] [-propagate_global_directives]
-ctrl_file_models
Generate a control file model (CFM) for block-level analysis in addition to the interface
logic model (ILM). Default: only the ILM is generated. Missing ILMs are treated as black
boxes during top-level analysis.
-propagate_global_directives
Propagate all global directives in control files specified to cdc -report_constraints to the
hierarchical block control files. This option expands and distributes wildcard patterns
through the hierarchy, but also decreases performance. Default: faster heuristic algorithm
propagates global directives to the block-level control files. Certain directives are skipped.
Description
During block-level analysis, cdc generates a CDC interface logic model (ILM) of the block for
use in top-level CDC analysis. Specifying -ctrl_file_models at the block level also generates a
CDC control file model named 0in_cdc_hier_block_ctrl.v (see Control File Models on
page 131). If you specify set_cdc_hier_preference -ctrl_file_models in a top-level CDC control
file, the directive is propagated to the block levels via the hierarchical control files (during
report constraints). However, it is not necessary to specify this directive for the top-level
analysis run.
Examples
The following steps generate a control file model for block2 and use the control file model for
block2 in the top-level analysis. Assume block1 and block3 have already been analyzed and
interface logic models for them exist in the default cache directories.
1. Ensure set_cdc_hier_preference -ctrl_file_models directives are specified for the blocklevel analyses.
shell prompt> more 0in_hier/block2/block2_ctrl.v
. . .
// 0in set_cdc_hier_preference -ctrl_file_models
274
Command Reference
set_cdc_hier_preference
3. Run top-level CDC analysis specifying the control file model generated in step 2.
shell prompt> 0in -cmd cdc -d top -od 0in_hier/top \
-ctrl 0in_hier/top/top_ctrl.v \
-hier_cache 0in_hier/blk1/0in_cache 0in_hier/blk3/0in_cache \
-hier_ctrl_file_model blk2 0in_cdc_hier_block2_ctrl.v
275
Command Reference
set_cdc_port_constraint
set_cdc_port_constraint
Sets CDC port constraints for design units identified as custom synchronizers.
Syntax
set_cdc_port_constraint
module_pattern -ports port_pattern
[-tx_clock_groups clock_group] [-rx_clock_groups clock_group]
[-clock_group_pair tx_clock_group rx_clock_group]
module_pattern
One or more custom synchronizer design units.
-ports port_pattern
Ports used to determine the constraints.
-tx_clock_groups clock_group
Clock groups allowed for the transmitting domain.
-rx_clock_groups clock_group
Clock groups allowed for the receiving domain.
Description
CDC port constraints are restrictions on which clock domains are allowed for signals that
connect to ports of instances of a design unit. The set_cdc_port_constraint directive assigns
CDC constraints to ports of design units. Currently, CDC port constraints are supported only for
custom synchronizers (i.e., design units identified with set_cdc_synchronizer custom
directives). CDC analysis reports custom synchronizer ports that violate their port constraints as
port_constraint_mismatch violations.
The module_pattern argument identifies the design units (which must be custom synchronizers)
for the directive. Each matching design unit should have one or more ports with names that
match the -ports port_pattern argument or a warning is issued for that design unit.
How you specify port constraints depends on the type of custom synchronizer:
custom_sync
Use a single directive. Specify one or more input ports with the -ports argument. Use
-tx_clock_groups to specify valid clock domains for signals connected to the inputs. Use
-rx_clock_groups to specify valid clock domains for clocks that synchronize the signals
connected to these inputs. Use -clock_group_pair arguments to identify valid pairs of
clock domains associated with these input ports.
276
Command Reference
set_cdc_port_constraint
custom_sync_with_crossing
Use two directives. For the first directive, specify one or more input ports using the
-ports argument and use -tx_clock_groups to specify valid clock domains for signals
connected to these inputs. For the other directive, specify one or more output ports with
the -ports argument and use -rx_clock_groups to specify valid clock domains for signals
connected to these outputs. Do not use the -clock_group_pair argument.
The clock_group arguments must be specified as clock groups at the top level (as specified in
the User-specified Clock Groups and Inferred Clock Groups tables of 0in_cdc_design.rpt).
They are not clocks specified with respect to the design units specified by module_pattern.
Examples
Example 1
// 0in set_cdc_synchronizer custom -module sync_2dff
// 0in set_cdc_synchronizer custom -module sync_3dff
// 0in set_cdc_port_domain -module sync_2dff IN -clock clks_slow
Restricts signals connected to the IN port of sync_2dff to the domain of clock group
clks_slow.
/* 0in set_cdc_port_constraint sync_3dff -ports IN
-rx_clock_groups clks_fast */
// 0in set_cdc_port_domain -module sync_3dff IN -clock clks_fast
Restricts signals connected to the IN port of sync_3dff to the domain of clock group
clks_fast.
Example 2
// 0in set_cdc_synchronizer custom -module sync_2dff
// 0in set_cdc_port_domain -module sync_2dff IN -clock clk1
/* 0in set_cdc_port_constraint sync_2dff -ports IN
-rx_clock_groups clk1 clk2
-clock_group_pair clk3 clk5
-clock_group_pair clk4 clk6 */
Restricts signals connected to the IN port of sync_2dff to the domains of the following
clock groups:
clk1
clk2
clk5 (but only if the IN port of the sync_2dff instance is clocked by clk3)
clk6 (but only if the IN port of the sync_2dff instance is clocked by clk4)
277
Command Reference
set_cdc_port_constraint
Note that the allowed domains are additive. That is, sync_2dff can legally synchronize a
crossing from clk1, even if IN is clocked by clk5.
Example 3
// 0in set_cdc_synchronizer custom -module syncx_2dff
// 0in set_cdc_port_domain -module sync_2dff IN -clock clkA
Restricts signals connected to the IN port of the custom synchronizer with crossing
syncx_2dff to the domain of clock group clkA. The -tx_clock_groups argument is used
because IN is clocked by a transmit domain clock.
// 0in set_cdc_port_constraint syncx_2dff -ports OUT -rx_clock_groups clkB
Restricts signals connected to the OUT port of syncx_2dff to the domain of clock group
clkB.
278
Command Reference
set_cdc_port_domain
set_cdc_port_domain
Identifies the clock domains of top level and black box ports, enables reporting of clock domain
crossings from the ports and identifies domains of black box ports for use with hierarchical
verification.
Syntax
set_cdc_port_domain {-input | -output | -inout | port_pattern}
{-async | [-async] -clock clock_id | -tx_clock clock_port | -rx_clock clock_port | -ignore}
[-same_driver] [-mode mode] [-module module_pattern] [hierarchical_CDC_options]
hierarchical_CDC_options ::= [-same_clock port_pattern] [-combo_logic]
[-combo_path primary_input_port | -nosync]
port_pattern
One or more top-level or black box ports (wildcards are allowed). Top-level port matches to
bit slices are supported. Matches to bit-sliced black box ports are not supported.
-async
Identifies the ports as asynchronous to all clock domains. For a custom synchronizer
module, -clock clock_signal -async means that the associated port is considered
asynchronous, but the ports receive domain clock is derived from clock_signal.
-clock clock_id
Identifies the clock domain. You can specify a clock signal local to any of the specified
modules (or a top clock name if module is not specified) or a clock group name.
279
Command Reference
set_cdc_port_domain
-ignore
Identifies primary input ports as driving signals that should be ignored for structural CDC
analysis. Also identifies ports of black boxes and custom synchronizers that are driven by
signals that should be ignored for CDC structural analysis.
-same_driver
Ports are considered driven by the same source driver signal when analyzing single-source
reconvergence paths. The divergence depth from the single-source driver to the ports is
taken as 1 sequential level for the purpose of calculating the divergence depth of
reconverging pathseven if the actual divergence depth inside the black box is greater than
1. Option is supported only on DUT (-d module) inputs.
single-source
reconvergence paths
-same_driver
depth = 1
divergence depth = 1
synchronizer
black box
synchronizer
synchronizer
Tx Clock Domain
Rx Clock Domain
-mode mode
The -mode option specifies the mode name to which the command in question is applicable
in modal analysis.
The user might have different CDC constraints, such as port domains in different modes.
This can be specified as follows:
// 0in set_mode mode1 -set sel 1'b1
// 0in set_mode mode2 -set sel 1'b0
// set_cdc_port_domain in -clock clk1 -mode mode1
// set_cdc_port_domain in -async -mode mode2
With the above example, constraints port in is synchronous to clk1 in mode mode1 and
asynchronous in mode mode2.
If the user specifies the -mode option with a constraint and is using regular (not modal)
CDC analysis flow, then the directive is ignored.
-module module_pattern
The directive applies to ports on all instances of the modules that match module_pattern.
Default: top-level module.
280
Command Reference
set_cdc_port_domain
-same_clock port_pattern
This option is used only for hierarchical verification. The -same_clock option is specified
for an input port. This option is used to specify that the port should be in the same clock
domain as the other ports. If the two ports are not clocked on the same clock, then a warning
is printed. This models cases when two ports of a block are connected to a DMUX
synchronizer. One of the ports goes to the select of the DMUX and the other goes to the data
bus. The same clock constraint ensures that the DMUX select and data are clocked on the
same clock.
-combo_logic
This option is used only for hierarchical verification. Identifies a hierarchical blocks
input ports with combinational fanout logic and output ports with combinational fanin logic
(for hierarchical CDC analysis). With this information, CDC analysis can detect
combinational logic before synchronizers:
combinational
logic
-combo_logic
data_a
data_b
synchronizer
clock_b
clock_a
black box
-combo_path primary_input_port
This option is used only for hierarchical verification. This option is used to model a
combination path from a list of primary inputs to a primary output. The option specified for
an output port, indicates a combinational path from the input ports to the output. The option
takes a list of string names that are the names of primary inputs which have a combinational
path to that output. While computing the outputs port domain, the inputs port domain is
taken into account. In case of conflicting input port domains, the output port domain is
inferred as -async. The -combo_path option is also used in clock propagation when the input
is connected to a clock. The output is then treated as a clock and propagated forward.
black box
port_a
combinational
logic
port_b
281
Command Reference
set_cdc_port_domain
-nosync
This option is used only for hierarchical verification. The -nosync option is specified for
an input port. This option is used to model a primary input port that is connected to flipflops clocked on different clock domains. Such a port is declared as nosync because any
crossing to such a port is a missing synchronizer. In other words, specifies that the port is
sampled by a different clock and therefore, is a bad crossing.
sampled by
different clock
-nosync
black box
clk_b
clk_a
Description
The set_cdc_port_domain global directives identify the clock domain characteristics of the
ports of the top-level module and internal black boxes. Without information from
set_cdc_port_domain directives, CDC only has the logic driven inside the DUT when it
analyzes clock domain crossings that originate outside the DUT logic. The
set_cdc_port_domain directives have two uses:
Pass hierarchical CDC information from an analyzed hierarchical level to be used in the
current level analysis.
This information is generated automatically by the CDC tool during hierarchical CDC
analysis of other hierarchical levels. The hierarchical_CDC_options (-same_clock
port_pattern, -combo_logic, -combo_path primary_input_port and -nosync) are
reserved for hierarchical CDC sessions and generate warnings if the hierarchical data for
the ports is missing.
282
Command Reference
set_cdc_port_domain
Examples
1. Each set_cdc_port_domain global directive with a -clock argument assigns all
matching ports to the same clock domain (that is, the directive does not assign to
multiple clock domains). For example,
module cdc_ctrl;
// 0in set_cdc_port_domain a b c clock U1.clk_A
// 0in set_cdc_port_domain d clock U2.clk_B
endmodule
283
Command Reference
set_cdc_port_domain
The code snippet for this example is shown in Example 6-1 on page 284, the schematic
view is shown in Figure 6-1 on page 284, and the 0in_cdc.rpt report file is shown in
Example 6-2 on page 284.
Example 6-1. Single-source Reconvergence Code Snippet
dff f1(clk1, rst1, d, d_tx0);
dff f2(clk1, rst1, d_tx0, d_tx1_1); // single-source_depth =Divergence
1
dff f3(clk1, rst1, d_tx0, d_tx1_2); // single-source_depth = 1
sync sync1(clk2, rst2, d_tx1_1, q_rx0_1);
sync sync2(clk2, rst2, d_tx1_2, q_rx0_2);
Synchronizers
Convergence
284
Command Reference
set_cdc_port_domain
clk2 : start : sync2.u1.q (back_depth1.v : 6) (Synchronizer
ID:two_dff_19004)
clk2 : start : sync1.u1.q (back_depth1.v : 6) (Synchronizer
ID:two_dff_18748)
clk1 : diverge : f1.q (back_depth1.v : 6) (ID:SSR_7566)
285
Command Reference
set_cdc_preference
set_cdc_preference
Sets preferences for CDC static analysis.
Syntax
set_cdc_preference
[-clock_in_data] [-detect_primary_output_clock] [-detect_pure_latch_clock] [-clock_as_rx]
[-infer_clock_off] [-enable_internal_resets] [-report_resets] [-promote_async_reset]
[-handshake_scheme] [-fifo_scheme] [-complex_scheme_as_synchronizer]
[-report_undriven_custom_sync] [-print_detailed_custom_sync] [-custom_fx]
[-multi_clock_convergence] [-unrestricted_reconvergence] [-promote_reconvergence]
[-dmux_as_recon_start] [-report_black_box_recon] [-black_box_empty_module]
[-ignore_black_box] [-sample_data_stability] [-dmux_promote_sample]
[-formal_add_bus_stability] [-formal_add_recon_stability] [-infer_modes_off]
[-report_mode_signals] [-allow_enable_in_sync] [-delayed_pulse] [-mult_fanout_async]
[-input_async] [-vectorize_nl] [-filtered_report] [-print_port_domain_template]
[-multi_paths] [-max_cdc_crossings number]
Clocks
-clock_in_data
Reports all crossings, including clock signals that go to data inputs of registers. In some
cases, runtime can increase substantially. Default: CDC crossings of signals used as both
clock and data are not reported.
-detect_primary_output_clock
Detects primary output clocks. An output port of the top module is inferred as a clock port if
the fanin logic of the port has a signal either specified as a clock (with set_cdc_clock) or is
used to clock a register/latch. Default: clocks are not inferred for top-level output ports.
-detect_pure_latch_clock
Assumes latch enables are clocks. Default: only latch enable signals that clock another
register or that are specified with set_cdc_clock are recognized as clock signals.
-clock_as_rx
Reports clock domain crossings to Rx nodes that have clock signals in their fanin cones (and
are not registers, latches, primary outputs, or inputs to custom synchronizers or black
boxes)unless Tx is part of the clock tree. Default: these crossings are not reported.
-infer_clock_off
Disables clock inference. Only user-specified clocks (i.e., specified by set_cdc_clock) are
assumed to be clocks. This option lets you avoid grouping inferred clocks. Default: CDC
clock analysis infers clocks.
286
Command Reference
set_cdc_preference
Resets
-enable_internal_resets
Infers internal reset signals as resets. Default: only reset signals derived from primary (i.e.,
DUT) ports are inferred as resets.
-report_resets
Reports reset tree data in the design report. Default: reset trees are not reported.
-promote_async_reset
Promotes cdc_sync checkers for async_reset. Default: checkers are not promoted for
async_reset schemes.
Complex Schemes
-handshake_scheme
Identifies HANDSHAKE CDC schemes. Default: HANDSHAKE CDC schemes are
reported as dmux or multi_bits schemes.
-fifo_scheme
Identifies FIFO CDC schemes. Default: FIFO CDC schemes are reported as memory_sync
or multi_bits schemes.
-complex_scheme_as_synchronizer
Recognizes dmux schemes that have complex synchronizers as the MUX-select
synchronizer. Default: to report a dmux scheme, its MUX-select synchronizer must be a
two_dff synchronizer.
Custom Synchronizers
-report_undriven_custom_sync
Reports as instances of the custom_sync scheme those custom synchronizer crossings
originating from internal or undriven wires. Default: only reports custom synchronizers that
are driven by ports.
-print_detailed_custom_sync
Reports custom synchronizers on signals that are not reported as CDC crossings (see
Custom Synchronization Modules on page 467). Default: these signals are not reported.
To report a custom synchronizer in a CDC crossing, add the -tx/-rx arguments to the
set_cdc_port_domain specification.
-custom_fx
Allows tx signals in CDC-FX checkers to come from ports and custom synchronizers and
allows rx signals to drive custom synchronizers. Injection occurs when tx and rx clocks are
aligned and the checker fires when data changes in the metastability window. With this
option more false violations can occur. Default: tx signals must come from registers and rx
signals must drive only registers.
287
Command Reference
set_cdc_preference
Reconvergence
-multi_clock_convergence
Reports reconvergence with synchronizers in different Rx clock domains or coming from
different Tx clock domains.
-unrestricted_reconvergence
Reports reconvergence for unsynchronized paths (i.e., paths with missing synchronizers,
combo logic, and so on). Default: reconvergent paths reported only if no other schemes
apply.
-promote_reconvergence
Promotes cdc_hamming1 checkers for reconvergence schemes. Default: checkers are not
promoted for reconvergence schemes.
-dmux_as_recon_start
Recognizes dmux, simple_dmux and multi_sync_mux_select schemes as starting points for
reconvergence schemes.
-report_black_box_recon
Reports reconvergence schemes that reconverge at black boxed instances. Default: these
schemes are not reported.
Black Boxes
-black_box_empty_module
Turns all empty (i.e., stub) modules/entities into inferred black boxes. An empty
module/entity is one for which a module or entity/architecture definition is present, but the
content is empty. That is, only the I/O ports (with directions) are declared. This option does
not apply to unresolved modules/entities. Crossings to or from inferred black boxes are
reported to guard against possible real clock domain crossings. To eliminate false
positives you should indicate the port domains of inferred black boxes using
set_cdc_port_domain directives. Default: empty modules are analyzed as regular modules.
-ignore_black_box
Do not report CDC black_box crossings to the ports of any black box design units that do
not have port domain definitions. Default: report black_box crossing schemes to ports
without port domain definitions for inferred black box design units. Crossings to userspecified black box design units are never reported as black_box schemes.
Protocol Verification
-sample_data_stability
Turns on the data_sample check (by specifying -tx_min) for all promoted
cdc_hamming_one checkers. Default: cdc_hamming_one checkers are promoted with the
data_sample check turned off.
288
Command Reference
set_cdc_preference
-dmux_promote_sample
Promotes cdc_sample checkers for dmux schemes. Default: no protocol checkers are
promoted for dmux schemes.
Formal Analysis
-formal_add_bus_stability
Adds checks for signal stability to the synchronization schemes gray-coding protocols
verified by formal CDC.
-formal_add_recon_stability
Adds checks for signal stability to the reconvergence schemes gray-coding protocols
verified by formal CDC.
Modal Analysis
-infer_modes_off
Turns off inferring of modes during cdc -report_modes sessions. Used in special
circumstances to reduce cdc run time: if you know the user-defined modes are complete,
you do not need to infer other modes. For example, if you run a default -report_modes
session and define the inferred modes with set_mode, you can re-run cdc -report_modes
with mode inference disabled. Default: -report_modes performs mode inference.
-report_mode_signals
Reports the mode control signals (see Mode Design Information on page 457) in
0in_cdc_design.rpt. Default: table not reported.
Other Options
-allow_enable_in_sync
Recognizes 2-DFF synchronizers with enable signals in the DFFs. Default: 2-DFF
synchronizers with enables are not recognized as 2-DFF synchronizers.
-delayed_pulse
Recognizes pulse schemes that have a register to delay the output of the pulse synchronizer.
-mult_fanout_async
Identifies input ports that fan out to multiple clock domains as asynchronous ports. Default:
one clock domain is selected.
-input_async
Identifies all DUT input ports as asynchronous ports. Default: all inputs are assumed to be
synchronous with their fanout logic.
-vectorize_nl
Reports as a single-bus synchronizer (for example, BUS_TWO_DFF) each CDC scheme
where the signals start from the same bus, all the signals are synchronized by the same
synchronization scheme and all signals are merged back into a single bus after
289
Command Reference
set_cdc_preference
synchronization. Default: Bus bits that are separately synchronized are reported as single-bit
CDC schemes (for example, TWO_DFF).
-filtered_report
Identifies filtered CDC schemes in the CDC report and in the 0in_cdc static CDC analysis
results (GUI). With this preference, schemes identified using the set_cdc_report global
directive as filtered (-severity off) and schemes with stable transmit domain signals
(set_cdc_signal -stable) are reported. Caution: Can result in increased runtime and memory
usage if many set_cdc_report -severity off with wildcards are specified. Default: Filtered
schemes are not reported.
-print_port_domain_template
Creates a 0in_cdc_port_domain_template.v file with the set_cdc_port_domain directives
for the primary ports. Use this template as a starting point for setting up the
set_cdc_port_domain constraints. CDC analysis cannot identify the clock domains of the
ports as they depend on the DUT external environment. You should review the constraints
and adjust as necessary. You can ignore set_cdc_clock directives in the template if you have
specified the set_cdc_clock directives in a control file.
-multi_paths
Reports all the paths for each clock domain crossing (i.e., Tx/Rx pair). This option can
reduce performance significantly. Default: Only one path per crossing is reported in the
CDC report.
-max_cdc_crossings number
Limits the number of CDC crossings analyzed. Once this limit is reached, no more crossings
are analyzed. You can use this option to reduce session time when initially setting up a
design for CDC analysis. Default: no limit (number = 0).
Description
This global directive defines preferences for CDC. The status of the CDC preferences is printed
in the 0in_cdc_setting.rpt file (see Figure 6-2).
Figure 6-2. Global CDC Preferences (0in_cdc_setting.rpt)
Global CDC Preferences
--------------------------------------------------------------------Option
Value
--------------------------------------------------------------------multi_clock_convergence
FALSE
clock_in_data
FALSE
allow_enable_in_sync
FALSE
max_cdc_crossings
0
custom_fx
FALSE
promote_reconvergence
TRUE
mult_fanout_async
TRUE
dmux_promote_sample
FALSE
input_async
FALSE
290
Command Reference
set_cdc_preference
ignore_black_box
handshake_scheme
fifo_scheme
delayed_pulse
report_resets
detect_primary_output_clock
formal_add_bus_stability
formal_add_recon_stability
filtered_report
vectorize_nl
unrestricted_reconvergence
clock_as_rx
multi_paths
report_undriven_custom_sync
print_port_domain_template
dmux_as_recon_start
print_detailed_custom_sync
report_black_box_recon
black_box_empty_module
sample_data_stability
infer_clock_off
detect_pure_latch_clock
promote_async_reset
complex_scheme_as_synchronizer
infer_modes_off
enable_internal_resets
report_mode_signals
FALSE
FALSE
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
Examples
// 0in set_cdc_preference -allow_enable_in_sync
// 0in set_cdc_preference -clock_in_data
// 0in set_cdc_preference -max_cdc_crossings 200
// 0in set_cdc_preference -filtered_report
291
Command Reference
set_cdc_protocol
set_cdc_protocol
Identifies a CDC protocol checker type to promote for one or more custom synchronizer
modules.
Syntax
set_cdc_protocol
checker_type -module custom_synch_pattern [-rx_clock clock] [-tx_var signal]
checker_type
Type of checker to promote. Currently, only values of cdc_sync and cdc_hamming1 are
supported.
-module custom_synch_pattern
Custom synchronizer modules.
-rx_clock clock
Rx clock signal in the synchronizer. Default: if the synchronizer has only one clock port,
that clock is inferred as the Rx clock. Otherwise, a warning is issued and the directive is
skipped.
-tx_var signal
Transmit domain CDC input signal in the synchronizer. Default: if the synchronizer has
only one data input port, that signal is inferred as tx_var. Otherwise, a warning is issued and
the directive is skipped.
Description
Used with the set_cdc_synchronizer directive to identify custom synchronizers for CDC
analysis. Static CDC analysis assumes each module specified by a set_cdc_synchronizer
directive is a custom synchronizer. The set_cdc_protocol directive indicates a type of checker to
promote to check the CDC transfer protocol for schemes that are synchronized by one of the
matching synchronizers. The directive needs the module name pattern of the synchronizers and
the checker type for the promoted protocol checkers. Currently, only the cdc_sync and
cdc_hamming1 checker types are supported.
A basic custom synchronizer has an Rx clock input, a Tx domain input and an Rx domain
output. Currently, this is the only type of custom synchronizer supported by set_cdc_protocol.
If two set_cdc_protocol directives reference the same port, a directive-273 warning is issued
and the second directive is ignored.
292
Command Reference
set_cdc_protocol
Example
// 0in set_cdc_synchronizer cust -module cust_sync1
// 0in set_cdc_port_domain D -async -module cust_sync1
// 0in set_cdc_protocol cdc_sync -module cust_sync1
Promotes the following checker directive, where tx_var is the signal connected to the D
port of the cust_sync1 instance, tx_clock is the inferred clock in cust_sync1 and
clock_ratio is the ratio of the inferred Rx/Tx clocks.
/* 0in cdc_sync
-tx_var tx_var -tx_clock tx_clock -tx_min clock_ratio */
293
Command Reference
set_cdc_reconvergence
set_cdc_reconvergence
Specifies reconvergence control parameters.
Syntax
set_cdc_reconvergence [-check off] [-depth depth] [-divergence_depth depth]
[-tx_clock clock] [-rx_clock clock] [-bit_recon]
-check off
The -check option is used to turn off reconvergence checking totally. The default is On.
-depth depth
Maximum sequential reconvergence depth for reporting reconvergence and single-source
reconvergence CDC schemes.
depth 3
synchronizer
3 sequential
levels
synchronizer
3 sequential
levels
2 sequential
levels
synchronizer
Tx Clock Domain
Rx Clock Domain
reconvergence
paths
combinational
logic
The sequential reconvergence depth is the number of sequential levels from the storage
element after the synchronizer to the reconvergence point. In cases where the reconvergent
paths have different numbers of levels, the sequential reconvergence depth is the largest
number of sequential levels. For example, suppose paths A and B are reconvergent with 5
and 8 sequential levels to the reconvergence point respectively. Then this scheme instance is
not reported as a reconvergence violation if set_cdc_reconvergence sets -depth 5, but is
reported if set_cdc_reconvergence sets -depth 8. Default: 0.
-divergence_depth depth
Enables reporting of single-source reconvergence and sets the divergence depth. Default:
instances of SSR schemes are reported only as reconvergence schemes.
294
Command Reference
set_cdc_reconvergence
depth 2
divergence_depth 2
synchronizer
synchronizer
synchronizer
Tx Clock Domain
Rx Clock Domain
single-source
reconvergence
paths
combinational
logic
-tx_clock clock
Restricts the directive to paths originating in the Tx clock domain.
-rx_clock clock
Restricts the directive to paths terminating in the Rx clock domain.
bit_recon
Report as instances of the reconvergence scheme, those paths where the individual bits of
the output of a bus 2DFF synchronizer are re-combined.
bus 2DFF
re-converging bits
Description
Use this global directive to specify reconvergence control parameters.
295
Command Reference
set_cdc_report
set_cdc_report
Sets the severity level and promotion property of matching clock domain crossings.
Syntax
set_cdc_report
{ -severity severity [-scheme sync_scheme] [-promotion {on | off | protocol | fx}]
| -default_severity severity -scheme sync_scheme}
[-default_promotion {off | on}] [-tx_clock clock_signal] [-rx_clock clock_signal]
[[-from var_pattern] [-through var_pattern] | -from_signals var_pattern ]
[-to variable_pattern] [-message string] [-mode mode] [-module module_pattern]
severity := {violation | caution | evaluation | waived | off}
By default, crossing that are waived are not promoted. The waived crossing can be
promoted using the following:
// 0in set_cdc_report -severity waived -promotion on
When -severity is used to set the severity of a particular crossing to violation, formal CDC
does not analyze the crossing (so the crossing remains a violation).
-scheme sync_scheme
Set attributes for crossings conforming to the specified scheme type (for example,
single_source_reconvergence, dmux, and so on). Default: all schemes.
296
Command Reference
set_cdc_report
-tx_clock clock_signal
Crossings from transmission logic clocked by a particular clock.
-rx_clock clock_signal
Crossings to receive logic clocked by a particular clock.
Schemes other than the reconvergence scheme do not allow specification of more than one
signal in the -from option (including wildcard matches). A directive that violates this rule is
ignored, in which case the CDC compiler issues a warning message.
In the special case of reconvergence to black boxes (i.e., set_cdc_preference
-report_black_box_recon) the -to variable_pattern can be the instance name pattern of one
or more black boxed modules. To be considered a reconvergent path, the two converging
paths need only end at any port of the same black boxed instance.
297
Command Reference
set_cdc_report
-from_signals variable_pattern
This option is used only for reconvergence analysis. Specifies variables that identify
registers or wires that contain data in one clock domain that are separately synchronized and
then recombined in another clock domain. The difference between -from and -from_signals
is that -from takes the OR of the signals and -from_signals takes the AND of the signals.
You must specify -scheme reconvergence with this option, otherwise, the directive is
ignored and the CDC compiler issues the following warning message:
Warning: Reconvergence scheme must be used when the -from_signals
option is specified.
Directive set_cdc_report.
: Directive will be ignored.[hdl-86]
If both -from and -from_signals options are specified, the directive is ignored and the CDC
compiler issues the following warning message:
Warning: Options from and from_signals specified.
Directive set_cdc_report.
: Directive will be ignored.[hdl-104]
The directive matches reconverging paths that have the following (complete) sets of start
points: (A1 B C) and (A1 A2 B C). The directive does not match reconverging paths that
have the following (complete) sets of start points: (B C) and (A1 B C E).
-message string
Message string to add to the path reports of matching CDC schemes. Default: no message
added.
-mode mode
The -mode option specifies the mode name to which the command in question is applicable
in modal analysis. If you specify the -mode option with a constraint and is using regular
(not modal) CDC analysis flow, then the directive is ignored.
-module module_pattern
The global directive applies to matching CDC crossings in all instances of the module
specified by module_pattern. Wildcards are allowed, in which case the directive applies to
all instances of the matching modules. If the -module option is omitted, then the directive
applies the -d module.
Example 1:
298
Command Reference
set_cdc_report
//0in set_cdc_report -module A -severity caution
Only crossings completely within the same instance of A are set to caution.
Crossings across instances of A are not affected.
Example 2:
//0in set_cdc_report -module A -from B -severity caution
Crossings in which the from signal is X.B are set to caution, where X is any
instance of module A.
Description
The set_cdc_report global directive sets the severity level and promotion property of matching
clock domain crossings. Use this directive to override the default severity and promotion of
clock domain crossing checks.
Specify one of the following:
If you do not specify other arguments, then the directive applies to all CDC crossings. If you do
not specify other arguments except -module module, then the directive applies only to crossings
entirely within module. Otherwise, you can specify a combination of arguments to identify one
or more CDC crossings. The specified crossings are all of those that match all of the criteria. If
-module module is specified, these crossings need not lie completely inside module.
Note that -severity off turns off promotionso, -severity off -promotion on generates a warning
message and the directive is ignored.
Example 1: set_cdc_report
module cdc_ctrl;
/* 0in set_cdc_report -scheme black_box
-from out2a -to bb1.* -severity off */
// 0in set_cdc_report -scheme two_dff_phase -severity evaluation
endmodule
299
Command Reference
set_cdc_report_comment
set_cdc_report_comment
Adds a user-specified comment to the CDC report.,
Syntax
set_cdc_report_comment -comment string
-comment string
String to print to the User Comment section of the CDC report.
Description
The set_cdc_report_comment global directive specifies a comment to add to the CDC report.
Example
// 0in set_cdc_report_comment -comment SHIBA: static CDC run.
prompt> more 0in_cdc.rpt
Questa CDC Version 10.0a linux_x86_64 18 March 2011
----------------------------------------------------------------Clock Domain Crossing Report.
Created Tue Mar 8 12:23:17 2011
----------------------------------------------------------------User Comments
=================================================================
SHIBA: static CDC run.
300
Command Reference
set_cdc_signal
set_cdc_signal
Reclassifies the CDC signal type of specified CDC signals or adds properties to specified CDC
signals.
Syntax
set_cdc_signal
variable_pattern [-split] [-stable] [-gray_coded] [-module module_pattern] [-mode mode]
[-merge]
variable_pattern
One or more CDC signals. Names can include wildcards and can be bit slices. The
classification or CDC property assigned by the directive is applied to all matching variables.
-split
Treats bits of the specified multiple-bit registers/latches as individual control signals for
CDC analysis. By default, synchronization of a CDC data bus must be performed on the
whole bus. If not, then the bus is marked with a BUS SYNC warning. But, if a register has
only one bit derived from a CDC signal, then synchronization of that bit should be allowed.
For example, a status bit might be extracted from a state variable or a single multiple-bit
register (for example, a status register) might store amalgamated control signals. Splitting a
CDC data bus for CDC analysis eliminates the BUS SYNC warning.
Treating bits individually is independent of the synchronization type: the bits can be
synchronized with control synchronization (for example, 2DFF) or data synchronization
(for example, DMUX). You might want to treat bits in a bus individually for any of the
following reasons:
The bus is a collection of individual signals (such as status signals) that you want to
consider as individual bits.
Various bits of a split bus can be used together in the destination domain (for example, in a
receiving state machine decoding). To check for reconvergence problems, CDC analysis
identifies these crossings as potential RECONVERGENCE warnings.
-gray_coded
Identifies the specified variables as properly gray-coded data buses for CDC analysis.
2DFF and four latch synchronizations can be valid for a gray-coded data bus. So by default,
checks for CDC data buses that have either of these types of synchronizers are promoted as
a cdc_hamming_distance_one checkers to verify gray-coding and synchronization.
Identifying a particular variable as gray-coded indicates the data bus is properly gray-coded
(that is, with gray coder/decoder logic), so gray-code checking is unnecessary. In this case,
the crossing check is promoted as a cdc_sync checker.
301
Command Reference
set_cdc_signal
-stable
Identifies the specified variables as stable for CDC analysis. CDC analysis considers a
stable variable (and its propagated values) as properly synchronized.
The -stable option has no effect if signal is not an Rx or Tx of a CDC crossing, or if signal
cannot be propagated to an Rx of a CDC crossing, or if signal drives an input of
combinational logic whose output is not stable. To see the signals marked as stable that have
no effect on CDC analysis, specify the set_cdc_preference -filtered_report directive and
review the Filtered CDC Checks Summary section in 0in_cdc.rpt.
-module module_pattern
The global directive applies to matching CDC signals in all instances of modules that match
module_pattern. If -module is omitted, the global directive applies to the -d module.
-mode mode
The -mode option specifies the mode name to which the command in question is applicable
in modal analysis. If you specify the -mode option with a constraint and is using regular
(not modal) CDC analysis flow, then the directive is ignored.
-merge
Merge the signals into a single signal for CDC analysis.
Description
The set_cdc_signal global directive reclassifies the CDC signal type of specified CDC signals
or adds properties to specified CDC signals. Use this directive to override the inferred
classifications of CDC signals and to identify synchronization properties of particular CDC
signals.
Specify the following:
signals
Note that all CDC crossings filtered by the // 0in set_cdc_signal -stable global directive are
reported at the end of the 0in_cdc.rpt file when the set_cdc_preference -filtered_report is
specified.
Examples
Example 1
module cdc_ctrl;
// 0in set_cdc_signal tx_status1 tx_status2 merge module mtr
// 0in set_cdc_signal write_addr gray_coded module pci_if
endmodule
The list of wildcard expanded signals are reported in 0in_cdc_setting.rpt. Following is a sample
control file showing the use of wildcards with the set_cdc_signal directive:
302
Command Reference
set_cdc_signal
module check;
// 0in set_cdc_clock clk1
// 0in set_cdc_clock clk2 -group g2
// 0in set_cdc_signal out[1:4] -module dff20 -stable
// 0in set_cdc_signal * -module dff40 -split
// 0in set_cdc_signal q -module *10 -gray_coded
endmodule
Following is the information regarding the wildcard expanded signals that are reported in the
0in_detail.log file for the above example:
Wildcards for set_cdc_signal directive with -module
----------------------------------------------------------------File t28_ctrl.v : Line 5
----------------------------------------------------------------* in module dff40 matches
clk
rst
ena
d
q
File t28_ctrl.v : Line 6
----------------------------------------------------------------q in module dff10 matches
q
Example 2
sig_b
combo
logic
sig_c
sig_a
tx_clk
-stable
might not
be stable
rx_clk
Marking sig_a as stable has no effect on CDC analysis because the sig_b input to the combo
logic block might make sig_c unstable. Therefore, a combo_logic violation is reported. Signals
marked as stable that do not affect CDC analysis return a directive-284 warning.
303
Command Reference
set_cdc_synchronizer
set_cdc_synchronizer
Identifies nonstandard synchronizer types and their corresponding properties.
Syntax
set_cdc_synchronizer
{ dff {-level level | -min level -max level} [-tx_clock clock_signal] [-rx_clock clock_signal]
| latch -level level [-tx_clock clock_signal] [-rx_clock clock_signal]
| custom -module module_pattern}
[-mode mode]
-level level
Number of DFF or latch instances in the synchronizer. Single-bit crossings synchronized by
this type of synchronizer are considered properly synchronized by default; they have
evaluation severity. Default: 2 for DFF synchronizers and 4 for latch synchronizers.
Note the following:
If you set the level to N, then the number of DFF in the synchronizers should be
exactly N.
If there are < N DFFs, then the synchronizer will have severity violation.
If there are > N DFFs, then the synchronizer will have severity evaluation; but if it is
used to control other crossings (like DMUX), then the tool will not be able to
recognize it. In this case, you should use the -min and -max options to define a valid
window of delays.
You can restrict the assignment to DFF synchronization schemes on signals from a specified
-tx_clock domain, or to a specified -rx_clock domain, or on signals between both.
-min level
Minimum number of DFFs to be considered a dff synchronizer. If a crossing has fewer than
level DFFs in series, a MISSING_SYNCHRONIZER violation is reported.
-max level
Maximum number of DFFs in the dff synchronizer. If a crossing has more than level DFFs
in series, a MISSING_SYNCHRONIZER violation is reported.
-tx_clock clock_signal
Restricts the directive to dff/latch synchronizers with Tx clock -tx_clock clock_signal.
-rx_clock clock_signal
Restricts the directive to dff/latch synchronizers with Rx clock -rx_clock clock_signal.
304
Command Reference
set_cdc_synchronizer
-module module_pattern
The module name of the custom synchronizer. A custom synchronization scheme must be
contained within its own module definition. You must identify the synchronizer module
(that is, the -module option is required). You can use wildcards in the module identifier; the
custom synchronizer specification applies to all matching modules.
-mode mode
The -mode option specifies the mode name to which the command in question is
applicable in modal analysis. If you specify the -mode option with a constraint and are
using regular (not modal) CDC analysis flow, then the directive is ignored.
Description
The set_cdc_synchronizer global directive identifies nonstandard synchronizer types and their
corresponding properties. Use this directive to configure CDC analysis to handle specific DFF
or custom synchronizers. Each global directive identifies a single synchronizer type; therefore,
you must specify only one synchronizer type (dff, latch or custom).
Examples
Example 1
// 0in set_cdc_synchronizer custom -module cust_2sync
// 0in set_cdc_port_domain in1 out2 -clock clk1 -module cust_2sync
// 0in set_cdc_port_domain in2 out1 -clock clk2 -module cust_2sync
Identifies cust_2sync as a custom synchronizer module and assigns the clock domains of
its data ports.
Example 2
// 0in set_cdc_synchronizer dff -min 2 -max 4
Specifies that 2-, 3- and 4-delay DFFs are valid DFF synchronizers. Note that a 5-delay
DFF is not a valid synchronizer.
Example 3
// 0in set_cdc_synchronizer dff -level 1
305
Command Reference
set_cdc_synchronizer
0in
0in
0in
0in
0in
Rx Clock Domain
DFF
DFF
sig_rx
clk_rx
clk_tx
INT_SYNC
The INT_SYNC module is a custom synchronizer module where the transmitting register
is internal to the module. In particular, the clock domain crossing for the synchronizer
occurs within the custom synchronizer module itself. The set_cdc_synchronizer
directive specifies INT_SYNC as a custom synchronizer module. The two
set_cdc_port_domain directives declare the INT_SYNC to be an internal-crossing
synchronizer (compare with Example 1). The two set_cdc_protocol directives promote
pulse-width and gray-code checkers for the driver of sig_tx.
An internal-crossing custom synchronizer module is identified when all the following
requirements are met:
306
At least one transmit clock and one receive clock are identified using the
set_cdc_port_domain options -tx_clock and -rx_clock.
Command Reference
set_constant
set_constant
Assumes a variable is kept at a specified constant value for CDC analysis.
Syntax
set_constant variable_pattern constant [-module module_pattern]
variable_pattern
Hierarchical name pattern for the variables, specified relative to the DUT. Pattern matches
can be bit slices.
constant
Constant Verilog or VHDL value for variable. If constant has fewer bits than variable, then
constant is zero-extended. If constant has more bits than variable, then the high-order bits
of constant are truncated. All nets connected to variable are forced to the constant value.
-module module_pattern
Module or modules containing variable.
Description
CDC analysis keeps variable set to constant. This directive can be used on internal variables.
The set_constant directive simplifies the CDC model by discarding part of the DUT circuitry
during cdc compilation. For example, this capability is useful for disabling test logic to reduce
DUT size.
Example
// 0in set_constant U0.rst 1'b1
307
Command Reference
set_constant_propagation
set_constant_propagation
Propagates constants through sequential logic.
Syntax
set_constant_propagation [reset] [enable]
-reset
Value of the D-input of the register can be different from the reset value. The propagated
value only depends on the D-input. For example,
always @(posedge clk)
if (rst) q <= 1'b0
else q <= d;
and:
// 0in set_constant d 1'b0
// 0in set_constant_propagation
-enable
Propagates through registers with non-constant enables. For example,
always @(posedge clk)
if (rst) q <= 1'b0;
else if (enable) q <= d;
and:
// 0in set_constant d 1'b0
// 0in set_constant enable 1'b1
// 0in set_constant_propagation
You should always include this argument when specifying set_constant_propagation for
formal analysis.
308
Command Reference
set_constant_propagation
Description
Simplifies CDC and formal models by propagating constant values set by the RTL source code
or by set_constant through sequential logic, including latches.
309
Command Reference
set_memory
set_memory
Sets the memory model type for specified multidimensional arrays.
Syntax
set_memory {{-exact | -abstract} [mem_pattern]} [-module module_pattern]
mem_pattern
Name pattern for one or more multidimensional arrays. Pattern can be hierarchical, can
contain wildcards and can be repeated. Default: *
-exact | -abstract
How the arrays are modeled: -exact models the arrays as register logic; -abstract models
them as abstract memories. The default model for each multidimensional array is
determined by heuristic analysis.
-module module_pattern
Module patterns for modules containing multidimensional arrays that match
mem_pattern. Default: * (all modules).
Description
Selects the type of model to use (exact or abstract) for the specified multidimensional arrays.
Used to override memory modeling assignments made by the csl and cdc compilation
heuristics. The following example sets ram32x512 in module sram to be modeled as an abstract
memory and ram4x16 to be modeled as an exact memory.
reg [32] ram32x512 [511:0]
//0in set_memory -abstract ram32x512 -exact ram4x16 -module sram
Exact memories are modeled as register banks. They are simple sequential logic, so they behave
as RTL logic in CDC and formal analysis (i.e., they match the design behavior exactly). When a
very large multidimensional array is modeled exactly, the footprints of the formal and CDC
models can be too large and analysis can be too slow. So, logic models for these memories are
abstracted.
For formal verification, an abstract model of a multidimensional array is a partial model of the
memory. For formal proofs, the memory outputs are treated as inputs controllable by the proof
algorithms. Proven assertions are legitimately proven, but proofs can be missed that would
otherwise be found if the model were exact. Formal firings are found in two ways. When the
partial model of a memory is used for a firing, the behavior of the memory is modeled exactly.
The firing is a violation and is reported as a regular firing. Otherwise, if formal analysis can fire
the target by controlling the part of the memory that is not exact, the violation is reported as a
firing with a warning.
For CDC analysis, an abstract model of a multidimensional array is treated as a black box.
310
Command Reference
set_memory
By default, the csl and cdc compilers use similar (but slightly different) heuristic analyses to
determine which multidimensional arrays are selected for abstract modeling. Each abstracted
memory is reported by an SPC warning:
Warning SPC-116 Abstracting large memory. Memory mem in module module
The set_memory directive is used to override this selection, typically with the -abstract option
to force the modeling for one or more memories to be exactfor example, if an assertions
fanin logic has an abstract memory that is causing a firing with a warning. The set_memory
directive also is used to force an exact memory to be abstractedfor example, to reduce system
memory usage or to speed up analysis.
311
Command Reference
set_mode
set_mode
Selects a mode of operation for CDC analysis..
Syntax
set_mode
mode {-set variable value} [-ignore]
mode
The mode is the current mode name.
-ignore
Mode is not to be considered for analysis.
Description
The set_mode global directive is used to create a mode of operation (see Modal CDC
Analysis on page 133).
Example
/* 0in set_mode ModeA
-set sel1 1'b0
-set sel2 1'b1 */
312
Command Reference
set_mode_control
set_mode_control
Identifies allowed values for specified mode control signals.
Syntax
set_mode_control
signal_pattern [-values value]
signal_pattern
The signal name can have bit/wildcard. For example,
sig[1] sig*
-values values
The values can have the question mark (?) wildcard. For example,
3'b?1?
Description
The set_mode_control global directive is used to define mode signals for mode inference
(see Modal CDC Analysis on page 133).
313
Command Reference
set_reset
set_reset
Identifies the specified signals as reset signals or removes them from the list of inferred resets.
Syntax
set_reset signal_pattern [-remove] [-module module_pattern]
signal_pattern
Name pattern for the reset signals. Can include wildcards and references to bit slices.
-remove
Changes the sense of the directive to remove the specified signals as inferred resets.
-module module_pattern
Name of the module containing the reset signals. Default: top-level module.
Description
The set_reset directive is used to adjust the reset inferencing performed by the CDC compiler.
Inferred asynchronous resets are true resets, but in certain cases, inferred synchronous resets
might not be resets. Use set_reset with the -remove option to remove these resets from the list of
resets. Some other reset schemes might result in the reset inference algorithm missing bona fide
resets. Use the set_reset directive to specify the missed resets. By default added resets are
synchronous with active high polarity. Use the -negedge and -async options to override these
defaults.
Some designs (for example some low-power handling schemes) use the same signal as an active
high reset for one part of the circuit and as an active low rest for another part of the circuit. In
this case, the compiler issues a warning, but reset inference still considers these signals as real
resets (to both subcircuits).
Examples
// 0in set_reset rst_* -negedge -module pci
314
Command Reference
Directives for Checker Generation
Description
Wildcard Args
default_reset
-module
use_synthesis_case_directives Directs the compilers to recognize non-0in
case directives (for example full and parallel
case directives).
exclude_checker
include_checker
-type
-name
-module
-group
disable_checker
-type
-name
-module
disable_used
set_severity
set_checker_action
-module
Specifies the action to perform when the
number of firings of checkers with the given
-severity reaches the specified count. Directive
only applies to assertions in simulation.
checker_firing_keyword
create_wire
-type
-name
-module
315
Command Reference
checker_firing_keyword
checker_firing_keyword
Specifies the keyword used in the firing messages for checkers.
Syntax
checker_firing_keyword name keyword_string [severity level]
-name "keyword_string"
String to insert into firing messages.
-severity level
Severity level (0 - 9) of checkers that are to have the specified keyword string added to their
firing messages. Default: keyword_string is added to all checker messages.
Description
By default, each checker firing message begins with:
0-In Firing:...
The -severity level option restricts the directive to checkers with matching severity level.
Example
//0in checker_firing_keyword -name "Warning S4" -severity 4
316
Command Reference
create_wire
create_wire
Creates a wire to use with assertion logic.
Syntax
create_wire -var wire [-width width] [-module module]
-var wire
Name to give the created wire.
-width width
Number of bits in the wire. Default: 1.
-module module
Create the wire in the specified module. Default: wire is created in the current module.
Description
The create_wire global directive creates a wire in the current or specified module, for use in
assertion logic. Wires created by this directive have the following limitations:
Examples
Following example creates a wire inside the module containing the create_wire directive.
module dut(in, clk, out);
parameter P1 = 3;
input [P1-1:0] in;
input clk;
output [P1-1:0] out;
// 0in set_clock clk -default
// 0in create_wire -var w -width P1
// 0in create_assign -var (~out) -var_out w
// 0in one_hot -var w
endmodule
317
Command Reference
default_reset
default_reset
Specifies a default checker reset signal or activates default reset inference. Can be specified in a
design module.
Syntax
Identify Default Reset
signal | -none
Signal to be used as the default reset signal for checkers. The signal is taken to be a signal in
module. If module is not specified, you must specify the full hierarchical path to signal.
-active_high | -active_low
Polarity of the reset signal. Checker resets are active-high polarity, so specifying
-active_high connects the signal directly and specifying -active_low inverts the signal
before connecting. Default: -active_high.
-sync | -async
Checker reset port: reset (-sync) or areset (-async). Typically, only one type of reset is used
for the design and the other checker reset ports are tied to zero. Default: -sync
-infer
Infers the reset for each checker and only uses signal if the inference is not successful. This
option can reduce ccl checker (i.e., simulation) compilation performance. Default: no
inference.
-module module
Module name or wildcard pattern (pattern must match exactly one module). Default:
checkers in all modules (if specified in a control file) or the current module (if specified in a
source code module).
-infer
Infers the reset for each checker and uses 1b0 if the inference is not successful. This option
can reduce checker (i.e., simulation) compilation performance. Default: no inference.
318
Command Reference
default_reset
-module module
Module name or wildcard pattern (pattern must match exactly one module). Default:
checkers in all modules (signal must be a hierarchical path).
Description
Checker reset signals are not used by the SVA and PSL checkers, and they are explicitly
identified in the instantiations of OVL and QVL checkers. CheckerWare checkers have two
reset ports: reset (synchronous) and areset (asynchronous). Connection to these ports can be
specified in the checker directive for a checker with the -reset and -areset arguments. When
both connections are not specified, the missing connections are determined from the
specification of default_reset global directives and by reset signal inference.
Inferring reset connections (and similarly clock connections) can be expensive in terms of lower
compilation performance.
The default_reset directive has two basic uses and the syntax depends on the usage:
Identifies a default reset signal for CheckerWare checkers.
A specific reset signal is provided as the default reset for checkers in the DUT or for a
particular module. The -active_low option inverts the signal before connecting. The
-sync or -async option identifies which reset ports to connect. The -infer option directs
the compiler to try to infer the connection before assigning the default reset.
319
Command Reference
disable_checker
disable_checker
Identifies a signal that can disable checkers during simulation.
Syntax
disable_checker signal [severity level] [name checker] [type type]
[module module [local]]
signal
Signal to use to disable matching checkers.
-severity level
Severity level of checkers to disable with signal. Default: all levels.
-name checker
Checker name or wildcard pattern. Default: *.
-type type
Checker type or wildcard pattern. Default: *.
-module module
Module name or wildcard pattern. Default: all modules.
-local
Restrict the directive to checkers in the top-level of module. Default: module hierarchy.
Description
The disable_checker global directive specifies a signal that dynamically disables specified
checkers during simulation. When ccl synthesizes a checker, it derives the signal to connect to
the checkers active input from the AND of the inverted disabling signal, any activation
condition (<), if specified and any active option signal, if specified.
320
Command Reference
disable_used
disable_used
Disables the -used option of CheckerWare checkers of a given type.
Syntax
disable_used -type type [-module module [-local]]
-type type
Checker type or wildcard pattern.
-module module
Module name or wildcard pattern. Default: all modules.
-local
Restricts the directive to checkers in the top-level of module. Default: module hierarchy.
Description
Overrides the -used option of CheckerWare checkers that have the specified checker type. The
-used option constrains a checker to fire only if at least one downstream register samples at least
one bit of the value on the element being checked (this constraint is called the used_condition).
In general, used_condition is composed of the conditions in which downstream registers load a
value, and the muxing/combinational logic (between the downstream registers and the element
being checked) is turned on to allow the value to flow through combinationally to the
downstream registers.
Example
//0in disable_used -type one_hot
321
Command Reference
exclude_checker
exclude_checker
Excludes the specified checkers from formal verification (and simulation with assertions).
Syntax
exclude_checker [-severity level] [-name checker] [-type type] [-group group]
[-module module [-local]]
-severity level
Severity level of checkers to exclude. Default: all levels.
-name checker
Checker name or wildcard pattern.
-type type
Checker type or wildcard pattern.
-group group
Group name or wildcard pattern.
-module module
Module name or wildcard pattern. Default: all modules.
-local
Restrict the directive to checkers in the top-level module. Default: module hierarchy.
Description
Identifies checkers to exclude from the formal model by the csl compiler. The -group, -type and
-name options restrict the directive to checkers with the specified checker group, checker type
or checker name. The wildcard character * matches zero or more characters. Use the
include_checker directive to override checkers specified with wildcards in exclude_checker
directives. For example:
// 0in exclude_checker -type * -module sync3_r
// 0in include_checker -type fire -module sync3_r
In the -name option, the wildcard can match the hierarchy delimiter. For example:
-name tb.*.state*
322
Command Reference
include_checker
include_checker
Includes the specified checkers in the formal model and checker compilation.
Syntax
include_checker [-severity level] [-name checker] [-type type] [-group group]
[-module module [-local]]
-severity level
Severity level of checkers to include. Default: all levels.
-name checker
Checker name or wildcard pattern.
-type type
Checker type or wildcard pattern.
-group group
Group name or wildcard pattern.
-module module
Module name or wildcard pattern. Default: all modules.
-local
Restricts the directive to checkers in the top-level module. Default: module hierarchy.
Description
Identifies checkers to compile by the ccl/csl compiler even if they are specified in an
exclude_checker directive. The -group, -type and -name options restrict the directive to
checkers with the specified checker group, checker type or checker name. The wildcard
character * matches zero or more characters. Use the include_checker directive to override
checkers specified with wildcards in exclude_checker directives. For example:
// 0in exclude_checker -type * -module sync3_r
// 0in include_checker -type fire -module sync3_r
In the -name option, the wildcard can match the hierarchy delimiter. For example:
-name tb.*.state*
323
Command Reference
set_checker_action
set_checker_action
Specifies the action to perform when the number of simulation firings of checkers having a
given severity level reaches the specified count.
Syntax
set_checker_action [-count count ] [-stop | -finish] [-severity level] [-module module]
-count count
Total number of firings for all checkers of the specified severity. When the number of
firings of the specified severity reaches this count, the simulation performs the specified
action of -stop or -finish.
-stop
Stop the simulation, but you can restart the session.
-finish
End the simulation. By default, the simulation ends 10 time units after the last firing. Use
the +0in_checker_finish_delay+time ccl option to change this default.
-severity level
The directive specifies a single severity level (positive digit 0 to 9) and an optional count.
Severity level 0 sets the default checker action.
-module module
Restrict the global directive to checkers in the specified module.
Description
Each set_checker_action global directive specifies the action to perform when the number of
firings of checkers having a given severity level reaches the specified count. This directive only
applies to simulation.
324
Command Reference
set_severity
set_severity
Assigns a severity level to specified checkers.
Syntax
set_severity
[-severity level [-default]] [-name checker_pattern] [-type type_pattern]
[-module module_pattern [-local]]
-severity level
Severity level to assign to matching checkers (0 - 9). Default: no severity.
-default
Restricts the directive to checkers that have default severity. CheckerWare checkers that do
not have a -severity level argument in the original checker directive have default severity.
PSL and SVA checkers also have default severity.
-name checker_pattern
Checker name or wildcard pattern.
-type type_pattern
Checker type or wildcard pattern.
-module module_pattern
Module name or wildcard pattern. Default: all modules.
-local
Restricts the directive to checkers in the top-level module. Default: module hierarchy.
Description
Overrides the severity level of specified checkers. A checkers can have no severity (called the
default severity) or it can have a value in the range 0 to 9 assigned as its severity level. Ranking
is up to you (default might have level 0 or level 10). Severity levels are used primarily in
simulation with assertions to affect the simulator response to checker firings.
Example
The following directives exclude psl and decrement checkers.
// 0in set_severity -severity 7 -type psl
// 0in set_severity -severity 7 -type decrement
// 0in exclude_checker -severity 7
325
Command Reference
use_synthesis_case_directives
use_synthesis_case_directives
Creates case checkers for matching non-native (e.g., synthesis) case directives.
Syntax
use_synthesis_case_directives
[-min_width width] [-min_item_count count]
[-max_width width] [-max_item_count count]
[-used] [-module module [-local]]
-min_width width
Minimum width of the case switch.
-min_item_count count
Minimum number of case items in the statement.
-max_width width
Maximum width of the case switch.
-max_item_count count
Maximum number of case items in the statement.
-used
Adds the -used argument to the generated case checkers. A generated case checker can fire
only when at least one bit of a variable assigned in the active case block is loaded into a
destination register.
-module module
Module name or wildcard pattern. Default: all modules.
-local
Restricts the directive to checkers in the top-level module. Default: module hierarchy.
Description
Creates case checkers for non-native case directives in the HDL code. These are directives of
the following form:
// product [full_case] [parallel_case]
Where product indicates the identifier for the non-native synthesis product (for example,
synopsys or synthesis).
326
Command Reference
Shell Commands
Shell Commands
Three types of shell commands are used in CDC analysis:
The vlib command sets up the working library for compiling the design units for
CDC analysis.
0in shell The compilation environment for CDC, the Questa Formal tools and
assertions in simulation is controlled from a special verification command shell called
the 0in shell, invoked from the system shell by the 0in shell command.
Simulation commands The ccl 0in shell command generates the assertion logic for
simulation with assertions. Using the data generated by ccl and a set of simulation-time
simulator arguments, you run simulation with assertions using a native
(Questa/ModelSim) simulator or a third-party simulator (VCS/NC-Verilog).
327
Command Reference
vlib
vlib
Creates a design library for use by vmap/vcom/vlog, and sets accessibility to design units in a
library (or to the entire library).
Syntax
vlib
[-locklib | -unlocklib] [{-lock | -unlock} design_unit] library
-locklib
Locks the library so the library cannot be overwritten by the compilers.
-unlocklib
Unlocks the library so the library can be overwritten by the compilers.
library
Name to identify the library. The name work is the default working library: a library work
statement is not needed in the source and work is the default destination of compiled units
(so work need not be mapped). Must be the last argument.
Description
Two types of design libraries are used with the Questa tools:
resource libraries
Static libraries used by the source code for your design. Pre-compiled resource libraries
are typically supplied by a third party (for example, models of gate-level netlists) or
another design team. But, you also can specify resource libraries when compiling the
design (after using vlib to create the library). For a Verilog library, use the -L option to
vlog. For a VHDL library, use the -work library option to vcom to specify the library
name for the compiled VHDL resource library, so it is not saved as the work library.
Within a VHDL source file, use a VHDL library clause to specify names of resource
libraries referenced in the design unit.
working library
Dynamic library containing executable code, debug information, dependency
information and other data for compiling a design. Only one library is the working
library for analyzing a design. The library named work is the default assumed working
library. But, you still must use vlib to create the working library:
system prompt> vlib work
328
Command Reference
vmap
vmap
Creates a logical-to-physical mapping for a design library, removes logical-to-physical
mappings or reports current mappings
Syntax
vmap
[-modelsimini init_file [-c]] [logical_name [dir] | -del logical_name]
-modelsimini init_file
Add the mapping to the compiler initialization file init_file. Default: ./modelsim.ini (copied
from the distribution software if ./modelsim.ini does not exist.
-c
Copy init_file to ./modelsim.ini and add the mapping to ./modelsim.ini. However, if
./modelsim.ini exists and is write-protected, add the mapping to init_file instead.
logical_name
Name to map or un-map. Default: reports the current logical-to-physical mappings (from
modelsim.ini).
dir
Physical directory to which the logical name should map. Default: prints the current logicalto-physical mapping for logical_name.
-del logical_name
Un-map the logical-to-physical mappings for the specified logical_name list.
Description
The vlib command creates a design library with a given logical name and stores the library
information in a directory with the same name in the current directory. By default, the library
name is mapped to the directory name. The vmap command is used to change this logical-tophysical mapping and to manage logical-to-physical mappings. Non-default logical-to-physical
mappings are stored in the modelsim.ini file in the current directory.
Examples
Example 1
system prompt> vmap
329
Command Reference
vmap
Example 3
system prompt> vmap work ../shiba/my_work
Copying path/modelsim.ini to modelsim.ini
Modifying modelsim.ini
Maps the work library to ../shiba/my_work. Copies modelsim.ini from the software installation
to the current directory and adds the mapping to ./modelsim.ini.
Example 4
system prompt> vmap -modelsimini ../shiba/modelsim.ini \
work ../shiba/my_work
Modifying ../shiba/modelsim.ini
Maps the work library to ../shiba/my_work and adds the mapping to ../shiba/modelsim.ini.
Example 5
system prompt> ls
work
system prompt> vmap -modelsimini -c ../shiba/modelsim.ini \
work ../shiba/my_work
Copying ../shiba/modelsim.ini to modelsim.ini
Modifying modelsim.ini
** Warning: Copied ../shiba/modelsim.ini to modelsim.ini.
Updated modelsim.ini.
MODELSIM set to ../shiba/modelsim.ini.
The MODELSIM environment variable is used to find the modelsim.ini
file, so this local copy will not be used.
Maps the work library to ../shiba/my_work and adds the mapping to ./modelsim.ini.
330
Command Reference
vmap
Example 7
system prompt> vmap -del work
Removing reference to logical library work
Modifying modelsim.ini
Un-maps any existing mapping for the work library and restores the mapping to the default
directory for the library (./work).
Example 8
system prompt> vmap -del ZLIB YLIB
Removing reference to logical library ZLIB
Modifying modelsim.ini
Removing reference to logical library YLIB
Modifying modelsim.ini
Un-maps any existing mappings for the ZLIB and YLIB libraries and restores the mappings to
the default directories (./ZLIB and ./YLIB).
331
Command Reference
vcom
vcom
Compiles VHDL source files into a design or resource library.
Syntax
vcom
[-version] [-work logical_name] [modelsimini init_file] [-87 | -93 | -2002 | -2008]
[-explicit] [skipsynthoffregion [synthprefix keyword]] [-check_synthesis]
[-noindexcheck | -norangecheck | -nocheck] [-source] [-time] [-mixedsvvh [b | l | r] [i]]
[-pslfile vunit_file] [-lower | -preserve] [-l file] [-quiet] [-nowarn number]
[{-fatal | -error | -warning | -note | -suppress | msglimit} msg_number [,msg_number]...]...
[-f arg_file] [other_vcom_options] VHDL_file
-version
Report the Questa version and exit.
-work logical_name
Name of the design library to use as the destination for the compilation. Default: work.
-modelsimini init_file
Load init_file as the compiler initialization (modelsim.ini) file. Default: search path shown
in Figure 3-4 on page 59.
-explicit
Resolve ambiguous function overloading in favor of the explicit definition. Default: value
specified by the Explicit variable (default on) in modelsim.ini. Having Explicit set in
modelsim.ini makes the compiler compatible with common industry practice. Commenting
out Explicit favors implicit definitions, which matches the VHDL standard.
-skipsynthoffregion
Do not parse synthesis off and translate off regions of HDL code. Keywords for synthesis
off/on and translate off/on pragmas are: pragma, synthesis, synopsys, 0in, mentor, mspa, mti
and vcs, plus custom keywords specified with the -synthprefix keyword argument. Default:
HDL code in synthesis off and translate off regions is parsed and made ready for use in
simulation and Questa CDC/Formal.
Use this option to avoid parsing synthesis/translate off region code that might be
syntactically or semantically incorrect. However, if you specify -skipsynthoffregion, the
design library is not suitable for simulation. Therefore, Questa simulator users should try to
avoid using this option.
332
Command Reference
vcom
-synthprefix keyword
Synthesis off/on pragma keyword. Skip (i.e., ignore and do not parse) code in <keyword>
synthesis_off regions and <keyword> translate_off regions. For example if you specify
-synthprefix zin, the following regions of code are ignored.
-- zin synthesis_off
VDHL code to ignore
-- zin synthesis_on
// zin translate_off
Verilog code to ignore
// zin translate_on
Default synthesis off/on keywords: pragma, synthesis, synopsys, 0in, mentor, mspa, mti and
vcs.
-check_synthesis
Perform limited synthesis rule checks (for example, process signals are in the process
sensitivity list). Default: value specified by the CheckSynthesis variable (default off) in
modelsim.ini.
-source
Include corresponding source code line numbers in messages.
-time
Report the process time (actual time, not CPU time) taken for the compilation.
-mixedsvvh [b | l | r] [i]
Compile VHDL packages so they can be included in a SystemVerilog design. Qualifiers
have the following meanings:
b
l
r
i
-pslfile vunit_file
PSL VHDL flavor vunit file to bind and compile. Vunits must be compiled at the same time
as the design units to which they are bound.
333
Command Reference
vcom
-lower | -preserve
Store VHDL identifiers in lower case (-lower) or with the same case as the VHDL code
(-preserve). However, the following objects always are converted to lower case: VHDL
design unit names and basic VHDL identifiers in packages compiled with -mixedsvvh.
Preserving case does not make VHDL compilation case sensitive. These options set the case
of stored names of signals, functions, procedure, instances, variables, and constants in
messages, the GUI, reports, VCD output, WLF files, coverage reports and so on. Default:
value specified by the PreserveCase variable (default on) in modelsim.ini.
-l file
Write the log to file.
-quiet
Do not report loading messages.
-nowarn number
Do not report warning messages for number category:
1
2
3
4
5
6
7
unbound component
process without a wait statement
null range
no space in time literal
multiple drivers on unresolved signal
VITAL compliance checks
VITAL optimization messages
8
9
10
11
13
14
lint checks
signal value dependency at elaboration
VHDL-93 constructs in VHDL-87 code
PSL warnings
constructs that coverage cannot handle
locally static error deferred until
-f arg_file
File containing additional command arguments. Argument files have the following syntax
rules:
334
single quotes (text) groups text and prevents character substitution (such as variable
expansion and character escapes).
Command Reference
vcom
double quotes (text) groups text and prevents character substitution except for
backslash escape and environment variable substitution. For example:
// groups argument with spaces and substitutes value for $TIME_UNIT
-timescale "$TIME_UNIT / 1 ps"
other_vcom_options
Options only relevant to simulation do not affect the CDC compiler. But other advanced
options might affect tool resultsthese are described in the Questa documentation.
VHDL_file
Files containing VHDL source code to compile. Wildcards are supported (e.g., *.vhd).
Design units are compiled in the order they appear.
Description
The vcom command compiles one or more VHDL source files into a design library. Before
using this command, use the vlib command to create the initial design library. Subsequent
applications of vcom can be used to incrementally compile and recompile the VHDL portion of
the design. For VHDL, compile order is important. You must compile entities and
configurations before architectures that reference them.
Examples
Example 1
system prompt> vcom dut.vhd
Compiles block1.vhd, block2.vhd and top.vhd (in that order) into the my_work library.
Example 3
system prompt> vlib work
system prompt> vcom -2008 block1.vhd
system prompt> vcom block2.vhd top.vhd
Creates a work library; compiles the VHDL-2008 flavor block1.vhd file; then compiles the
VHDL-2002 (default) flavor block2.vhd and top.vhd files.
335
Command Reference
vlog
vlog
Compiles Verilog source files into a design or resource library.
Syntax
vlog
[-version] [-work logical_name] [-libmap library_map_file [-libmap_verbose]]
[-modelsimini init_file] [{-Lf | -L } library] [-vlog95compat | -vlog01compat]
[-sv] [sv05compat | sv09compat] [-skipsynthoffregion [-synthprefix keyword]]
[-skipprotected | -skipprotectedmodule] [-pedanticerrors] [-mixedansiports]
[-timescale units/precision | -override_timescale units/precision]
[+define{+macro[=value}] [-convertallparams] [+floatparameters[+param_path[.]]]
[+incdir{+include_dir}] [+libext{+extension}] [-y library_dir]
[-v library_file] [-compile_uselibs[=uselib_dir]] [-printinfilenames] [-source] [-time] [-93]
[-u] [-mixedsvvh [b | s | v] [packedstruct]] [-mfcu [-cuname comp_unit] | -sfcu]
[-pslfile vunit_file] [-l file] [-quiet] [-nowarnID | -nowarn number]
[{-fatal | -error | -warning | -note | -suppress | -msglimit} msg_number [,msg_number]...]...
[-f arg_file] [other_vlog_options] Verilog_file
version
Report the Questa version and exit.
work logical_name
Name of the library to use as the destination for the compilation. Default: work.
libmap library_map_file
Verilog 2001 logical-to-physical library map file.
libmap_verbose
Report library map pattern matching information to troubleshoot problems with matching
filename patterns in the library file.
modelsimini init_file
Load init_file as the compiler initialization (modelsim.ini) file. Default: search path shown
in Figure 3-4 on page 59.
Lf library | L library
Resource library containing pre-compiled modules for the compilation. With the Lf
argument, library is searched before searching in the effective uselib library (if specified)
for the instantiation. With the L argument, library is searched after searching the effective
uselib library. The LibrarySearchPath variable defines an initial resource library search
path. When searching for a module for an instantiation, the libraries specified by
LibrarySearchPath are searched in (left-to-right) order, as if they were specified with the L
argument. If no match is found, the libraries specified in the Lf and L options are searched
in the order specified in the command invocation.
336
Command Reference
vlog
vlog95compat | vlog01compat
Assume the IEEE 1364-1995 standard (-vlog95compat) or the IEEE 1364-2001 standard
(-vlog01compat). These two Verilog standards have some conflicts, so running the correct
compatibility ensures valid code is compiled properly. Default: value specified by the
vlog95compat variable (default off, i.e., 2001) in modelsim.ini.
sv
Recognize SystemVerilog source code in all files. Default: SystemVerilog source code is
recognized only in files with .sv extensions.
sv05compat | sv09compat
Assume the IEEE 1800-2005 standard (-sv05compat) or the IEEE 1800-2009 standard
(-sv09compat). These two SystemVerilog standards have some conflicts, so running the
correct compatibility ensures valid code is compiled properly. Default: value specified by
the sv09compat variable (default off, i.e., 2005) in modelsim.ini.
skipsynthoffregion
Do not parse synthesis off and translate off regions of HDL code. Keywords for synthesis
off/on and translate off/on pragmas are: pragma, synthesis, synopsys, 0in, mentor, mspa, mti
and vcs, plus custom keywords specified with the -synthprefix keyword argument. Default:
HDL code in synthesis off and translate off regions is parsed and made ready for use in
simulation and Questa CDC/Formal analysis.
Use this option to avoid parsing synthesis/translate off region code that might be
syntactically or semantically incorrect. However, if you specify -skipsynthoffregion, the
design library is not suitable for simulation. Therefore, Questa simulator users should try to
avoid using this option.
synthprefix keyword
Synthesis off/on pragma keyword. Skip (i.e., ignore and do not parse) code in <keyword>
synthesis_off regions and <keyword> translate_off regions. For example if you specify
-synthprefix zin, the following regions of code are ignored.
-- zin synthesis_off
VDHL code to ignore
-- zin synthesis_on
// zin translate_off
Verilog code to ignore
// zin translate_on
Default synthesis off/on keywords: pragma, synthesis, synopsys, 0in, mentor, mspa, mti and
vcs.
337
Command Reference
vlog
skipprotected
Ignore (do not parse or compile) protected regions of HDL code (inside
protected/endprotected regions). Default: compile code inside protected/endprotected
regions and assume that the HDL code in these regions is encrypted and must be decrypted
before parsing.
skipprotectedmodule
Exclude modules containing protected/endprotected regions from being added to the
library. However, check each of these modules for syntax errors until a protected pragma is
encountered. Default: modules containing protected regions are compiled and added to the
library.
This first example has a Verilog syntax error after the protected pragma:
module test(input in, output out);
protected reg tmp; endprotected
hello;
assign out = tmp && in;
endmodule
This second example has a Verilog syntax error before the protected pragma:
module test(input in, output out);
hello;
protected reg tmp; endprotected
assign out = tmp && in;
endmodule
With the skipprotectedmodule option the syntax error is reported, because it is seen before
the first protected pragma:
prompt> vlog test.v -skipprotectedmodule
-- Compiling module test
** Error: test.v(2): near ";": syntax error, unexpected ;
** Warning: test.v(3): (vlog-2281) Skipping module containing
protected region.
General rule: Try -skipprotected first, then if there is still a syntax error, try
-skipprotectedmodule.
338
Command Reference
vlog
pedanticerrors
Report mismatched else directives and enforce the following IEEE Verilog Standard 18002005 restrictions:
new for queues is illegal. Default: new creates a queue whose elements are initialized
to the default value of the queue element type.
PSL statements with cover bool@clk constructs are illegal. Default: these constructs
are legal.
mixedansiports
Allows mixing of ANSI-style and non-ANSI-style port declarations, which can cause
runtime errors when redefined types do not match. The following example shows such a
port re-declaration:
module a (input sig);
reg sig;
. . .
endmodule
Default: a redefined ANSI-style port generates a vlog-2248 warning: Port port already
declared (ANSI Style) in this scope (scope).
timescale units/precision
Default timescale for modules. Precision must be units and both units and precision have
the form:
{1 | 10 | 100}{fs | ps | ns | us | ms | s}
For example: timescale 10ns/100ps.
override_timescale timescale
Timescale to use for the compilation. Default: timescales specified in the source files and
the default timescale set by -timescale.
+define{+macro[=value]}
Text macro specification. Overrides any matching define compiler directives.
convertallparams
Compile non-ANSI parameters so they can be translated into std_logic_vector, bit_vector,
std_logic, vl_logic, vl_logic_vector, and bit generics when interfacing with VHDL design
units.
339
Command Reference
vlog
+floatparameters[+param_path[.]]
Do not evaluate specified parameters, so they can be overridden by -g/-G options to csl and
vsim. The param_path is a module, module/parameter, hierarchical path to an instance, or
hierarchical path to a parameter in an instance. Specifying a period (.) applies the argument
recursively to instances in param_path. Default param_path: all parameters.
+incdir+include_dir
Input include directory.
+libext{+extension}
File extensions to use when searching for library files. For example, +libext+.v.
y library_dir
Directory containing library files.
v library_file
Library file.
compile_uselibs[=uselib_dir]
Compile uselib source files into uselib_dir directory and update modelsim.ini with the
logical-to-physical mappings for the uselib libraries. The uselib directives are persistent:
the last uselib directive in a file applies to the rest of the code in the fileand to the code in
subsequent files in the vlog invocation, up to the next uselib directive. You can specify an
empty uselib directive at the end of a file to prevent the effect of the last uselib directive
from carrying over to the next file. Default uselib directory: $MTI_USELIB_DIR (if
defined) in the current directory, otherwise mti_uselibs in the current directory.
printinfilenames
Print the paths of all source files opened during the session, including include files.
source
Include corresponding source code line numbers in messages.
time
Report the process time (actual time, not CPU time) taken for the compilation.
93
Use VHDL-1993 extended identifiers when interfacing with VHDL design units, to
preserve case in Verilog identifiers that contain upper-case letters.
u
Convert identifiers to upper case.
340
Command Reference
vlog
mixedsvvh [b | s| v] [packedstruct]
Compile SystemVerilog packages so they can be included as packages in a VHDL design.
Qualifiers have the following meanings:
b
s
v
packedstruct
mfcu
Compile the named source files into a single compilation unit (i.e., a multi-file compilation
unit). Default: value specified by the MultiFileCompilationUnit variable (default off) in
modelsim.ini. If multi-file compilation units are not enabled, a compilation unit is created
for each source file, which matches the SystemVerilog standard.
cuname comp_unit
Name to give the compilation unit created by -mfcu. Use this option if a module has a bind
statement, but no module in the design depends on the resulting compilation unit. In this
case, the bind statement would not be elaborated by csl or vsim. For these tools, naming
comp_unit forces elaboration of the compilation unit package (including the bind
statement), which otherwise would not be elaborated. If specified, you must also specify the
comp_unit to csl/cdc (with the -cuname option). Though the vsim command accepts only a
single comp_unit name, csl/cdc accept multiple comp_unit names.
sfcu
Compile the named source files into individual compilation units (i.e., single-file
compilation units). Default: value specified by the MultiFileCompilationUnit variable
(default off) in modelsim.ini. If MultiFileCompilationUnit is not set to 1, -sfcu is not needed.
pslfile vunit_file
PSL Verilog flavor vunit file to bind and compile. Vunits must be compiled at the same time
as the design units to which they are bound.
l file
Write the log to file.
quiet
Do not report loading messages.
341
Command Reference
vlog
The argument to filter out RDGN warnings is: -nowarnRDGN. Warning category numbers
identify broad categories of messages:
11 PSL warnings
12 non-LRM compliance to match
alien simulator behavior
f arg_file
File containing additional command arguments. Argument files have the following syntax
rules:
single quotes (text) groups text and prevents character substitution (such as variable
expansion and character escapes).
double quotes (text) groups text and prevents character substitution except for
backslash escape and environment variable substitution. For example:
// groups argument with spaces and substitutes value for $TIME_UNIT
-timescale "$TIME_UNIT / 1 ps"
other_vlog_options
Options only relevant to simulation (which do not affect the Questa CDC/Formal tools).
Other advanced options might affect tool resultsthese are described in the Questa
documentation.
Verilog_file
Files containing Verilog source code to compile. Wildcards are supported (e.g., *.v *.sv).
Description
The vlog command compiles one or more Verilog/SystemVerilog source files into a design
library. Before using this command, use the vlib command to create the initial design library.
342
Command Reference
vlog
Subsequent applications of vlog can be used to incrementally compile and recompile the
Verilog portion of the design.
Examples
Example 1
system prompt> vlog dut.v
Creates a work library; compiles the Verilog-95 flavor block1.v file; then compiles the
Verilog-2001 (default) flavor block2.v and SystemVerilog top.sv files.
343
Command Reference
verror
verror
Reports detailed information about Questa utility errors.
Syntax
verror
[ ranges | [[fmt] [tag] | full] {message_number | [kind tool] -all} ]
ranges
Report the numeric ranges of message numbers for all tools. Numbers missing from the
ranges are invalid messages. For example, 126 is not in a range so verror 126 returns:
** Error: Invalid message number 126.
Specify both fmt and tag to report the format string and the tag. Specify full to report this
information plus a detailed message. Default: report the detailed message only.
message_number
List of message numbers. For example, the following vlog error message has message
number 19:
Vlog error.(vlog-19) Failed to access library work at "work".
Description
Error/warning messages reported by Questa tools are terse. Use the verror command to get
detailed information about messages.
344
Command Reference
verror
Examples
Example 1
system prompt> verror -full 2155
MSG_IDX_GLBL_VARS_IN_VERILOG
Global declarations are illegal in Verilog 2001 syntax.
Global declarations are only legal in SystemVerilog. To enable
SystemVerilog you can either use the -sv vlog command line switch or give
the source file a .sv extension.
Example 2
system prompt> verror -ranges
common:
1-98 (98)
100-125 (26)
129-148 (20)
151
(1)
. . .
pseudo_synth:
9001-9009 (9)
9100-9120 (21)
9200-9207 (8)
9300-9306 (7)
9308-9339 (32)
9401-9411 (11)
9600-9639 (40)
9650-9685 (36)
Total number of messages = 2703.
345
Command Reference
vdir
vdir
Reports information about the contents of a library.
Syntax
vdir
[prop id | l] [r] [modelsimini file] [all | [lib library] [design_unit]]
prop id
Report the information specified by id for each design unit.
id
archcfg
bbox
body
default
dir
dpnd
entcfg
extern
inline
lock
lrm
Information
Configuration for architecture
Black box for optimized design
Needs a body
Compile defaults
Source directory
Depends on
Configuration for entity
Package reference number
Module inlined
Design unit locked/unlocked
VHDL language standard
id
mtime
name
opcode
options
fulloptions
root
src
top
ver
vlogv
voptv
Information
Source modified time
Short name
Opcode format
Compile options
Full compile options
Optimized Verilog design root
Source file
Top-level model
Version string
Verilog version
Verilog optimized version
l
Report all the information in the above table for each design unit.
r
Report the architectures for each VHDL entity.
modelsimini file
Use file as the modelsim.ini file to determine the library or libraries. Default: ./modelsim.ini.
all
Report information for all libraries. Default: library (or work) only.
lib library
Report information for library (logical or physical library). Default library: work.
design_unit
Design unit to report. Default: all entities, configurations, modules, packages and optimized
design units.
346
Command Reference
vdir
Description
The vdir command reports information about the contents of a library. The command with no
arguments lists the design units in the default library (work) with their types. You can specify
another library with the lib library option or specify all the modelsim.ini libraries with the all
option.
The vdir command can report detailed information about the design units. Either specify prop
id to get the information corresponding to a single id, or specify l to report the complete
detailed information about each design unit. The l option produces a lengthy output, so you
might also want to restrict the information reported to a single design_unit.
Examples
Example 1
system prompt> vdir
Library vendor : Model Technology
Maximum unnamed designs : 3
MODULE a_ovl_pci_pcir_fifo_control
MODULE a_pci_monitor
. . .
MODULE pci_pciw_pcir_fifos
ENTITY pci_perr_crit
ENTITY pci_perr_en_crit
MODULE pci_rst_int
ENTITY pci_serr_crit
ENTITY pci_serr_en_crit
MODULE pci_sync_module
MODULE pci_synchronizer_flop
. . .
Example 2
system prompt> vlib -lock wb_slave
system prompt> vdir -prop lock
Library vendor : Model Technology
Maximum unnamed designs : 3
MODULE a_ovl_pci_pcir_fifo_control
MODULE a_pci_monitor
. . .
MODULE wb_slave
Design unit locked/unlocked: locked
. . .
347
Command Reference
vdir
Example 3
system prompt> vdir -l synchronizer_flop
Library vendor : Model Technology
Maximum unnamed designs : 3
MODULE synchronizer_flop
Package reference number: 1 sv_std std
Depends on: X sv_std std WnQ=;W1X^o9K1PIQTgInR3
Verilog version: 75H<P_OOUP;li]1h@XcB20
Version string: Vz3hiFlX4K>9PJJZjj9EW2
Source directory: /u/ramesh/examples/fv_demo/zin/demo
Source modified time: Thu Oct 29 14:17:15 2009
HDL source file: ../../pci/rtl/verilog/synchronizer_flop.v
Source file: ../../pci/rtl/verilog/synchronizer_flop.v
Start location: ../../pci/rtl/verilog/synchronizer_flop.v:105
Opcode format: QA Baseline: 6.6 - 2149934; VLOG SE Object version 44
Optimized Verilog design root: 1
VHDL language standard: 1
Compile options: -sv -permissive -mixedansiports
-compile_uselibs=/u/ramesh/examples/fv_demo/zin/demo/
log_static/0in_cache/AN/compile_uselibs_output -pslallowseverity
-synthprefix {$s} -synthprefix {$s} -cuname root_cuname -mfcu
+libext+.vlib -L mtiAvm -L mtiOvm -L mtiUPF
348
Command Reference
vdel
vdel
Deletes design units from a library.
Syntax
vdel
{all | primary [arch] | allsystemc} [lib library] [modelsimini file] [verbose]
all
Delete the entire library.
Caution
You are not prompted for confirmation. Once deleted, the library cannot be recovered.
primary [arch]
Design unit to delete: primary is the entity, package, configuration, or module; arch is a
specific architecture for primary. If primary is an entity and arch is not specified, all
architectures of primary are deleted. Not supported for SystemC modules.
allsystemc
Delete all SystemC modules.
lib library
Delete from library (logical or physical library). Default library: work.
modelsimini file
Use file as the modelsim.ini file to determine the library. Default: ./modelsim.ini.
verbose
Report progress messages.
Description
The vdel command deletes a design unit from a library, deletes all SystemC modules in a
library, or deletes an entire library.
349
Command Reference
vdel
Examples
Example 1
system prompt> vdel shiba -all
Deletes the behavior architecture of the xor entity from the work library.
350
Command Reference
0in
0in
Runs the 0in shell.
Syntax
0in [version] [l log_file] [detail detailed_log_file] [nl][limit_messages]
[cache dir] [rel_paths] [od output_dir] [sim {questa | vcs | nc | nc3}]
[licq] [script_file | cmd command_string]
version
Print the version information and exit.
l log_file
Rename the generated 0in shell log file. Default: 0in.log.
detail detailed_log_file
Rename the generated detailed 0in shell log file. Default: 0in_detail.log.
nl
Disable message logging to the detailed log and the 0in shell log. Default: messages are
logged.
limit_messages
Limit the number of messages in the detailed log. For each message type encountered, only
the first 10 messages are logged. Default: all messages are logged.
cache dir
Rename the generated 0in cache directory for the session. Default: 0in_cache in the output
directory.
rel_paths
Uses relative pathnames in generated argument files. Default: full paths.
od output_dir
Directory to store all output files. Default: current directory.
licq
Enables license queuing for 0in shell commands. Default: command terminates if the
required license is being used. Use this option to enqueue multiple sessions that are
executed automatically as licenses become available. To do this, include -licq as a 0in shell
command option. For example:
shell prompt> 0in -licq -cmd csl ....
351
Command Reference
0in
If a license is requested that is not available, then the shell issues the following warning:
0-In Info: Waiting for license key version
When the shell gains the license, it issues the following message and starts processing:
0-In Info: Obtained license key version
Requests in the queue are handled on a first-in, first-out basis, with all requests having the
same priority. You cannot specify a timeout limit for the request; you must issue an interrupt
signal to remove a request from the queue. The -licq option does not apply to licenses for
third-party EDA tools.
script_file
Specifies a script file containing 0in shell commands to run (ignored if cmd is specified).
cmd command_string
Passes the succeeding invoked arguments to the 0in shell as a single command.
Description
The 0in command runs the 0in shell. The 0in shell is a command execution environment for
Questa compilers and functional verification tools. The 0in shell runs the clock-domain crossing
analyzer (cdc). In addition, the 0in shell runs the formal model compiler (csl) and the checker
synthesis compiler (ccl). The 0in shell also runs the vlib, vmap, vcom and vlog design
compilation utilities. The shell runs the versions of these utilities stored in
$HOME_0IN/modeltech/plat.
To run in batch mode, specify a script file. Otherwise the shell runs interactively.
The special 0in shell command help, prints the utilities available to run in the shell. The utility
cwhelp shows syntax of the global directives.
352
Command Reference
0in_cdc
0in_cdc
Runs the CDC GUI environment.
Syntax
0in_cdc
[ [db] db_file [restore_state gui_state_file | {mergedb db_file}]
| project_file [restore_state gui_state_file]
| [p project_name ] [hdl_file] [d design] [f verilog_filelist] [vhf vhdl_filelist]
[[ctrl verilog_control_file] [vhctrl vhdl_control_file] | [ctrl_module module]]
[import_ctrl control_file] [v95] [libmapfile library_map_file] [y lib_dir]
[v lib_file] [work library] [od output_dir] [no_directive_error_check]
[+libext{+ext}] [+incdir{+dir}] [+define{+macro[=val]}] [dw]
[sdc_in sdc_file] [sdc_out file] [formal] [block module] [cdcid id] [verbose]
]
db_file
Formal database file (.db) to load.
mergedb db_file
Formal database file (.db) to merge (as with File >Merge Database).
project_file
Project file (.zpf) to load.
p project_name
Project or project file (.zpf) to load. If a project with the name project_name does not exist,
a new project with that name is created.
restore_state gui_state_file
Load the initial state of the GUI windows from gui_state_file. Use File >Export >State to
save the current GUI state to a file. This command also creates a run file having the same
name, but with a _run extension. The run file runs the GUI with the .db file or project and
the -restore_state option. You can use this process to freeze the view of the GUI so you
can examine it later or from another system. Default: state of the GUI windows does not
show the debug tools opened when the project was saved.
hdl_file
HDL files to add to the project.
design
Name of the top-level DUT design unit.
f verilog_filelist
Text file listing Verilog source files. Maximum pathname length: 1024 characters.
353
Command Reference
0in_cdc
vhf vhdl_filelist
Text file listing VHDL source files.
ctrl verilog_control_file
Verilog control file.
vhctrl vhdl_control_file
VHDL control file.
ctrl_module module
Module or design unit in the -work library to use as a control file. You can use vcom/vlog to
compile a control file (for example, if a control module or design unit contains modeling
logic), then use the -ctrl_module option to indicate the control modules and control design
units used for analysis.
import_ctrl control_file
Verilog or VHDL control file containing global directives to import so they can be edited in
the directive editor dialogs (as with File >Import >Directives).
v95
Assume Verilog 95 syntax. Default: Verilog 2K.
libmapfile library_map_file
Library mapping file.
y lib_dir
Directory containing library files.
v lib_file
Library file.
work work_dir
GUI work directory. Default: ./work.
od output_dir
Output directory for reports and databases.
no_directive_error_check
Turns off error checking (i.e., signals, ports, modules exist) in the directives dialogs.
+libext{+ext}
File extensions of library files to search for. Example: +libext+.v+.vhd
+incdir{+dir}
Directories containing the include files. Example: +libext+include+../common/include
354
Command Reference
0in_cdc
+define{+macro[=val]}
Verilog macro defines. Example: +define+STATIC_FIFO+FIFO_SIZE=16
dw
Compile remodeled versions of DesignWare elements (see dw on page 370).
sdc_in sdc_file
Load the specified SDC file and use the SDC data to set up CDC analysis.
sdc_out file
Write the SDC data to file for use in downstream tools.
formal
Run formal CDC during static CDC analysis.
block module
Treat the module/entities as blocks for hierarchical analysis.
cdcid id
CDC crossing to select and show the corresponding source code.
verbose
Turn on verbose reporting (see cdc on page 364).
Description
The 0in_cdc shell command runs the CDC GUI environment.
Examples
shell prompt> 0in_cdc
Runs the CDC GUI with no data loaded. The blank main window appears.
355
Command Reference
0in_cdc
Runs the CDC GUI with specified data and options. Project name is set to mem_ctrl The
main window appears.
CDC > Run CDC
The GUI saves the project to the mem_ctrl.zpf file in the current directory.
shell prompt> 0in_cdc -p mem_ctrl
The GUI starts up and loads the mem_ctrl project saved in the previous example.
356
Command Reference
0in_db2ucdb
0in_db2ucdb
Translates a .db database into a UCDB database; or creates a .do file that excludes certain
AutoCheck violations from coverage metrics calculated by vsim/vcover; or creates a report file
for a specified UCDB.
Syntax
0in_db2ucdb in_file out_file
{prefix hierarchy_prefix prefix_modules module [cdc] | exclude | report}
in_file
Source file for the operation. For UCDB generation and exclusion .do file generation, in_file
is a .db database file (.db). For report file generation, in_file is a UCDB file.
out_file
Name to give the generated file.
prefix hierarchy_prefix
Location in the design library of the generated UCDB scheme.
prefix_modules module
Design units to include in the translation.
cdc
Translate CDC data from the .db database. Default: no CDC data are translated.
exclude
Create a .do file of exclusion commands for input to vsim and do not generate a UCDB file.
report
Create a report file showing the information in the specified UCDB file.
Description
The 0in_db2ucdb command has three functions:
357
Command Reference
0in_db2ucdb
Questa AutoCheck
Questa AutoCheck analysis detects three types of information relevant to UCDBs: unreachable
FSM states, unreachable FSM transitions and unreachable blocks of code. After debugging any
issues found by autocheck analysis, any remaining unreachable FSM states/transitions and
blocks of code are presumably OK. However, after running simulations and merging results,
these unreachable objects are used in the calculations of FSM and line coverage reported by
vcover. The effect is that reported coverage measures are lower than necessary.
To work around this problem, you can exclude certain coverage objects from the coverage
calculations using the coverage exclude commands. For example:
coverage
coverage
coverage
coverage
coverage
coverage
coverage
exclude
exclude
exclude
exclude
exclude
exclude
exclude
-du
-du
-du
-du
-du
-du
-du
These commands exclude state states 4b0111 and 4b1000, state transition 4b0110 ->
4b0111, current_state states 5b01000 and 5b10000, and lines 75-76 in dut.v from coverage
calculations. Since autocheck analysis has already detected these unreachable objects, you do
not need to manually code these exclusionsthey are automatically generated by 0in_db2ucdb
with the -exclude option:
prompt>
prompt>
prompt>
prompt>
prompt>
0in_autocheck ....
0in_db2ucdb -exclude 0in_autocheck.db exclude.do...
vsim ... exclude.do...
vcover report -select f -bydu sim.ucdb > du.report
vcover report code s sim.ucdb > cover.report
Questa CDC
The UCDB schema supports CDC attributes. To include CDC data in the UCDB translation,
specify the -cdc option to 0in_db2ucdb. If you run 0in_db2ucdb -report on the generated ucdb
file, the utility creates a report with the CDC information included. For example:
prompt> 0in_db2ucdb -prefix tb.dut -prefix_modules pci \
-cdc 0in_cdc.db 0in_cdc.ucdb
prompt> 0in_db2ucdb -report 0in_cdc.ucdb cdc.report
prompt> more cdc.report
# 0in_db2ucdb Report
------------ TEST ------------------------Name
: 0in_cdc
File name
: 0in_cdc.ucdb
Status
: OK
Simulation time : 0.000000 us
Compulsory
: 0
Seed
: NONE
Test args
: (null)
Vsim args
: (null)
Comment
: UCDB created from 0-In DB
358
Command Reference
0in_db2ucdb
. . .
Attribute:
Attribute:
Attribute:
Attribute:
name
name
name
name
=
=
=
=
. . .
Attribute:
#### START
Attribute:
Attribute:
Attribute:
name
attr
name
name
name
name
attr
name
name
name
359
Command Reference
0in_db2ucdb
Flags
: 0x00000100
Attribute: name = #DUSIGNATURE#, Attribute type: string, Attribute value =
(null)
------------- INSTANCE SCOPE ---------------Name
: .tb_top
Type
: UCDB_INSTANCE
Source type
: VERILOG
File info
: name = <none> line = 2
DU Scope
: work.tb_top
Weight
: 1
Flags
: 0x00000000
------------- INSTANCE SCOPE ---------------Name
: .tb_top.top0
Type
: UCDB_INSTANCE
Source type
: VERILOG
File info
: name = <none> line = 15
DU Scope
: work.top
Weight
: 1
Flags
: 0x00000000
360
Command Reference
0in_db2ucdb
<ux:attr key="CDC_TOTAL_CAUTIONS" type="int">1</ux:attr>
<ux:attr key="CDC_TOTAL_EVALUATIONS" type="int">1</ux:attr>
. . .
<ux:attr key="CDC_CROSSING_RECORD-dmux_3211" type="handle"><ux:attr
key="CDC_SCHEME_TYPE" type="int">6</ux:attr>
<ux:attr key="CDC_SEVERITY_TYPE" type="int">1</ux:attr>
<ux:attr key="CDC_TX_NAME" type="str">pi.control[2]</ux:attr>
<ux:attr key="CDC_TX_CLK" type="str">clk1</ux:attr>
<ux:attr key="CDC_RX_NAME" type="str">po.data</ux:attr>
<ux:attr key="CDC_RX_CLK" type="str">clk2</ux:attr>
<ux:attr key="CDC_VIA_SIGNALS" type="array"/></ux:attr>
. . .
Questa Formal
Questa Formal analysis detects three types of information relevant to UCDBs and assertion
coverage:
A cover points covered count is added to the cover points coverage count.
Use 0in_db2ucdb to generate a UCDB file that you can merge with simulation UCDBs to
update your coverage reports with this information. For example, assume vsim simulation
generated a UCDB file called vsim.ucdb and the Assertions window looks like:
Then run:
prompt> 0in_confirm ....
prompt> 0in_db2ucdb -prefix TESTBENCH.r -prefix_modules "TESTBENCH top" \
0in_confirm.db 0in.ucdb
prompt> vcover merge merge.ucdb vsim.ucdb 0in.ucdb
prompt> vsim -viewcov merge.ucdb
361
Command Reference
0in_db2ucdb
Two things have happened: the pass/failure counts have been incremented with the new formal
analysis data and the formal analysis results (vacuous count, formal and proof radius fields) are
now shown.
362
Command Reference
0in Shell Commands
The 0in shell also has a command-line help facility, which has the following invocations:
0in>command -help
Reports the syntax for the command 0in shell command. For example:
0in>cdc -help
Reports the syntax for the specified global directive or checker type (see cwhelp on
page 381). For example:
0in>cwhelp set_cdc_report
0in>cwhelp bits_on
Note
You cannot include UNIX environment variables in a 0in shell script or within an
interactive 0in shell session. However, it is permitted to include UNIX environment
variables when invoking from the system shell prompt or from a system shell script.
363
Command Reference
cdc
cdc
Compiles a clock domain model of the design; performs static CDC analysis; promotes CDC
protocol assertions for formal verification and simulation; and promotes CDC-FX metastability
injection logic for simulation.
Syntax
cdc d design
[ report_clock | report_modes
| report_hier_scripts | report_constraints block_pattern
| hier | hier_block block [-output_hier_ctrl file] | hier_instance instance
| [hier_cache ILM_cache] [hier_ctrl_file_model block CFM_ctrl_file]]
[work work_library] [modelsimini init_file] [{L | Lf} library]
[cuname comp_unit] [cache pathname]
control_options := [[ctrl control_file] [ctrl_list control_file] [v95 | v2k | sv]
[vhctrl control_file] [93 | 87 | 2002 | 2008] | [ctrl_module module] ]
reporting_options := [cr report_file] [verbose] [gen_port_domain_template]
[print_all_cdc_paths] [+nowarn{+messageID}] [+error{+messageID}]
sdc_options := [sdc_in sdc_file] [sdc_out file] [report_sdc]
advanced_options := [de {[module.]inst_pattern}] [di {[module.]inst_pattern}]
[G name=value] [g name=value] [mode mode] [fx] [process_dead_end]
[effort unlimited] [formal [formal_effort {low | medium | high | maximum}]]
[auto_black_box] [dw]
compile_cdc_assertions_options := [compile_assertions prefix hierarchy_prefix
[sim {questa | vcs | nc | nc3}] [sim_lib simulation_library]
[compiled_assertion_report file] [sif root_name] [rel_paths] ]
d design
HDL design unit to be verified. To specify a particular VHDL architecture for a top-level
entity, specify the architecture in parentheses with the entity name. For example: d
top(arch).
report_clock
Report only clock domains and exit. Default: perform full CDC analysis.
report_modes
Generate a mode report in the 0in_detail.log file and exit. Default: run CDC analysis; do not
generate a mode report.
report_hier_scripts
Generate hierarchical flow scripts; and exit. The generated flow scripts create their output
files in the directory specified by the -od 0in shell option (default: run directory).
364
Command Reference
cdc
report_constraints block_pattern
Generate hierarchical constraints files for the matching blocks (modules and entities);
generate hierarchical flow scripts; and exit. The generated flow scripts create their output
files in the directory specified by the -od 0in shell option (default: run directory).
hier
Generate an interface logic model of the CDC logic of the design using a user-specified
CDC constraints file (i.e., one manually constructed). This model is used to run hierarchical
CDC analysis when the current DUT is instantiated as part of a larger design. Use this
option if the top-level design is not available.
hier_block block
Run block-level hierarchical CDC analysis for block (Verilog module or VHDL design unit)
using the hierarchical CDC constraints in the specified control file (created by a previous
cdc session using -report_constraints). Using the results, generate a CDC interface logic
model for the block for use in top-level CDC analysis. Use this option if all instances of the
block are homogeneous.
output_hier_ctrl file
Name to give the control file generated for the block (when set_cdc_hier_preference
-ctrl_file_models is specified). Default: 0in_cdc_hier_<block>_ctrl.v.
hier_instance instance
Run block-level hierarchical CDC analysis for the specified homogeneous instances of a
block using the hierarchical CDC constraints in the specified control file (created by a
previous cdc session using -report_constraints). Using the results, generate a CDC interface
logic model for the group of instances for use in top-level CDC analysis. Use this option if
the instances of the block are not homogeneous.
hier_cache ILM_cache
Use the specified CDC interface logic model caches generated from block-level analyses
and perform top-level hierarchical CDC analysis on the DUT.
work work_library
Logical name of the design library containing precompiled design units. Also used as the
target library for compilation performed by cdc. If work_library does not exist, it is created.
Default: work in the current run directory.
modelsimini init_file
Load init_file as the compiler initialization (modelsim.ini) file, which is used when vopt is
called (under the hood). If you ran vlog and vcom compilation with the -modelsimini
365
Command Reference
cdc
init_file option, you must use this option with cdc and the option must point to the same file.
Default: search path shown in Figure 3-4 on page 59.
L library | Lf library
Resource library containing pre-compiled modules for the clock domain model compilation.
With the Lf argument, library is searched before searching in the effective uselib library
(if specified) for the instantiation. With the L argument, library is searched after searching
the effective uselib library. The LibrarySearchPath variable defines an initial resource
library search path. When searching for a module for an instantiation, the libraries specified
by LibrarySearchPath are searched in (left-to-right) order, as if they were specified with the
L argument. If no match is found, the libraries specified in the Lf and L options are
searched in the order specified in the command invocation.
cuname comp_unit
Specifies -cuname comp_unit when vopt is called (under the hood). If you ran vlog
compilation with the -cuname comp_unit option, you must use the same option with csl/cdc.
This option can be specified multiple times. Note that for 1-step csl/cdc compilation,
-cuname root_cuname (default name of the global SystemVerilog package) is passed
automatically. The root_cuname package contains everything outside the compiled
modules/packages. When preparing to run Questa simulation, include the -cuname
root_cuname option to vlog and vcom to catch these extra constructs.
cache pathname
0in cache directory. Default: same as the 0in shell cache directory.
Control Options
ctrl control_file
Verilog-flavor control file.
ctrl_list control_file []
One or more Verilog-flavor control files. For example:
-ctrl_list *.v
The dash () terminates a list of control file names to separate the names from source file
names.
v95 | v2k | sv
Verilog version (Verilog-95, Verilog 2000 or SystemVerilog) used in Verilog-flavor control
files. Default: v2k if modelsim.ini variable vlog95compat is 0 or 95 if vlog95compat is 1.
In Verilog 1-step mode, this argument specifies the Verilog version (v95 or v2k) used by
the design files having .v extensions. Files with .sv extensions are assumed to be
SystemVerilog files. Default for Verilog 1-step: -v2k.
vhctrl control_file
VHDL-flavor control file.
366
Command Reference
cdc
ctrl_module module
Module or design unit in the -work library to use as a control file. You can use vcom/vlog to
compile a control file (for example, if a control module or design unit contains modeling
logic), then use the -ctrl_module option to indicate the control modules and design units
used for analysis.
For example, if ctrl.v is a control file with a Verilog module ctrl_mod that contains global
directives. then the following sequence of commands:
prompt> vlog ctrl.v
prompt> 0in -cmd cdc -d dut -ctrl_module ctrl_mod
is equivalent to:
prompt> 0in -cmd cdc -d dut -ctrl ctrl.v
Reporting Options
cr report_file
Name to give the CDC report file. Default: 0in_cdc.rpt.
verbose
Report the filtered CDC crossings (turned off using the -severity off option of the
set_cdc_report directives) and the stable signals (identified by set_cdc_signal directives
with the -stable option) in the Filtered CDC Checks Summary section of the 0in_cdc.rpt
file. Report detailed warning messages related to the set_cdc_report global directives. For
example, by default, if a set_cdc_report global directive has an invalid wildcard signal or an
incomplete list of signals for reconvergence filtering, then a warning message that the global
directive did not match any CDC crossing is issued (directive-214). With -verbose, the
warning message specifies the type of error in the global directive. Also report the list of
signals that match wildcard patterns for each directive that supports wildcards in arguments.
To report crossings filtered by set_cdc_report -severity off and set_cdc_signal -stable
directivesbut not the other extra informationuse set_cdc_preference -filtered_report
directives.
gen_port_domain_template
Generate a 0in_cdc_port_domain_template.v file containing set_cdc_port_domain
directives for the primary ports.
print_all_cdc_paths
Print all CDC paths to 0in_cdc_path.rpt.
367
Command Reference
cdc
+nowarn{+messageID}
Turn off reporting of the specified warning messages. Message ID is a category and number
(e.g., parser-47). Default: all warning messages reported.
+error{+messageID}
Turn the specified warning messages into errors. Message ID is a category and number
(e.g., parser-47).
SDC Options
sdc_in sdc_file
Load the specified SDC file and use the SDC data to set up CDC analysis.
sdc_out file
Write the SDC data to file for use in downstream tools.
report_sdc
Generate the 0in_sdc_ctrl.v control file with global directives for the SDC data.
Advanced Options
de {[module.]inst_pattern}
Exclude instances in module that match inst_pattern. Default module is the design.
di {[module.]inst_pattern}
Exclude instances in module that do not match inst_pattern. Default module is the design.
The following example shows usage of di and de together.
top
m2
m1
top
m2
-di m1
-de mid.i*
i1
i2
i3
e1
m1
mid
excluded logic
i1
i2
i3
e1
i2
i3
i1
e1
G name=value
Override the final value of the generic/parameter specified by name. The name can be a
hierarchical path. For example, irrespective of the value in the source code, the value used
for dut.u1.p1 is 10 in the following invocation.
0in -cmd cdc -d dut -G dut.u1.p1=10 -G p2=20 -infer_clk
368
Command Reference
cdc
Command Line Questa CDC/Formal has no blank space between the -G option
and the parameter. For example: -G p1=10 (Questa CDC/Formal) vs -Gp1=10
(Questa Sim).
g name=value
Default value of the generic/parameter specified by name. The name can be a hierarchical
path. For example, unless the value of p1 is set by a defparam statement, the value used for
p1 is 10 in the following invocation.
0in -cmd cdc -d top -g p1=10 -g p2=20 -infer_clk
Command Line Questa CDC/Formal has no blank space between the -g option
and the parameter. For example: -g p1=10 (Questa CDC/Formal) vs -gp1=10
(Questa Sim).
mode mode
Infer all modes of operation or run CDC modal analysis on the design using the specified
mode and exit (without doing any CDC analysis). Generate a modal script (0in_mode.scr).
Directives that specify -mode arguments with different modes are ignored. Default: run
regular CDC analysis. Directives that specify any -mode arguments are ignored.
fx
Generate the 0in_cdc_fx_sim_ctrl.v control file with directives for the promoted cdc_fx
checkers.
process_dead_end
Report all CDC issues, including paths that do not connect to output ports (dead end paths).
Default: CDC does not report issues found on registers in dead logic.
effort unlimited
Set the effort level of CDC analysis to unlimited, which can increase runtime and memory
usage.
formal
Run formal CDC during static CDC analysis.
auto_black_box
Turns all unresolved modules/entities into inferred black boxes. An unresolved
module/entity is one for which no module or entity/architecture definition is present. If a
component declaration is present, the port directions are derived from that declaration.
Otherwise, the port directions are inferred from the connected logic. If a port direction
cannot be inferred, the port direction is assumed to be INOUT. Default: unresolved modules
are treated as unused/undriven logic.
369
Command Reference
cdc
dw
Compile remodeled versions of DesignWare elements (1-step compilation). For example:
prompt> 0in -cmd cdc dut.v -d dut -dw
For 2-step compilation, use vlog to compile the remodeled DesignWare element library by
specifying the encrypted Verilog source and the include directory as shown in this example:
prompt> vlog $HOME_0IN/share/MODIFIED/dw/dw.remodel.v \
+incdir+$HOME_0IN/share/MODIFIED/dw/
prompt> 0in -cmd cdc -d dut
Not all DesignWare elements are available. You cannot use remodelled DesignWare
elements for simulation with CDC protocol monitors or for CDC-FX simulation.
Compile CDC Assertions Options
compile_assertions
Compile CDC protocol checkers and CDC-FX checkers into the -work library and create a
simulator arguments file for simulation. Use set_cdc_report -promotion off directives to
skip compilation of CDC protocol checkers for specific crossings. Assertion compilation
uses the CDC logic model to generate the CDC protocol assertions and CDC-FX logic used
by vsim. So compilation is much more efficient than running a separate ccl session to
compile the CDC assertion logic. Default: compilation for simulation is not performed.
prefix hierarchy_prefix
Hierarchy prefix showing the hierarchy from the top level (typically the testbench) to the
DUT.
sim_lib simulation_library
Logical name for the protocol assertion library used for simulation. The assertion names in
the Questa Sim simulation arguments file generated by cdc have simulation_library as a
prefix.
compiled_assertion_report file
Name to give the generated CDC assertion compilation report. Default:
0in_cdc_checker.rpt.
sif file
Root name to give the generated simulation arguments file. Default root file name:
0in_cdc_sim.arg.
370
Command Reference
cdc
rel_paths
Use relative pathnames in generated argument files. This option can be used to change the
0in_check.db link path to not use the absolute path name. For example,
0in_check.db -> ./0in_cache/DB/0in_check.db
-work library
design
files
cdc
control
files
0in_cdc.db
0in_cdc
GUI
debugging
environment
If you specify compile_assertions, cdc performs CDC analysis as usual, but also compiles
assertion logicand CDC-FX injectors, if you also specify -fx (Figure 6-4). The
-compile_assertions argument also creates simulator arguments files used to direct vcom/vlog
compilation and vsim simulation. When specifying -compile_assertions, also include the -prefix
hierarchy_prefix that identifies the hierarchy path from the testbench top level to the DUT
analyzed by cdc.
371
Command Reference
cdc
cdc
-compile_assertions
control
files
-work library
vsim
-f 0in_cdc_sim.arg
-f 0in_cdc_sim_vhdl.arg
merge
0in_checksim.db
vcom/vlog
0in_cdc
0in_cdc.db
GUI
vcom/vlog
testbench
files
debugging
environment
4. Compile the protocol assertions with the simulation arguments files generated by cdc.
prompt> vlog -f 0in_cdc_sim.arg
prompt> vcom -f 0in_cdc_sim_vhdl.arg
6. Run simulation. Specify the PLI library path for the simulator and the vsim arguments
files.
prompt> vsim -c tb -pli $HOME_0IN/lib/lib0InLoadMTIPLI.so \
-f 0in_cdc_sim.arg.vsim -f 0in_cdc_sim.arg.vsimrun \
-do "add log -r /*; run 1000; quit -f"
372
Command Reference
cdc
The input files for the cdc command are shown in Table 6-4.
Table 6-4. cdc Input Files
design library
control files
Control files that contain global directives for the following operations:
Specifying attributes of clocks and clock groups.
Changing attributes of CDC schemes.
Setting preferences for CDC analysis.
Adjusting attributes of promoted CDC protocol assertions and
CDC-FX checkers.
Controlling netlist generation.
SDC files
373
Command Reference
cdc
Hierarchical CDC
Output Files
The 0in_cache directory contains cached data for CDC analysis. Other output files are listed in
Table 6-5.
Table 6-5. cdc Output Files
0in_cdc.db
0in.log
0in_detail.log
0in_cdc.rpt
0in_cdc_design.rpt
0in_design.rpt
0in_cdc_setting.rpt
0in_cdc_path.rpt
0in_cdc_ctrl.v
0in_cdc_param.inc
0in_cdc_mode_ctrl.v
0in_mode.scr
SDC output file
374
Command Reference
cdc
Hierarchical CDC
Compile Assertions
0in_cdc_port_domain_template.v
0in_cdc_fx_sim_ctrl.v
375
Command Reference
cdc
Examples
Example 1
system prompt> vlib work
system prompt> vlog -f source/filelist
QuestaSim-64 vlog 6.6c Compiler
-- Compiling module tb
-- Compiling module dpmem2clk
. . .
system prompt> 0in -cmd cdc -d demo_top
Questa: Questa Advanced Functional Verification System v10.0...
. . .
Command: cdc
Command arguments:
-d demo_top
. . .
Top level modules:
demo_top
Analyzing design...
-- Loading module demo_top
-- Loading module generic_fifo_dc_gray
-- Loading module dpmem2clk
-- Loading module crc_16_calc
Optimizing 4 design-units (inlining 0 instances):
-- Optimizing module dpmem2clk(fast)
Error: Design unit dump is compiled with older Questa simulator version.
. . .
Error
: Design elaboration failed. [command-188]
: Processing will abort.
Error
: Design Elaboration (Child process) returned a non zero status.
[command-195]
: Processing will abort.
Error/Warning Summary
----------------------------------------------------------Count Type
Message ID
Summary
----------------------------------------------------------1 Error
command-188 Design elaboration failed.
1 Error
command-195 Design Elaboration (Child process) returned a
non zero status.
1 Error
elaboration-113 Design unit dump is compiled with older
Questa simulator version.
This example compiles the Verilog files using vlog and then runs the cdc command. An error is
returned because the design is compiled with an older version of vlog than the version
compatible with V3.x tools. To avoid these types of errors, use the front-end utilities from the
Questa CDC/Formal installation softwarenot the utilities in the Questa Sim installation.
376
Command Reference
cdc
Example 2
system prompt> $HOME_0IN/modeltech/bin/vlib work
system prompt> $HOME_0IN/modeltech/bin/vlog -f source/filelist
Model Technology ModelSim SE vlog QA Baseline: 6.6 ...
-- Compiling module tb
-- Compiling module dpmem2clk
. . .
system prompt> 0in -cmd cdc -d demo_top
Questa: Questa CDC/Formal Functional Verification System v10.0
. . .
Command: cdc
Command arguments:
-d demo_top
. . .
Parsing files...
Analyzing designs.
Processing CDC checks for module demo_top
Processing 113 candidates
Processing 27 CDC signals after duplicate removal.
CDC Summary
=================================================================
Violations (8)
----------------------------------------------------------------Single-bit signal does not have proper synchronizer.
(3)
Combinational logic before synchronizer.
(2)
Reconvergence of synchronizers.
(3)
Cautions (10)
----------------------------------------------------------------DMUX synchronization.
(2)
Multiple-bit signal synchronized by DFF synchronizer.
(4)
Multiple-bit signal across clock domain boundary.
(1)
Memory Synchronization.
(2)
Simple DMUX synchronization.
(1)
Evaluations (8)
----------------------------------------------------------------Single-bit signal synchronized by DFF synchronizer.
(7)
Pulse Synchronization.
(1)
Waived (0)
----------------------------------------------------------------<None>
Proven (0)
----------------------------------------------------------------<None>
Filtered (0)
----------------------------------------------------------------<None>
. . .
Error/Warning Summary
----------------------------------------------------------Count Type
Message ID
Summary
-----------------------------------------------------------
377
Command Reference
cdc
1
4
25
Warning
Warning
Warning
This example specifies the absolute path to the Questa CDC/Formal installed front-end utilities,
which eliminates the version mismatch error that occurs in Example 1.
Example 3: Compile Assertions (VCS)
This example runs cdc with the -compile_assertions option and runs CDC protocol simulation
with a VCS simulator.
vlib work
vmap work work
vlog test.v
0in -sim vcs -cmd cdc -d test -compile_assertions -prefix tb.dut
vcs -R test.v $HOME_0IN/0InPLI/vcs/lib0InvcsPLI.so -f 0in_cdc_sim.arg
0in_cdc 0in_cdc.db -mergedb 0in_checksim.db
378
Command Reference
lib2v
lib2v
Translates data from an Si2 Liberty file into Verilog modules containing functional descriptions
of each cell and corresponding control files for CFM-based hierarchical CDC.
Syntax
lib2v lib liberty_file [dir output_directory] [strict] [no_line] [verbose]
lib liberty_file
Liberty file to translate.
dir output_directory
Directory to store the generated Verilog cell library and control files. Default:
./0in_lib_vlog/<library>, where <library> is the Liberty technology library name.
strict
Generate an error message for each of the modules ports that does not have an associated
clock domain,
no_line
Do not insert V2K line directives into the generated Verilog modules and Verilog control
files. Default: generate code has line directives that link the generated code to the
corresponding line number and file name of the related attribute in the .lib file.
verbose
Report detailed messages. Use this option when comparing generated modules to the source
Liberty cells. When used with strict, the command strictly enforces the translation.
Liberty files sometimes contain directives that are unspecified in the Liberty LRM (i.e., the
directives are not publicly available). The Synopsys Library compiler can compile these
cells, but the Questa compilers might not. With both options specified, lib2v generates
errors for these unpublished directives. Default: unexpected Liberty directives generate
warnings.
Description
Liberty is a standard technology library specification format maintained by Synopsys, Inc.
Technology vendors use the Liberty format to describe cells in their libraries, for example,
cells pin-outs, functionality, timing, area, power requirements and so on. The lib2v utility reads
data from an Si2 Liberty file and creates Verilog cell libraries and Verilog CDC control files
from the data. You can then compile the generated Verilog files with vlog and add the generated
control files to the cdc/csl invocation.
For example, suppose technology library L contains cellA, cellB and so on. Then, lib2v creates a
Verilog file in 0in_lib_vlog/L for each cell: cellA.v, cellB.v and so on. Cell name, pin-out and
functionality directives for each cell are translated into the corresponding Verilog module.
The lib2v utility creates a control file in 0in_lib_vlog/L for each cell: cellA_lib_ctrl.v,
cellB_lib_ctrl.v and so on. These control files specify the clocks and the clock domains for the
Questa CDC User Guide, v10.0c_2
October 2011
379
Command Reference
lib2v
ports of the corresponding cells. If a port does not have an associated clock domain, the
command generates a commented-out set_cdc_port_domain template.
By default, if the source library data do not include information to fully describe the
functionality of all output pins of a cell, lib2v issues a warning message, adds a Verilog
wrapper module for the cell and includes a set_black_box directive for the module in the
corresponding control file.
The lib2v utility translates only the Liberty directives needed to create Verilog models for use
with Questa CDC/Formal products. It ignores the other directives. Currently, the following
attributes are translated:
ID
library, cell
pin-out
pin, direction, type, bus, bundle
functionality
memory, memory_read, memory_write, pin_equal, pin_opposite, ff, state, ff_bank, latch,
latch_bank, state_table, complementary_pin, function, internal_node, inverted_output,
nextstate_type, pin_func_type, prefer_tied, primary_output, state_function,
test_output_only, three_state, x_function, input_map
timing
clock, generated_clock, clock_pin, master_pin, timing, timing_type, related_pin,
related_bus_pins, related_bus_equivalent
380
Command Reference
cwhelp
cwhelp
Reports the syntax for a 0in global directive.
Syntax
cwhelp [directive]
directive
Report syntax for directive. Default: list the global directives with short descriptions.
Description
The cwhelp 0in shell utility reports the directive syntaxes for the 0in global directives.
Examples
Default
The cwhelp utility with no arguments lists the global directives by the 0in utilities.
0in> cwhelp
globals
checker_firing_keyword
checklist_off
checklist_on
default_reset
. . .
checkers
always
Global Directives
Adds a keyword to firing messages
Excludes a specified checklist check
from design file
Includes a specified checklist check
from control file
Specifies a default reset
. . .
Checker Directives
Ensures that a specified signal always
asserts.
arbiter
arithmetic_overflow
After using cwhelp with no arguments to find the name of a global directive, use cwhelp again
to find the syntax for the global directive:
0in> cwhelp default_reset
Command: cwhelp
Command arguments:
default_reset
usage: default_reset
381
Command Reference
cwhelp
[<signal>]
[-module <module_name>]
[-none]
[-infer]
[-posedge or -active_high
or -negedge or -active_low]
[-sync
or -async]
[-help]
Specifies a default reset
The syntax shows alias names for arguments (for example, -posedge is an alias for
-active_high).
382
Command Reference
Protocol/FX Checkers
Protocol/FX Checkers
Each checker type has a data sheet that provides the specification for checkers of that type. Data
sheets contain the following information:
Symbolic Representation
Symbolic representation of a generic checker of that type.
Description
Description of the properties checked by checkers of the checker type.
Syntax
Syntax statement for the checker directive.
Corner Cases
Names of the corner case counts maintained by the checker.
Statistics
Names of statistics maintained by these checkers, with explanations of each. One
statistic is designated as the evaluation statistic (evals), which typically corresponds to
the number of times the checker evaluated.
Notes
Notes describing any special features or requirements of these checkers.
Examples
Examples of directives and checker applications.
Standard Options
One group of options (Table 6-6) is included in every syntax statement (except for certain
special checker types that do not support some of the options). These options are called
standard options and are indicated in syntax statements as:
[standard_option]
These options are universalthey have the same meaning for each checker type.
383
Command Reference
Protocol/FX Checkers
-module mod
-name
{identifier |
formatted_string}
Base name for the checker. Default: derived from the directive
and hierarchy.
-group
{identifier |
formatted_string}
Base name for the checker. Default: derived from the directive
and hierarchy.
-message formatted_string
User message shown when the checker fires (in addition to the
firing message). Default: standard message only.
-severity level_constant
-quiet
-assume_if constant
If constant is not zero, this option marks all checks for the checker
as check assumptions. If constant is zero, the checks are marked
as targets unless overridden by an enable_assumption or
exclude_target directive. The disable_assumption directive
overrides this setting.
-non_vacuous off
-check_fire signal
Connects the firing output for the specified check to the specified
signal. Default: no connection.
-corner_case variable
-statistic variable
384
Command Reference
cdc_dsel
cdc_dsel
active
signals
variables
constants
tx_clock
tx_reset
tx_data_select
rx_clock
rx_reset
rx_data_select
tx_data_stable_fire
rx_data_stable_fire
tx_min_fire
dsel
minimum_time_window_equals_min
tx_data
transfers_checked evals
rx_data
longest_assertion
tx_min
shortest_assertion
areset
default name:
tx_data_var_tx_data_var
checks:
firings
tx_data_stable (On)
rx_data_stable (On)
tx_min (On)
tx_clock, tx_reset, areset:
inferable from tx_dsel_signal
corner
cases
rx_clock, rx_reset:
inferable from rx_dsel_signal
statistics
vacuity property:
!tx_reset && !rx_reset &&
!areset && active &&
tx_dsel_signal === 0
Description
Ensures that a signal between two clock domains, where the transmitters data select signal
drives the select input of a data multiplexor in the receiver, is held stable enough for the signal
to be sampled reliably by the receiver and ensures that the data remains stable while the data
select signal asserts.
Syntax
[<] {cdc_dsel | dsel}
-tx_data tx_data_variable -rx_data rx_data_variable
{-tx_data_select tx_dsel_signal | -tx_data_stable off}
{-rx_data_select rx_dsel_signal | -rx_data_stable off}
[-tx_min tx_min_constant | -tx_min_check off ]
[-tx_clock tx_clock] [-tx_reset tx_reset ] [-rx_clock rx_clock] [-rx_reset rx_reset]
[-assume [all | {txdata | rxdata | txdsel}]] [standard_option]
Required Arguments
-tx_data tx_data_variable
Variable with the transmit data in the transmit clock domain.
-rx_data rx_data_variable
Variable with the receive data in the receive clock domain.
Inferable Options
385
Command Reference
cdc_dsel
Checks and Related Options
Other Options
386
txdata tx_data_stable
rxdata rx_data_stable
txdsel tx_min
Command Reference
cdc_dsel
Corner Cases
Asserted for tx_min Cycles number of times tx_dsel_signal asserted for exactly
tx_min_constant cycles. Reported only if the tx_min check is enabled.
Statistics
Notes
The following block diagram shows a typical implementation of a cdc_dsel checker:
TX Module
tx_dsel
tx_data_select
SYNC
rx_dsel
RX Module
cdc_dsel
checker
MUX
tx_data
rx_data
tx_data
1. This is a dual-clock checker, in which the transmit data are based upon -tx_clock
tx_clock (inferable from -tx_data_select tx_dsel_signal) and the receive data are based
on -rx_clock rx_clock (inferable from -rx_data_select rx_dsel_signal). The standard
-clock option should not be specified.
2. Asynchronous reset for this checker can be specified using the standard -areset option. If
this option is not specified, then the asynchronous reset is inferred from -tx_data_select
tx_dsel_signal. In either case, the reset applies to the entire checker, including logic on
both clocks.
3. This checker is synchronous with respect to each clock, so it responds only to behavior
that is observable at the active edge of the transmit or receive clock.
387
Command Reference
cdc_dsel
Examples
/* 0in cdc_dsel -tx_data tx_data -rx_data rx_data -tx_min 3
-rx_data_stable_off -tx_data_select tx_dsel
-tx_min_fire tx_min_fire */
Checks that tx_dsel does not assert for fewer than 3 cycles of the transmitting domain
clock.
tx_clk
tx_dsel
tx_min_fire
Checks that the value of tx_data does not change while tx_dsel asserts.
tx_clk
tx_data
AF
FF
tx_dsel
tx_data_stable_fire
Checks that the value of rx_data does not change while rx_dsel asserts.
rx_clk
tx_clk
tx_data
AF
00
FF
rx_dsel
tx_data_stable_fire
388
Command Reference
cdc_fifo
cdc_fifo
signals
active
tx_clock
tx_reset
enq
rx_clock
rx_reset
deq
variables
wr_ptr
rd_ptr
constants
depth
cdcf
wr_ptr_fire
rd_ptr_fire
enqueue_fire
dequeue_fire
firings
full_count
empty_count
corner
cases
enqueues_and_dequeues evals
enqueues
statistics
dequeues
maximum_fifo_entries
current_fifo_entries
areset
default name:
enq_var_deq_var
checks:
wr_ptr (On)
rd_ptr (On)
enqueue (On)
dequeue (On)
tx_clock, tx_reset, areset:
inferable from enq_signal
rx_clock, rx_reset:
inferable from deq_signal
vacuity property:
!tx_reset && !rx_reset &&
!areset && active &&
enq_signal === 0
Description
Ensures that the write and read pointers of an asynchronous FIFO change by hamming distance
one, and ensures that the FIFO does not overflow or underflow.
Syntax
[<] {cdc_fifo | cdcf}
-enq enq_signal -deq deq_signal -depth depth_constant
[-tx_clock tx_clock] [-tx_reset tx_reset] [-rx_clock rx_clock] [-rx_reset rx_reset]
{-wr_ptr write_pointer_variable | -wr_ptr_check off}
{-rd_ptr read_pointer_variable | -rd_ptr_check off}
[-enqueue off] [-dequeue off] [-assume [all | {wptr | rptr | ptr | enq | deq}]]
[standard_option]
Required Arguments
-enq enq_signal
FIFO enqueue signal. This signal indicates that the current FIFO entries should increase by
one.
-deq deq_signal
FIFO dequeue signal. This signal indicates that the current FIFO entries should decrease by
one.
-depth depth_constant
FIFO depth, where depth_constant is an HDL constant. The depth must be greater than 1.
389
Command Reference
cdc_fifo
Inferable Options
390
Command Reference
cdc_fifo
Other Options
wptr wr_ptr
rptr rd_ptr
enq enqueue
deq dequeue
Corner Cases
Statistics
Enqueues and Dequeues (Evals) number of times the FIFO enqueued or dequeued a
value.
Maximum FIFO Entries maximum number of values held in the FIFO at one time.
FIFO
wr_ptr
mem
TX Module
rx_clock
rd_ptr
read
RX Module
cdc_fifo
checker
1. This is a dual-clock checker, in which the transmit data are based upon -tx_clock
tx_clock (inferable from -enq enq_signal) and the receive data are based on -rx_clock
Questa CDC User Guide, v10.0c_2
October 2011
391
Command Reference
cdc_fifo
rx_clock (inferable from -deq deq_signal). The standard -clock option should not be
specified.
2. Asynchronous reset for this checker can be specified using the standard -areset option. If
this option is not specified, then the asynchronous reset is inferred from -enq
enq_signal. In either case, the reset applies to the entire checker, including logic on both
clocks.
3. This checker is synchronous with respect to each clock, so it responds only to behavior
that is observable at the active edge of the transmit or receive clock.
Examples
/* 0in cdc_fifo -enq enq -deq deq -depth 8
-wr_ptr_check off -rd_ptr_check off
-enq_fire enq_fire */
Checks that the values of write_ptr and read_ptr do not change by more than a
hamming distance of 1.
rx_clk
tx_clk
write_ptr
enq
write_ptr_fire
rx_clk
tx_clk
read_ptr
deq
read_ptr_fire
392
Command Reference
cdc_glitch
cdc_glitch
active
signals
flags
cdc_glitch_fire
var
firings
cglt
used
reset
areset
default name:
var_signal
checks:
glitch (On)
clock, reset, areset:
inferable from var_signal
vacuity property:
!reset && !areset && active
=== 0
Description
Ensures that the input signal to a specified register does not change more than once within a
clock period.
Syntax
[<] {cdc_glitch | cglt}
[-var var_signal] [-glitch off] [-used] [-clock signal] [-reset signal] [-areset signal]
[standard_option]
Inferable Options
[-var var_signal]
Register driven by the signal to be checked. If unspecified, it is inferred from the declaration
or assignment in the most recent HDL statement on the same line as the beginning of the
0-In comment.
Other Options
[-used]
The checker fires only if var_signal is used (that is, loaded into a destination register).
393
Command Reference
cdc_glitch
Statistics
Cycles Checked (Evals) number of cycles checked (i.e., the number of cycles that the
signal driving var_signal changed value at least once).
Notes
1. This is an asynchronous checker that responds to combinational behavior. The clock
signals active edges are used to define time windows for the checkers glitch detection
logic.
2. Whereas the glitch checker checks for glitches on the specified -var signal, the
cdc_glitch checker infers the driving logic to the specified -var register and checks for
glitches on the inferred driving signal (connected to the var_d port of the cdc_glitch
checker).
inferred
connection
checker checks
for glitch on var_d
var_d
cdc_glitch
var
Examples
// 0in cdc_glitch -var reg
Checks that the input (var_d) to the reg register does not glitch.
clk
var_d
glitch_fire
394
glitch
Command Reference
cdc_hamming_distance_one
cdc_hamming_distance_one
active
signals
tx_clock
tx_reset
variables
tx_var
constants
tx_min
hamming_one_fire
stable_fire
value_changed_at_tx_min
cdc_hamming1
areset
values_checked evals
lontgest_stable_time
shortest_stable_time
default name:
tx_variable
firings
corner checks:
cases
hamming_one (On)
data_stable (Off)
statistics tx_clock, tx_reset, areset:
inferable from tx_variable
vacuity property:
!tx_reset && !areset && active
=== 0
Description
Ensures that the data crossing from transmit clock to receive clock domain changes by only one
hamming distance and that it remains stable for a specified tx_min clock cycles.
Syntax
[<] {cdc_hamming_distance_one | cdc_hamming1}
[-tx_var tx_variable] [-tx_clock tx_clock] [-tx_reset tx_reset ]
[-tx_min tx_min_constant] [-hamming_one off] [-assume [all | {dist | stable}]]
[standard_option]
Inferable Options
[-tx_var tx_variable]
Variable with the transmit data in the transmit clock domain. If unspecified, it is inferred
from the declaration or assignment in the most recent HDL statement on the same line as the
beginning of the 0-In comment.
395
Command Reference
cdc_hamming_distance_one
Other Options
dist hamming_one
stable data_stable
Corner Cases
Statistics
Notes
1. This is a dual-clock checker, in which the transmit data are based upon -tx_clock
tx_clock (inferable from -tx_var tx_variable) and the receive clock is unused. The
standard -clock option should not be specified.
2. Asynchronous reset for this checker can be specified using the standard -areset option. If
this option is not specified, then the asynchronous reset is inferred from -tx_var
tx_variable. In either case, the reset applies to the entire checker, including logic on both
clocks.
3. This checker is synchronous with respect to the transmit clock, so it responds only to
behavior that is observable at the active edge of the transmit clock.
396
Command Reference
cdc_hamming_distance_one
Examples
/* 0in cdc_hamming_distance_one -tx_var tx_var
-hamming_one_fire hamming_one_fire */
0011
0101
hamming_one_fire
Checks that each time the value of tx_var changes, the data remains stable for at least
3 cycles of the transmit domain clock.
rx_clk
tx_clk
tx_var
0101
0100
1100
stable_fire
397
Command Reference
cdc_handshake_data
cdc_handshake_data
active
signals
tx_invalid_handshake_fire
rx_invalid_handshake_fire
data_stable_fire
tx_valid_assert_until_done_assert_fire
tx_done_assert_until_valid_deassert_fire
tx_valid_deassert_until_done_deassert_fire
rx_valid_assert_until_done_assert_fire
rx_done_assert_until_valid_deassert_fire
tx_valid_stable_fire
tx_clock
rx_done_stable_fire
tx_reset
turnaround_max_fire
tx_valid
turnaround_min_fire
tx_done
rx_clock
rx_reset
rx_valid
rx_done
variables
constants
tx_data
cdc_hsd
turnaround_at_max
turnaround_at_min
handshake_cycles_started evals
handshake_cycles_compeleted
handshake_turnaround_time_max
handshake_turnaround_time_min
tx_min
rx_min
turnaround_max
turnaround_min
areset
default name:
tx_valid_sig_tx_done_sig
checks:
cdc_handshake (On)
data_stable (On)
tx_valid_assert_until_tx_
done_assert (On)
firings
tx_done_assert_until_tx_
valid_deassert (On)
tx_valid_deassert_until_tx
_done_deassert (On)
rx_valid_assert_until_rx_
done_assert (On)
rx_done_assert_until_rx_
valid_deassert (On)
tx_valid_stable
(Off)
corner
cases
rx_done_stable (Off)
turnaround_max (Off)
turnaround_min (Off)
statistics clock, reset, areset:
inferable from
tx_valid_signal
vacuity property:
!tx_reset && !rx_reset &&
!areset && active &&
tx_valid_signal === 0
Description
Ensures that the handshaking protocol between transmitter and receiver is correctly followed,
and ensures that the transmit data remains stable in data transfer window.
Syntax
[<] {cdc_handshake_data | cdc_hsd}
[-tx_data tx_data_variable] [-tx_clock tx_clock] [-tx_reset tx_reset]
[-rx_clock rx_clock] [-rx_reset rx_reset] [-tx_valid tx_valid_signal]
[-tx_min tx_min_constant] [-rx_min rx_min_constant]
[-turnaround_max turnaround_max_constant][-turnaround_min turnaround_min_constant]
[-cdc_handshake off] [-data_stable off] [-tx_valid_assert_until_tx_done_assert off]
[-tx_done_assert_until_tx_valid_deassert off]
[-tx_valid_deassert_until_tx_done_deassert off]
[-rx_valid_assert_until_rx_done_assert off] [-rx_done_assert_until_rx_valid_deassert off]
[-tx_done tx_done_signal] [-rx_valid rx_valid_signal] [-rx_done rx_done_signal]
[-assume [all | {txval | tx_done | rxval | rxdone | data | max | min}]] [standard_option]
398
Command Reference
cdc_handshake_data
Inferable Options
[-tx_data tx_data_variable]
Variable with the transmit data in the transmit clock domain. This variable is used with the
cdc_handshake, data_stable and turnaround checks. If one of these checks is on and -tx_data
is unspecified, it is inferred from the declaration or assignment in the most recent HDL
statement on the same line as the beginning of the 0-In comment.
If transmit data bus is not available, you must turn off the cdc_handshake and data_stable
checks.
[-tx_valid tx_valid_signal]
Signal that indicates the transmit data in the transmit clock domain is valid. This signal is
used with the cdc_handshake, data_stable, tx_* and turnaround checks. If one of these
checks is on and -tx_valid is unspecified, it is inferred from the declaration or assignment in
the most recent HDL statement on the same line as the beginning of the 0-In comment.
If transmit valid signal is not available, you must turn off the cdc_handshake, data_stable
and *_tx_valid_* checks.
399
Command Reference
cdc_handshake_data
Firing message: tx_data changed from previous_value to value in the data transfer
window.
400
Command Reference
cdc_handshake_data
401
Command Reference
cdc_handshake_data
[-tx_done tx_done_signal]
Signal that indicates data transmission is complete. This signal is required for the
cdc_handshake, data_stable, tx and turnaround checks.
[-rx_valid rx_valid_signal]
Signal that indicates the receive data in the receive clock domain is valid. This signal is used
with the cdc_handshake, data_stable, rx and turnaround checks.
[-rx_done rx_done_signal]
Signal that indicates data reception is complete. This signal is required for the
cdc_handshake, data_stable, rx and turnaround checks.
Note
Important: If the rx_valid and rx_done signals are not available, you must turn off the
cdc_handshake, rx_valid_assert_until_rx_done_assert and
rx_done_assert_until_rx_valid_deassert checks.
402
default cdc_handshake
txval tx_valid_assert_until_tx_done_assert,
tx_valid_deassert_until_tx_done_deassert, tx_valid_stable, cdc_handshake
Command Reference
cdc_handshake_data
Corner Cases
Statistics
Total Tx_valid (Evals) number of times tx_valid_signal was asserted, starting a new data
transfer cycle.
Maximum Turnaround Cycles maximum number of transmit clock cycles taken for a
complete data transfer cycle.
Minimum Turnaround Cycles minimum number of transmit clock cycles taken for a
complete data transfer cycle.
Notes
The following block diagram shows a typical implementation of a cdc_handshake_data
checker:
tx_valid
TX Module
Rx SYNC
cdc_handshake_data
checker
rx_valid
RX Module
tx_done
Tx SYNC
rx_done
tx_data
data
rx_data
1. This is a dual-clock checker, in which the transmit data are based upon -tx_clock
tx_clock (inferable from -tx_valid tx_valid_signal) and the receive data are based on
-rx_clock rx_clock (inferable from -rx_done rx_done_signal). The standard -clock
option should not be specified.
2. Asynchronous reset for this checker can be specified using the standard -areset option. If
this option is not specified, then the asynchronous reset is inferred from -tx_valid
tx_valid_signal. In either case, the reset applies to the entire checker, including logic on
both clocks.
3. This checker is synchronous with respect to each clock, so it responds only to behavior
that is observable at the active edge of the transmit or receive clock.
403
Command Reference
cdc_handshake_data
Examples
/* 0in cdc_handshake_data -tx_data tx_data
-tx_valid tx_valid -tx_done tx_done
-rx_valid rx_valid -rx_done rx_done
-tx_invalid_handshake_fire tih_fire
-rx_invalid_handshake_fire rih_fire
-data_stable_fire ds_fire*/
Checks that the handshake protocol between transmitter and receiver is correctly
followed and the value of tx_data remains unchanged during the data transfer.
/* 0in cdc_handshake_data -tx_data tx_data
-tx_valid tx_valid -tx_done tx_done
-rx_valid rx_valid -rx_done rx_done
-cdc_handshake off -data_stable off
-tx_valid_assert_until_done_assert_fire tvauda_fire
-tx_done_assert_until_valid_deassert_fire tdauvd_fire
-tx_valid_deassert_until_done_deassert_fire tvdudd_fire
-rx_valid_assert_until_done_assert_fire rvauda_fire
-rx_done_assert_until_valid_deassert_fire rdauvd_fire */
Checks that the handshaking protocol between the transmit and receive valid/done
signal pairs is obeyed for each data transfer window.
rx_clk
tx_clk
tx_valid
tx_done
tvauda_fire
rx_clk
tx_clk
tx_valid
tx_done
tdauvd_fire
rx_clk
tx_clk
tx_valid
tx_done
tvdudd_fire
404
Command Reference
cdc_handshake_data
rx_clk
tx_clk
rx_valid
rx_done
rvauda_fire
rx_clk
tx_clk
rx_valid
rx_done
rdauvd_fire
/* 0in cdc_handshake_data
-tx_valid tx_valid -tx_min 5 -rx_done rx_done -rx_min3
-cdc_handshake off -data_stable off
-tx_valid_assert_until_done_assert_fire off
-tx_done_assert_until_valid_deassert_fire off
-tx_valid_deassert_until_done_deassert_fire off
-rx_valid_assert_until_done_assert_fire off
-rx_done_assert_until_valid_deassert_fire off
-tx_valid_stable_fire tvs_fire
-rx_done_stable_fire rds_fire */
Checks that tx_valid is held constant for at least 4 transmit clock cycles and that
rx_done is held constant for at least 2 receive clock cycles.
rx_clk
tx_clk
tx_valid
rx_done
tvs_fire
rds_fire
Checks that the handshake protocol between transmitter and receiver is correctly
followed and the value of tx_data remains unchanged during the data transfer. Also
checks that the handshaking protocol between the transmit and receive valid/done
signal pairs is obeyed for each data transfer window. Also checks that every data
transfer cycle lasts at least 10, but no more than 16, transmit clock cycles.
405
Command Reference
cdc_sample
cdc_sample
active
signals
variables
tx_clock
tx_reset
rx_clock
rx_reset
tx_var
rx_var
sample
setup_fire
hold_fire
all_one
all_zero
all_zero_to_one
all_one_to_zero
values_sampled evals
sample_zero_bitmap
sample_one_bitmap
one_to_zero_transition_bitmap
zero_to_one_transition_bitmap
areset
default name:
tx_var_rx_var
firings
checks:
setup (On)
corner
cases
hold (On)
tx_clock, tx_reset, areset:
inferable from tx_variable
statistics rx_clock, rx_reset:
inferable from rx_variable
vacuity property:
!tx_reset && !rx_reset &&
!areset && active &&
rx_enable_signal === 0
Description
Ensures that data between two clock domains remain stable in the transmit domain for one
receive clock cycle before and one receive clock cycle after it is sampled in the receive domain.
(i.e., the receive domain samples at least twice for each transmit signal so that the correct value
is sampled).
Syntax
[<] {cdc_sample | sample}
-tx_var tx_variable -rx_var rx_variable [-tx_clock tx_clock] [-tx_reset tx_reset]
[-rx_clock rx_clock] [-rx_reset rx_reset] [-setup off] [-hold off] [-assume]
[standard_option]
Required Arguments
-tx_var tx_variable
Source variable in the transmit clock domain.
-rx_var rx_variable
Destination variable in the receive clock domain.
Inferable Options
406
Command Reference
cdc_sample
Checks and Related Options
[-hold off]
For every cycle that rx_variable is sampled, the value of tx_variable must remain constant
from the active receive clock edge at which the value of rx_variable is sampled to the next
active transmit or receive clock edge (whichever is earlier). This check occurs at the active
rx_clock edge whenever rx_variable has been sampled at the previous active rx_clock edge.
The checker fires each time tx_variable has improperly changed. The -hold off option turns
off this check.
Firing message: The transmit data was unstable after being sampled in the receive clock
domain.
Other Options
[-assume]
Sets all enabled checks to formal assumptions.
Corner Cases
All One to Zero non-zero if every bit of rx_variable was sampled transitioning from
1 to 0 (that is, all bits of One to Zero Transition Bitmap are 1).
All Zero to One non-zero if every bit of rx_variable was sampled transitioning from
0 to 1 (that is, all bits of Zero to One Transition Bitmap are 1).
Statistics
Sample Zero Bitmap bit vector representing which bits of rx_variable were sampled
as 0.
Sample One Bitmap bit vector representing which bits of rx_variable were sampled
as 1.
407
Command Reference
cdc_sample
One to Zero Transition Bitmap bit vector representing which bits of rx_variable were
sampled transitioning from 1 to 0.
Zero to One Transition Bitmap bit vector representing which bits of rx_variable were
sampled transitioning from 0 to 1.
If more than 32 bits are specified, the bitmaps are displayed as hexadecimal values.
Notes
The following block diagram shows a typical implementation of a cdc_sample checker:
TX Reg
tx_var
rx_var_d
cdc_sample
checker
tx_clk
rx_var
RX Reg
rx_clk
1. This is a dual-clock checker, in which the transmit data are based upon -tx_clock
tx_clock and the receive data are based on -rx_clock rx_clock. The standard -clock
option should not be specified.
2. Asynchronous reset for this checker can be specified using the standard -areset option. If
this option is not specified, then the asynchronous reset is inferred from -tx_var
tx_variable. In either case, the reset applies to the entire checker, including logic on both
clocks.
3. The cdc_sample checker has an rx_enable port with an inferred connection to the
sampling condition used to sample tx_variable in the receive clock domain. If the
rx_enable connection cannot be inferred, the checker is excluded (directive-166
warning).
Examples
/* 0in cdc_sample
-tx_var tx_var -tx_clock tx_clk
-rx_var rx_var -rx_clock rx_clk
-setup_fire setup_fire -hold_fire hold_fire */
Checks that tx_var remains stable for the tx_clk cycle preceding, and for the tx_clk
cycle after, each rx_clk edge at which rx_var is sampled.
rx_clk
tx_clk
tx_var
AA
A5
C5
rx_enable
(inferred)
setup_fire
hold_fire
408
Command Reference
cdc_sync
cdc_sync
active
signals
constants
tx_var[n]*
tx_clock
tx_reset
stable_fire
value_changed_at_tx_min
sync
tx_min
areset
firings
corner
cases
values_checked evals
shortest_stable_time
statistics
longest_stable_time
default name:
tx_variable
checks:
stable (On)
tx_clock, tx_reset, areset:
inferable from tx_variable
vacuity property:
!tx_reset && !areset &&
active === 0
[-tx_var tx_variable]
Variable with the transmit data in the transmit clock domain. If unspecified, it is inferred
from the declaration or assignment in the most recent HDL statement on the same line as the
beginning of the 0-In comment.
409
Command Reference
cdc_sync
Other Options
[-tx_min tx_min_constant]
Minimum number of transmit clock cycles that the value of tx_variable should remain
stable. Default: 2 cycles.
[-assume]
Sets the stable check to a formal assumption, if it is on.
Corner Cases
Statistics
Notes
The following block diagram shows a typical implementation of a cdc_sync checker:
tx_var
SYNC
(double ff)
TX Module
rx_clk
tx_clk
RX Module
cdc_sync
checker
1. This is a dual-clock checker, in which the transmit data are based upon -tx_clock
tx_clock (inferable from -tx_var tx_variable) and the receive clock is unused. The
standard -clock option should not be specified.
2. Asynchronous reset for this checker can be specified using the standard -areset option. If
this option is not specified, then the asynchronous reset is inferred from -tx_var
tx_variable. In either case, the reset applies to the entire checker, including logic on both
clocks.
3. This checker is synchronous with respect to the transmit clock, so it responds only to
behavior that is observable at the active edge of the transmit clock.
410
Command Reference
cdc_sync
Examples
/* 0in cdc_sync -tx_var tx_var
-tx_min 3 -stable_fire data_stable_fire */
Checks that each time the value of tx_var changes, the data remains stable for at least
3 cycles of the transmit domain clock.
rx_clk
tx_clk
tx_var
stable_fire
411
Command Reference
cdc_fx
cdc_fx
active
cdc_fx_fire
glitch_swallowed_fire
glitch_caught_fire
cfx
signals
all_bits_inverted
tx_clock
loading_while_clocks_aligned
rx_clock
evals
rx_reset
clocks_aligned_cycles
rx_areset
metastable_cycles
loading_while_rx_clock_before_tx_clock
loading_while_tx_clock_before_rx_clock
rx_clock_before_tx_clock
tx_clock_before_rx_clock
rx_load_enable
delayed_transitions
clks_aligned[65:0]
advanced_transitions
bits_inverted
inverted_bits_bitmap
rx_reg
tx_reg
rx_q
clocks
monitor
tx_clock
corner
cases
statistics
rx_reg
value
rx_clock
tx_reg
firings
default name:
rx_reg
checks:
cdc_fx (Off)
glitch_swallowed (Off)
glitch_caught (Off)
tx_clock, tx_reset, areset:
inferable from rx_reg
vacuity property:
!tx_reset && !areset &&
active === 0
rx_reg
Description
Injects metastability at the output of a receive register.
Syntax
[<] {cdc_fx | cfx}
-rx_reg rx_register_variable -tx_reg tx_register_variable
[-rx_clock rx_clock] [-tx_clock tx_clock] [-rx_reset rx_reset] [-rx_areset rx_areset]
[-rx_load_enable value] [-cdc_fx] [-glitch_caught] [-glitch_swallowed][standard_option]
Required Arguments
-rx_reg rx_register_variable
Receiving register in the receive clock domain.
-tx_reg tx_register_variable
Transmitting register in the transmit clock domain. The tx_register_variable can be a
concatenation of source registers for the receiving register (for example, {tx_reg3, tx_reg2,
tx_reg1}).
412
Command Reference
cdc_fx
Inferable Options
-rx_clock rx_clock
Receive clock. If unspecified, then it is inferred from rx_register_variable.
-tx_clock tx_clock
Transmit clock. If unspecified, then it is inferred from tx_register_variable.
-rx_reset rx_reset
Receive synchronous reset. If unspecified, then it is inferred from rx_register_variable.
-rx_areset rx_areset
Receive asynchronous reset. If unspecified, then it is inferred from rx_register_variable.
-rx_load_enable value
Asserted when rx_reg is loaded with valid data. If unspecified, then it is inferred from
rx_register_variable.
413
Command Reference
cdc_fx
tx_reg
tx_clock
rx_reg
rx_clock
Glitch_caught Check
tx_clk
rx_clk
d
glitch
metastability
injected
metastability
not injected
rx_q
q_sim
glitch_caught_fire
Glitch_swallowed Check
tx_clk
rx_clk
d
glitch
metastability
injected
metastability
not injected
rx_q
q_sim
glitch_swallowed_fire
414
Command Reference
cdc_fx
Corner Cases
All Bits Inverted nonzero if every output bit of the receive register has had metastability
inserted.
Statistics
Rx_clock Before Tx_clock number of receive clocks cycles in which rx_clock goes
active before tx_clock and tx_register_variable is changing.
Tx_clock Before Rx_clock number of clocks aligned cycles in which tx_clock goes
active before rx_clock and tx_register_variable is changing.
Loading While Rx_clock Before Tx_clock number of clocks aligned cycles in which
rx_clock goes active before tx_clock, tx_register_variable is changing and
rx_register_variable is loading.
Loading While Tx_clock Before Rx_clock number of clocks aligned cycles in which
tx_clock goes active before rx_clock, tx_register_variable is changing and
rx_register_variable is loading.
Delayed Transitions number of times metastability injection delayed a transition until the
next cycle.
Bits Inverted number of bits of the receive register output that had metastability inserted
(that is, the number of 1s in the inverted bits bitmap).
Inverted Bits Bitmap bitmap of the bits that had metastability injected.
Notes
1. The following statistics and corner case are updated each cycle: Clocks Aligned Cycles,
Tx_clock Before Rx_clock, Rx_clock Before Tx_clock, and Loading While Clocks
Aligned. The other statistics and corner case are updated only if the rx_register_variable
is loaded.
415
Command Reference
cdc_custom_fx
cdc_custom_fx
active
signals
cdc_custom_fx_fire
tx_clock
rx_clock
all_bits_inverted
ccfx
evals
clocks_aligned_cycles
metastable_cycles
bits_inverted
inverted_bits_bitmap
firing
corner
case
clks_aligned[65:0]
rx_reg
tx_reg
statistics
rx_q
clocks
monitor
tx_clock
rx_reg
value
rx_clock
tx_reg
default name:
rx_reg
checks:
cdc_custom_fx (Off)
tx_clock, tx_reset, areset:
inferable from rx_reg
vacuity property:
!tx_reset && !areset &&
active === 0
rx_reg
Description
Injects metastability at the input of a custom synchronizer. Injection occurs when -tx_clock and
-rx_clock align and the checker fires when data changes within the metastability window. This
checker is only promoted if set_cdc_preference -custom_fx is specified.
Syntax
[<] {cdc_fx | cfx}
-rx_reg rx_register_variable -tx_reg tx_register_variable
[-rx_clock rx_clock] [-tx_clock tx_clock] [-cdc_custom_fx off] [standard_option]
Required Arguments
-rx_reg rx_register_variable
Receiving register in the receive clock domain.
-tx_reg tx_register_variable
Transmitting register in the transmit clock domain. The tx_register_variable can be a
concatenation of source registers for the receiving register (for example, {tx_reg3, tx_reg2,
tx_reg1}).
Inferable Options
-rx_clock rx_clock
Receive clock. If unspecified, then it is inferred from rx_register_variable.
-tx_clock tx_clock
Transmit clock. If unspecified, then it is inferred from tx_register_variable.
416
Command Reference
cdc_custom_fx
Checks and Related Options
Corner Cases
All Bits Inverted nonzero if every output bit of the receive register has had metastability
inserted.
Statistics
Bits Inverted number of bits of the receive register output that had metastability inserted
(that is, the number of 1s in the inverted bits bitmap).
Inverted Bits Bitmap bitmap of the bits that had metastability injected.
Notes
Clocks Aligned Cycles is updated each cycle. The other statistics and corner case are
updated only if the rx_register_variable is loaded.
clks_aligned[65:0]
When the assertion compiler instantiates a cdc_custom_fx checker, it also creates clock
monitor logic that determines when the transmit clock is within the metastability window of
the receive clock (for that transmit clock). Whenever this occurs, the receive register is
prone to metastability if its input value also changes in that receive clock cycle. The
clks_aligned output from the clock monitor is used to pass this information to the
cdc_custom_fx checker.
During the analysis phase, promotion is generated for the cdc_custom_fx checker. The
tx_reg signal is the transmitting register. The custom synchronizer input port is specified as
rx_reg. These promotions should only be done on the input ports of the custom
synchronizer. If there is a crossing from an output port to another synchronizer, then no
promotions are done. CDC promotion is enabled by the set_cdc_preference global directive.
417
Command Reference
cdc_custom_fx
418
During simulation, metastability is injected on the port specified as rx_reg. The metastable
value is a function of the data value on the port before and after the tx_clk edge. There are
two main limitations when compared to general CDC-FX flow as follows:
The active edge of rx_clk should occur after tx_clk. If rx_clk ticks before or in the
same delta cycle as tx_clk, then metastability injection does not impact the simulation
behavior.
The data transitions can only be delayed. The data transitions cannot be advanced one
clock cycle as in the general CDC-FX solution. In other words, the stop window is
implicitly set to zero.
Chapter 7
GUI Reference
GUI Main Window
Menus
Toolbar
Debugging Windows
Design Data
Windows
Analysis
Windows
GUI Basics
The main GUI window has popup menus that appear when you select certain window objects
and right-click. Each popup menu shows commands relevant to the selected object (or objects).
For example, right-clicking on an instance of a CDC scheme displays commands (such as Show
Source and Show Schematic) for displaying the various debug windows for that check.
Popup Menu
419
GUI Reference
GUI Main Window
For some objects (such as check types and schematic objects), the GUI window has hover help,
which displays relevant information about an object when you hover the cursor over the object.
u1.txdata3_r1
Hover Help
In the default layout, the design data windows and the analysis windows are stacked, that is,
they occupy the same part of the GUI window. To display (bring to the front) a particular
window, click on its associated tab.
Project Window
Design Window
Design Tab
420
GUI Reference
GUI Main Window
Object Icon
Click-hold and drag object
to the target window
421
GUI Reference
GUI Main Window
Depending on your selected browser, you might need to adjust some browser preferences. From
the title page of an HTML document, scroll down and click on the Browser Requirements link.
Select the Browser Settings topic and follow the directions for your brand of browser.
With the Firefox browser, if the fonts are too small, you can adjust the font sizes from the
browser itself (for example, using [CTRL SHIFT +] and [CTRL ]).
422
GUI Reference
GUI Main Window
Window Layouts
Adjust the current window layout using the move-window buttons to drag windows to new
locations and the stretch-shrink bars to adjust the sizes of the windows (Figure 7-3).
Figure 7-3. Organizing the Window Layout
Move-Window Button
Click-hold and drag window outline to
the new location for the window.
Window
Outline
Stretch/Shrink Bar
Click-hold and drag
window border to
reshape the window
Zoom/Unzoom Buttons
When the window shows multiple windows, each window has a zoom button (+) at the top right
of the window. A zoomed window takes up the entire layout (Figure 7-4). The other windows
are available from tabs at the bottom of the window. When you select a tab, its window is
displayed as a zoomed window. The unzoom button () on the zoomed window returns the
window to the composite window layout.
423
GUI Reference
GUI Main Window
Undock/Dock Buttons
The undock button at the top right of a window undocks the window, so it appears as a separate
window (Figure 7-5). You also can undock a window by using its move-window button to drag
the window to the edge of the main window. The dock button on an undocked window docks
the window back into the main window.
Figure 7-5. Undocking a Window
Undock Button
Moves the window
to its own window
Dock Button
Re-docks the window
back to the main window
424
GUI Reference
GUI Main Window
425
GUI Reference
Analysis Windows
Analysis Windows
The CDC GUI has the following windows that show information about CDC analysis results.
CDC Checks Window shows the static CDC analysis results and the merged results
of formal verification and simulation with promoted CDC assertions.
Errors/Warnings Window
The error/warnings window (Figure 7-7) shows the errors and warning generated by the formal
session.
Figure 7-7. Errors/Warnings Window
Hover the cursor over a message to display additional information about the error/warning.
Right-click on a message to pop up a menu that you can use to:
426
GUI Reference
Analysis Windows
427
GUI Reference
Analysis Windows
Check Type of CDC scheme (for example: Two DFF Bus Sync, Combo Logic,
DMUX).
Tx File File containing the tx module and file line number of the tx signal.
Rx File File containing the rx module and file line number of the rx signal.
ID ID that identifies the scheme and the design objects associated with it. The name
of the promoted checker includes this ID so simulation and formal results can be merged
into the static CDC results (see Path and Protocol ID on page 49).
If a simulation database (created by simulating the CDC protocol checkers) is merged in, each
entry has the following additional information:
428
GUI Reference
Analysis Windows
Covered Whether or not the checkers corner cases were covered in simulation.
First Firing Testbench time of the first firing, if the checker fired.
Show
Source view the declaration of the TX signal driver or the RX signal receiver.
Schematic view the CDC path in a schematic window and highlight the TX or
RX signal.
Simulation Firings view a firings waveform for the protocol check promoted for
the selected CDC scheme (if the check fired).
Coverage view simulation coverage data for the protocol check promoted for the
selected CDC scheme in the details window.
Filter set and manage filter lists that hide groups of CDC scheme entries based on
various criteria. Also used to create set_cdc_report directives from filtered elements:
From Instance hide schemes on paths that originate from specified design
instances.
By Column view Filter CDC Checks dialog for filtering entries based on their
CDC checks tab field values.
Import clear the current filtered list and load a previously-saved filtered list.
Reset Columns redisplay hidden columns and display columns in the default order.
Create Directive view Set Cdc Report dialog for creating set_cdc_report directives.
Dialog fields are pre-filled with information extracted from the selected scheme.
Find view Search CDC Checks View dialog for searching for specified text in
column entries.
Help invoke HTML help for the selected CDC scheme type.
429
GUI Reference
Debug Windows
Debug Windows
The CDC GUI has the following tools used to debug problems detected by CDC analysis:
Objects Window design objects (ports and internal registers/nets) for design units.
Waveform Viewer shows waveforms for assertion firings, sanity checks, anystate
checks and cover points.
The debug windows are not all stacked together like the design data windows and the analysis
windows. The firings, objects, details and FSM viewer windows are singular windows. Only
one of each can be displayed and the contents are updated depending on your selections in the
analysis windows. The source code editor, schematic browser and waveform viewer are
multiple windows. You can display multiple instances of each of these windows. Each of these
three groups of windows are stacked. For example, you can display waveforms for several
property violations at the same time. The waveform windows are stacked together. Clicking on
a tab displays its associated waveform viewer in front.
Details Window
The details window (Figure 7-10) shows the details for the design instance or entity selected in
the design window.
Figure 7-10. Details Window
430
GUI Reference
Debug Windows
Assertion MSD ratio of the instances registers covered by assertions (within the
Minimum Sequential Distance).
Objects Window
The objects window (Figure 7-11) displays design objects (ports and internal registers/nets) for
the current design unit instance . Click on a design unit instance in the design window to select
the current design unit.
Figure 7-11. Objects Window
Use drag-and-drop to add selected objects to the waveform viewer or the schematics viewer.
Right-click on an entry to pop up a menu that you can use to:
Edit Directive
Show in Schematic
New View open a new schematic viewer showing the selected objects.
Active View add the selected objects to the active schematic view.
431
GUI Reference
Debug Windows
Abstract View show the selected objects in an abstract view of the design unit.
Select in Schematic selects and highlights the selected objects in the active schematic
view.
From Signals Add the selected objects to the From Signals group for path tracing.
To Signals Add the selected objects to the To Signals group for path tracing.
Thru Signals Add the selected objects to the Thru Signals group for path tracing.
Log/Report Browsers
You can open a log or report directly in a browser (Figure 7-12):
in the toolbar.
432
GUI Reference
Debug Windows
You also can open a log (Figure 7-13) indirectly from the popup menu for a selected item in the
errors/warnings window:
Go to Log File shows the log with the corresponding error/warning flagged.
Figure 7-13. Log Browser Showing Error/Warning Information
433
GUI Reference
Schematics Viewer
Schematics Viewer
Running a Show >Schematic command for a CDC check or a Show in Schematic command for
a clock in the Clocks window displays a schematic view of the clock domain crossing scheme
or the drivers/receivers of the selected clock (Figure 7-14).
Figure 7-14. Schematics Viewer
434
GUI Reference
Schematics Viewer
Expand the view to show the drivers/readers of a net or port. To do this, double-click
on the net or port.
expand drivers/readers
of a net or port
double-click
on net/port
expand
combinational logic
double-click
on logic
block
TBS
435
GUI Reference
Schematics Viewer
A quick way of zooming the view (in or out) to fit the viewer (i.e., zoom full) is to
middle-click and drag up and left.
zoom-to-fit
drag
middle-mouse
up & left
A quick way of zooming the view out is to middle-click and drag up and right. The
longer the distance dragged, the greater the amount zoomed.
drag
middle-mouse
up & right
zoom out
A quick way of zooming the view in is to middle-click and drag left/right (level or
down). The view zooms in to the range selected by the bounding box.
drag
middle-mouse
down & left
or right
436
zoom in
GUI Reference
Source Code Editor
Directly:
Edit from the project window popup window opens the selected file at line 1.
Go to Declaration opens the source code file containing the items declaration
with the declaration flagged. This command is available for the following windows:
project, design, modules and objects.
Go to Instantiation opens the source code file containing the module instantiation
with the instantiation flagged. This command is available for the following
windows: design and modules.
Go to Source opens the source code file containing the erroneous construct with
the construct flagged. This command is available for the following window:
errors/warnings.
Show Source opens the file containing the associated construct with the construct
flagged. This command is available for the following windows: property checks,
policy checks, design checks, properties and firing inputs.
Figure 7-15. Source Code Editor
437
GUI Reference
Waveform Viewer
Waveform Viewer
The Show Waveform command for a CDC protocol check firing displays a waveform for the
firing (Figure 7-16).
Figure 7-16. Waveform Viewer
File >Save Format. In the Save Format dialog, specify a pathname to save the
waveform format file.
438
To reconstitute a saved view in an empty viewer: From a view generated from the same
data as the saved view: File >New Window. An empty wave viewer appears. From this
viewer: File >Load. From the Open Format dialog, select the saved do file. The new
viewer displays the saved wave view.
Questa CDC User Guide, v10.0c_2
October 2011
GUI Reference
Waveform Viewer
To load saved wave format data into the current wave view: Create a do file with the
desired wave format data (taken from a saved waveform format file), for example:
WaveRestoreCursors {{Config Complete} {1033 ns} 1}
configure wave -justifyvalue right
configure wave -timelineunits ps
bookmark add wave {Cmd Load} {{1774 ns} {3709 ns}} 0
bookmark add wave Firing {{893 ns} {4887 ns}} 0
From the current wave view: File >Load. From the Open Format dialog, select the do
file.
To load saved wave format data into the every wave view: Create a do file with the
desired wave format data (taken from a saved waveform format file), for example:
add wave -noupdate -format Logic -radix binary replay_qvl_.../clock1
add wave -noupdate -format Logic replay_qvl_.../pci_err__in
add wave -noupdate -format Logic -radix binary replay_qvl.../combo
WaveRestoreCursors {{Config Complete} {1033 ns} 1}
configure wave -justifyvalue right
configure wave -timelineunits ps
bookmark add wave {Cmd Load} {{1774 ns} {3709 ns}} 0
bookmark add wave Firing {{893 ns} {4887 ns}} 0
From the GUI main window: Tools >Edit Preferences. From the Edit Preferences
dialog, go to the Misc tab. In the Waveform section, add the do file to the Configuration
File field.
This procedure applies the saved wave view formatting to every waveform. The identity
of the wave format configuration file is saved in .0in_ui_local_prefs, so it is persistent
across GUI sessions run from the current directory. You also can use this procedure to
automatically load a reference set of specific signals to every waveform. These
signals provide a baseline for analyzing formal results. If the added signals are in the
fanin/fanout cones of the current property, formal analysis controls affect their
individual waveforms and the baseline information is useful. Signals not in these cones
provide baseline information up to the starting state for formal analysis, but are set to
flat-line after that.
Use the zoom in, zoom out, zoom full and zoom in on active cursor icons
(
).
439
GUI Reference
Waveform Viewer
A quick way of zooming the view (in or out) to fit the viewer (i.e., zoom full) is to
middle-click and drag up and left.
drag
middle-mouse
up & left
A quick way of zooming the view out is to middle-click and drag up and right. The
longer the distance dragged, the greater the amount zoomed.
drag
middle-mouse
up & right
zoom-to-fit
zoom out
A quick way of zooming the view in is to middle-click and drag left/right (level or
down). The view zooms in to the range selected by the starting and ending points.
drag
middle-mouse
down & left
or right
zoom in
440
Create a bookmark for the current view: Add >Bookmark. In the Bookmark Properties
dialog, provide a mnemonic for the view in the Bookmark Name field. By default, the
bookmark saves the zoom value (Zoom Range) and the vertical scroll location (Top
Index). You can select to save either or both with the bookmark.
Jump the viewer to a saved bookmark view: View >Bookmarks >name. The Bookmarks
submenu lists all the saved bookmarks. Here, name is ne of the bookmarks.
GUI Reference
Waveform Viewer
Give the signal a Display Name, which is shown in the pathname pane in place of the
signal name.
Select colors for the signal waveform (Wave Color) and signal name (Name Color).
Change the Radix (for example, decimal, octal, hex, binary) for the displayed signal
value.
To change display properties for multiple signals, select the signals and use the Format menu
commands (Radix, RadixEnum, Format, Color and Height) to adjust their display properties as
a group.
toggle
leaf names
full names
edit grid/timeline
441
GUI Reference
Waveform Viewer
Since full signal names can be overly long, you can set the maximum number of
hierarchical levels displayed in the long names. To do this: click the edit grid/timeline
icon ( ) next to the pathname toggle icon. From the Display tab of the Wave Window
Properties dialog, set the Display Signal Path field to the maximum number of pathname
elements to display.
Adding Signals
To add signals, do one of the following:
From the signals pane popup menu, run Add Signals >Current View. In the Add Signal
to Wave Window dialog, select the signals and click on Add.
From the objects window, select an object to add to the waveform. Drag and drop the
object to the signals pane of the waveform viewer.
442
Objects Window
GUI Reference
Waveform Viewer
These signals are added to the current wave view. You also can identify signals to add to every
wave view. To do this:
From the signals pane popup menu, run Add Signals >Always. In the Always Add
Signals to Wave Display dialog, update the Always Add These Signals list.
Removing Signals
To remove signals from the viewer: select the signals and press Delete.
Organizing Signals
The signals panel at the left of the waveform viewer lists the signals in the waveform. Signals
are identified by blue diamonds ( ). To organize the signals in the signals panel you can:
Combine signals into a bus. To do this: select the signals for the bus and run Tools
>Wave >Combine Signals. From the Combine Selected Signals dialog, provide a name
for the new bus. Set the other fields to determine the ordering of the signals in the bus.
To remove the old signals after the bus is created, select Remove selected signals after
combining. The created bus is identified by a red diamond ( ). The bus waveform
shows the the combined values of the constitute signals.
Combine signals into a wave group. To do this: select the signals for the group and run
Tools >Groups. From the Wave Group Create dialog, provide a name for the new wave
group. The created group is identified by a red diamond ( ). No waveform is displayed
for the group itself, but waveforms for the group members are displayed when the group
is expanded.
443
GUI Reference
Waveform Viewer
Add category dividers. Signals in the signals panel are separated into categories
labeled with dividers. When you add signals they are automatically assigned to the
Added Signals category (unless they are added by dragging and dropping).
To help you organize signals, you can add new category dividers. To do this, select the
signals and run View >Wave >Add >Divider. The Wave Divider Properties dialog is
displayed. Specify a divider name and specify the divider height (to add extra spacing
around the divider).
custom
category
dividers
To move a divider to a new location, select the divider and drag. To delete a divider,
select the divider and press Delete.
Re-order signals. Select the signals and drag to the new location. You also can sort the
signals alphabetically with the View >Wave >Sort commands (Ascending, Descending,
Ascending Full Path and Descending Full Path). Signals are sorted within each category
(defined by the dividers).
444
GUI Reference
Waveform Viewer
original pane
pane
boundary
separate
scroll
bars
active
pane
bar
added pane
Click and drag the pane boundary to reshape both panes. To delete a pane, click in the pane (the
active pane is identified with a white bar) and run Edit >Delete Window Pane.
The initial waveform shows at least three cursors. These are vertical lines that let you compare
signal behavior at specific times.
Firing indicates a firing of the associated assertion or sanity check. For a cover property
or covered checker, the Firing cursor indicates when the property became covered.
The left (gray) panel of the cursor pane lists the cursors. You can:
Give the cursor a name by selecting and right-clicking on the cursor name and entering a
user-specified name.
Remove a cursor by selecting the cursor and clicking on the corresponding remove
cursor icon ( ).
).
445
GUI Reference
Waveform Viewer
To save the image as a BMP file, File >Export >Image. Use the Save Image dialog to
save the file.
To save the image as a PostScript file, File >Print PostScript. Use the Write PostScript
dialog to print all or part of the waveform to a PS file.
Do not remove the focus from the waveform window until the capture completes (to prevent
the captured image from being corrupted).
Select the variable. All references to the variable are then highlighted. Drag and drop
any reference to the variable to any wave view at the desired location.
add a signal to a wave view
from the source code viewer
Select the variable. All references to the variable are then highlighted. Place the cursor
over one of the variables references and run the Add to Wave Window popup command.
The signal is added to the Added Signals category of the last displayed wave view.
Drag the signal to the intended category and location.
446
GUI Reference
Waveform Viewer
With source code annotation on, the source code view shows values of the variables in the
source code. They are displayed in red under the associated variables. The variables values are
their values at the time of the current selected cursor in the current wave view. So, as you move
a cursor along a wave view, the source code reflects the changing values of the variables.
variables values are shown for the time of the current active cursor
447
GUI Reference
Project Mode Windows
Project Window manages the source code files for the project.
The project mode windows display objects at the design unit level, set global directives for the
objects, manage source files for the project and set basic project properties. In addition, some
windows have a find panel (Figure 7-17). Use this panel to search for matches to specified text
in the window
Figure 7-17. Find Panel in Design Data Windows
Pull-down Menu
Wrap search
Match whole word
Find all matches
Search direction
Project Window
The project window (Figure 7-18) manages the source code files for the project.
Figure 7-18. Project Window
448
GUI Reference
Project Mode Windows
Compile the source file, all source files or the out-of-date source files.
Change Compile Order move the selected files up or back in compile order.
Change Compile Options change the work library, language syntax or language type
and add command line options.
Design Window
The design window (Figure 7-19) shows the hierarchy of the DUT instances.
Figure 7-19. Design Window
Filter Checks displays the Filter Design Checks dialog for filtering the display of
types of design checks.
Select in Schematic select the design unit in the current displayed schematics
window.
449
GUI Reference
Project Mode Windows
Copy to Clipboard save the design unit name or details to the clipboard.
Modules Window
The modules window (Figure 7-20) shows the DUT design units with their assertion densities.
Figure 7-20. Modules Window
450
Select in Schematic select the instance in the current displayed schematics window.
Copy to Clipboard save the design unit name or details to the clipboard.
GUI Reference
Project Mode Windows
Clocks Window
The clocks window (Figure 7-21) shows the DUT clock signals.
Figure 7-21. Clocks Window
Go to clock declaration in the source code or the design unit with the clock in the
hierarchy.
Edit Directive see set_cdc_clock on page 265 and set_constant on page 307..
Show in Schematic shows the clock drivers, clock readers or both in a schematics
view.
Select in Schematic zooms in and selects the clock signal in the active schematic
view.
Add to Path Tracing adds the clock to the path tracing points.\
Copy to Clipboard copies the clock path (name) or name and clock group (details) to
the clipboard.
Show Details shows the details window with clock name and clock group name.
451
GUI Reference
Project Mode Windows
Directives Window
The directives tab (Figure 7-22) shows the current global directives. Use this tab to add and edit
global directives.
Figure 7-22. Directives Window
452
Add view a dialog customized for the selected type of directive. After completing the
form, the directive is added to the directives tab. The directive types are: Clock
(set_cdc_clock on page 265), Reset (set_reset on page 314), Port Domain
(set_cdc_port_domain on page 279), Signal (set_cdc_signal on page 301), Report
(set_cdc_report on page 296), Synchronizer (set_cdc_synchronizer on page 304),
Constant (set_constant on page 307), Reconvergence (set_cdc_reconvergence on
page 294), Preference (set_cdc_preference on page 286), Black Box (set_black_box
on page 264), Memory (set_memory on page 310), FX Metastability
(set_cdc_fx_metastability_window on page 271), FX Check (set_cdc_fx_check on
page 270) and FX Timescale (set_cdc_fx_timescale on page 272).
Chapter 8
Reports/Logs Reference
The CDC compiler automatically generates the following files:
0in_cdc_ctrl.v Clock domain crossing checker control file, which contains suggested
CDC protocol checker directives for signals crossing clock domains (for use with
simulation and the formal tools).
453
Reports/Logs Reference
CDC Design Report
454
Reports/Logs Reference
CDC Design Report
455
Reports/Logs Reference
CDC Design Report
O1r_0_rg.clk
O2r_0_rg.clk
O2r_1_rg.clk
O2r_2_rg.clk
O2r_3_rg.clk
Group
2(12 Register Bits)
----------CLK2
sy2.I_CLK
sy3.I_CLK
sy4.I_CLK
sy5.I_CLK
detrxst_0_rg.clk
Group
3(358 Register Bits)
----------CLKX [gate: ((TCS === 1b0) ? CLK0 : ((TCS === 1b1) ? TRK : 1bx))]
O2w_0_rg.clk
O2w_1_rg.cl
O2w_2_rg.clk
O2w_3_rg.clk
sy6.I_CLK
sy7.I_CL
sy8.I_CLK
sy9.I_CLK
sya.I_CLK
modr.I_CLK
modr.modr1_0.I_CLK
modr.modr1_0.syb.I_CLK
modr.modr1_0.syc.I_CLK
. . .
modr.modr1_3.ft_rg.clk
modr.modr1_3.f_r_rg.clk
Group
4(5 Register Bits)
----------modr.rz0_tree [gate: (TCS ? TRK : ((I5[1:0] == 2'b0) ? RCLK[0] :RCLK[1]))]
modr.wz_rg.clk
modr.t_l0_rg.clk
456
Reports/Logs Reference
CDC Design Report
457
Reports/Logs Reference
CDC Design Report
Number of Latches
Number of RAMs
= 0
= 0
458
Reports/Logs Reference
CDC Design Report
Clock Domain Clock domain of the port. The {clock} indicates the primary clock
for the domain, and {clock1 | clock2 |...} indicates the clock domain is
ambiguous. The relevant primary clocks are listed. An async indicates the port is
marked as an asynchronous port using the set_cdc_port_domain global directive
(page 279).
Type Method used to determine the clock domain. User indicates the clock domain is
assigned by the set_cdc_clock directive for clock ports, or by using the
set_cdc_port_domain directive. 0in_cdc indicates CDC analysis identified the domain
(or potential domains).
Mode Information
The 0in_cdc_design.rpt file contains the mode information as shown in Example 8-9. Note that
the mode information is generated only when the cdc -report_modes option is specified.
Example 8-9. Mode Information
Mode information
================
--------------------------------------------Mode
Type
Information
--------------------------------------------cdc_mode_0
Questa CDC Missing mode
cdc_mode_1
Questa CDC Missing mode
cdc_mode_2
Questa CDC Missing mode
--------------------------------------------User Modes
==========
None
Inferred Modes
==============
Constants in cdc_mode_0 (Missing)
----------------------------------------Signal
Value
----------------------------------------TCS
1'b1
----------------------------------------Constants in cdc_mode_1 (Missing)
-----------------------------------------
459
Reports/Logs Reference
CDC Design Report
Signal
Value
----------------------------------------TCS
1'b0
I5[1:0]
2'b00
----------------------------------------Constants in cdc_mode_2 (Missing)
----------------------------------------Signal
Value
----------------------------------------TCS
1'b0
I5[1:0]
2'b01
-----------------------------------------
460
Reports/Logs Reference
Clock Domain Crossing Report
User Comments
The 0in_cdc.rpt file contains a user-specified comment when the set_cdc_report_comment
directive is specified, as shown in Example 8-11.
Example 8-10. User Comments
// 0in set_cdc_report_comments -comment SHIBA project; phase 3.
User Comments
=================================================================
SHIBA project; phase 3
-----------------------------------------------------------------
461
Reports/Logs Reference
Clock Domain Crossing Report
CDC Summary
The 0in_cdc.rpt file contains the CDC summary that shows the counts for each type of
violation, caution, and evaluation as shown in Example 8-11.
Example 8-11. CDC Summary
CDC Summary
=================================================================
Violations (7)
----------------------------------------------------------------Single-bit signal does not have proper synchronizer.
(3)
Combinational logic before synchronizer.
(1)
Reconvergence of synchronizers.
(1)
Single Source Reconvergence of synchronizers.
(2)
Cautions (6)
----------------------------------------------------------------DMUX synchronization.
(2)
Multiple-bit signal across clock domain boundary.
(1)
FIFO synchronization.
(2)
Handshake synchronization.
(1)
Evaluations (1)
----------------------------------------------------------------Single-bit signal synchronized by DFF synchronizer.
(1)
Waived (6)
----------------------------------------------------------------Multiple-bit signal synchronized by DFF synchronizer.
(4)
Reconvergence of synchronizers.
(2)
Proven (8)
----------------------------------------------------------------Single-bit signal synchronized by DFF synchronizer.
(6)
Reconvergence of synchronizers.
(1)
Pulse Synchronization.
(1)
Filtered (1)
----------------------------------------------------------------Combinational logic before synchronizer.
(1)
462
Reports/Logs Reference
Clock Domain Crossing Report
Violations
The 0in_cdc.rpt file contains the CDC violations that shows the paths that result in the CDC
violations as shown in Example 8-13.
Example 8-13. Violations
Violations
========================================================================
Single-bit signal does not have proper synchronizer. (no_sync)
-----------------------------------------------------------------------cpu_clk_in : start : init_done (/demo_top.v : 82)
core_clk_in : end : tx_state[0] (/demo_top.v : 193) (ID:no_sync_47305)
core_clk_in : end : tx_en (/demo_top.v : 86) (ID:no_sync_2628)
core_clk_in : end : tx_mask_valid (/demo_top.v : 90) (ID:no_sync_31547)
Combinational logic before synchronizer. (combo_logic)
------------------------------------------------------------------------cpu_clk_in : start : pass_en[1] (/demo_top.v : 79)
mac_clk_in : end : check_en_r1 (/demo_top.v : 324) (ID:combo_logic_46571)
cpu_clk_in : start : err_thrs (/demo_top.v : 78)
mac_clk_in : end : check_en_r1 (/demo_top.v : 324) (ID:combo_logic_85239)
Reconvergence of synchronizers. (reconvergence)
------------------------------------------------------------------------mac_clk_in : end : rx_payload_en (/demo_top.v : 381)
(ID:reconvergence_68819)
mac_clk_in : start : tx_sop_r2 (/demo_top.v : 360)
mac_clk_in : start : tx_eop_r2 (demo_top.v : 371)
mac_clk_in : end : rx_masked_data (/demo_top.v : 382)
(ID:reconvergence_51498)
mac_clk_in : start : tx_eop_r2 (/demo_top.v : 371)
mac_clk_in : start : tx_mask_valid_r2 (/demo_top.v : 303)
mac_clk_in : end : pass_valid (/demo_top.v : 47)
(ID:reconvergence_31994)
mac_clk_in : start : fifo_1_d.wp_s (/generic_fifo_dc_gray.v : 149)
mac_clk_in : start : fifo_0_h.wp_s (/generic_fifo_dc_gray.v : 149)
mac_clk_in : end : pass (/demo_top.v : 45) (ID:reconvergence_11498)
mac_clk_in : start : fifo_1_d.wp_s (/generic_fifo_dc_gray.v : 149)
mac_clk_in : start : fifo_0_h.wp_s (/generic_fifo_dc_gray.v : 149)
Cautions
The 0in_cdc.rpt file contains the CDC cautions that displays the paths that result in the CDC
cautions as shown in Example 8-14.
Example 8-14. Cautions
Cautions
=======================================================================
463
Reports/Logs Reference
Clock Domain Crossing Report
DMUX synchronization. (dmux)
----------------------------------------------------------------------cpu_clk_in : start : fstp[7:1] (/demo_top.v : 81)
mac_clk_in : end : crc_1.scramble (/demo_top.v : 435) (ID:dmux_30303)
via : crc_1.fstp
core_clk_in : start : tx_mask_d (/demo_top.v : 198)
mac_clk_in : end : mask (/demo_top.v : 336) (ID:dmux_12402)
Evaluations
The 0in_cdc.rpt file contains the CDC evaluations that displays the paths that result in the CDC
evaluations as shown in Example 8-15.
Example 8-15. Evaluations
Evaluations
=======================================================================
Single-bit signal synchronized by DFF synchronizer. (two_dff)
----------------------------------------------------------------------cpu_clk_in : start : init_done (/demo_top.v : 82)
mac_clk_in : end : init_done_r1 (/demo_top.v : 119) (ID:two_dff_5840)
cpu_clk_in : start : pass_en[0] (/demo_top.v : 79)
mac_clk_in : end : pass_en0_r1 (/demo_top.v : 314) (ID:two_dff_81824)
core_clk_in : start : tx_sop (/demo_top.v : 88)
mac_clk_in : end : tx_sop_r1 (/demo_top.v : 360) (ID:two_dff_11314)
464
Reports/Logs Reference
Clock Domain Crossing Report
Waived
The 0in_cdc.rpt file contains the schemes assigned with waived severity using the
set_cdc_report -waived directive as shown in Example 8-15.
Example 8-16. Waived
Waived
=================================================================
Multiple-bit signal synchronized by DFF synchronizer. (bus_two_dff)
----------------------------------------------------------------mac_clk : start : fifo_0_h.rp_gray (.../generic_fifo_dc_gray.v : 147)
core_clk : end : fifo_0_h.rp_s1 (.../generic_fifo_dc_gray.v : 149)
(ID:bus_two_dff_62001)
core_clk : start : fifo_0_h.wp_gray (.../generic_fifo_dc_gray.v : 146)
mac_clk : end : fifo_0_h.wp_s1 (.../generic_fifo_dc_gray.v : 149)
(ID:bus_two_dff_53361)
mac_clk : start : fifo_1_d.rp_gray (.../generic_fifo_dc_gray.v : 147)
core_clk : end : fifo_1_d.rp_s1 (.../generic_fifo_dc_gray.v : 149)
(ID:bus_two_dff_94611)
core_clk : start : fifo_1_d.wp_gray (.../generic_fifo_dc_gray.v : 146)
mac_clk : end : fifo_1_d.wp_s1 (.../generic_fifo_dc_gray.v : 149)
(ID:bus_two_dff_80275)
465
Reports/Logs Reference
Clock Domain Crossing Report
mac_clk : start : fifo_0_h.wp_s (.../generic_fifo_dc_gray.v : 148)
(Synchronizer ID:bus_two_dff_53361)
mac_clk : start : fifo_1_d.wp_s (.../generic_fifo_dc_gray.v : 148)
(Synchronizer ID:bus_two_dff_80275)
mac_clk : end : pass_valid (.../demo_top.v : 51) (ID:reconvergence_31994)
mac_clk : start : fifo_0_h.wp_s (.../generic_fifo_dc_gray.v : 148)
(Synchronizer ID:bus_two_dff_53361)
mac_clk : start : fifo_1_d.wp_s (.../generic_fifo_dc_gray.v : 148)
(Synchronizer ID:bus_two_dff_80275)
Proven
The 0in_cdc.rpt file contains the paths with CDC transfer protocols that cannot be violated as
shown in Example 8-15.
Example 8-17. Proven
Proven
=================================================================
Single-bit signal synchronized by DFF synchronizer. (two_dff)
----------------------------------------------------------------core_clk : start : hdren_tx (.../demo_top.v : 76)
mac_clk : end : hdren_rx1 (.../demo_top.v : 77) (ID:two_dff_33161)
cpu_clk : start : init_done (.../demo_top.v : 94)
mac_clk : end : init_done_r1 (.../demo_top.v : 131) (ID:two_dff_5840)
cpu_clk : start : pass_en[0] (.../demo_top.v : 91)
mac_clk : end : pass_en0_r1 (.../demo_top.v : 371) (ID:two_dff_81824)
core_clk : start : tx_eop (.../demo_top.v : 99)
mac_clk : end : tx_eop_r1 (.../demo_top.v : 428) (ID:two_dff_54238)
core_clk : start : tx_mask_valid (.../demo_top.v : 102)
mac_clk : end : tx_mask_valid_r1 (.../demo_top.v : 360)
(ID:two_dff_52495)
core_clk : start : tx_sop (.../demo_top.v : 100)
mac_clk : end : tx_sop_r1 (.../demo_top.v : 417) (ID:two_dff_11314)
466
Reports/Logs Reference
Clock Domain Crossing Report
mac_clk : end : tx_en_r1 (.../demo_top.v : 346) (ID:pulse_sync_13276)
Filtered
The -filtered_report option of the set_cdc_preference directive directs CDC analysis to include
details of filtered schemes in the 0in_cdc.rpt report as shown in Example 8-15. Use the
set_cdc_report -severity off directive to filter CDC schemes.
Example 8-18. Filtered
Filtered
=================================================================
Combinational logic before synchronizer. (combo_logic)
----------------------------------------------------------------cpu_clk : start : err_thrs (.../demo_top.v : 90)
mac_clk : end : check_en_r1 (.../demo_top.v : 381)
(ID:combo_logic_85239)
467
Reports/Logs Reference
Clock Domain Crossing Report
468
Reports/Logs Reference
Clock Domain Crossing Report
bad1.R3 (wrong clock : clk2)
good1.R1 (wrong reset_polarity : posedge U0.f2)
good1.R3 (wrong clock : clk2, wrong reset_polarity : posedge U0.f2)
Asynchronous reset signals that are not synchronized properly either have no synchronizer or
are not properly synchronized as follows:
no synchronizer
Asynchronous reset detection reports no synchronizer if a reset signal is used to reset
flip-flops in a multiple clock design without using a synchronizer. In the following
subcircuit, rst_a is used directly (without a synchronizer):
rst_a is used
directly
rst_a
rst_a
1'b1
1'b1
clk_a
clk_a
Incorrect Usage
Correct Usage
wrong clock
Asynchronous reset detection reports wrong clock if an asynchronous reset signal is
used to reset logic in another clock domain. In the following subcircuit, the reset_a
signal is used incorrectly to reset logic in a clock domain other than the domain of
clk_a.
reset_a
rst_a
reset_a
rst_a
1'b1
1'b1
wrong clock
clk_a
clk_b
Incorrect Usage
clk_a
clk_a
Correct Usage
469
Reports/Logs Reference
Clock Domain Crossing Report
is used as an active high reset (that is, the reset has the wrong polarity). In the following
subcircuit, the active high reset_a signal is used as an active low reset.
reset_a wrong polarity
rst_a
1'b1
1'b1
clk_a
clk_a
Incorrect Usage
reset_a
rst_a
Correct Usage
470
Reports/Logs Reference
CDC Settings Report
471
Reports/Logs Reference
CDC Settings Report
472
Reports/Logs Reference
CDC Settings Report
max_cdc_crossings
custom_fx
promote_reconvergence
mult_fanout_async
dmux_promote_sample
fx_use_local_clk
input_async
ignore_black_box
handshake_scheme
fifo_scheme
delayed_pulse
report_resets
detect_primary_output_clock
formal_add_bus_stability
formal_add_recon_stability
filtered_report
vectorize_nl
unrestricted_reconvergence
no_clock_as_rx
multi_paths
multi_through
report_undriven_custom_sync
print_port_domain_template
dmux_as_recon_start
print_detailed_custom_sync
report_black_box_recon
black_box_empty_module
sample_data_stability
infer_clock_off
detect_pure_latch_clock
promote_async_reset
complex_scheme_as_synchronizer
0
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
473
Reports/Logs Reference
CDC Settings Report
474
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Index
Symbols
+define+, 339
+error, 368
+incdir+, 340
+libext, 340
+nowarn, 368
+skip_syscall, 70
Numerics
0-In comments, 254
definition, 254
single-line, 254
0in.log, 374
0in_cdc.db, 374
0in_db2ucdb, 357
0in_detail.log, 374
1-Step compilation, 56
2-Step compilation, 57
A
abstract memory model, 310
ad hoc synchronizer, 31
-allow_enable_in_sync, 289
Altera, 63
ANSI port declaration, 339
assertion defined, 47
assertion-based verification, 47
-assume, 410
Assumption groups
data, 402
deq, 391
dist, 396
enq, 391
max, 402
min, 402
ptr, 391
rptr, 391
rxdata, 386
rxdone, 402
rxval, 402
stable, 396
txdata, 386
txdone, 402
txdsel, 386
txval, 402
wptr, 391
async_reset scheme, 181
async_reset_no_sync scheme, 184
asynchronous
clocks, 25
inputs, 25
no synchronizer, 469
reset detection, 467
reset signals, 469
reset synchronizers, 468
reset with missing synchronizer, 468
user-entered reset, 468
wrong clock, 469
wrong reset polarity, 469
-auto_black_box, 369
B
Black box, 70
black_box scheme, 186
-black_box_empty_module, 288
Block constraints generation mode, 118
Block specifications, 119
Bookmarks, 440
bus_dff_sync_gated_clk scheme, 191
bus_four_latch scheme, 193
bus_shift_reg scheme, 195
bus_two_dff scheme, 197
bus_two_dff_phase scheme, 199
C
cache, 366
Case directive, non-native, 326
CDC
cautions report, 463
evaluation report, 464, 465, 466
475
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
filtered crossings, 367
promotion, 104
promotion summary report, 462
scheme types, 39
scheme, turn off reporting, 40
schemes, 39, 179
schemes with potential errors, 44
summary report, 462
violation report, 463
CDC checks window, 427
cdc command, 364
cdc input files, 373
CDC port constraint, 276
cdc_dsel, 385
cdc_fifo, 389
cdc_glitch, 393
cdc_hamming_distance_one, 395
-cdc_handshake, 399
cdc_handshake_data, 398
cdc_sample, 406
cdc_sync, 409, 412, 416
CDC-FX
cdc_fx checker, 175
metastability injected simulation, 29
Checker
promotion, 48
checker
cdc_fx, 159
promotion, 40
protocol, 47
simulate a design, 50
Checker summary, 290
Checker types
cdc_dsel, 385
cdc_fifo, 389
cdc_glitch, 393
cdc_hamming_distance_one, 395
cdc_handshake_data, 398
cdc_sample, 406
cdc_sync, 409, 412, 416
CheckerWare assertion library, 48
clock
asynchronous, 25
domain crossing, 26
domains, 25
476
group, 25
group inferred by compiler, 455
group summary, 454
jitter, 28
user-specified clock group, 455
clock domain
crossing report file, 461
-clock_as_rx, 286
-clock_group_pair, 276
-clock_in_data, 286
Clocks, 25
Clocks window, 451
cmd, 352
combo_logic scheme, 201
commands
ccl, 379
Configure columns buttons, 421
Consistency checks, 122
Control file models, 130
control signal synchronizers, 31
Corner cases
all one, 407
all one to zero, 407
all zero, 407
all zero to one, 407
asserted for tx_min cycles, 387
FIFO is empty, 391
FIFO is full, 391
turnaround cycles completed at
turnaround_max, 403
turnaround cycles completed at
turnaround_min, 403
value changed at tx_min, 396, 410
counterexample, 49
Coverage count, 361
cuname, 366
Current layout, 425
-custom_fx, 287
custom_sync scheme, 189, 203, 205
cwhelp, 381
D
data
synchronization, 42, 43
Data sheets, checkers, 383
-data_stable, 399
Questa CDC User Guide, v10.0c_2
October 2011
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
de, 368
Defaults file, 58
-delayed_pulse, 289
-depth, 389
Depth of divergence, 37
Depth of reconvergence, 37
-deq, 389
-dequeue, 390, 409
design
detailed information, 458
general information, 457
Design window, 449
DesignWare, 355, 370
detail, 351
Details window, 430
-detect_primary_output_clock, 286
dff_sync_gated_clk scheme, 207
Directive order, 259
Directives
non-native case, 326
Directives window, 452
Divergence depth, 37
Dividers, 444
dmux scheme, 208, 244
-dmux_as_recon_start, 288
-dmux_promote_sample, 288, 289
Dock button, 424
Drag-and-drop, 420
dw, 355, 370
E
Empty modules, 288
-enq, 389
-enqueue, 390, 410
Errors/Warnings window, 426
Evals, 383
Evaluation statistic, 383
exact memory model, 310
Expansion, 257
F
Failure count, 361
fanin_different_clks scheme, 210
-fifo_scheme, 287
files
0in_cdc_design.rpt, 454
Questa CDC User Guide, v10.0c_2
October 2011
G
G, 368
g, 369
-glitch, 393
Global CDC preferences, 118
global directives
create_wire, 317
disable_checker, 320
set_cdc_port_domain, 282
set_cdc_preference, 290
set_cdc_reconvergence, 295
set_cdc_report, 299, 300
set_cdc_signal, 302
set_cdc_synchronizer, 305
set_checker_action, 324
set_constant_propagation, 308
set_memory, 310
set_mode, 312
set_mode_control, 313
wildcarded signals, 367
Global reconvergence, 35
Gray-coding protocol, 47
H
-hamming_one, 395
477
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
-handshake_scheme, 287
Hierarchical constraints control file, 118
hierarchical verification
use model, 117
-hold, 407
Homogeneous instances of a block, 128
Hover help, 420
I
-ignore_black_box, 288
Inconclusive, 46
Inferred black box, 70
InfoHub, 21
-input_async, 289
J
jitter, 28
L
l, 351
L/-Lf, 336, 366
lib2v, 379
Liberty technology library, 379
libmapfile, 336, 339
library cells, 379
Library section, 61
-licq, 351
limit_messages, 351
Local reconvergence, 35
-locklib, 328, 329
-loop_no_latch, 262
M
-max_cdc_crossings number, 290
mean-time-between-failure, 26
memory_sync scheme, 223
metastability
cdc_fx checker, 159
fence logic, 30
in hardware, 26
in RTL simulation, 27
injection, 159
metastable flip-flops, 26
registers, 26
windows, 160
modal analysis
capabilities, 132
478
mode
report information, 459
modelsim.ini, 58, 61
modelsimini, 332, 336, 365
Modules window, 450
Move-window button
Buttons
Move-window, 423
MTBF, 26
-mult_fanout_async, 289
multi_bits scheme, 225
-multi_clock_convergence, 288
multi_sync_mux_select scheme, 227
Multibit reconvergence, 35
Multicycle reconvergence, 36
Multiple always blocks, 74
Multiple directives, 254
N
netlist analysis, 45
nl, 351
no_sync scheme, 229, 231
Non-native case directives, 326
O
Objects window, 431
od, 351
out-of-band signals, 30
override_on/override_off, 71
P
Parser directives, 71
Pass count, 361
Path ID, 49
PLI
function calls, 171
Popup menus, 419
port
domain information, 458
Port constraints, 276
-ports, 276
Pragmas, 71
-print_detailed_custom_sync, 287
-print_port_domain_template, 290
Project mode, 91
Project window, 448
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
-promote_reconvergence, 287, 288
Promoted checkers, 48
promotion, 40
pulse_sync scheme, 233
Q
question mark (?) wildcard, 313
R
-rd_ptr, 390
-rd_ptr_check, 390
reconvergence
defined, 35
scheme, 235, 246
Reconvergence depth, 37
redundant scheme, 238, 240
-registered, 410
rel_paths, 351
Report clocks, 93
-report_black_box_recon, 288
Resource libraries, 60
-restore_state, 353
Restrictions
formal block, 70
-rx_clock, 385, 390, 399, 406
-rx_clock_group, 276
-rx_data_select, 386
-rx_data_stable, 386
-rx_done, 402
-rx_done_assert_until_rx_valid_deassert, 401
-rx_min, 401
-rx_reset, 385, 390, 399, 406
-rx_valid, 402
-rx_valid_assert_until_rx_done_assert, 400
-rx_var, 406
S
-sample_data_stability, 288
Saving the current layout, 425
schemes
async_reset, 181
async_reset_no_sync, 184
black_box, 186
bus_dff_sync_gated_clk, 191
bus_four_latch, 193
bus_shift_reg, 195
bus_two_dff, 197
bus_two_dff_phase, 199
CDC, 39
combo_logic, 201
custom_sync, 189, 203, 205
dff_sync_gated_clk, 207
dmux, 208, 244
fanin_different_clks, 210
four_latch, 218
memory_sync, 223
multi_bits, 225
multi_sync_mux_select, 227
no_sync, 229, 231
potential problems, 44
pulse_sync, 233
reconvergence, 235, 246
redundant, 238, 240
shift_reg, 242
two_dff, 251
two_dff_phase, 253
set_black_box, 70
set_constant_propagation, 308
set_memory, 310
-setup, 407
severity level
caution, 39
evaluation, 40
violation, 39
waived, 40
shift_reg scheme, 242
Signal dividers, 444
Signal stability protocol, 46
signals
out-of-band, 30
transmitting, 470
sim, 351
simulation
checkers in simulation, 50
transfer protocol, 30
Single-source reconvergence, 37, 246
Skipping modules, 70
specifying design intent, 47
stability protocol, 46
-stable, 409
Standard options
479
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
definition, 383
Static formal analysis, 91
Statistics
current FIFO entries, 391
cycles checked (evals), 394
dequeues, 391
enqueues, 391
enqueues and dequeues (evals), 391
longest assertion, 387
longest stable time, 396, 410
maximum FIFO entries, 391
maximum turnaround cycles, 403
minimum turnaround cycles, 403
one to zero transition bitmap, 408
sample one bitmap, 407
sample zero bitmap, 407
shortest assertion, 387
shortest stable time, 396, 410
total turnaround cycles, 403
total tx_valid, 403
transfers checked, 387
values checked enqueues and dequeues
(Evals), 410
values checked enqueues and dequeues
(evals), 396
values sampled (evals), 407
zero to one transition bitmap, 408
Status flags, 53
Stretch-shrink bars, 423
structured synchronizers, 31
Stub modules, 288
synchronization
custom modules, 467
data, 42, 43
scheme, 30, 48
synchronizer
ad hoc, 31
asynchronous reset, 468
block diagram, 30
control signal, 31
structured, 31
synthesis_off/synthesis_on, 71
T
Target design, 153
Tasks, 74
480
transfer protocol, 30
translate_off regions, 71
transmitting signals, 470
-turnaround_max, 401
-turnaround_min, 401
two_dff scheme, 251
two_dff_phase scheme, 253
-tx_clock, 385, 390, 395, 399, 406, 409
-tx_clock_group, 276
-tx_data, 385, 399, 409
-tx_data_select, 386
-tx_data_stable, 386
-tx_done, 402
-tx_done_assert_until_tx_valid_deassert, 400
-tx_min, 386, 396, 401
-tx_min_check, 386
-tx_reset, 385, 390, 395, 399, 406, 409
-tx_valid, 399
-tx_valid_assert_until_tx_done_assert, 400
-tx_valid_deassert_until_tx_done_deassert,
400
-tx_var, 395, 406, 409
U
Undock button, 424
Unresolved modules, 369
Unsynthesizable code, 73
Unzoom button, 423
-used, 393
V
v, 340, 341
-var, 393
-vectorize_nl, 289
verification
formal, 49
version, 351
vhctrl, 366
W
Waiver file, 126
Wave view
Bookmarks, 440
wd, 351
Wildcards
Directive order, 259
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Patterns, 257
wildcards
in variables and wire names, 297
question mark(?), 313
with global directives, 267, 302, 367
Windows
CDC checks, 427
Clocks, 451
Design, 449
Details, 430
Directives, 452
Errors/Warnings, 426
Modules, 450
objects, 431
Project, 448
work, 365
-wr_ptr, 390
-wr_ptr_check, 390
X
Xilinx, 63
Y
y, 340
Z
Zoom button, 423
481
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
482
Third-Party Information
This section provides information on open source and third-party software that may be included in the Questa CDC product.
This software application may include google hash table version 1.9 third-party software, which is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. google hash table version 1.9 may be
subject to the following copyrights:
2005, 2006, 2007, 2010, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1996-1999 Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this
permission notice appear in supporting documentation. Silicon Graphics makes no representations about the suitability of
this software for any purpose. It is provided "as is" without express or implied warranty.
1994 Hewlett-Packard Company
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this
permission notice appear in supporting documentation. Hewlett-Packard Company makes no representations about the
suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
This software application may include Aiger third-party software, which is distributed on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND, either express or implied. Aiger may be subject to the following copyrights:
2006-2007, Armin Biere, Johannes Kepler University.
2006, Marc Herbstritt, University of Freiburg.
2006, Daniel Le Berre, Universite dArtois.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This software application may include minisat version 2.0 third-party software, which is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. minisat version 2.0 may be subject to the
following copyrights:
2003-2006, Niklas Een, Niklas Sorensson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This software application may include Open Source SDC Parser version SDC1.8 third-party software. Open Source SDC
Parser version SDC1.8 is distributed under the terms of the Synopsys Open Source License version 1.0 and is distributed
on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the license for the
specific language governing rights and limitations under the license. You can view a copy of the license at:
<your_Mentor_Graphics_documentation_directory>/legal/synopsys_open_source_1.0.pdf.
This software application may include mpich2 version 1.4 third-party software. Portions of mpich2 version 1.4 may be
subject to the Perl Artistic and is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
express or implied. See the license for the specific language governing rights and limitations under the license. You can
view a copy of the license at: <your_Mentor_Graphics_documentation_directory>/legal/perl_artistic_2.0.pdf. mpich2
version 1.4 may be subject to the following copyrights:
2010 Mathematics and Computer Science, Argonne National Laboratory
2010 Argonne Leadership Computing Facility, Argonne National Laboratory
2010 Futures Laboratory, Oak Ridge National Laboratory
Permission is hereby granted to use, reproduce, prepare derivative works, and to redistribute to others.
LICENSE
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer listed in this license in the documentation and/or other materials provided with the distribution.
Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.
The copyright holders provide no reassurances that the source code provided does not infringe any patent, copyright, or
any other intellectual property rights of third parties. The copyright holders disclaim any liability to any recipient for
claims brought against recipient by any third party for infringement of that parties intellectual property rights.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2.
GRANT OF LICENSE. The software installed, downloaded, or otherwise acquired by Customer under this Agreement,
including any updates, modifications, revisions, copies, documentation and design data (Software) are copyrighted, trade
secret and confidential information of Mentor Graphics or its licensors, who maintain exclusive title to all Software and retain
all rights not expressly granted by this Agreement. Mentor Graphics grants to Customer, subject to payment of applicable
license fees, a nontransferable, nonexclusive license to use Software solely: (a) in machine-readable, object-code form (except
as provided in Subsection 5.2); (b) for Customers internal business purposes; (c) for the term of the license; and (d) on the
computer hardware and at the site authorized by Mentor Graphics. A site is restricted to a one-half mile (800 meter) radius.
Customer may have Software temporarily used by an employee for telecommuting purposes from locations other than a
Customer office, such as the employee's residence, an airport or hotel, provided that such employee's primary place of
employment is the site where the Software is authorized for use. Mentor Graphics standard policies and programs, which vary
depending on Software, license fees paid or services purchased, apply to the following: (a) relocation of Software; (b) use of
Software, which may be limited, for example, to execution of a single session by a single user on the authorized hardware or for
a restricted period of time (such limitations may be technically implemented through the use of authorization codes or similar
devices); and (c) support services provided, including eligibility to receive telephone support, updates, modifications, and
revisions. For the avoidance of doubt, if Customer requests any change or enhancement to Software, whether in the course of
receiving support or consulting services, evaluating Software, performing beta testing or otherwise, any inventions, product
improvements, modifications or developments made by Mentor Graphics (at Mentor Graphics sole discretion) will be the
exclusive property of Mentor Graphics.
3.
ESC SOFTWARE. If Customer purchases a license to use development or prototyping tools of Mentor Graphics Embedded
Software Channel (ESC), Mentor Graphics grants to Customer a nontransferable, nonexclusive license to reproduce and
distribute executable files created using ESC compilers, including the ESC run-time libraries distributed with ESC C and C++
compiler Software that are linked into a composite program as an integral part of Customers compiled computer program,
provided that Customer distributes these files only in conjunction with Customers compiled computer program. Mentor
Graphics does NOT grant Customer any right to duplicate, incorporate or embed copies of Mentor Graphics real-time operating
systems or other embedded software products into Customers products or applications without first signing or otherwise
agreeing to a separate agreement with Mentor Graphics for such purpose.
4.
BETA CODE.
4.1. Portions or all of certain Software may contain code for experimental testing and evaluation (Beta Code), which may not
be used without Mentor Graphics explicit authorization. Upon Mentor Graphics authorization, Mentor Graphics grants to
Customer a temporary, nontransferable, nonexclusive license for experimental use to test and evaluate the Beta Code
without charge for a limited period of time specified by Mentor Graphics. This grant and Customers use of the Beta Code
shall not be construed as marketing or offering to sell a license to the Beta Code, which Mentor Graphics may choose not to
release commercially in any form.
4.2. If Mentor Graphics authorizes Customer to use the Beta Code, Customer agrees to evaluate and test the Beta Code under
normal conditions as directed by Mentor Graphics. Customer will contact Mentor Graphics periodically during Customers
use of the Beta Code to discuss any malfunctions or suggested improvements. Upon completion of Customers evaluation
and testing, Customer will send to Mentor Graphics a written evaluation of the Beta Code, including its strengths,
weaknesses and recommended improvements.
4.3. Customer agrees to maintain Beta Code in confidence and shall restrict access to the Beta Code, including the methods and
concepts utilized therein, solely to those employees and Customer location(s) authorized by Mentor Graphics to perform
beta testing. Customer agrees that any written evaluations and all inventions, product improvements, modifications or
developments that Mentor Graphics conceived or made during or subsequent to this Agreement, including those based
partly or wholly on Customers feedback, will be the exclusive property of Mentor Graphics. Mentor Graphics will have
exclusive rights, title and interest in all such property. The provisions of this Subsection 4.3 shall survive termination of this
Agreement.
5.
RESTRICTIONS ON USE.
5.1. Customer may copy Software only as reasonably necessary to support the authorized use. Each copy must include all
notices and legends embedded in Software and affixed to its medium and container as received from Mentor Graphics. All
copies shall remain the property of Mentor Graphics or its licensors. Customer shall maintain a record of the number and
primary location of all copies of Software, including copies merged with other software, and shall make those records
available to Mentor Graphics upon request. Customer shall not make Products available in any form to any person other
than Customers employees and on-site contractors, excluding Mentor Graphics competitors, whose job performance
requires access and who are under obligations of confidentiality. Customer shall take appropriate action to protect the
confidentiality of Products and ensure that any person permitted access does not disclose or use it except as permitted by
this Agreement. Customer shall give Mentor Graphics written notice of any unauthorized disclosure or use of the Products
as soon as Customer learns or becomes aware of such unauthorized disclosure or use. Except as otherwise permitted for
purposes of interoperability as specified by applicable and mandatory local law, Customer shall not reverse-assemble,
reverse-compile, reverse-engineer or in any way derive any source code from Software. Log files, data files, rule files and
script files generated by or for the Software (collectively Files), including without limitation files containing Standard
Verification Rule Format (SVRF) and Tcl Verification Format (TVF) which are Mentor Graphics proprietary syntaxes
for expressing process rules, constitute or include confidential information of Mentor Graphics. Customer may share Files
with third parties, excluding Mentor Graphics competitors, provided that the confidentiality of such Files is protected by
written agreement at least as well as Customer protects other information of a similar nature or importance, but in any case
with at least reasonable care. Customer may use Files containing SVRF or TVF only with Mentor Graphics products. Under
no circumstances shall Customer use Software or Files or allow their use for the purpose of developing, enhancing or
marketing any product that is in any way competitive with Software, or disclose to any third party the results of, or
information pertaining to, any benchmark.
5.2. If any Software or portions thereof are provided in source code form, Customer will use the source code only to correct
software errors and enhance or modify the Software for the authorized use. Customer shall not disclose or permit disclosure
of source code, in whole or in part, including any of its methods or concepts, to anyone except Customers employees or
contractors, excluding Mentor Graphics competitors, with a need to know. Customer shall not copy or compile source code
in any manner except to support this authorized use.
5.3. Customer may not assign this Agreement or the rights and duties under it, or relocate, sublicense or otherwise transfer the
Products, whether by operation of law or otherwise (Attempted Transfer), without Mentor Graphics prior written
consent and payment of Mentor Graphics then-current applicable relocation and/or transfer fees. Any Attempted Transfer
without Mentor Graphics prior written consent shall be a material breach of this Agreement and may, at Mentor Graphics
option, result in the immediate termination of the Agreement and/or the licenses granted under this Agreement. The terms
of this Agreement, including without limitation the licensing and assignment provisions, shall be binding upon Customers
permitted successors in interest and assigns.
5.4. The provisions of this Section 5 shall survive the termination of this Agreement.
6.
SUPPORT SERVICES. To the extent Customer purchases support services, Mentor Graphics will provide Customer updates
and technical support for the Products, at the Customer site(s) for which support is purchased, in accordance with Mentor
Graphics then current End-User Support Terms located at http://supportnet.mentor.com/about/legal/.
7.
AUTOMATIC CHECK FOR UPDATES; PRIVACY. Technological measures in Software may communicate with servers
of Mentor Graphics or its contractors for the purpose of checking for and notifying the user of updates and to ensure that the
Software in use is licensed in compliance with this Agreement. Mentor Graphics will not collect any personally identifiable data
in this process and will not disclose any data collected to any third party without the prior written consent of Customer, except to
Mentor Graphics outside attorneys or as may be required by a court of competent jurisdiction.
8.
LIMITED WARRANTY.
8.1. Mentor Graphics warrants that during the warranty period its standard, generally supported Products, when properly
installed, will substantially conform to the functional specifications set forth in the applicable user manual. Mentor
Graphics does not warrant that Products will meet Customers requirements or that operation of Products will be
uninterrupted or error free. The warranty period is 90 days starting on the 15th day after delivery or upon installation,
whichever first occurs. Customer must notify Mentor Graphics in writing of any nonconformity within the warranty period.
For the avoidance of doubt, this warranty applies only to the initial shipment of Software under an Order and does not
renew or reset, for example, with the delivery of (a) Software updates or (b) authorization codes or alternate Software under
a transaction involving Software re-mix. This warranty shall not be valid if Products have been subject to misuse,
unauthorized modification or improper installation. MENTOR GRAPHICS ENTIRE LIABILITY AND CUSTOMERS
EXCLUSIVE REMEDY SHALL BE, AT MENTOR GRAPHICS OPTION, EITHER (A) REFUND OF THE PRICE
PAID UPON RETURN OF THE PRODUCTS TO MENTOR GRAPHICS OR (B) MODIFICATION OR
REPLACEMENT OF THE PRODUCTS THAT DO NOT MEET THIS LIMITED WARRANTY, PROVIDED
CUSTOMER HAS OTHERWISE COMPLIED WITH THIS AGREEMENT. MENTOR GRAPHICS MAKES NO
WARRANTIES WITH RESPECT TO: (A) SERVICES; (B) PRODUCTS PROVIDED AT NO CHARGE; OR (C) BETA
CODE; ALL OF WHICH ARE PROVIDED AS IS.
8.2. THE WARRANTIES SET FORTH IN THIS SECTION 8 ARE EXCLUSIVE. NEITHER MENTOR GRAPHICS NOR
ITS LICENSORS MAKE ANY OTHER WARRANTIES EXPRESS, IMPLIED OR STATUTORY, WITH RESPECT TO
PRODUCTS PROVIDED UNDER THIS AGREEMENT. MENTOR GRAPHICS AND ITS LICENSORS
SPECIFICALLY DISCLAIM ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT OF INTELLECTUAL PROPERTY.
9.
10. HAZARDOUS APPLICATIONS. CUSTOMER ACKNOWLEDGES IT IS SOLELY RESPONSIBLE FOR TESTING ITS
PRODUCTS USED IN APPLICATIONS WHERE THE FAILURE OR INACCURACY OF ITS PRODUCTS MIGHT
RESULT IN DEATH OR PERSONAL INJURY (HAZARDOUS APPLICATIONS). NEITHER MENTOR GRAPHICS
NOR ITS LICENSORS SHALL BE LIABLE FOR ANY DAMAGES RESULTING FROM OR IN CONNECTION WITH
THE USE OF MENTOR GRAPHICS PRODUCTS IN OR FOR HAZARDOUS APPLICATIONS. THE PROVISIONS OF
THIS SECTION 10 SHALL SURVIVE THE TERMINATION OF THIS AGREEMENT.
11. INDEMNIFICATION. CUSTOMER AGREES TO INDEMNIFY AND HOLD HARMLESS MENTOR GRAPHICS AND
ITS LICENSORS FROM ANY CLAIMS, LOSS, COST, DAMAGE, EXPENSE OR LIABILITY, INCLUDING
ATTORNEYS FEES, ARISING OUT OF OR IN CONNECTION WITH THE USE OF PRODUCTS AS DESCRIBED IN
SECTION 10. THE PROVISIONS OF THIS SECTION 11 SHALL SURVIVE THE TERMINATION OF THIS
AGREEMENT.
12. INFRINGEMENT.
12.1. Mentor Graphics will defend or settle, at its option and expense, any action brought against Customer in the United States,
Canada, Japan, or member state of the European Union which alleges that any standard, generally supported Product
acquired by Customer hereunder infringes a patent or copyright or misappropriates a trade secret in such jurisdiction.
Mentor Graphics will pay costs and damages finally awarded against Customer that are attributable to the action. Customer
understands and agrees that as conditions to Mentor Graphics obligations under this section Customer must: (a) notify
Mentor Graphics promptly in writing of the action; (b) provide Mentor Graphics all reasonable information and assistance
to settle or defend the action; and (c) grant Mentor Graphics sole authority and control of the defense or settlement of the
action.
12.2. If a claim is made under Subsection 12.1 Mentor Graphics may, at its option and expense, (a) replace or modify the Product
so that it becomes noninfringing; (b) procure for Customer the right to continue using the Product; or (c) require the return
of the Product and refund to Customer any purchase price or license fee paid, less a reasonable allowance for use.
12.3. Mentor Graphics has no liability to Customer if the action is based upon: (a) the combination of Software or hardware with
any product not furnished by Mentor Graphics; (b) the modification of the Product other than by Mentor Graphics; (c) the
use of other than a current unaltered release of Software; (d) the use of the Product as part of an infringing process; (e) a
product that Customer makes, uses, or sells; (f) any Beta Code or Product provided at no charge; (g) any software provided
by Mentor Graphics licensors who do not provide such indemnification to Mentor Graphics customers; or
(h) infringement by Customer that is deemed willful. In the case of (h), Customer shall reimburse Mentor Graphics for its
reasonable attorney fees and other costs related to the action.
12.4. THIS SECTION 12 IS SUBJECT TO SECTION 9 ABOVE AND STATES THE ENTIRE LIABILITY OF MENTOR
GRAPHICS AND ITS LICENSORS FOR DEFENSE, SETTLEMENT AND DAMAGES, AND CUSTOMERS SOLE
AND EXCLUSIVE REMEDY, WITH RESPECT TO ANY ALLEGED PATENT OR COPYRIGHT INFRINGEMENT
OR TRADE SECRET MISAPPROPRIATION BY ANY PRODUCT PROVIDED UNDER THIS AGREEMENT.
13. TERMINATION AND EFFECT OF TERMINATION. If a Software license was provided for limited term use, such license
will automatically terminate at the end of the authorized term.
13.1. Mentor Graphics may terminate this Agreement and/or any license granted under this Agreement immediately upon written
notice if Customer: (a) exceeds the scope of the license or otherwise fails to comply with the licensing or confidentiality
provisions of this Agreement, or (b) becomes insolvent, files a bankruptcy petition, institutes proceedings for liquidation or
winding up or enters into an agreement to assign its assets for the benefit of creditors. For any other material breach of any
provision of this Agreement, Mentor Graphics may terminate this Agreement and/or any license granted under this
Agreement upon 30 days written notice if Customer fails to cure the breach within the 30 day notice period. Termination of
this Agreement or any license granted hereunder will not affect Customers obligation to pay for Products shipped or
licenses granted prior to the termination, which amounts shall be payable immediately upon the date of termination.
13.2. Upon termination of this Agreement, the rights and obligations of the parties shall cease except as expressly set forth in this
Agreement. Upon termination, Customer shall ensure that all use of the affected Products ceases, and shall return hardware
and either return to Mentor Graphics or destroy Software in Customers possession, including all copies and
documentation, and certify in writing to Mentor Graphics within ten business days of the termination date that Customer no
longer possesses any of the affected Products or copies of Software in any form.
14. EXPORT. The Products provided hereunder are subject to regulation by local laws and United States government agencies,
which prohibit export or diversion of certain products and information about the products to certain countries and certain
persons. Customer agrees that it will not export Products in any manner without first obtaining all necessary approval from
appropriate local and United States government agencies.
15. U.S. GOVERNMENT LICENSE RIGHTS. Software was developed entirely at private expense. All Software is commercial
computer software within the meaning of the applicable acquisition regulations. Accordingly, pursuant to US FAR 48 CFR
12.212 and DFAR 48 CFR 227.7202, use, duplication and disclosure of the Software by or for the U.S. Government or a U.S.
Government subcontractor is subject solely to the terms and conditions set forth in this Agreement, except for provisions which
are contrary to applicable mandatory federal laws.
16. THIRD PARTY BENEFICIARY. Mentor Graphics Corporation, Mentor Graphics (Ireland) Limited, Microsoft Corporation
and other licensors may be third party beneficiaries of this Agreement with the right to enforce the obligations set forth herein.
17. REVIEW OF LICENSE USAGE. Customer will monitor the access to and use of Software. With prior written notice and
during Customers normal business hours, Mentor Graphics may engage an internationally recognized accounting firm to
review Customers software monitoring system and records deemed relevant by the internationally recognized accounting firm
to confirm Customers compliance with the terms of this Agreement or U.S. or other local export laws. Such review may include
FLEXlm or FLEXnet (or successor product) report log files that Customer shall capture and provide at Mentor Graphics
request. Customer shall make records available in electronic format and shall fully cooperate with data gathering to support the
license review. Mentor Graphics shall bear the expense of any such review unless a material non-compliance is revealed. Mentor
Graphics shall treat as confidential information all information gained as a result of any request or review and shall only use or
disclose such information as required by law or to enforce its rights under this Agreement. The provisions of this Section 17
shall survive the termination of this Agreement.
18. CONTROLLING LAW, JURISDICTION AND DISPUTE RESOLUTION. The owners of certain Mentor Graphics
intellectual property licensed under this Agreement are located in Ireland and the United States. To promote consistency around
the world, disputes shall be resolved as follows: excluding conflict of laws rules, this Agreement shall be governed by and
construed under the laws of the State of Oregon, USA, if Customer is located in North or South America, and the laws of Ireland
if Customer is located outside of North or South America. All disputes arising out of or in relation to this Agreement shall be
submitted to the exclusive jurisdiction of the courts of Portland, Oregon when the laws of Oregon apply, or Dublin, Ireland when
the laws of Ireland apply. Notwithstanding the foregoing, all disputes in Asia arising out of or in relation to this Agreement shall
be resolved by arbitration in Singapore before a single arbitrator to be appointed by the chairman of the Singapore International
Arbitration Centre (SIAC) to be conducted in the English language, in accordance with the Arbitration Rules of the SIAC in
effect at the time of the dispute, which rules are deemed to be incorporated by reference in this section. This section shall not
restrict Mentor Graphics right to bring an action against Customer in the jurisdiction where Customers place of business is
located. The United Nations Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
19. SEVERABILITY. If any provision of this Agreement is held by a court of competent jurisdiction to be void, invalid,
unenforceable or illegal, such provision shall be severed from this Agreement and the remaining provisions will remain in full
force and effect.
20. MISCELLANEOUS. This Agreement contains the parties entire understanding relating to its subject matter and supersedes all
prior or contemporaneous agreements, including but not limited to any purchase order terms and conditions. Some Software
may contain code distributed under a third party license agreement that may provide additional rights to Customer. Please see
the applicable Software documentation for details. This Agreement may only be modified in writing by authorized
representatives of the parties. Waiver of terms or excuse of breach must be in writing and shall not constitute subsequent
consent, waiver or excuse.