Conformal Lec Training Basic Advance
Conformal Lec Training Basic Advance
Conformal Lec Training Basic Advance
Conformal
LEC
Logic Equivalence Checker
Basic Training Manual
Verplex
Systems, Inc.
2 CADENCE CONFIDENTIAL
Getting Help
You can get help with Cadence software
from the following sources:
Education Services training materials
SourceLink service on the Internet:
sourcelink.cadence.com
OR go to the Cadence home page
(http://www.cadence.com).
Select the Customer Support link.
You must have a maintenance contract to log in (authorization
number).
Customer Response Center (CRC) or send your
request to support@cadence.com
3 CADENCE CONFIDENTIAL
Agenda of Conformal LEC Basic
Training
Overview of Verplex formal verification tools
Conformal
LEC usage
Introduction to LEC
A typical session (flat compare)
Hierarchical compare
4 CADENCE CONFIDENTIAL
Overview of Verplex formal
verification tools
5 CADENCE CONFIDENTIAL
Formal verification
A systematic method that uses mathematical
proof to check the designs properties
Advantages of formal verification
Enable "White box" verification
No test vectors required
Exhaustive verification
Find bugs earlier
Speed
6 CADENCE CONFIDENTIAL
Functional Closure
Verplex enables you to obtain the Golden
RTL that meets the functional specifications
Verplex ensures that the functionality of the
final layout matches that of the Golden RTL
Final
Layout
Golden
RTL
RTL
Blocks
RTL
Blocks
Functional
Specification
RTL
Blocks
Property
Checking
Logical
consistency
Structural
consistency
Clock
synchronization
Structural
consistency
Semantic
consistency
Clock
synchronization
Implementation
Verification
Our formal technology enables you to catch bugs
Earlier Target a class of bugs typically found with
simulation late in the design cycle
Faster Formal is magnitudes faster than simulation
Easier No test vectors required, easy debugging
7 CADENCE CONFIDENTIAL
VERPLEX Conformal Solution Overview
Conformal Custom
Extends EC to Cust. Log &
memory
Extends EC to
custom logic
and memory
Conformal ASIC
Property Checking
Verifies
Clock domain
crossings
Semantic
consistency
Structural
consistency
Design it golden - keep it golden.
TM
Conformal Ultra
Extends EC to Datapath
RTL-gate
Equivalence Checking
(EC)
Conformal ASIC
Equivalence Checker
RTL-gate
Equivalence Checking
(EC)
Verifies
Clock domain
crossings
Structural
consistency
RTL GDSII Gate
Design
Implementation
Physical
Implementation RTL GDSII Gate
Design
Creation
Design Flow
Functional
Specification
8 CADENCE CONFIDENTIAL
Assertion Based Property Checker
Pre-Defined
Checks
(automatic)
Done Done
Pass
HDL
design
Fail Debug
Proof Proof
engine engine
Verplex Formal Verification Solution
9 CADENCE CONFIDENTIAL
Assertion Based Functional Checker
Pre-Defined Checks (PDC)
Automatically checks for
Asynchronous clock domain crossing
Clock domain analysis
Structural checks for metastability prevention
Functional checks for data stability
Semantic inconsistency
full_case/parallel_case
range-overflow conditions
X-assignment
Structural inconsistency
Tri-state enable stuck-at conditions
Simultaneous set-reset conflict
Conflicting values on multi-port latches
Bus contention and bus floating
Verplex Formal Verification Solution
10 CADENCE CONFIDENTIAL
Conformal LTX Logic Transistor
Extraction
Module xor(y, a, b)
input a,b;
output y;
y = (~a&b) | (a&~b);
endmodule
RTL
Abstract
transistor-level
circuitry into gate-
level
Enable
equivalence
checking
Conformal LEC
Conformal LTX
Gate-Level
SPICE
Verilog
or CDL
Verplex Formal Verification Solution
11 CADENCE CONFIDENTIAL
Conformal LEC Logic Equivalence
Checker
Largest designs with the highest
completion rate
Handles even complex logic
Verifies any step back to original
RTL
Accommodates any combination:
RTL and gate, flat or hierarchical
Easiest to use
Annotated error patterns
RTL-gate cross highlighting
Logic cone schematic display
Highest performance
Flat R2G compare: 1hr / 1M gates
Flat G2G compare: 20min / 1M
gates
Verplex Formal Verification Solution
12 CADENCE CONFIDENTIAL
Conformal LEC Usage
13 CADENCE CONFIDENTIAL
LEC usage
Introduction to LEC
Getting familiar with LEC
LEC modes of operation
LEC flow
A typical session (flat compare)
Hierarchical compare
14 CADENCE CONFIDENTIAL
Getting familiar with LEC
Starting and exiting LEC
LEC GUI environment
LEC command conventions
3-2-1
Add/Delete/Report
Convenient features
Online help and documentation
15 CADENCE CONFIDENTIAL
Starting and exiting LEC
Starting LEC
GUI mode: UNIX% lec
Non-GUI mode: UNIX% lec -nogui
Switch GUI & non-GUI modes (anytime during LEC session)
LEC> set gui [on | off]
Batch mode:
UNIX % lec -dofile <batch_file> -nogui
LEC> dofile <batch_file>
Exiting LEC
LEC> exit -force
LEC automatically closes all windows upon exit
16 CADENCE CONFIDENTIAL
GUI environment
Mode Read lib Read design
Golden Revised
Design
hierarchy
Messages
Command Entry window
Read Design
window
File list area
Selected file area
Browser
File
filter
Design type
LEC
window
Transcript
window
17 CADENCE CONFIDENTIAL
Command: 3-2-1 convention
Most three-word commands can be abbreviated
Example:
SETUP> add pin constraint 0 scan_en
can be written as:
SETUP> add pi c 0 scan_en
If 3-2-1 convention does not produce unique
command, more letters may be added
add in c ADD INstance Constraint
add pi c ADD PIn Constraint
set lo f SET LOg File
3-2-1 convention Commands
18 CADENCE CONFIDENTIAL
Add/Delete/Report convention
For every ADD command, there is a corresponding
REPORT and DELETE command
For example, if you specify:
SETUP> ADD PIn Constraint 0 scan_en
To report all pin constraints:
SETUP> REPort PIn Constraint
To remove the added constraint:
SETUP> DELete PIn Constraint scan_en
19 CADENCE CONFIDENTIAL
Convenient features
Rerun previous command
Up and down arrow keys help avoid retyping previous
commands
Alias
Alias command usage: add alias <name> <string>
Example alias in .conformal_lec file:
add alias setup set system mode setup
Initial command file, .conformal_lec, executed in the following
order (3.4.0.a or later ):
a. Verplex install directory: $VERPLEX_HOME/lib/.conformal_lec
b. Home directory: ~/.conformal_lec
c. Current working directory: ./.conformal_lec
20 CADENCE CONFIDENTIAL
Online help and documentation
Access location of the PDF format manuals:
Commands: List of all command options, usage, examples,
and related commands
Reference Manual: PDF format file of command reference
with detailed command usage and definitions
User Manual: PDF format file with information related to the
product (for example; installation, process flow, and GUI)
Directory location of the PDF format manuals:
$VERPLEX_HOME/doc
21 CADENCE CONFIDENTIAL
LEC usage
Introduction to LEC
Getting familiar with LEC
LEC modes of operation
LEC flow
A typical session (flat compare)
Hierarchical compare
22 CADENCE CONFIDENTIAL
Modes of operation
SETUP mode
Saving LEC transcript to a log file
Specifying black boxes
Reading libraries and designs
Specifying design constraints
Specifying modeling directives
LEC mode
Mapping process
Resolving unmapped key points
Compare process
Debugging non-equivalent key points
Report run statistics
23 CADENCE CONFIDENTIAL
Switching modes of operation
GUI: click
Command: set system mode [lec | setup]
24 CADENCE CONFIDENTIAL
LEC usage
Introduction to LEC
Getting familiar with LEC
LEC modes of operation
LEC flow
A typical session (flat compare)
Hierarchical compare
25 CADENCE CONFIDENTIAL
No
Equivalence Equivalence
established established
Differences ? Differences ?
Yes
All mapped ? All mapped ?
Specify constraints Specify constraints
& other parameters & other parameters
Golden Golden
Analyze Analyze
Yes
Debug Debug
Fix design Fix design
No
Revised Revised
Map key points Map key points
Compare key points Compare key points
ASIC
Lib
ASIC ASIC
Lib Lib
LEC flow
Setup
mode
LEC
mode
26 CADENCE CONFIDENTIAL
LEC usage
Introduction to LEC
Getting familiar with LEC
LEC modes of operation
LEC flow
A typical session (flat compare)
Hierarchical compare
27 CADENCE CONFIDENTIAL
A typical session (flat compare)
Saving LEC transcript to a log file
Specifying black boxes
Reading libraries and designs
Specifying design constraints
Specifying modeling directives
Switching to LEC mode
Mapping process
Resolving unmapped key points
Compare process
Debugging non-equivalent key points
Report run statistics
LEC
SETUP
28 CADENCE CONFIDENTIAL
Saving LEC transcript to a log file
Example 1:
Specify the name of the log file where LEC session
transcript is to be written
set log file logfile -replace
...
set log file logfile -replace
...
Example 2:
Note: $LEC_VERSION is automatically set to the current LEC version
set log file logfile.$LEC_VERSION -replace
...
set log file logfile.$LEC_VERSION -replace
...
29 CADENCE CONFIDENTIAL
A typical session (flat compare)
Saving LEC transcript to a log file
Specifying black boxes
Reading libraries and designs
Specifying design constraints
Specifying modeling directives
Switching to LEC mode
Mapping process
Resolving unmapped key points
Compare process
Debugging non-equivalent key points
Report run statistics
LEC
SETUP
30 CADENCE CONFIDENTIAL
Black box
Module types
RAM, ROM, analog, behavioral, or
any module you dont want to verify
Allows wildcard(*) specification
Black box connections are verified
RAM
ALU CTRL
31 CADENCE CONFIDENTIAL
Specifying black boxes
Execute black boxing command before module is
read in
For missing module, create one with just
input/output declaration
set log file logfile.$LEC_VERSION replace
setenv LIB /user1/lib/verilog/
add notranslate module *ram* hstm -full -both
read library $LIB/verilog/*.v -verilog both
...
set log file logfile.$LEC_VERSION replace
setenv LIB /user1/lib/verilog/
add notranslate module *ram* hstm -full -both
read library $LIB/verilog/*.v -verilog both
...
module sram1(in1, in2, out2, out2);
input in1, in2;
output out1, out2;
//empty
endmodule
module sram1(in1, in2, out2, out2);
input in1, in2;
output out1, out2;
//empty
endmodule
32 CADENCE CONFIDENTIAL
Reporting black boxes
SETUP> report black box
Check for unbalanced black boxes in the
Golden and Revised
LEC window
SETUP> report black box
SYSTEM: (G R) ram8x256
SYSTEM: (G R) hstm
SETUP> report black box
SYSTEM: (G R) ram8x256
SYSTEM: (G R) hstm
33 CADENCE CONFIDENTIAL
A typical session (flat compare)
Saving LEC transcript to a log file
Specifying black boxes
Reading libraries and designs
Specifying design constraints
Specifying modeling directives
Switching to LEC mode
Mapping process
Resolving unmapped key points
Compare process
Debugging non-equivalent key points
Report run statistics
LEC
SETUP
34 CADENCE CONFIDENTIAL
Supported formats
Library
Verilog (standard simulation libraries)
Liberty
LEC
Logic Equivalence Checker
Advanced Training Manual
Verplex
Systems, Inc.
163 CADENCE CONFIDENTIAL
Agenda
1. LEC-1 review
2. Mapping Problems
3. Debugging & Diagnosis Tips
4. Multipliers
5. Resolving abort key points
6. RTL coding guidelines
7. Labs
164 CADENCE CONFIDENTIAL
1. LEC-1 review
165 CADENCE CONFIDENTIAL
LEC-1 review
LEC modes of operation
LEC flow
A typical LEC session (flat comparison)
Hierarchical comparison session
166 CADENCE CONFIDENTIAL
LEC modes of operation
SETUP mode
Specifying black boxes
Reading libraries and designs
Specifying design constraints
Specifying modeling directives
LEC mode
Mapping process
Resolving unmapped key points
Compare process
Debugging non-equivalent key points
167 CADENCE CONFIDENTIAL
LEC flow
No
Equivalence Equivalence
established established
Differences ? Differences ?
Yes
All mapped ? All mapped ?
Specify constraints Specify constraints
& other parameters & other parameters
Golden Golden
Analyze Analyze
Yes
Debug Debug
Fix design Fix design
No
Revised Revised
Map key points Map key points
Compare key points Compare key points
ASIC
Lib
ASIC ASIC
Lib Lib
Setup
mode
LEC
mode
168 CADENCE CONFIDENTIAL
A typical LEC session (flat compare)
Saving LEC transcript to a log file
Specifying black boxes
Reading libraries and designs
Specifying design constraints
Specifying modeling directives
Switching to LEC mode
Executing mapping process
Resolving unmapped key points
Executing comparison process
Debugging non-equivalent key points
Reporting run statistics
LEC
SETUP
169 CADENCE CONFIDENTIAL
Hierarchical Comparison session
Saving LEC transcript to a log file
Specifying black boxes
Reading libraries and designs
Specifying design constraints
Specifying modeling directives
Generating a hierarchical compare script
Executing the hierarchical compare script
Analyzing comparison result
Reporting run statistics
LEC
SETUP
170 CADENCE CONFIDENTIAL
2. Problem of Mapping key points
171 CADENCE CONFIDENTIAL
What is key point mapping?
Pairing corresponding key points: PIs, POs,
DFFs, D-latches, black boxes, Z gates, cut gates
Key points
Combinatorial logic
172 CADENCE CONFIDENTIAL
Mapping problem: Special cases
Black boxes
Module pins
Phase inversion
173 CADENCE CONFIDENTIAL
Mapping black boxes
Problem:
Module names are different (e.g, parameterized modules)
By default, LEC doesnt map black boxes of different module
names, even though instance names are the same
Solutions:
Manual mapping
Add mapping point <golden_bbox> <rev_bbox>
Turn off default mode:
set mapping method -nobbox_name_match
Match module names with renaming rule
add renaming rule <rule_id> <> <> -module
174 CADENCE CONFIDENTIAL
Mapping module pins
Problem:
Black box pins not mapped due to name differences
To see how the pins are mapped:
report map point <black_box> -input -output
Solution:
Apply renaming rule to the pin
Syntax: add renaming rule name_name \
<search_string> <replace_string> -pin -bbox \
<module_name> [-golden|-revised]
175 CADENCE CONFIDENTIAL
Phase inverted mapping: Problem
DFF/DLAT implemented with phase inverted library
cells (inverted data, set/reset swapping)
RST
D Q
R
S
IN OUT
CLK
U1_reg
RST
D Q
R
S
IN OUT
CLK
U1_reg
Golden
Revised
U1_reg must be phase-mapped
176 CADENCE CONFIDENTIAL
Phase inverted mapping: Solution
Enable phase map method
read design cpu_rtl.v -verilog -golden
read design cpu_netlist.vg -verilog -revised
set mapping method -phase
set system mode lec
...
read design cpu_rtl.v -verilog -golden
read design cpu_netlist.vg -verilog -revised
set mapping method -phase
set system mode lec
...
Faster if phase map only applies on phase-inverted cells
read design cpu_rtl.v -verilog -golden
read design cpu_netlist.vg -verilog -revised
add mapping model <cell_name* > -invert revised
set mapping method -phase
set system mode lec
...
read design cpu_rtl.v -verilog -golden
read design cpu_netlist.vg -verilog -revised
add mapping model <cell_name* > -invert revised
set mapping method -phase
set system mode lec
...
Note: add mapping model command is not documented
177 CADENCE CONFIDENTIAL
3. Debugging & Diagnosis
178 CADENCE CONFIDENTIAL
Debugging non-equivalent key
points
Diagnosis tips
Diagnose smaller cone first
Using the Mapping Manager to sort key points
by supporting size
Concentrate on one logic cone at a time
Diagnosis tools
Diagnosis Manager
Schematic Viewer
Source Code Manager
Gate Manager
179 CADENCE CONFIDENTIAL
Diagnosis Manager
Compared Point
Diagnosis Point (Active)
Diagnosis Points
Corresponding Support
Non-corresponding Support
Non-corresponding,
and not mapped (red)
Non-corresponding, but
mapped (yellow with M)
M
Error Patterns Error Candidates
180 CADENCE CONFIDENTIAL
How do I debug from the Diagnosis
Manager?
Non-corresponding support points hint at setup or mapping
problems
Shows unconstrained signals (e.g., scan_en, undriven signals)
shows incomplete mapping, possible sequential optimization, merging,
and replication
Invoke the Schematic Viewer to view logic cones
Examine the simulation patterns in the corresponding supports
Look for common values in all reported test vectors
Examine non-equivalence support points (red color code)
need phase mapping?
incorrect mapping?
Invoke Schematic Viewer & Source Code Viewer to debug
181 CADENCE CONFIDENTIAL
Typical false non-equivalence: Setup
problems
Missing constraints
Need to disable scan-chain and JTAG test logic when
verifying normal mode of operation
Tie off undriven signals
Missing modeling directives
Modeling options are specific to synthesis tools and ASIC
library vendors. User must turn on appropriate modeling
directives
Example: Folding D-latch that models a DFF
set flatten model -latch_fold
182 CADENCE CONFIDENTIAL
More typical causes of false non-
equivalence
Unbalanced black-boxes
Use LEC commands :
report design data
report black box
Port order inverted for black-boxes (undefined cell)
set undef cell black -noascend
Not phase mapped
Phase map method is off by default for optimal runtime
Symptom shows non-equivalence on Data, Set, and Reset
cones
Can try prove <golden_ID> <revised_ID> -invert
183 CADENCE CONFIDENTIAL
Debug non-equivalence: Hierarchical
compare
Isolate problem module
Reduce cone size for easier debugging
Refer to Hierarchical Comparison section for how
to set up
184 CADENCE CONFIDENTIAL
4. Multipliers
185 CADENCE CONFIDENTIAL
Introduction
Multipliers can take a long time to compare due to
Unmatched architectures
Operand swapping
Solution:
Match multiplier architectures
Swap operands
186 CADENCE CONFIDENTIAL
DC synthesized multipliers
DesignCompiler
TM
uses DesignWare
TM
components
to implement arithmetic operators, comparators, etc.
assign z = a * b;
<mod>_DW02_mult U1 (.A(a), .B(b), .TC(1b0),
.PRODUCT(z));
Three DW multiplier architectures
Carry Save Adder (CSA): DW Basic
Wallace Tree (WALL): DW Foundation required
Non-Booth Wallace Tree (NBW): DW Foundation required
(new in DC 99.05)
Report architectures from DC command
dc_shell>report_resources
187 CADENCE CONFIDENTIAL
Explicit control of DC implementation
module foo (in1, in2, out);
input [9:0] in1, in2;
output [19:0] out;
// synopsys dc_script_begin
// set_implementation wall
// synopsys dc_script_end
assign out = in1 * in2;
endmodule
LEC understands this embedded script and will
create specified architecture
LEC also understands analogous VHDL syntax
188 CADENCE CONFIDENTIAL
Instantiated multiplier or divider
Multiplier or divider instantiated in RTL
DW02_mult #(A_width, B_width) U1 (.A(a),
.B(b), .TC(1b1), .PRODUCT(z);
DW02_divide #(A_width, B_width, TC_mode)U2
(.A(a), .B(b), .TC(tc),
.DIVIDE_BY_0(div_by_0),
.QUOTIENT(result));
LEC has a built-in representation for DW02_mult
and DW02_divide
Do not read in the simulation models (for example:
DW02_mult.v)
189 CADENCE CONFIDENTIAL
Long runtime due to multipliers?
Check to see if there are any multipliers in the design
LEC> report design data
Matched architecture will be compared faster
...
------ word-level --------------------------
ADD * 55 0
MULT * 3 0
BBOX 2 2
--------------------------------------------
Total
Transcript window
...
------ word-level --------------------------
ADD * 55 0
MULT * 3 0
BBOX 2 2
--------------------------------------------
Total 1058 1058
1058 1058
190 CADENCE CONFIDENTIAL
Matching multiplier architecture
Method 1: LEC commands
Automatic (recommended)
set multiplier option
Manual
set multiplier implementation
Method 2: Verplex directive
Hard-coded in RTL
191 CADENCE CONFIDENTIAL
LEC automatically
chooses best matching architecture
swaps the operand order if necessary
Requirement:
specify command: set multiplier option auto
version 4.0.1.a or later
multiplier module must have boundary
Advantage:
User doesnt need to know the revised architecture
Push-button solution
Disadvantage:
Doesnt work on multiplier with no module boundary
Matching multiplier architecture:
Automatic
192 CADENCE CONFIDENTIAL
User manually specifies
Which type of architecture to set
Operand swapping
Requirement:
Specify command:
set multiplier implementation <auto | CSA |
WALL | NBW | RCA | BKA>
auto default, choose NBW if combined input width < 52, WALL
otherwise
CSA, WALL, & NBW correspond to DC architectures
RCA Ripple Carry Adder
BKA BuildGate
TM
architecture
Command must be executed before the read design
command
Matching multiplier architecture:
Manual
193 CADENCE CONFIDENTIAL
Matching multiplier architecture:
Manual (contd)
Advantage
Doesnt require module boundary for multiplier modules
Disadvantage
Users knowledge of the Revised architecture
194 CADENCE CONFIDENTIAL
Matching multiplier architecture:
Verplex directive
module foo (a, b, c, d, out1, out2);
input [7:0] a, b, c, d;
output [7:0] out1, out2;
// verplex multiplier wall
assign out1 = a * b;
assign out2 = c * d;
endmodule
Only the next statement is affected by directive
Implement out1 with WALL architecture
out2 will use the default implementation
195 CADENCE CONFIDENTIAL
Operand swapping
Multiplier structures are not symmetric
Comparing multipliers with different operand order can also
take a long time
Synthesis tools might swap the operand order (usually
happens in VHDL)
set multiplier implementation [-noswap |
-swap | -autoswap]
noswap - do not swap operands
swap - swap operands
autoswap - first operand is the largest
Dont have to specify swapping if set multiplier
option auto command is used
May have to re-code RTL to control operand ordering
196 CADENCE CONFIDENTIAL
Isolating multiplier modules
Multiplier logic is complex and hard to
compare
Isolating to compare multiplier modules and
compare them separately can help the
compare process
Two ways to isolate multiplier modules
Flat compare: Black box multiplier modules and
compare separately
Hierarchical compare: Please refer to the
Hierarchical Compare section
197 CADENCE CONFIDENTIAL
5. Resolving abort key points
198 CADENCE CONFIDENTIAL
Introduction
What are abort points?
Investigate RTL causing abort
Dont Cares
Data Path
What to do if compare aborts:
Increase compare effort (first resort)
Partition large logic cones
Hierarchical compare
Key point partition -automatic
Key point partition -manual
199 CADENCE CONFIDENTIAL
What are abort points?
Key points that have neither been proven
equivalent nor non-equivalent, based on the
current compare effort algorithms
Abort points can be attributed to large logic cone
sizes with large numbers of support points
Abort points can also be attributed to different
structures with dont care conditions (RTL-gate)
200 CADENCE CONFIDENTIAL
Investigating RTL dont cares
Please see RTL coding guideline section
Dont cares
Use LEC to report dont cares in logic cone:
report map point <abort_point> -property
Note: -property option is not documented
full case/parallel case/x-assignments are common source of
dont cares
re-coding RTL to get rid of dont cares might help
201 CADENCE CONFIDENTIAL
Investigating RTL data path
Operator ordering
Multiplier - refer to the Multiplier section
202 CADENCE CONFIDENTIAL
Operator ordering
LEC operator tree implementation
z = a * b * c * d; z = (a * b) * (c * d);
a b c d
z
a b c d
z
203 CADENCE CONFIDENTIAL
Operator ordering
Different logical structures can exacerbate situation
RTL ordering Netlist ordering
z = a * b * c * d; (a * b) * (c * d);
a b c d
z
a b c d
z
Changing RTL to match the netlist ordering can
make comparison faster
204 CADENCE CONFIDENTIAL
Identifying abort points in LEC
GUI: yellow-filled circle on Mapping Manager
Non-GUI: LEC> rep compare data -class abort
Abort key points
are shown with
yellow-filled circle
205 CADENCE CONFIDENTIAL
Resolving abort points:
Increase compare effort
Default compare effort: low
Can be changed to high or super
Should be used after low-effort run is completed (to avoid
"expensive" methods used on easy compare points)
set log file logfile.$LEC_VERSION -replace
read design cpu_rtl.v -verilog -golden
read design -f verilog.vc -verilog -revised
set system mode lec
add compare points -all
compare
//set compare effort auto will automatically switch to super compare
effort to aborted key points
report compare data -abort
set compare effort high
compare
...
set log file logfile.$LEC_VERSION -replace
read design cpu_rtl.v -verilog -golden
read design -f verilog.vc -verilog -revised
set system mode lec
add compare points -all
compare
//set compare effort auto will automatically switch to super compare
effort to aborted key points
report compare data -abort
set compare effort high
compare
...
206 CADENCE CONFIDENTIAL
Resolving abort points:
Partition large logic cone
Hierarchical compare
Key point partition - Automatic
Key point partition - Manual
207 CADENCE CONFIDENTIAL
Hierarchical compare
Narrows down abort modules
Reduces logic cone size
Please refer to the Hierarchical Compare section
208 CADENCE CONFIDENTIAL
Key point partitioning
Divide-and-conquer approach to verifying large logic cones
0
Iteration 1
AB = 00
0
0
1
Key points are selected by LEC or users
LEC automatically generates a dofile that executes the
above iterations
Iteration 2
AB = 01
0
1
1
Iteration 3
AB = 10
1
Iteration 4
AB = 11
209 CADENCE CONFIDENTIAL
Key point partitioning: Automatic
read design cpu_rtl.v -verilog -golden
read design -f verilog.vc -verilog -revised
set system mode lec
add compare points -all
compare
report compare data -abort
set compare effort high
compare
report compare data -abort > aborts.high
set compare option -partition key //This command is not documented
compare
read design cpu_rtl.v -verilog -golden
read design -f verilog.vc -verilog -revised
set system mode lec
add compare points -all
compare
report compare data -abort
set compare effort high
compare
report compare data -abort > aborts.high
set compare option -partition key //This command is not documented
compare
LEC can select partition key points automatically
set compare option -partition <flow | key>
flow allows LEC to select points inside the cloud of logic
key will limit partition points to inputs to logic cone
Note: This command is not documented
...
...
210 CADENCE CONFIDENTIAL
Key point partitioning: Manual
read design cpu_rtl.v -verilog -golden
read design -f verilog.vc -verilog -revised
set system mode lec
add compare points -all
compare
report compare data -abort
set system mode setup
add partition key_point -pin a b
write partition dofile partition.dofile -replace
dofile partition.dofile
...
read design cpu_rtl.v -verilog -golden
read design -f verilog.vc -verilog -revised
set system mode lec
add compare points -all
compare
report compare data -abort
set system mode setup
add partition key_point -pin a b
write partition dofile partition.dofile -replace
dofile partition.dofile
...
When should I manually partition the key points?
When automatic selection does not work to your satisfaction
Criteria in selecting key points:
Support points of aborted cones
Key points that are already proven equivalent
211 CADENCE CONFIDENTIAL
Contents of partition.dofile
// Iteration 1
//
delete pin constraint a -golden
delete pin constraint a -revised
delete pin constraint b -golden
delete pin constraint b -revised
add pin constraint 0 a -golden
add pin constraint 0 a -revised
add pin constraint 0 b -golden
add pin constraint 0 b -revised
set system mode lec
add compare points -all
compare
set system mode setup
//
// Iteration 2
//
delete pin constraint a -golden
delete pin constraint a -revised
delete pin constraint b -golden
delete pin constraint b -revised
add pin constraint 0 a -golden
add pin constraint 0 a -revised
add pin constraint 1 b -golden
add pin constraint 1 b -revised
set system mode lec
add compare points -all
compare
set system mode setup
// Iteration 1
//
delete pin constraint a -golden
delete pin constraint a -revised
delete pin constraint b -golden
delete pin constraint b -revised
add pin constraint 0 a -golden
add pin constraint 0 a -revised
add pin constraint 0 b -golden
add pin constraint 0 b -revised
set system mode lec
add compare points -all
compare
set system mode setup
//
// Iteration 2
//
delete pin constraint a -golden
delete pin constraint a -revised
delete pin constraint b -golden
delete pin constraint b -revised
add pin constraint 0 a -golden
add pin constraint 0 a -revised
add pin constraint 1 b -golden
add pin constraint 1 b -revised
set system mode lec
add compare points -all
compare
set system mode setup
// Iteration 3
//
delete pin constraint a -golden
delete pin constraint a -revised
delete pin constraint b -golden
delete pin constraint b -revised
add pin constraint 1 a -golden
add pin constraint 1 a -revised
add pin constraint 0 b -golden
add pin constraint 0 b -revised
set system mode lec
add compare points -all
compare
set system mode setup
//
// Iteration 4
//
delete pin constraint a -golden
delete pin constraint a -revised
delete pin constraint b -golden
delete pin constraint b -revised
add pin constraint 1 a -golden
add pin constraint 1 a -revised
add pin constraint 1 b -golden
add pin constraint 1 b -revised
set system mode lec
add compare points -all
compare
// Iteration 3
//
delete pin constraint a -golden
delete pin constraint a -revised
delete pin constraint b -golden
delete pin constraint b -revised
add pin constraint 1 a -golden
add pin constraint 1 a -revised
add pin constraint 0 b -golden
add pin constraint 0 b -revised
set system mode lec
add compare points -all
compare
set system mode setup
//
// Iteration 4
//
delete pin constraint a -golden
delete pin constraint a -revised
delete pin constraint b -golden
delete pin constraint b -revised
add pin constraint 1 a -golden
add pin constraint 1 a -revised
add pin constraint 1 b -golden
add pin constraint 1 b -revised
set system mode lec
add compare points -all
compare
212 CADENCE CONFIDENTIAL
6. RTL coding guidelines to
optimize equivalence checking
213 CADENCE CONFIDENTIAL
Introduction
The following RTL coding guidelines can be used to
improve the performance of the equivalence
checking process
Keep difficult arithmetic blocks separate
Assign known values to all cases in case statement
Use more assign statements
Avoid combinatorial feedback loops
Following the guidelines helps reduce problems
described in sections:
Multipliers
Comparison: Debugging non-equivalent compare points
Resolving abort key points
214 CADENCE CONFIDENTIAL
Keep difficult arithmetic blocks separate
Arithmetic blocks such as multipliers tend to
produce longer runtime, more difficult mapping,
abort points (more than random logic blocks)
Complexity dramatically increases when these
multipliers are buried within a flattened design
When kept in their own hierarchy, verification
stands a much better chance of completion through
module-based (hierarchical) comparison mode
215 CADENCE CONFIDENTIAL
Assign known value to all cases in
case statement: Problem
Applying synthesis full_case directive or X assignments on
incompletely specified case statements creates "dont care" (DC)
conditions in LEC
LEC creates DC circuitry to ignore comparison of unspecified states
DC circuitry grows with greater numbers of unspecified states
Bigger DC circuitry leads to longer LEC runtime
Module xyz (sm, out);
input [1:0] sm;
output out;
reg out;
always @(sm)
case (sm) //synopsys full_case
2b00: out = 2b01;
2b01: out = 2b10;
2b11: out = 2b00;
endcase
endmodule
01
10
00
11
DC
216 CADENCE CONFIDENTIAL
Assign known value to all cases in
case statement: Solution
Use "default" with known value to catch all unspecified
conditions
Using default with known value does not necessarily
impact synthesis performance in area/speed optimization
Note: Refer to an Esnug paper on "full_case parallel_case", the Evil Twins of Verilog Synthesis by Cliff
Cummings, Sunburst Design, Inc.
Module xyz (sm, out);
input [1:0] sm;
output out;
reg out;
always @(sm)
case (sm)
2b00: out = 2b01;
2b01: out = 2b10;
2b11: out = 2b00;
default = 2b00;
endcase
endmodule
01
10
00
11
0 0
217 CADENCE CONFIDENTIAL
Using more assign statements
Break down the size of logic cones
Improve compare performance with smaller intermediate
cones
Easier to diagnose with more intermediate similarity points
assign pmo = (((x * y) & mask) + offset);
assign p = (x * y);
assign pm = (p & mask);
assign pmo = (pm + offset);
Golden Revised
Golden Revised
Before
After
218 CADENCE CONFIDENTIAL
Avoid combinatorial feedback
Combination feedback loops can hinder
verification process
LEC must insert cut gate to break the loops
Hard to match point of cut in the Golden and the
Revised loops
For difficult cases, user has to specify where to
insert cut gate
219 CADENCE CONFIDENTIAL
7. Labs
220 CADENCE CONFIDENTIAL
Lab 1
OBJECTIVE: Add renaming rule(s) to complete
mapping key points
1. Unix % cd ~/lec2_labs/mapping/key_point_mapping, start
LEC.
2. Execute the dofile init.do.
4. Open the Mapping Manager to examine the unmapped points.
7. Starting from the compare point (dark blue DFF), trace the fan-in logic
to find the source of the logic difference. LEC (3.4.0.a or later) trims the
similar logic for easier debugging, but it might be hard to see the logic
connection at first. To have LEC open more gates to get a better picture of
the circuit, click to highlight the compare point then right click Fan-in Cone
Close Right click again Fan-in Cone Open to EQ/Key Points. Do
this for both the Golden and the Revised schematics.
Diagnosis Manager
8. Labs
229 CADENCE CONFIDENTIAL
Lab 4 (contd)
8. Exit LEC when done debugging.
Note: Solution is at the end of this section and current working directory
8. Labs
230 CADENCE CONFIDENTIAL
Lab 5
OBJECTIVE: Map modules with renaming rules
1. Start LEC: Unix% cd
~/lec2_labs/hier_compare/mod_map_renaming
2. Read golden.v for the Golden design.
3. Read the Revised library lib.v.
4. Read revised.v as the Revised design.
5. Generate hierarchical compare script.
6. Use add renaming rule to map all modules (5 modules).
7. Regenerate the hierarchical compare script.
Verify that the generated script includes 5 modules for hierarchical
compare.
Note: The solution is at the end of this section and current working
directory.
8. Labs
231 CADENCE CONFIDENTIAL
Lab 6
OBJECTIVE: Map modules with uniquify
command
1. Start LEC :
Unix% cd ~/lec2_labs/hier_compare/mod_map_uniquify
2. Read golden.v for the Golden design.
3. Read the Revised library lib.vpx.v.
4. Read revised.v as the Revised design
5. Generate hierarchical compare script.
6. Instead of using add renaming rule, use uniquify command to
fix mapping problem for the modules being instantiated more than once (7
modules).
7. Re-generate hierarchical compare script.
Verify that the generated script includes 7 modules for hierarchical
compare.
Note: The solution is at the end of this section and current working
directory.
8. Labs
232 CADENCE CONFIDENTIAL
Lab 7
OBJECTIVE: Debug non-equivalent key points
using
hierarchical compare
technique
1. Unix % cd ~/lec2_labs/debug_neq/debug_via_hier, start
LEC.
2. Execute the dofile init.do.
3. Try debugging to pinpoint the error gate.
4. If you havent pinpointed the error gate, try narrowing down the
non-equivalent module using a hierarchical compare.
a) Switch to SETUP mode.
b) set gui off
c) Generate a hierarchical compare script, and then execute the script.
Note that one module will be reported non-equivalent.
5. Set root module to the non-equivalent module, and then start
comparing this module flat.
8. Labs
233 CADENCE CONFIDENTIAL
Lab 7 (contd)
Sort the non-equivalent key points by size with the command:
diagnose -summary -sort size.
From the report, find the key points with smaller cone size to
diagnose. Note these key points by their ID number, and then invoke
the Mapping Manager to start the diagnosis process. From the
schematic window, you should be able to see that the Revised design
has an extra inverter.
7. Exit LEC.
Note: Solution is at the end of this section and current working
directory.
8. Labs
234 CADENCE CONFIDENTIAL
Lab solutions
Lab1: Add renaming rules to complete mapping key points
add notranslate module regfile_9x30 regfile_9x64 -lib
read library lib/baselib.v lib/lib.v lib/regfile_9x30.v lib/regfile_9x64.v
read design golden.v
read design revised.v -rev
set undriven signal 0
add pin constraint 0 scan_en -rev
set mapping method -name only
set system mode lec
add renaming rule R1 \/ _ -gold
add renaming rule R2 \/ _ -rev
map key point
Lab1: Add renaming rules to complete mapping key points
add notranslate module regfile_9x30 regfile_9x64 -lib
read library lib/baselib.v lib/lib.v lib/regfile_9x30.v lib/regfile_9x64.v
read design golden.v
read design revised.v -rev
set undriven signal 0
add pin constraint 0 scan_en -rev
set mapping method -name only
set system mode lec
add renaming rule R1 \/ _ -gold
add renaming rule R2 \/ _ -rev
map key point
8. Labs
235 CADENCE CONFIDENTIAL
Lab solutions
Lab 2: Mapping black box pins
add notranslate module DP_SRAM*
add search path ./rtl/ -gold
read library lib/*.v -gold
read design -f rtl/filelist -root PCI -gold
read library lib/lib.vpx.v -rev
read design gate/PCI.gv -root PCI -rev
set flatten model -nodff_to_dlat_feedback
set undriven signal 0
add renaming rule R1 reg_%d reg[@1] -rev //this rule speeds up the mapping process
add renaming rule R2 in_I in -pin -bbox DP_SRAM_ADDR_LENGTH5_SIZE32_1 -rev
add renaming rule R3 inA in -pin -bbox DP_SRAM_ADDR_LENGTH5_SIZE32_1 -rev
set mapping method -nobbox_name_match
set sys mode lec
add compare point -all
compare
Lab 2: Mapping black box pins
add notranslate module DP_SRAM*
add search path ./rtl/ -gold
read library lib/*.v -gold
read design -f rtl/filelist -root PCI -gold
read library lib/lib.vpx.v -rev
read design gate/PCI.gv -root PCI -rev
set flatten model -nodff_to_dlat_feedback
set undriven signal 0
add renaming rule R1 reg_%d reg[@1] -rev //this rule speeds up the mapping process
add renaming rule R2 in_I in -pin -bbox DP_SRAM_ADDR_LENGTH5_SIZE32_1 -rev
add renaming rule R3 inA in -pin -bbox DP_SRAM_ADDR_LENGTH5_SIZE32_1 -rev
set mapping method -nobbox_name_match
set sys mode lec
add compare point -all
compare
8. Labs
236 CADENCE CONFIDENTIAL
Lab solutions
Lab 3: Debug non-equivalent key points through the Diagnosis Manager
add notranslate module DP_SRAM*
add search path ./rtl/ -gold
read library lib/*.v -gold
read design -f rtl/filelist -root PCI -gold
read library lib/lib.vpx.v -rev
read design gate/PCI.gv -root PCI -rev
set flatten model -nodff_to_dlat_feedback
add renaming rule R1 reg_%d reg[@1] -rev //this rule speeds up the mapping process
add renaming rule R2 isr_bit3_0_reg%d_%d isr_bit3_0_reg[@2] -rev
set mapping method -nobbox_name_match
set sys mode lec
add compare point -all
compare
Lab 3: Debug non-equivalent key points through the Diagnosis Manager
add notranslate module DP_SRAM*
add search path ./rtl/ -gold
read library lib/*.v -gold
read design -f rtl/filelist -root PCI -gold
read library lib/lib.vpx.v -rev
read design gate/PCI.gv -root PCI -rev
set flatten model -nodff_to_dlat_feedback
add renaming rule R1 reg_%d reg[@1] -rev //this rule speeds up the mapping process
add renaming rule R2 isr_bit3_0_reg%d_%d isr_bit3_0_reg[@2] -rev
set mapping method -nobbox_name_match
set sys mode lec
add compare point -all
compare
8. Labs
237 CADENCE CONFIDENTIAL
Lab solutions
Lab 4: Debug non-equivalent key points
The output data_out[31]the BBOX bridge/pci_target_unit_fifos/pciw_ram is disconneted
on the revised design.
Lab 4: Debug non-equivalent key points
The output data_out[31]the BBOX bridge/pci_target_unit_fifos/pciw_ram is disconneted
on the revised design.
8. Labs
238 CADENCE CONFIDENTIAL
Lab solutions
Lab5: Mapping modules with renaming rules
read design golden.v
read library lib.v -rev
read design revised.v -rev
add renaming rule R1 %s_scan$ @1 -module -rev
add renaming rule R2 %s_%d$ @1 -module -rev
write hier dofile hier.do -noexact -constraint -replace
//dofile hier.do
Lab5: Mapping modules with renaming rules
read design golden.v
read library lib.v -rev
read design revised.v -rev
add renaming rule R1 %s_scan$ @1 -module -rev
add renaming rule R2 %s_%d$ @1 -module -rev
write hier dofile hier.do -noexact -constraint -replace
//dofile hier.do
Lab 6: Mapping modules with uniquify command
read design golden.v
read library lib.vpx.v -rev
read design revised.v -rev
uniquify lrp -gold
uniquify burp -gold
write hier dofile hier.do -noexact -constraint -replace
//dofile hier.do
Lab 6: Mapping modules with uniquify command
read design golden.v
read library lib.vpx.v -rev
read design revised.v -rev
uniquify lrp -gold
uniquify burp -gold
write hier dofile hier.do -noexact -constraint -replace
//dofile hier.do
8. Labs
239 CADENCE CONFIDENTIAL
Lab solutions
Lab 7: Debug non-equivalent key points using hierarchical compare technique
add notranslate module DP_SRAM*
add search path ./rtl/ -gold
read library lib/*.v -gold
read design -f rtl/filelist -root PCI -gold
read library lib/lib.vpx.v -rev
read design gate/PCI.gv -root PCI -rev
set flatten model -nodff_to_dlat_feedback
add renaming rule R1 reg_%d reg[@1] -rev //this rule speeds up the mapping process
set mapping method -nobbox_name_match
write hier dofile hier.do -noexact -constraint -replace
dofile hier.do
set root module PCI_TARGET32_SM -both //non-equivalent module needs to be diagnosed
set sys mode lec
add compare point -all
compare
diagnose -summary -sort size
//diagnose the NEQ key point bc0_out will show very obviousely that there is
//an extra inverter in the revised logic cone, which causes NEQ
Lab 7: Debug non-equivalent key points using hierarchical compare technique
add notranslate module DP_SRAM*
add search path ./rtl/ -gold
read library lib/*.v -gold
read design -f rtl/filelist -root PCI -gold
read library lib/lib.vpx.v -rev
read design gate/PCI.gv -root PCI -rev
set flatten model -nodff_to_dlat_feedback
add renaming rule R1 reg_%d reg[@1] -rev //this rule speeds up the mapping process
set mapping method -nobbox_name_match
write hier dofile hier.do -noexact -constraint -replace
dofile hier.do
set root module PCI_TARGET32_SM -both //non-equivalent module needs to be diagnosed
set sys mode lec
add compare point -all
compare
diagnose -summary -sort size
//diagnose the NEQ key point bc0_out will show very obviousely that there is
//an extra inverter in the revised logic cone, which causes NEQ
8. Labs