Upload
ryu3214
View
221
Download
0
Embed Size (px)
Citation preview
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
1/36
Advanced Debugging
With Assertions
January 2010
Harry D FosterChief Verification Scientist
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
2/36
Mentor Graphics Company Confidential2
Overview
Understanding the debug challenge
How Questa can help debug assertions
Additional debug techniques
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
3/36
Mentor Graphics Company Confidential3
Debugging is the Bottleneck
Effor t Allocation of Dedicated Ver ification
Engineers by Type of Activity
52%
34%
14%
Verif ication Debug Testbench Development Other
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
4/36
Mentor Graphics Company Confidential4
Traditional Flow Focused on Full ChipBug Rate vs. Team Capacity
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
5/36
Mentor Graphics Company Confidential5
Improved Flow with Sub-system Verif icationBug Rate vs. Team Capacity
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
6/36
Mentor Graphics Company Confidential6
Debug - A Big Challenge
Environments include multiple disciplines
Verilog / VHDL / SystemC and now SystemVerilog
Advanced ver ification techniques improve verification productivity
At the price of debug productivi ty
Debug is 52% of the overall verification cycle*
Ability to create unknown out-of-body code experiences
New verification methodologies require new debug paradigms
* Source: 2008 Farwest Research and Mentor IC/ASIC Functional Verification Study
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
7/36
Mentor Graphics Company Confidential7
Desired State for Debug
Single Environment for Design and Testbench debug
Automation that improves debug productivity
Automatic logging of assertion data, classes
Capabili ties that allow analysis and
quick identification of bugs
Software like debug capabili ties
Enhanced hardware like debug capabili ties
How ?
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
8/36
Mentor Graphics Company Confidential8
Questa Debug ProductivityLeading Assertion and Coverage technology
Native support for both PSL and SVA
High performance assertion engine
Mentors ABV added value
Efficient Debug capabilities for PSL & SVA
Integrated Assertion Browser
View assertions in wave window
Break simulation if error encountered
Interactive and batch mode control
Best root cause analysis
Assertions are recorded in WLF fi le
Linking to dataflow
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
9/36
Mentor Graphics Company Confidential9
Overview
Understanding the debug challenge
How Questa can help debug assertions
Additional debug techniques
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
10/36
Mentor Graphics Company Confidential10
Debugging Assertions
Assertions are compact code structures
Can be a challenge to write, even more-so to debug
Need good tools to help visualize the assertion
Questa has powerful visualization and debug tools
Analysis pane
Lists all assertions at current hierarchical level and their
statistics
Waveform Viewer
Displays assertions and related signals Clear indication of status: active/inactive/pass/fail
Thread View
Decomposes assertions clause by clause for easy debug
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
11/36
Mentor Graphics Company Confidential11
SystemVerilog lets you capture data at critical points w ithin a
sequence/property using local variables
Call functions/tasks within sequences
Debugging becomes easy with the assertion thread viewer
Debugging Assertions:SVA example with local variables
valid
in
out
EA BF
EB C0
Two threads
property e;
int x;
(valid, x = in) |-> ##5 (out == (x+1));
endproperty
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
12/36
Mentor Graphics Company Confidential12
Questa: Assertion Debug Example
Assume we start with a design and the following assertion:
1. We compile the design & invoke simulator for assertion debug
vlib workvlog +acc=a
vsim assertdebug
propertyp_hs;
@(posedge clk) $rose(REQ) |-> ##[2:4] $rose(GNT);
endproperty
a_hs: assertproperty(p_hs)
else begin $error("%m Failed"); end
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
13/36
Mentor Graphics Company Confidential13
Questa: Starting Window
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
14/36
Mentor Graphics Company Confidential14
Questa: Analysis pane
Expanded view
of assertion a_hs
Asser tion
Fail
Count
Asser tion
Pass
Count
2. The analysis pane is a central location to analyzeand control assertions in your simulation
Enabling
assertionPass/Fail
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
15/36
Mentor Graphics Company Confidential15
3. Add a desired assertion to the waveform window In Analysis pane right click on desired assertion and select:
In Analysis pane right click on desired assertion and select:
Questa: Waveform Setup
Add Wave / Selected Objects
Enable Assertion Thread Viewer
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
16/36
Mentor Graphics Company Confidential16
Questa: Waveform Setup
4. In Waveform Window menu, select:
View / Assertion Debug
5. Run simulation
6. Click on Waveform Window red assertion failure triangle A yellow Cursor appears and the debug pane updates
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
17/36
Mentor Graphics Company Confidential17
Questa: Wave view..
Asser tionStart
Asser tionPass
Asser tionFail
# of active
assertions
Asser tioninactive
Asser tionActive
Asser tion debug pane
gives signal info
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
18/36
Mentor Graphics Company Confidential18
Bring up Assertion Thread View window
In Analysis pane right click on desired assertion and select:
View ATV
From popup, select start-time of failing assertion (390ns here)
Questa: Debug Assertion Threads
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
19/36
Mentor Graphics Company Confidential
19
Questa: Assertion Thread View
Interim Fail butother evaluations
still pending
Expression
matchedThread
finish
Thread
start
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
20/36
Mentor Graphics Company Confidential
20
Multiple Threads in Wave Window
Automatic
Thread count
integer
Expand to
see
individual
thread
RMC on start
of thread box
invokes ATV
Blue box
above thread
indicates
start of new
thread
Red triangle
indicates failure(green = pass)
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
21/36
Mentor Graphics Company Confidential
21
Advanced Assertion Debug with ATVExpanded
assertion
Green dots indicates
expression is true
Redundant failures:
individual spawned
thread failed but other
threads sti ll active
Red dots indicates
expression is false
Local
variable
pane
Yellow dots indicates
additional thread
spawned
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
22/36
Mentor Graphics Company Confidential
22
Selectable ThreadsFailing/Passing
thread
automatically
highlighted
Ability to select
or highlight
threads
individually
Local Variables
update to reflect
thread selection
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
23/36
Mentor Graphics Company Confidential
23
ABV Commands
vsim -nosva switch disables assertions during simulation
Assertion TCL commands apply to both PSL and SVA
Examples:
vsim> view assertions
vsim> assertion fail [-recursive] [-enable] [-disable]
[-action continue | break | exit ]
[-limit | none]
[-log on | off]
vsim> assertion pass [-recurs ive] [-enable] [-disable]
[-limit | none][-log on | off]
vsim> assertion report [-number] [-recursive] [-tcl_list]
[-verbose]
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
24/36
Mentor Graphics Company Confidential
24
Overview
Understanding the debug challenge
How Questa can help debug assertions
Additional debug techniques
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
25/36
Mentor Graphics Company Confidential
25
Debugging your design
What other debug tasks
contribute to the 52% of
project time attributed
to debug?
Design comprehension
Understanding results
Waveform analysis
Would it help to do this
post-simulation?
E i P D b
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
26/36
Mentor Graphics Company Confidential
26
Easing Processes DebugAids design comprehension
View all processes
together regardless
of language
Toggle between
viewing modes
All Windows l inked
to process window
Integral with
SystemC Debug
Interface
Message Viewer
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
27/36
Mentor Graphics Company Confidential
27
Message ViewerSee important messages quickly!
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
28/36
Mentor Graphics Company Confidential
28
Source Code Annotation
Linked to cursor location in wave window
Linked to dataflow window
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
29/36
Mentor Graphics Company Confidential
29
Textual Dataflow: Tracing Signals
Find reader of strb_r
Select Signal
then RMB
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
30/36
Mentor Graphics Company Confidential
30
Textual Dataflow: Tracing Signals
Find driver(s) of prdy_r
Select Signal
then RMB
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
31/36
Mentor Graphics Company Confidential
31
Drop Source To Waveform
S G
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
32/36
Mentor Graphics Company Confidential
32
Wave Window: Signal Grouping
Group signals
under user
defined name
Drag & drop
signals into and
out of group
Drag & drop
group as one
object
Collapse &
expand group
as needed
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
33/36
Mentor Graphics Company Confidential
33
Wave Window: Expanded Time
Expand the Wave Window to view all transit ions
during a single time step
Indicates multiple transitions
Blue background indicates
expanded section
Delta-time steps
Optional Post Processing Debug
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
34/36
Mentor Graphics Company Confidential
34
Optional Post Processing DebugDebug using familiar techniques post-simulation
No Simulation loaded, post
processing environment
Determine cause of event in
waveform through dataflow
Trace instance to module
Find object in source
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
35/36
Mentor Graphics Company Confidential
35
Summary
In this session we
Learned about how new verification
techniques create a new debug
paradigm
Learned new debug techniques that
can ease the assertion learning curve
Learned additional debug techniques
to reduce the verification effort
8/12/2019 Seminar Abv Fpga Session2 Advanced Debugging With Assertions Rardeishar
36/36
Mentor Graphics Company Confidential
36