Graph-Based Verification in a UVM Environment – Staffan Berg
Graph-Based Verification in a UVM Environment – Staffan Berg
Graph-Based Verification in a UVM Environment – Staffan Berg
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Graph</strong>-<strong>Based</strong> <strong>Verification</strong><br />
<strong>in</strong> a <strong>UVM</strong> <strong>Environment</strong><br />
<strong>Staffan</strong> <strong>Berg</strong><br />
European Applications Eng<strong>in</strong>eer<br />
July 2012
<strong>Graph</strong>-<strong>Based</strong><br />
Intelligent Testbench Automation (iTBA)<br />
• Welcome DVClub<br />
— Attendees<br />
— Organizers<br />
— Presenters<br />
• <strong>Verification</strong> Challenges<br />
— Time To Market<br />
— Quality Products<br />
• Step Function Ga<strong>in</strong>s<br />
— Higher Coverage Faster<br />
— Testbench Automation<br />
at SoC Level<br />
— Testbench Re-Use<br />
— <strong>Verification</strong> Productivity<br />
2<br />
Questa - April 2011<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
AGENDA<br />
• <strong>Graph</strong>s, Rules & Intelligent Testbench Automation<br />
• Why <strong>Graph</strong>-<strong>Based</strong> <strong>Verification</strong> is important<br />
• Fundamentals of iTBA<br />
• The Role of Coverage<br />
• Advanced Concepts<br />
• <strong>Graph</strong> based stimulus <strong>in</strong> the Context of OVM/<strong>UVM</strong>/*VM<br />
• Applications and Results <strong>–</strong> what to expect<br />
3<br />
SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Intelligent Testbench Automation (iTBA)<br />
From a <strong>Graph</strong>-<strong>Based</strong> Stimulus Description Model<br />
Gary Smith -<br />
“ . . .The [automatic] generation of a testbench from a system-level design description. . . “<br />
Mentor <strong>Graph</strong>ics -<br />
“ . . . testbench automation that is aware<br />
of the valid test space, the eng<strong>in</strong>eer’s<br />
verification targets with<strong>in</strong> that space,<br />
and the current state of the design - that<br />
uses automation to efficiently achieve<br />
the verification goals . . . “<br />
iTBA Def<strong>in</strong>itions<br />
Start<br />
<strong>in</strong>it<br />
wait_rdy<br />
Rw_opts setup_rd setup_wr<br />
Rw_size rw_4 rw_2 rw_1<br />
ack<br />
Stop<br />
Start = <strong>in</strong>it repeat ( wait_rdy Rw_opts Rw_size ack ) ;<br />
Rw_opts = setup_rd | setup_wr ;<br />
The graph def<strong>in</strong>es the ―valid test space‖<br />
Rw_size = rw_1 | rw_2 | rw_4 ;<br />
4<br />
SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Benefits of <strong>Graph</strong>-based <strong>Verification</strong><br />
• Predictable Coverage Closure<br />
— Achieve coverage goals <strong>in</strong> a fraction of the time<br />
— <strong>Graph</strong> techology enables N vs N*ln(N) advantage<br />
• Facilitate Re-use<br />
— Stimulus model is <strong>in</strong>dependent of testbench environment<br />
<strong>–</strong> Same model can be re-used for SystemC, RTL, Emulation…<br />
<strong>–</strong> Same model can be re-used between projects<br />
• Br<strong>in</strong>gs iTBA to SoC level<br />
— Automatically generate stimulus at RTL block level<br />
— Automatically generate stimulus at SoC level (s/w & h/w)<br />
• Productivity improvements<br />
— Generation of testbench code<br />
— <strong>Graph</strong>ical analysis / debug<br />
— Visualiz<strong>in</strong>g test scenario correlation to design spec<br />
5<br />
SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Def<strong>in</strong><strong>in</strong>g the valid test space - Rules<br />
• Rules have two sections:<br />
— Declarations<br />
— Grammar<br />
• Declarations <strong>in</strong>clude:<br />
— <strong>Graph</strong> nodes l<strong>in</strong>ked to tasks/functions<br />
— Variables l<strong>in</strong>ked to tasks/functions<br />
— Rule build<strong>in</strong>g blocks<br />
• Grammar def<strong>in</strong>es abstract behavior<br />
— Replaces directed test procedural code<br />
— Replaces CRT constra<strong>in</strong>t code<br />
— Often declarative decision tree of choices<br />
— May also use algebraic constra<strong>in</strong>ts<br />
• Rules are implementation-<strong>in</strong>dependent<br />
iTBA Rule<br />
User-Created<br />
Rule Text 1<br />
6 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Visualiz<strong>in</strong>g the test space - <strong>Graph</strong>s<br />
• Rules compiled <strong>in</strong>to graphs<br />
• <strong>Graph</strong>s visually depict stimulus<br />
• Protocol behavior<br />
• Packet construction options..<br />
• Stimulus siz<strong>in</strong>g<br />
• Stimulus siz<strong>in</strong>g useful to assess<br />
• What to target for coverage<br />
• What to generate randomly<br />
• Simulation time needed to reach<br />
coverage goals<br />
• For this example<br />
• 864 total test comb<strong>in</strong>ations<br />
• 108 tests <strong>in</strong> CovParams sub-graph<br />
Rules<br />
compile<br />
2<br />
7 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Def<strong>in</strong><strong>in</strong>g the <strong>Verification</strong> Goals - Coverage<br />
• Coverage Strategy def<strong>in</strong>es Goals & Priorities<br />
• Specify regions to cover graphically<br />
• Generate stimulus coverage code<br />
• Two types of stimulus coverage<br />
• Path coverage <strong>–</strong> traversal paths / cross coverage<br />
• Node coverage <strong>–</strong> like a system verilog coverpo<strong>in</strong>t<br />
• Path coverage atomic_tb_bl_combos covers<br />
• 108 comb<strong>in</strong>ations of am, bt, bl<br />
• Node coverage bsz[] covers<br />
• 8 values of bsz<br />
Path<br />
Coverage<br />
User Added Stimulus<br />
Coverage Directives 3<br />
Node<br />
Coverage<br />
8 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
<strong>Graph</strong>-based iTBA <strong>in</strong> Simulation<br />
• Integration/compilation<br />
• Plug-<strong>in</strong> to exist<strong>in</strong>g methodologies<br />
• Runtime code<br />
• <strong>Graph</strong>s loaded <strong>in</strong>to simulator<br />
• Algorithms manage graphs dur<strong>in</strong>g<br />
simulation<br />
• Runtime graph debug<br />
• Debug TB or DUT problems<br />
• Set graph breakpo<strong>in</strong>ts<br />
• S<strong>in</strong>gle-step or run to breakpo<strong>in</strong>t<br />
iTBA_comp*.sv<br />
Compiled<br />
<strong>Graph</strong>(s)<br />
iTBA runtime<br />
tb.sv<br />
compile<br />
top.sv<br />
Simulator<br />
Runtime<br />
<strong>Graph</strong><br />
Debugg<strong>in</strong>g<br />
9 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
The Role of Coverage<br />
• The rule graphs def<strong>in</strong>e the<br />
entire stimulus space<br />
• Without coverage goals,<br />
traversal will be purely random<br />
• <strong>Graph</strong> coverage strategy<br />
def<strong>in</strong>es goals and priorities<br />
• iTBA algorithms prioritize<br />
generation<br />
— Can still generate random vectors<br />
outside the coverage space<br />
10<br />
SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
<strong>Graph</strong>-based <strong>Verification</strong> Advanced Concepts<br />
Reactive / adaptive graphs<br />
• Some fields <strong>in</strong> a stimulus item may be a property of the<br />
testbench or DUT state, not randomly selected<br />
— And may still be <strong>in</strong>cluded <strong>in</strong> a cross cover goal<br />
• These fields become <strong>in</strong>puts (imports) to a stimulus graph<br />
— Enables opportunistic target<strong>in</strong>g of random-resistant scenarios<br />
DUT state can be used<br />
to change constra<strong>in</strong>ts<br />
<strong>Graph</strong> behaviour<br />
adapts to TB or<br />
DUT state<br />
11 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Integrat<strong>in</strong>g <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong><br />
Generat<strong>in</strong>g Stimulus <strong>in</strong> an OVM/<strong>UVM</strong> <strong>Environment</strong><br />
• Stimulus is generated by sequences<br />
• A sequence produces sequence items<br />
• Driver applies stimulus to DUT<br />
12 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Generat<strong>in</strong>g <strong>Graph</strong>-<strong>Based</strong> Stimulus<br />
• <strong>Graph</strong> <strong>in</strong>tegrates with<strong>in</strong> a sequence<br />
— <strong>Graph</strong> execution produces sequence items<br />
• Maximizes reuse of <strong>in</strong>frastructure<br />
— No need to change exist<strong>in</strong>g drivers, monitors, etc<br />
iTBA<br />
Sequence<br />
13 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
iTBA OVM/<strong>UVM</strong> Integration Process<br />
Identify the target sequence Item<br />
Describe stimulus doma<strong>in</strong> with a graph<br />
• Declare a graph variable for each sequence-item field<br />
• Def<strong>in</strong>e relationships between graph variables<br />
Def<strong>in</strong>e stimulus-coverage goals<br />
• Often corresponds to exist<strong>in</strong>g functional coverage goals<br />
Run the iTBA sequence via an OVM/<strong>UVM</strong> test<br />
14 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Sequence Item<br />
• Verify<strong>in</strong>g a simple bus protocol<br />
— 32-bit address<br />
— 64-bit data bus<br />
— Supports burst lengths up to 16 beats<br />
• Exist<strong>in</strong>g <strong>UVM</strong> sequence Item<br />
— Conta<strong>in</strong>s fields that describe a transaction<br />
15 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Def<strong>in</strong><strong>in</strong>g <strong>Graph</strong> Variables<br />
• Declare a graph variable for each item field<br />
• Declare the valid doma<strong>in</strong> of each variable<br />
Sequence Item<br />
Rules<br />
16 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Declare Variable Relationship<br />
• Simple bus protocol constra<strong>in</strong>ts<br />
— Address must be aligned to the transfer size<br />
— Burst-transfer beats may only be 32 or 64-bit width<br />
• <strong>Graph</strong> permits flexible description of relationships<br />
— Branches<br />
— Algebraic constra<strong>in</strong>ts<br />
• Reuse exist<strong>in</strong>g constra<strong>in</strong>ts<br />
— Can be imported automatically<br />
17 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Simple Bus Protocol <strong>Graph</strong><br />
• <strong>Graph</strong>ical view of the stimulus space<br />
— Automatically created from rule description<br />
— Intuitive way to visualize choice tree<br />
• <strong>Graph</strong> branches restrict burst_len/size<br />
— Enables visual approach to code review<br />
18 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
<strong>Graph</strong> Integration <strong>in</strong>to Sequence<br />
• <strong>Graph</strong> nodes l<strong>in</strong>k to tasks <strong>in</strong> the sequence class<br />
• Tasks set the value of sequence-item fields<br />
• Integration code is automatically-created from graph<br />
19 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Def<strong>in</strong>e Stimuli-Coverage Goals<br />
• Simple protocol coverage goals<br />
— Cover 64 address ranges<br />
— Cover all valid comb<strong>in</strong>ations of transaction parameters<br />
• Describe address value b<strong>in</strong>n<strong>in</strong>g<br />
• Def<strong>in</strong>e graph-coverage strategy<br />
— Node Coverage for address<br />
— Path Coverage for transaction parameters<br />
• Pre-simulation coverage space analysis<br />
20 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Testbench <strong>Environment</strong> Integration<br />
• iTBA sequence is just like any other sequence<br />
— Use standard approaches to select and execute<br />
• Select the iTBA sequence via a type override<br />
• Explicitly create and run iTBA sequence<br />
21 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Example iTBA Applications<br />
• Architectural exploration<br />
— Performance characterization<br />
— Behavioral model verification<br />
• IP Block level verification<br />
— Bus (AXI, AHB, PCI*, …)<br />
— Memory (DDR,SDDR, nand flash,…)<br />
— Peripheral (i2c, dma,…)<br />
• SOC <strong>in</strong>tegration<br />
— Firmware<br />
— Subsystem <strong>in</strong>teractions<br />
• Processor verification<br />
— L2 cache<br />
— Instruction set verification<br />
22 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
iTBA <strong>Verification</strong> Results<br />
• Reached coverage <strong>in</strong> a s<strong>in</strong>gle iTBA sim vs multiple CRT sims/seeds<br />
• M<strong>in</strong>imum 10x coverage closure advantage for simple CRT cases<br />
• Often see >100x coverage closure advantage for common CRT cases<br />
23 SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
<strong>Graph</strong>-<strong>Based</strong> iTBA<br />
Ga<strong>in</strong><strong>in</strong>g Acceptance Across The Globe<br />
Industry Design <strong>Verification</strong> Current Results Time<br />
Ultra Results Benefits<br />
Consumer<br />
Electronics<br />
Error Check<strong>in</strong>g and<br />
Correct<strong>in</strong>g Module<br />
NC Sim<br />
Specman e<br />
>18 hours<br />
100% coverage<br />
1<br />
118 m<strong>in</strong>utes<br />
<br />
=<br />
Day<br />
100% coverage<br />
9.5 X faster<br />
Equal coverage<br />
Switch<strong>in</strong>g<br />
Subsystems<br />
Multiple Master<br />
AXI Bus Fabric<br />
Questa<br />
Directed Tests<br />
10,000 tests 2<br />
400,000 tests<br />
40 X more tests<br />
<br />
=<br />
Days<br />
Wireless<br />
Network<strong>in</strong>g<br />
Ethernet 802.11<br />
Device<br />
VCS<br />
NTB<br />
3175 CPU hours<br />
95% coverage<br />
35<br />
48 CPU hours<br />
<br />
=<br />
Hours<br />
97% coverage<br />
66 X faster<br />
+ 2 % coverage<br />
Storage &<br />
Network<strong>in</strong>g<br />
AXI Bus Bridge<br />
VCS<br />
SystemVerilog<br />
26,315,000 tests<br />
1<br />
196,000 tests<br />
170 X faster<br />
<br />
=<br />
79% coverage Week<br />
100% coverage<br />
+ 21% coverage<br />
Office<br />
Products<br />
Pr<strong>in</strong>ter Image<br />
Processor<br />
Questa<br />
SystemVerilog<br />
8 weeks on 6 CPUs<br />
60% coverage<br />
3<br />
36 hours on 6 CPUs<br />
<br />
=<br />
Days<br />
100% coverage<br />
37 X faster<br />
+ 40% coverage<br />
Wireless<br />
Telecom<br />
Interrupt Controller<br />
VCS<br />
Vera and SV<br />
3 days<br />
100% coverage<br />
6<br />
45 m<strong>in</strong>utes<br />
<br />
=<br />
Days<br />
100% coverage<br />
27 X faster<br />
Equal coverage<br />
Processors<br />
Multi-Core Memory<br />
Sub-system<br />
Questa<br />
SystemVerilog<br />
5 hours<br />
100% coverage<br />
1<br />
30 m<strong>in</strong>utes<br />
<br />
=<br />
Day<br />
100% coverage<br />
10 X faster<br />
Equal coverage<br />
Basestation<br />
Telecom<br />
Proprietary Interface<br />
Module for a Router<br />
NC Sim<br />
Specman e<br />
825,000 vectors<br />
100% coverage<br />
1<br />
75,000 vectors<br />
<br />
=<br />
Week<br />
100% coverage<br />
10 X faster<br />
Equal coverage<br />
24<br />
iTBA - Accelerat<strong>in</strong>g Time to Coverage Closure<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
Conclusions….<br />
• <strong>Graph</strong> algorithms enable fast, efficient<br />
— Coverage closure<br />
— Test scenario generation<br />
• <strong>Graph</strong>-based stimulus description emphasizes reuse<br />
— Vertically from block to SoC level<br />
<strong>–</strong> And across multiple testbench environments / languages<br />
— Horizontally from project to project<br />
• Easily <strong>in</strong>tegrate <strong>in</strong>to exist<strong>in</strong>g environments, e.g. OVM/<strong>UVM</strong><br />
25<br />
SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com
26<br />
SB , <strong>Graph</strong> <strong>Based</strong> <strong>Verification</strong> June 2012<br />
© 2010 Mentor <strong>Graph</strong>ics Corp. Company Confidential<br />
www.mentor.com