|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
1 b$ y! D2 }% v2 E& V2 x/ k" |5 Y
SystemVerilog for Verification:' L p* Z1 J3 V! v2 ^
A Guide to Learning the Testbench Language Features
9 g- Z; |+ H% c b1 j7 P, ~1. VERIFICATION GUIDELINES 1% h3 S$ {+ a7 [0 \* i4 x* A+ F5 e: d
1.1 Introduction 1
9 ?+ [# E, N R- W3 E5 f! V" p" A$ d1.2 The Verification Process 2$ }% @8 c I9 t& I5 O7 ]
1.3 The Verification Plan 4$ y( @! K8 n$ p
1.4 The Verification Methodology Manual 4
/ p& y; _1 u1 X+ v9 T1.5 Basic Testbench Functionality 5
f! c2 \6 _* ]4 f9 D& A8 i1.6 Directed Testing 5
% U( l4 G; {+ b% ~' Q1.7 Methodology Basics 7
1 @) h8 U& m) k/ J5 Q( [1.8 Constrained-Random Stimulus 8' w! e. o0 T0 K' g$ B j
1.9 What Should You Randomize? 10
/ K. F7 |8 c! q% @, l7 p L1.10 Functional Coverage 13( X6 c. [+ r5 q: _
1.11 Testbench Components 151 R+ ~! H! s7 r, {- u, h; M
1.12 Layered Testbench 16" h# A7 u7 N- J9 x# f" {- g
1.13 Building a Layered Testbench 22
8 P1 w( u! O1 s1.14 Simulation Environment Phases 23+ ?2 h7 }4 a+ H" f
1.15 Maximum Code Reuse 24
9 }! k8 @' O" x5 |6 [1.16 Testbench Performance 244 b" N( B3 v, [- r+ V& ?! t
1.17 Conclusion 25
, x* x! t4 o3 P2. DATA TYPES 27: m. M# Y* y: x" p$ f
2.1 Introduction 27
: b- a9 Y: D* ?0 p9 a1 r2.2 Built-in Data Types 27: l1 D9 A; n( O. H4 @! @$ T0 {
viii SystemVerilog for Verification; z5 x9 ~0 O# j
2.3 Fixed-Size Arrays 29
+ h- h, S6 L5 }4 o7 t- V/ u2.4 Dynamic Arrays 34* y# z" R: r3 N1 l
2.5 Queues 36
7 s2 k, z# ]* a/ t( n; B/ t2.6 Associative Arrays 37
4 h2 m) I$ _ x0 O4 r; x4 X3 N2.7 Linked Lists 39
/ n! K8 n: k; t. @& G9 P a2.8 Array Methods 40
+ @4 m% H' W3 |2.9 Choosing a Storage Type 42* O' e) C/ t) I$ ^& }
2.10 Creating New Types with typedef 45 i7 H3 {) T7 r! s2 M2 |+ f
2.11 Creating User-Defined Structures 46- j# C# J% m0 Y- A6 P9 G
2.12 Enumerated Types 47* C. O w& y# i- e$ n M' S
2.13 Constants 51
5 [8 M6 x3 W5 N/ d# N9 t2.14 Strings 51% V1 ^+ h+ z3 \$ A- V
2.15 Expression Width 52
# Q; d# a0 I! `2 J7 e2 V$ i" Q2.16 Net Types 53
( |5 W5 l, ^4 n2.17 Conclusion 538 p5 B7 ]8 t* d: v6 y( O0 w7 _* S/ r9 r
3. PROCEDURAL STATEMENTS AND ROUTINES 55
; q- |! F1 }4 D; S' l N; `3.1 Introduction 55
' \( W* d: p3 E' z) J/ L* K% V) K3.2 Procedural Statements 551 i8 z5 n! ?; V9 ^/ @
3.3 Tasks, Functions, and Void Functions 56 S( I" ~5 W [+ G T E" h3 ~. l
3.4 Task and Function Overview 57
" E7 C+ R' U5 I8 V& C" j: F7 ]3.5 Routine Arguments 57
/ c5 T( a0 I, T* i4 g- P$ |3.6 Returning from a Routine 62
) _$ G! T$ G( B9 l( F3.7 Local Data Storage 625 V9 ^' W# a" |
3.8 Time Values 64
; }; A; q* m" L v2 U( x3.9 Conclusion 65
0 _7 ?* ?& ^- f2 F: Q* P4. BASIC OOP 67
5 J F% b- S+ l! V, W; Q4.1 Introduction 677 L% g8 z4 d4 v6 W* @
4.2 Think of Nouns, not Verbs 676 T+ Y( ^& ]) R0 M5 z0 }# ~% a( z
4.3 Your First Class 68' v8 ]3 h+ U) O A1 j
4.4 Where to Define a Class 69
# ^4 @; k5 N; j& b4.5 OOP Terminology 690 U3 e0 X: n7 @. w0 U. T
4.6 Creating New Objects 70( `. a! y' _$ J
4.7 Object Deallocation 74$ V' y$ W8 T% ^, g/ x
4.8 Using Objects 767 S6 X+ w: L: t& p5 o1 O: \7 D+ Y( l
4.9 Static Variables vs. Global Variables 761 }% K# m0 r1 {% L ^& S
4.10 Class Routines 78
" j9 g5 H4 i0 V4 f! b0 ^& ^6 Z4.11 Defining Routines Outside of the Class 79! d8 Y6 H% M+ f0 z! n h
4.12 Scoping Rules 811 w" ]& {7 h: }, ]( ?3 a# r9 D
4.13 Using One Class Inside Another 85
3 }( J; X" `% `! H0 v, m4.14 Understanding Dynamic Objects 87& O+ v2 P2 U, }! v7 U" Y1 ^2 |1 J
4.15 Copying Objects 91' V. b- r' v4 k" }/ U$ L7 P
4.16 Public vs. Private 956 O3 C! R7 W$ H" H6 H
Contents ix
: U4 c* y6 k% I6 M, J) N* D4.17 Straying Off Course 963 f& g% O* k) [! X, H
4.18 Building a Testbench 96
/ q% N; U: e# V4 S4.19 Conclusion 97
( e' ~9 l8 R; P$ b5. CONNECTING THE TESTBENCH AND DESIGN 99
$ X' c: u- f! i1 q5.1 Introduction 990 \1 m3 d% w, Y* r5 p9 g v
5.2 Separating the Testbench and Design 99# a( h% `3 W% t8 z
5.3 The Interface Construct 102
- N8 r* h3 g+ [3 @* R5.4 Stimulus Timing 108
g. k# ^/ s4 ^4 n3 _- U5.5 Interface Driving and Sampling 114+ k. t! R3 ?( i. w) W' h7 J: [
5.6 Connecting It All Together 1218 N/ Q5 m+ v1 L. i, p
5.7 Top-Level Scope 121: _3 l6 Z2 i& m% Q
5.8 Program – Module Interactions 123; Z4 f3 t% U8 l- ^2 p) R5 R
5.9 SystemVerilog Assertions 124& R- t2 S' ?0 R! t
5.10 The Four-Port ATM Router 126% V. A9 ?# B, w; Q4 \9 a1 m! n
5.11 Conclusion 134
. ~0 Y" s* h. x* C ~" R$ y6. RANDOMIZATION 135
+ o* H3 n6 e* ~ c0 e5 @6 ~/ @6.1 Introduction 135; G# O# t- W3 l( b9 W& D1 t6 j" L
6.2 What to Randomize 136
5 J' n% r9 O' f. @! y6 R6.3 Randomization in SystemVerilog 1383 X% @0 H% y8 N
6.4 Constraint Details 141$ L0 @. M1 d* K4 Y: }. {
6.5 Solution Probabilities 149$ c- P) n; B# h, o4 L! N6 d4 J
6.6 Controlling Multiple Constraint Blocks 154( ?4 I, a0 o; b& I4 J! O
6.7 Valid Constraints 1548 [! y* P' G4 K; G9 s. O2 p/ a# N
6.8 In-line Constraints 155
; U% M7 d( u% q% q/ X. L2 r' i3 d6.9 The pre_randomize and post_randomize Functions 1569 l/ X# d0 m/ [5 n
6.10 Constraints Tips and Techniques 158& b ]2 [! K' ~# [# i W
6.11 Common Randomization Problems 164
$ ?6 ^+ t0 ?% C) j6.12 Iterative and Array Constraints 165
& N2 w" H9 w8 D& N8 k9 X+ p/ m6.13 Atomic Stimulus Generation vs. Scenario Generation 172
6 ]# j8 x3 A5 s) Q; ^) p" L6.14 Random Control 175
1 P# A/ f3 n( V) u* o3 e1 ^; o- a6.15 Random Generators 177/ J1 d2 i+ @& @! e- _) S
6.16 Random Device Configuration 180
7 Q; Y8 T. T; \6.17 Conclusion 1826 w8 t/ \" @$ u
7. THREADS AND INTERPROCESS COMMUNICATION 183
5 J& d3 q" `5 ]+ Q- z7 n- I5 a7.1 Introduction 183/ L* p2 l D* b/ n+ s+ A% E) l
7.2 Working with Threads 184% {. o3 ]% t3 Z- q1 ^7 V
7.3 Interprocess Communication 194
/ a' V% {& B: c$ h: Z. f* R7.4 Events 1958 x7 l. E* L, j/ a
7.5 Semaphores 1999 }3 ^+ k9 c2 g- ?7 b
7.6 Mailboxes 201
! t8 L4 ^6 N7 E7 W7.7 Building a Testbench with Threads and IPC 210* m+ q9 t7 l0 z% P9 @; i
x SystemVerilog for Verification: k( v! B3 b; H) j. l
7.8 Conclusion 214* l4 r9 l: v' N0 |" ]1 e% v
8. ADVANCED OOP AND GUIDELINES 2159 v8 m' o. Z& {& W
8.1 Introduction 215: j. U1 |7 z% E) t) v' e
8.2 Introduction to Inheritance 216
4 ~) G/ @- r& |- a8 |8.3 Factory Patterns 2213 ^5 l) L5 l; s7 d
8.4 Type Casting and Virtual Methods 225
: m/ R# D9 Y8 c- J( R. A, u6 B8.5 Composition, Inheritance, and Alternatives 2280 ]! s" d' D% @
8.6 Copying an Object 233
2 [* w' H6 Z) t$ s; F" C; b0 N8.7 Callbacks 236" Y7 P; z* N- h/ n& {, h
8.8 Conclusion 240
6 A: t+ ]* f! N+ l' L9. FUNCTIONAL COVERAGE 241) Q7 d6 M% O- L# x8 n( k
9.1 Introduction 241
/ s& D9 f3 B' i, P9.2 Coverage Types 2430 {4 C' O1 B- X* `- R8 l. g* p
9.3 Functional Coverage Strategies 246, K }' Z2 j* x W. a$ |
9.4 Simple Functional Coverage Example 248
: w6 g; ]6 C* G+ h, ~5 X- S% L9.5 Anatomy of a Cover Group 251
: G! ^' b% X/ V; i. D2 Z3 M9.6 Triggering a Cover Group 253
. x/ z) ?& M5 P9.7 Data Sampling 256$ g) X" [3 ~" y% j% f) [
9.8 Cross Coverage 265% F; l+ Z( \% T( g u
9.9 Coverage Options 272. J3 F* O3 e4 T( A- H4 U
9.10 Parameterized Cover Groups 274! K' K, I$ }" u% U& J% S0 C4 v9 d
9.11 Analyzing Coverage Data 275
4 o% ]" _, \/ _8 N' W9.12 Measuring Coverage Statistics During Simulation 276% |" w- a# }! y! }* H1 l
9.13 Conclusion 277 h: s) B! v! y6 Z$ y0 G8 g% \8 N7 B
10. ADVANCED INTERFACES 2795 j4 p; p. n M" H' w3 b
10.1 Introduction 279) e7 M! S+ k8 |% ~' u
10.2 Virtual Interfaces with the ATM Router 279- q! E% F( \4 f6 ?6 {7 V) n- k
10.3 Connecting to Multiple Design Configurations 284/ ~5 e3 q, E; C. Z1 N
10.4 Procedural Code in an Interface 290
1 B- k/ V: w+ y% J" b8 y10.5 Conclusion 294% w& E' w, F9 Z3 D1 @
References 2951 `0 M% ?) D* Q6 S4 [. n8 Q# m& b
Index 297# \5 |& G, e* ]
|
|