|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
, C! f( H- j8 t1 BSystemVerilog for Verification:8 z7 Y4 G Y: G# g# f" F$ R
A Guide to Learning the Testbench Language Features
G; N: e2 g4 ^# i4 P1. VERIFICATION GUIDELINES 1
/ \. S& X& t3 I# f s9 W1.1 Introduction 1
6 i, R* ]' {9 K1.2 The Verification Process 2/ A2 D4 R! S P, g$ S2 i- g9 J u
1.3 The Verification Plan 4
5 k5 J) o0 u( d ^9 h% R1.4 The Verification Methodology Manual 4- \- F3 R" W- f7 `
1.5 Basic Testbench Functionality 5
$ {& u' }* `# C' m- ^1 G1.6 Directed Testing 5
4 L2 \% L2 Z$ c! k* k! ]! Q' J1.7 Methodology Basics 7
2 R: f% l6 U1 |; M$ W, {; ~! b1.8 Constrained-Random Stimulus 80 a+ h1 C) w/ R$ T
1.9 What Should You Randomize? 10& {( u, i( J. k# n, d9 X
1.10 Functional Coverage 13
9 j% E# ]2 q+ X" K; y! h9 g! ?1.11 Testbench Components 15/ Z3 @7 n1 x! i. o9 t) g
1.12 Layered Testbench 16* ?' s/ j0 {# E. }' ]
1.13 Building a Layered Testbench 22
+ b7 T8 u9 w0 H& \5 z$ P% n8 e" @" t1.14 Simulation Environment Phases 23
- ?' f* q" U7 n: M ~9 Q( C) [8 G1.15 Maximum Code Reuse 247 T$ X8 v) g$ \! x& h7 ?
1.16 Testbench PeRFormance 24
7 L8 {( [* q$ U2 g; ~1.17 Conclusion 25
6 x l6 l4 X/ b7 }2. DATA TYPES 27! J# T0 F. O% r+ g) l
2.1 Introduction 27$ H6 P& U+ ^' n: t$ G! x0 E+ Q9 I
2.2 Built-in Data Types 27# m& @% p3 }5 U1 W
viii SystemVerilog for Verification8 \- _5 k5 L5 V( n2 b. E! q& H) Y
2.3 Fixed-Size Arrays 29: C a: N( B8 |3 M! I
2.4 Dynamic Arrays 34
/ Q+ m! y6 A O9 Y, J2.5 Queues 36
" n$ J$ x* V% V5 B. l" F2.6 Associative Arrays 378 a* L0 P& I' e! w1 J. P
2.7 Linked Lists 39
5 ^5 c+ `# n+ f9 g) N2 U2.8 Array Methods 40
1 ^1 q7 j; M% a! O3 ^8 R) l2.9 Choosing a Storage Type 42" v, ]* E1 P! k, o
2.10 Creating New Types with typedef 45, ~/ ^( V+ C; Z% k4 ^
2.11 Creating User-Defined Structures 46
, z# M6 K/ Z, t+ d8 G; e2.12 Enumerated Types 47
5 [) B6 t r; b8 A3 p, C8 G2.13 Constants 51: V. p9 x7 U* s! U: \6 j/ S+ q% W
2.14 Strings 51
4 C$ \9 c( G" [4 s; ^/ _3 V2.15 Expression Width 52! G( W5 Y# _3 O5 U
2.16 Net Types 534 l4 U# H" k. a' W- Z
2.17 Conclusion 536 a. ^. W7 m4 i) x/ W; J
3. PROCEDURAL STATEMENTS AND ROUTINES 55
6 i6 W" m7 N0 Z, e/ v6 t7 X: v& C9 O3.1 Introduction 55
" y, B% v" }& e5 q' L3 Y( Q3.2 Procedural Statements 55* a5 e/ L) E, k4 f! H" n
3.3 Tasks, Functions, and Void Functions 56/ o# F9 u( D' }( T6 A
3.4 Task and Function Overview 57
# S5 k7 W1 ?, J% H* X( R0 \3.5 Routine Arguments 57
8 m" f% I4 g/ Z2 h3.6 Returning from a Routine 62
R0 l1 n- O: t9 S: S0 k3.7 Local Data Storage 62
u' N; o7 M* y* c3.8 Time Values 64
% `! Z {/ ^; {& K U3 \4 W3.9 Conclusion 651 T+ W& u) e1 ~+ X3 u0 y
4. BASIC OOP 67 c: F+ a+ ~2 G* i9 X6 G& o! f
4.1 Introduction 67
2 ^$ t2 `5 m& C3 j6 O4.2 Think of Nouns, not Verbs 672 j" ^& ?5 M# U% P m/ P; F
4.3 Your First Class 68; K+ y0 V7 s0 A
4.4 Where to Define a Class 69
6 _6 E; C% X" J+ C; u4.5 OOP Terminology 69( f3 M5 m5 ?! y, b( ] @
4.6 Creating New Objects 70* A K" z7 a" ]5 y
4.7 Object Deallocation 743 z2 Z" J- f8 P ~9 f5 Z) I
4.8 Using Objects 76
5 S# ?, J, M6 `, v4.9 Static Variables vs. Global Variables 76
) q; k/ i! }; Y" z7 ?7 g; L7 q4.10 Class Routines 787 b; F( O: d. t7 ?$ J% u" r
4.11 Defining Routines Outside of the Class 79
5 }2 o& ^- @! l+ M8 d& d4.12 Scoping Rules 81+ ]. R$ O% Q& o. D, a# ?
4.13 Using One Class Inside Another 85
2 r- ]& W7 x% x/ w P, f% f4.14 Understanding Dynamic Objects 87
) l% N! a8 U+ h" D3 I* |4.15 Copying Objects 91
& ?7 R4 e" p. h) D1 d2 u4.16 Public vs. Private 95! d; q0 G: Q8 |
Contents ix
5 M, u5 f( I) Q+ c; G0 p4.17 Straying Off Course 96
0 `8 h9 o H& w$ h) D4.18 Building a Testbench 96
- g' H$ z( a1 Y8 }4.19 Conclusion 97
* ?6 @ z; b9 O# s5. CONNECTING THE TESTBENCH AND DESIGN 99/ h9 u$ b/ ^4 G5 ]0 M$ H; m4 {3 e; p
5.1 Introduction 99
5 P$ M* p+ ?- w5.2 Separating the Testbench and Design 99
D& r( v6 {' r5.3 The Interface Construct 1024 I$ \: I$ P; J
5.4 Stimulus Timing 108
+ ]0 n# c0 h! ^3 E3 z5.5 Interface Driving and Sampling 1149 K+ U) X9 P# t8 H2 R; G
5.6 Connecting It All Together 121
: |' D, i$ S: ~ l2 k8 ^- k5.7 Top-Level Scope 1214 f0 E w8 p+ f5 e" k4 G$ K% D
5.8 Program – Module Interactions 123: \; ]: r3 w$ P9 L5 Q4 M; L
5.9 SystemVerilog Assertions 1241 V! I1 K/ g0 g- a" X @
5.10 The Four-Port ATM Router 126
3 N' ]( a [# L5.11 Conclusion 1346 ]3 m0 y x2 E. r V" Q
6. RANDOMIZATION 135& |4 R, y4 Q/ P5 n3 U4 z5 ^
6.1 Introduction 135
. W0 b! m- a9 e" R3 j1 V( t6.2 What to Randomize 136/ @. r- a4 s: b3 M, P4 m
6.3 Randomization in SystemVerilog 138
- h5 J( \ _, r, _# w6.4 Constraint Details 141
. y9 [4 J, K1 u6.5 Solution Probabilities 149' d$ p( z) K- J5 { v
6.6 Controlling Multiple Constraint Blocks 154
3 s; D h; N+ _# _2 u& e# A: j% o, c6.7 Valid Constraints 154
0 ^7 }7 g3 s+ Z4 f, _5 q6.8 In-line Constraints 155* q3 T) k% s t% K9 T z/ O. O6 r% c
6.9 The pre_randomize and post_randomize Functions 156
+ e' r0 d: U& ^1 A- U* d7 m6.10 Constraints Tips and Techniques 158' n/ e, H* F8 j6 J) z
6.11 Common Randomization Problems 164
# W1 T. z" z; L# r- `1 m6.12 Iterative and Array Constraints 165
8 Z0 _" s X0 x2 \1 O( M/ S6.13 Atomic Stimulus Generation vs. Scenario Generation 1728 d9 `* E) V' J3 a. c3 e. c- D
6.14 Random Control 175) B4 J6 k; y' U) g2 v/ R1 l$ c+ O
6.15 Random Generators 177# {1 m' z+ s" W' X8 F+ _
6.16 Random Device Configuration 180) v2 F1 _: l' Y$ B5 i6 ]
6.17 Conclusion 182% Z' E4 r* W9 K S
7. THREADS AND INTERPROCESS COMMUNICATION 183& m2 d6 C4 ~* r& U) W4 M' \
7.1 Introduction 183# D8 Q3 O% K o8 {3 c( K9 J
7.2 Working with Threads 184
; i/ G5 A/ k3 U: C& u* J7.3 Interprocess Communication 194
3 y+ W) B t ~$ ~7.4 Events 195+ M) O: b/ W1 j) l: `
7.5 Semaphores 199
2 b7 U2 N# {& p0 ` a8 D7.6 Mailboxes 201" Z0 L+ s; ]. s9 ^1 @
7.7 Building a Testbench with Threads and IPC 210) O0 T1 x8 U+ S& R2 `) G
x SystemVerilog for Verification
6 B) s2 D( K; X: l. Q7.8 Conclusion 214/ @( ?4 O/ h; }# z* v
8. ADVANCED OOP AND GUIDELINES 215
2 K3 |$ {# _' G ?( @8.1 Introduction 2154 _( R* N; j) C/ D1 Z6 `2 g
8.2 Introduction to Inheritance 216
/ ~( @& Z& H' a4 ?# t8.3 Factory Patterns 221' S9 `* C& D" O" N( u2 K
8.4 Type Casting and Virtual Methods 225+ j! e) f' c8 u2 U
8.5 Composition, Inheritance, and Alternatives 2287 V6 s* ]5 Q5 r' s O$ y2 g
8.6 Copying an Object 233* ?9 s" [) o8 K# |
8.7 Callbacks 236
# l$ Z0 A9 M+ h; S2 r8.8 Conclusion 240: K2 V [9 D/ B+ N% f
9. FUNCTIONAL COVERAGE 241
2 `3 A# p2 [* ]- \( O& w" A9.1 Introduction 2416 p" \; m% d" J0 } a
9.2 Coverage Types 2430 v: y' f# V/ I7 I G2 n
9.3 Functional Coverage Strategies 2469 J+ F, I+ ~; k2 D3 A0 p9 G; c: I! C
9.4 Simple Functional Coverage Example 2486 Q! e* S e- z0 F) g
9.5 Anatomy of a Cover Group 251. J( f8 i" i( D
9.6 Triggering a Cover Group 253
1 b2 V( V% O2 V6 _ a/ u9.7 Data Sampling 2563 z# A* {7 S9 Y' U; k6 b" n2 [
9.8 Cross Coverage 265
6 M" _8 f+ s& b: W5 [. j8 m6 _9.9 Coverage Options 272
0 A7 r: f* X( h; j, ?$ V( y9.10 Parameterized Cover Groups 274- V u9 K3 |% O' t5 D- I1 Y
9.11 Analyzing Coverage Data 275
* B* p: b: ~9 m% {7 j( s9.12 Measuring Coverage Statistics During Simulation 276. f0 d: }3 ^8 D/ x
9.13 Conclusion 277: S3 S: {' r* W# q6 B' k) B" l
10. ADVANCED INTERFACES 279
3 L5 E+ \6 A8 k+ ^" a% k10.1 Introduction 279
5 l. o4 a9 x3 C$ \10.2 Virtual Interfaces with the ATM Router 2799 W" f( a4 d' G( }& A% C
10.3 Connecting to Multiple Design Configurations 284( R9 l, @" ^& C* p/ U; z
10.4 Procedural Code in an Interface 290
W7 ~# k4 I2 E, \+ `10.5 Conclusion 294
, y0 V0 _ A- MReferences 295
' B+ m r! }& J: h% {Index 297
& o# C' m% B3 F+ G* g: O! B5 Y |
|