LEC Verification Guide
LEC Verification Guide
This guide reviews the key steps in the synthesis verification flow. This guide has
recommendations on RTL Design / Synthesis for ease of verification, running LEC effectively,
resolving abort, debugging non-equivalence and updating LEC dofile, etc that will help
streamline the verification process.
LEC Verification Guide
Copyright Statement
© 2008-2013 Cadence Design Systems, Inc. All rights reserved worldwide. Cadence and the
Cadence logo are registered trademarks of Cadence Design Systems, Inc. All others are the
property of their respective holders.
LEC Verification Guide
Contents
Purpose ....................................................................................................................... 5
RTL Design for Ease of Verification ............................................................................. 5
RTL Coding Guidelines for Ease of Verification ....................................................... 5
Removing Don’t Care Conditions in RTL ................................................................. 6
Removing Don't Care Conditions in RTL.................................................................. 6
Removing Don't Care Conditions in RTL (index out-of-range reading) .................... 6
Removing Don't Care Conditions in RTL (unique case) ........................................... 7
Removing Don't Care Conditions in RTL (X assignment)......................................... 7
Removing Don't Care Conditions in RTL (range constraint)..................................... 8
Structural Implementation in RTL ............................................................................. 8
Design Partitioning in RTL ....................................................................................... 8
Design Report .......................................................................................................... 9
Design Partitioning in RTL (add module hierarchy) .................................................. 9
Design Partitioning in RTL (add module hierarchy) .................................................. 9
Understand Design Verification Complexity ........................................................... 10
Run LEC RTL Rule Checker .................................................................................. 10
Checklist for RTL Designs ...................................................................................... 11
Synthesis for Ease of Verification .............................................................................. 11
Multi-Stage Synthesis ............................................................................................ 12
Embed Verification Requirements in Synthesis...................................................... 12
Module Based Datapath (MDP) Analysis ............................................................... 12
Synthesis Script to Enable MDP Analysis .............................................................. 12
Synthesis Script to Enable MDP Analysis (continued) ........................................... 13
Collecting Synthesis Data ...................................................................................... 13
Qualifying Your Synthesis Environments ............................................................... 13
Checklist for Synthesis ........................................................................................... 14
Running LEC Effectively ............................................................................................ 14
Verification Flow ..................................................................................................... 14
Checklist for Running LEC ..................................................................................... 14
What is an Abort ........................................................................................................ 15
What Causes an Abort? ......................................................................................... 15
LEC Methods to Resolve Abort .............................................................................. 15
Advanced LEC Techniques .................................................................................... 15
User can Help to Resolve Abort ............................................................................. 16
Review Synthesis Flow .......................................................................................... 16
Review LEC Dofile/Logfile ...................................................................................... 16
Make LEC Hierarchical Compare Successful ........................................................ 16
LEC Verification Guide
Purpose
This guide reviews the key steps in the synthesis verification flow. Following are the
recommendations in this guide will help streamline the verification process.
• Adopt RTL coding guidelines for verification and include them into the designer's coding
style guide.
• Being aware of verification during the design stage can streamline all the downstream
synthesis and verification processing.
• Run LEC in the early stages of design.
o Check that the coding guidelines are fulfilled
o Understand verification complexity for your design style and avoid recoding RTL
at the last minute to resolve aborts
LEC Verification Guide
• Resolving aborts
• Diagnosis
• Performing ECO
• Simulation
// RTL
wire A, B[6:0], C[2:0];
// Since the index of B only allows from 0 to 6,
// don't care conditions are introduced when C[2:0] > 6.
A = B[ C[2:0] ];
// RTL without don't care conditions
A = B[ (C[2:0] > 6) ? 0 : C[2:0] ];
In general, the implementation using this coding style is more compact and thus it can yield
optimal synthesis QoR performance.
// RTL
wire sel[1:0];
wire in0, in1, in2;
reg out;
always @(*) // one-hot case selection
unique case (1'b1)
sel[0] : out = in0; // sel = 01
sel[1] : out = in1; // sel = 10
endcase // sel = 00, 11 : don't care
// RTL without don't care conditions
// (branch-1-condition & branch-1-data) |
// ... |
// (branch-n-condition & branch-n-data)
out = (sel[0] & in0) |
(sel[1] & in1);
// RTL
wire sel[1:0];
wire in0, in1, in2;
reg out;
always @(*)
case (sel)
2'b01 : out = in0;
2'b10 : out = in1;
default : out = 1'bx;
endcase
// RTL without don't care conditions
always @(*)
case (sel)
2'b01 : out = in0;
2'b10 : out = in1;
default : out = 1'b0;
endcase
LEC Verification Guide
// RTL (VHDL)
entity mult is
# Since the range is not the full range of the bit vector [1:0],
# don't care conditions are introduced.
port (a, b : IN integer range -1 to 1;
prod : OUT integer);
end mult;
architecture rtl of mult is
begin
prod <= a * b;
end rtl;
// RTL without don't care conditions
entity mult is
# Extend to the full range of the bit vector [1:0]
port (a, b : IN integer range -2 to 1;
prod : OUT integer);
end mult;
architecture rtl of mult is
begin
prod <= a * b;
end rtl;
• As the structural similarity between RTL and the synthesis netlist increases, the ease-of-
verification increases.
• Use detailed structural descriptions in RTL so that structural changes in synthesis are easier
to control.
o For complex arithmetic expressions, introduce intermediate signals and additional
assignments
o Implement datapath word-level structures in an explicit way
Design Report
LEC can report the module size in design hierarchies to help you partition the design into
reasonable sizes.
Example:
============================================
Summary Golden Revised
============================================
Design-modules 31 5
--------------------------------------------
AND * 3323 3821
....
XOR * 2106 0
------ word-level --------------------------
ADD * 40 0
MULT * 2 0
SUBTRACT * 34 0
--------------------------------------------
Total 7927 10158
Make critical intermediate signals in RTL as module boundaries and preserve them during
synthesis.
// RTL
module top (input [31:0] a, b, c, d, e, f, output [31:0] out);
wire [31:0] t;
assign t = a + b + c + d + e;
assign out = t * f;
endmodule
// Recoded RTL
module top (input [31:0] a, b, c, d, e, f, output [31:0] out);
wire [31:0] t;
// add module for preserving intermediate RTL signals
new_mod i0 (a, b, c, d, e, t);
assign out = t * f;
endmodule
// add additional module hierarchy
module new_mod (input [31:0] a, b, c, d, e, output [31:0] t);
assign t = a + b + c + d + e;
endmodule
Convert critical functions in RTL to modules and preserve the module boundaries during
synthesis.
LEC Verification Guide
// RTL
module top (input [31:0] a, b, c, d, e, f, output [31:0] out);
wire [31:0] t;
function [31:0] func_add;
input [31:0] a, b, c, d, e;
begin func_add = a + b + c + d + e; end
endfunction
assign t = func_add(a, b, c, d, e);
assign out = t * f;
endmodule
// Recoded RTL
module top (input [31:0] a, b, c, d, e, f, output [31:0] out);
wire [31:0] t;
// Convert the function into module
new_mod i0 (a, b, c, d, e, t);
assign out = t * f;
endmodule
// add additional module hierarchy
module new_mod (input [31:0] a, b, c, d, e, output [31:0] t);
assign t = a + b + c + d + e;
endmodule
• Run LEC in an early design stage to understand the verification complexity of the design
style.
• If the design has aborts, LEC can analyze the abort point.
• Example:
• -----------------------------------------------
• Compared result is abort.
• (G) + 38 PO /O1
• (R) + 38 PO /O1
• -----------------------------------------------
• Don't care condition
• 1) (G) X-assignment
• rtl.v:line 17, column 319
• -----------------------------------------------
• Similarity degree of the abort point fanin cone
• 20% fanin cone of gate O1
• -----------------------------------------------
• Datapath resources which cause abort:
• 1) (G) Datapath_module instance
• rtl.v:line 5, column 346
-----------------------------------------------
• Check the rules that highlight potential ambiguities in verification, such as simulation
mismatches.
• Ensure that there are no error/warning messages reported by RTL rule checks. To specify
rule severity:
Example:
Multi-Stage Synthesis
The basic guideline for ensuring ease of verification is to break down the difficulty in order to
verify synthesis optimizations in stages.
• To deploy a synthesis flow that is easy to verify, embed the verifications into the
synthesis scripts instead of re-synthesizing after running into verification challenges.
• Control synthesis options that impact verification, such as:
o Range constraint optimization
o Datapath synthesis, resource sharing
o Ungrouping, boundary optimizations, and clock gating
• Allow for a range of verification requirements to allow for trade-offs in verifiability
MDP analysis requires that synthetic datapath modules be preserved during synthesis. MDP
analysis is performed in order to improve the quality of the operator-level analysis.
• compile_ultra_mdp procedure is invoked before the first compile command in the DC script
• design_module argument in the procedure is the name of the top module that is
synthesized
Preserve Hierarchy of
MDP Level Boundary Optimization Sequential Output Inversion
DP/DW Design
1 YES NO ALLOW ALLOW
2 YES NO DISABLE ALLOW
3 YES NO DISABLE DISABLE
4 YES YES DISABLE DISABLE
During the synthesis process, the following information should be collected for verification:
• Datapath resource file: Required to ensure that datapath intensive design can be easily
verified
• Change name file: Required to ensure name-based mapping for ease of verification
• Synthesis log file: Can contain information to help guide the setup of the verification
Check Items
Use 2-step synthesis (RTL to first mapped, first mapped to final netlist)
Use MDP synthesis flow
Only incremental optimization is used for gate-to-gate compare
Collect datapath resource file and synthesis logfile
• Standardize on a dofile
• Deploy advanced features
• Review dofiles regularly
Verification Flow
What is an Abort
• All formal verification tools have a worst-case scenario where it takes an exponential
amount of time to complete
• To avoid the unrealistically long execution and to give a timely response, LEC aborts the
comparison
• Abort is a notion that LEC finds it not likely to prove or disprove the equivalence
relationship within a reasonable amount of time
• Abort also means that LEC will need much more effort and time on the proof, after which it
still may not resolve them
• Design size
o The larger the size of the design, the more difficult it can be to compare
o Ungrouping design modules or boundary optimization increases the design size
• Design similarity
o Less design similarity makes compare more difficult
o Advanced synthesis optimization usually decreases the design similarity
• Design function
o More complex function such as don't care conditions or datapath makes compare
more difficult
o Synthesis has more chance to optimize the design with datapath or don't care
conditions
• Hierarchical comparison
o For abort modules, check that no sub-modules (primitive size larger than 5k) are not
blackboxed
• For datapath-intensive designs
o Check that MDP has been used (analyze datapath –module)
o Check that datapath analysis is successful
• Abort Analysis
o Check that LEC abort analysis has been used (analyze abort)
• Multithreading
o Check that multithreading is used for abort analysis
• Sub-modules with high compare complexity must use hierarchical compare to resolve abort
• For hierarchical compare to be successful, it needs to keep the module boundary and
disable all the optimizations across boundary
o Preserve module boundary
o Disable clock gating
o Disable boundary optimizations
• LEC can report the reason that hierarchical compare cannot be applied on the module
LEC Verification Guide
• It can guide the user to adjust the synthesis flow to generate the netlist in which the sub-
module can run hierarchical compare
Abort Diagnosis
• When aborts cannot be completely resolved, identifying the region where aborts occurred:
o Allows for more targeted re-synthesis
o Allows for better understanding on the netlist that leads to abort
o Allows for additional verification to these smaller regions
• Techniques for isolating aborts:
o Ensure that the modules are hierarchically compared
Easier if RTL is partitioned well
o In MDP analysis flow, abstracted datapath cluster can be automatically isolated
• Narrow down the abort region. Instead of reporting all fanout keypoints from the datapath
module as abort, only the datapath module is reported as abort (See next slide)
• Invoke abort isolation using the following command:
[-resourcefile <filename>]
• Automatically generate a testcase for the abort datapath module using the following
command:
• ============================================
• compared points PO Total
• -------------------------------------------
• Equivalent 256 256
• ============================================================
• Compared results of isolated instances in Revised design (top)
• ============================================================
• Status Instance (Module)
• ------------------------------------------------------------
• Abort i0/add_1_S1_DP_OP_1_1
• (block_add_1_S1_DP_OP_1_1)
• ============================================================
Unresolved Aborts
When an abort cannot be resolved, running the following methods on the abort points can
increase the chance to detect non-equivalence if it exists in the designs:
• Simulation
• Functional partition
• Set LEC compare effort as complete
Debugging NEQs
• Remove sequential elements that are not in loops from circuits by using remodel -seq2buf
-all -both to see if the NEQs exist in the combinational logic
• When high numbers of NEQs are reported, make sure verification environment is properly
setup
o Missing top-level constraints (test mode vs. function mode)
o Missing design files, library files
• Large number of unbalanced DFF and DLAT in golden and revised
o set flatten mode –latch_fold is turned on?
• RTL elaboration differences
• LEC incomplete modeling
Incomplete Modeling
• Check modeling messages to see if modeling options are correctly enabled or disabled with
report message -modeling
• When majority of the design is properly setup, invoke analyze noneq -verbose to see
possible causes
• Correlate synthesis log with LEC modeling messages:
o Use read setup information file_name -type RCLOG | DCLOG
o Check missing sequential constants and constant values
o Check missing and/or incorrect sequential merges
• Clock gating issues
• Check wire-resolution behavior
• Check for same number of cut points created to break feedback paths between golden and
revised
• Using set analyze option -auto -effort high for high effort automatic analyze setup
• Invoke analyze setup -verbose twice
• Invoke analyze setup –effort high after compare
• Use the -repeat option for the remodel command
• Use set flatten model -loop_as_dlat if the NEQ key points involving unbalanced
number of DLATs and CUTs
• Use analyze setup -cut to fix the cut point positions
• Use abstract logic to abstract away state-holding loops
Check Items
Use phase mapping when the mapping is successful and compare is NEQ
Use renaming rules for verifying the synthesis flows that involve name changes
Use analyze setup to automatically correct setup issues
Use analyze noneq to determine the causes of the NEQs
Use diagnose to debug specific compare points
Make sure retiming modules are verified separately from the rest of the designs
Getting Help
• Providing a testcase is the best way to help Conformal improve the capability and help you
resolve the verification issues
• Saved sessions are limited in usefulness for debugging
o Cannot view RTL files, resource files, netlist information, etc.
o Cannot provide RTL recoding
• Review LEC Web Interface documents to see if any latest features can be applied
• Running LEC early and often and reporting LEC issues to Cadence early will provide us time
to investigate and resolve them in a timely manner
Check Items
All the necessary design files to reproduce the problem
LEC dofile and logfile
LEC project directory
Synthesis logfile, resourcefile and other report files
LEC Verification Guide