|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
7 ?) Q1 r0 V7 k# ~: Q) R1 f
SystemVerilog for Verification:
/ `; g* N5 j: @: M | dA Guide to Learning the Testbench Language Features
6 A/ S/ t: ]3 `6 W' N$ w1. VERIFICATION GUIDELINES 1" J; b0 u: ~' ?; A$ _: ^
1.1 Introduction 1! r5 O6 Z% o. m9 c) P7 {" ~
1.2 The Verification Process 2" i9 d/ P; w9 g; G$ N$ S+ K: x
1.3 The Verification Plan 4
u9 t, v7 U; s8 s1.4 The Verification Methodology Manual 4
" b2 c/ M) O6 n; p# G+ J1.5 Basic Testbench Functionality 5
; F2 P7 [8 k( |$ G( d1.6 Directed Testing 5
0 q% {9 H$ M p/ S& c* A1.7 Methodology Basics 7% Y* z% T" p$ P. W, x C2 C1 L( K
1.8 Constrained-Random Stimulus 8
$ x+ D8 }6 @ w" H: L4 K1.9 What Should You Randomize? 104 K, q! ~! ], b4 N. h, G* g
1.10 Functional Coverage 13# F/ }. j1 `+ {, R: v) B3 R7 j; \' Y& ]
1.11 Testbench Components 151 ~2 g* W- }0 {+ y# E8 t
1.12 Layered Testbench 16
) g {- P7 C& m {% ~1 Y5 _1.13 Building a Layered Testbench 22
+ W5 v& Z+ B! |7 Q1.14 Simulation Environment Phases 23+ ` J" v5 e }- N8 P+ p
1.15 Maximum Code Reuse 240 q0 h# v' m$ R1 \
1.16 Testbench Performance 24/ t' z8 W) d# u( Z# s
1.17 Conclusion 25- F$ R4 A! M) Y2 N# g" b
2. DATA TYPES 273 h* p" C% _) d' Q0 k4 {
2.1 Introduction 27
- C- S# ~8 @: R, |3 l2.2 Built-in Data Types 27
1 s0 V- x0 e; Z' u: Q# Sviii SystemVerilog for Verification! T/ m' g# c! u
2.3 Fixed-Size Arrays 290 |" \( x- M+ u3 G+ r4 D. }) z
2.4 Dynamic Arrays 34
( I4 L1 H. l9 j) L* }* s" J2.5 Queues 36$ K0 d- \8 c8 k; `, ^
2.6 Associative Arrays 37
$ h2 C+ H7 O+ q% }/ C0 ~ l& J7 R2.7 Linked Lists 39
5 x0 a1 W R( f4 L4 M1 `: g2.8 Array Methods 40
+ L& z$ q/ [9 l6 V% z8 B% C2.9 Choosing a Storage Type 42
9 F- Y4 m$ D' Q6 i0 }% P2.10 Creating New Types with typedef 456 p) b% S& P6 d% m- c2 ~4 C
2.11 Creating User-Defined Structures 46
( _: ?6 ^1 ]) r2.12 Enumerated Types 47
5 }$ P' V3 ^' f* k; S7 Z' e2.13 Constants 51
z0 b: ~2 S. B3 g! h/ ^2.14 Strings 51
3 s4 k5 `# Q K1 d+ P8 ^8 f" \; {. B2.15 Expression Width 52' O" Q2 R+ `! M6 A, w" m
2.16 Net Types 53* P$ E" U) v/ K) M5 t% F0 \8 A
2.17 Conclusion 539 I, D: `; x* q: t
3. PROCEDURAL STATEMENTS AND ROUTINES 55/ ]( j; i, n t- v
3.1 Introduction 55
2 Q) K' ~6 o& o0 {9 X4 ^1 `3.2 Procedural Statements 557 |. U% T; n9 }
3.3 Tasks, Functions, and Void Functions 566 u+ ?, q U( E. B0 U* r
3.4 Task and Function Overview 574 K, i# [$ i9 ~1 h4 d2 o' v# f
3.5 Routine Arguments 57& E, _4 A ?. K; }
3.6 Returning from a Routine 62
4 r) h2 [8 ?% V7 L& u3.7 Local Data Storage 62
7 M3 @. ^7 g, ^. P+ i( S5 l3.8 Time Values 643 ~% O) k" f6 Z: a2 J
3.9 Conclusion 65; p0 _- m0 Q, A r7 w6 {
4. BASIC OOP 67
k, T, F3 j/ v9 F' C3 r; l& u4.1 Introduction 676 N+ J& {7 v4 [" j% b% K- h
4.2 Think of Nouns, not Verbs 674 [* B0 S7 a, A$ F
4.3 Your First Class 68
" |* V6 p9 B3 ^. c$ f/ {0 n4.4 Where to Define a Class 69
% ^4 Q" ?1 t( z0 y/ }4.5 OOP Terminology 69
/ k0 I6 D1 ~2 s( Z7 v4.6 Creating New Objects 70
6 L2 L4 o& m! f$ E9 P/ J4.7 Object Deallocation 74
# d: K7 n1 ^; B* o- H4.8 Using Objects 76& h% K# W" o9 S3 O/ d3 S
4.9 Static Variables vs. Global Variables 760 h+ Z1 I: q/ t6 H, J/ h" y2 f& [" [
4.10 Class Routines 78
7 u2 W& u& d+ H$ M* C# z( q4.11 Defining Routines Outside of the Class 79
- Y7 r4 X1 D# P: ~ Y9 E9 P, a4.12 Scoping Rules 81
6 \5 s2 J6 q% R/ |- K( ]# K( a4.13 Using One Class Inside Another 85
6 i: N+ c1 d" F. \) v4.14 Understanding Dynamic Objects 87
0 G# a+ \! N P* P& Y6 f. o4.15 Copying Objects 91' ?2 k2 ?6 c6 O' C- M# v# R
4.16 Public vs. Private 95
3 R& S- v; T9 iContents ix3 H V( ]& A8 B% |: W# r
4.17 Straying Off Course 96
; ~+ B" C. e; N( \7 E8 [4.18 Building a Testbench 96
1 ^- ^8 W2 j0 J" O0 e4.19 Conclusion 97& d/ B- l0 M" w" x4 L. B+ R
5. CONNECTING THE TESTBENCH AND DESIGN 99
2 W& @( y# E7 t. ]: e% X; f5.1 Introduction 99, C- g5 x3 m( S8 S1 c. r) y/ u
5.2 Separating the Testbench and Design 99
4 F+ Q3 K0 W: B- ~5.3 The Interface Construct 102! F. C, g/ }5 t- c) g! U) {( Q9 I
5.4 Stimulus Timing 108! [2 m" M1 |. U
5.5 Interface Driving and Sampling 114
* d8 Y: D# D, w5 N( v5.6 Connecting It All Together 121
6 S# \4 s$ {) s9 Q5.7 Top-Level Scope 1211 i" J1 @& ?: S: f" B
5.8 Program – Module Interactions 123( L" Y3 P" |# G
5.9 SystemVerilog Assertions 1245 g* W( x% V& N% M" M
5.10 The Four-Port ATM Router 1264 c: O# v+ ]' Y/ ] J% ?& t/ w+ O
5.11 Conclusion 134
& @ m+ b N% E3 d+ X% K) F6. RANDOMIZATION 135 a" H: z& B* ~; m. w1 v
6.1 Introduction 135
% t. v/ [4 W. @6.2 What to Randomize 136
2 O' u1 R9 B, @6.3 Randomization in SystemVerilog 138( X% j9 o" l" X5 u. Y+ {
6.4 Constraint Details 141
' u& o _4 G* B; ]# A8 d6.5 Solution Probabilities 149* n/ _) M/ C' g2 V# G
6.6 Controlling Multiple Constraint Blocks 154
7 C! t. D! q, R8 J& N9 }3 n6.7 Valid Constraints 154
- q4 F5 m! G# J9 W$ E3 Y( R. k6.8 In-line Constraints 155( U; |* X* W9 E/ Y1 ~9 X4 n3 Y
6.9 The pre_randomize and post_randomize Functions 156
& T w# i: |& R ~2 f6.10 Constraints Tips and Techniques 158
' p" c5 D( N2 z7 `7 e' I( i; S6.11 Common Randomization Problems 164
5 u" L- {2 R6 \$ B) k$ y6.12 Iterative and Array Constraints 165* [# o3 W+ l7 w* |' ?
6.13 Atomic Stimulus Generation vs. Scenario Generation 172% ^: k, ^. j8 v$ ^: H4 ~( s+ M
6.14 Random Control 175( {. c; T' f; ?% N, U
6.15 Random Generators 177# R% h/ O- I% J6 S5 y" p
6.16 Random Device Configuration 1801 h& ^+ C. B2 g" r1 s
6.17 Conclusion 182- t, e3 T( T, I
7. THREADS AND INTERPROCESS COMMUNICATION 183$ U7 Y1 \$ S, `# Y
7.1 Introduction 1839 F) j/ A1 }1 S3 t8 s; S4 H! R
7.2 Working with Threads 184: G, ?& [; B: o$ H
7.3 Interprocess Communication 194
5 k' Y( J8 a: H, K7 Y* V4 y/ `7.4 Events 195
: g( @; z) y" L8 F7.5 Semaphores 199
& Z4 a2 T4 `$ B+ n V7.6 Mailboxes 201* ~ ~) f, Z- z) i' T$ Q1 C& t0 A; _
7.7 Building a Testbench with Threads and IPC 210
7 U- Z2 p+ U1 H3 y& Gx SystemVerilog for Verification7 Z' M' D4 J" q5 m+ w
7.8 Conclusion 2140 | m3 J1 T/ v' X( h$ n$ \
8. ADVANCED OOP AND GUIDELINES 215
, P/ d" H# X: c; _9 g; J, G8.1 Introduction 215! f2 @* U: Q) y5 i+ b
8.2 Introduction to Inheritance 216
% S( a9 k! M/ H" Q: z+ t" r8.3 Factory Patterns 2214 E9 b; `/ p) b" j
8.4 Type Casting and Virtual Methods 225; | m# \7 P' t; G1 D/ x
8.5 Composition, Inheritance, and Alternatives 228" h& N9 n# E% a
8.6 Copying an Object 233
7 Z% C7 M* N% G9 N; v8.7 Callbacks 236/ Z, `6 Q+ ]1 E; W8 |* j$ ` S
8.8 Conclusion 240
6 M+ U7 N* ]3 D G+ v9. FUNCTIONAL COVERAGE 241& J ^5 z0 a2 t4 K! r
9.1 Introduction 241
0 W8 a/ R; ?2 C: E5 M9.2 Coverage Types 243, J( J! b. B0 ^( ?( s* z, f2 n* s
9.3 Functional Coverage Strategies 246
4 k' r) }6 h. ?& J9.4 Simple Functional Coverage Example 248
/ S$ r" R: I5 P. `0 f8 n& s9.5 Anatomy of a Cover Group 251
1 S2 C. r+ h2 q n9.6 Triggering a Cover Group 253) _4 G2 L; t |8 r6 @* K, i
9.7 Data Sampling 256( I5 z% P# j! O9 F2 o
9.8 Cross Coverage 265! a! q$ g/ a' E, h6 Z, u
9.9 Coverage Options 2724 O5 |. F( n+ H0 d v& N
9.10 Parameterized Cover Groups 274( Z* X, |' L& t% Z9 M
9.11 Analyzing Coverage Data 275
( E, j0 J- {+ g8 I! A; }9.12 Measuring Coverage Statistics During Simulation 2764 G A5 X0 E: N+ {% ^
9.13 Conclusion 277- ~: U% T; _; g3 J w! Q8 P( |. g1 @
10. ADVANCED INTERFACES 2792 e$ N3 x& d7 W+ w6 f
10.1 Introduction 279
1 C/ z U0 ] h7 v10.2 Virtual Interfaces with the ATM Router 279* e& R1 O( T3 I, }" e$ g0 b
10.3 Connecting to Multiple Design Configurations 284
+ g! j/ f# H, b/ e- G& W4 S8 a10.4 Procedural Code in an Interface 290
( ^# j3 v0 `9 _3 m8 x- {+ H4 M10.5 Conclusion 294' d7 S% O, D# |" V/ _ p7 y
References 295
+ P* r4 n% X% s/ Q0 Y$ eIndex 297# J3 ]/ W, ]- C+ Y: l. ]
|
|