|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
9 U/ s1 h6 H) K' T
SystemVerilog for Verification:& y9 }! I% D+ _+ V* P9 h# s
A Guide to Learning the Testbench Language Features
: @ D% U( i4 C+ _2 Y- ?) i1. VERIFICATION GUIDELINES 1
# s8 m5 H+ Q3 U; B- s6 L' y1.1 Introduction 1
/ v9 H9 @6 D. J0 x1.2 The Verification Process 2
1 l5 q$ A. j+ O3 z7 L' c1.3 The Verification Plan 43 H& h& _9 D/ e5 q( \
1.4 The Verification Methodology Manual 4
( [) W" p2 I7 }! `1 R1.5 Basic Testbench Functionality 5
! S5 L% P: Z- t: i, d5 @1.6 Directed Testing 5
7 G" s* d! I+ v' X0 K0 S1.7 Methodology Basics 7
# e* V6 |& O& @& z1 C1.8 Constrained-Random Stimulus 8! V" G7 M$ `4 T/ l+ v
1.9 What Should You Randomize? 10' `4 I0 l5 _& y% v
1.10 Functional Coverage 13
/ g4 v; \6 Z0 S, d" {1.11 Testbench Components 15
6 y' s6 ]+ h1 D0 u# q. c- [1.12 Layered Testbench 16! l- \2 ?" {- C, \8 n. d3 \( r
1.13 Building a Layered Testbench 22
- Z# j0 y. Y3 Q2 ?* [% O" R% |1.14 Simulation Environment Phases 23
8 U0 x7 X2 ?8 \; P1 }" F/ }2 h1.15 Maximum Code Reuse 24
& A t/ s+ ~* r) q7 E1.16 Testbench Performance 24
+ D' Y f: L2 U1 @1.17 Conclusion 25
1 b0 x- M0 `. v2. DATA TYPES 270 h9 u L6 w D! r4 n7 K
2.1 Introduction 27
1 Y3 B. y5 v+ G$ o8 |4 l( `% F# W# R9 z2.2 Built-in Data Types 27; F! x! N! ? H
viii SystemVerilog for Verification8 D7 r) i2 ^4 @$ T9 a- T8 F5 H) r
2.3 Fixed-Size Arrays 29
2 R1 h* \! Y4 `% W- a8 G2.4 Dynamic Arrays 345 M; t& J* {% x0 F, ]* k
2.5 Queues 36" F2 \* T K0 a3 r4 W$ T; b
2.6 Associative Arrays 37; u. b) t# {$ T& N5 T# o6 Y
2.7 Linked Lists 39- e! ^4 D/ @* R1 L& D
2.8 Array Methods 40
; Z+ z! T& o* f' G5 o. s3 u2.9 Choosing a Storage Type 42
, M k& }+ V p* }8 ^: M2.10 Creating New Types with typedef 45
7 y5 y# i6 o, `- S6 V1 b+ Z- r, ?2.11 Creating User-Defined Structures 469 H: \5 T4 Y6 q) R8 H% \6 \
2.12 Enumerated Types 47
" Q, r+ a+ V1 w R* Y2.13 Constants 519 d1 _+ @: l% U8 [& G9 `
2.14 Strings 51/ {* y; e% Q: v$ \3 N9 R
2.15 Expression Width 52
2 F; m' e: k! D' Z: `# f( `2.16 Net Types 53& I4 b j- d3 l/ d8 m. M
2.17 Conclusion 53
- x; S6 r# e" `6 a8 a+ u* U3. PROCEDURAL STATEMENTS AND ROUTINES 55& t0 I$ c' y& f A2 D
3.1 Introduction 55
9 y. A8 u& x! O6 a( N: M3.2 Procedural Statements 559 ` ]" {4 j' C
3.3 Tasks, Functions, and Void Functions 56
6 c9 ~) L1 A2 h. `6 I3.4 Task and Function Overview 57
+ y$ P& S5 `4 t# C* s# v3 S3.5 Routine Arguments 57! N, N8 l/ z' Y- E
3.6 Returning from a Routine 62
; S3 r4 G' O3 R3.7 Local Data Storage 628 J# @" m" ~% D! ~
3.8 Time Values 64' \5 z/ M$ i7 M( B2 W; I
3.9 Conclusion 658 d6 R# s0 Z( v. ^7 t
4. BASIC OOP 67
2 N7 T# }6 @" z* u/ c. ^1 Y5 L4.1 Introduction 67
" F9 l" G6 z$ c4 M0 n% @ A4.2 Think of Nouns, not Verbs 67
+ D/ E% X! N1 x9 S: R4.3 Your First Class 68
7 |8 {' q+ N3 ~" B# R9 a; K4.4 Where to Define a Class 69& z r h2 u8 h
4.5 OOP Terminology 69* Y9 Y2 U' l$ R. `( b" a
4.6 Creating New Objects 70
" D; v/ C! \/ y( _$ X6 d1 x0 Q4.7 Object Deallocation 74
0 T0 c/ b. q% s5 ?- Y4.8 Using Objects 76
* K7 p1 b+ t7 o: j$ Q4.9 Static Variables vs. Global Variables 76( \9 D k6 [5 N! w- s) E
4.10 Class Routines 782 i6 m% z$ i2 H0 U& n% C5 Q o$ y- l
4.11 Defining Routines Outside of the Class 79" m' R3 e& }/ `- T; |2 O
4.12 Scoping Rules 81- U+ O* G$ q( V7 t# ?
4.13 Using One Class Inside Another 85
5 T6 |% ]6 d" F7 y! a4 z9 {4.14 Understanding Dynamic Objects 87
\8 r% g9 J9 Y) q4.15 Copying Objects 91
% H6 W8 Q$ d1 D6 |, g: W* H4.16 Public vs. Private 958 o _5 B$ V2 i$ E: _/ W m
Contents ix
. t& A& p& K4 m! |5 u. A) Y Y4.17 Straying Off Course 96
7 X; F5 s: B0 n; d' @- i# T4.18 Building a Testbench 96' M: C; D! O8 p; a7 I
4.19 Conclusion 97
; D' i7 f/ I0 _* }: E5. CONNECTING THE TESTBENCH AND DESIGN 99
! `6 H8 C! L. U& C4 S5.1 Introduction 99, H& B% d3 C1 ^' i
5.2 Separating the Testbench and Design 99
/ m& h- S' E# j" R1 d9 ~5.3 The Interface Construct 102
0 y1 \( }; `; W, O9 C, Y5.4 Stimulus Timing 108
! S2 C" e: \" Q; o" {5.5 Interface Driving and Sampling 114: F/ m3 h1 Q4 i+ C6 h
5.6 Connecting It All Together 121( L& p4 x0 W) l. e: H% m
5.7 Top-Level Scope 1215 E. I" k' g% V
5.8 Program – Module Interactions 1232 t$ g* q) ~& m# W5 ~5 y4 i6 @
5.9 SystemVerilog Assertions 124/ p& Q: n8 p( y9 _. P
5.10 The Four-Port ATM Router 126
1 d" A, K' C& O; P5 q1 ^- x$ W5.11 Conclusion 134
0 {, N+ {5 D1 B0 ?% X) q6 ]6. RANDOMIZATION 135# K7 F# f' o) ~! C
6.1 Introduction 135
+ t0 l" e; v$ v+ R& z* _0 o6.2 What to Randomize 1365 d: L& j# ~+ K% I1 R
6.3 Randomization in SystemVerilog 138
- h! ?5 {9 u: x3 _2 Z! |3 n4 v6.4 Constraint Details 141 n( M Z" k8 `; {7 x
6.5 Solution Probabilities 149; T$ ~3 Y9 K8 K5 a6 b
6.6 Controlling Multiple Constraint Blocks 154
F* v3 ~% m% k" v F6.7 Valid Constraints 154$ B0 g v+ J: o* p6 V
6.8 In-line Constraints 155
8 h& }: k0 j1 ]* M( i' Q6.9 The pre_randomize and post_randomize Functions 156
1 ^( n4 q2 `" U2 j6.10 Constraints Tips and Techniques 1589 s9 v0 o- i2 M9 Z1 Y0 ~
6.11 Common Randomization Problems 164
. O& i0 X n2 B3 T, d9 i, P6.12 Iterative and Array Constraints 165 a3 M& G' |* w( f# v
6.13 Atomic Stimulus Generation vs. Scenario Generation 172/ x& q8 ]' R% V, y @2 H6 B: M
6.14 Random Control 175
+ }7 Q1 m: S- G+ E% k% r6.15 Random Generators 177- q) J1 F- I- B0 t
6.16 Random Device Configuration 180) C6 E) S6 M/ ^8 K( L8 V _
6.17 Conclusion 182
0 I2 v$ ]7 D& p+ m) ` Z: U7. THREADS AND INTERPROCESS COMMUNICATION 183
4 f b9 G/ s% q0 D4 h7.1 Introduction 183' B5 Y6 R/ f+ ^3 j1 x; s# A
7.2 Working with Threads 184; @% e1 c7 G4 k1 q( F
7.3 Interprocess Communication 194! K' ?4 K* u; h" a4 n% R$ N( R) K
7.4 Events 195" \; g! M2 _9 s3 u3 S+ R7 h+ g
7.5 Semaphores 199' u d5 M3 r( x/ v; r* T3 O
7.6 Mailboxes 201/ J2 Z! }% `& g0 O4 ~
7.7 Building a Testbench with Threads and IPC 210
^) A2 @, H0 o) Dx SystemVerilog for Verification7 V5 ?$ S: r! ^; X! C
7.8 Conclusion 214
$ b6 G2 ~ ]! N, q8. ADVANCED OOP AND GUIDELINES 215! u- Y/ j/ b9 [2 v$ B& N
8.1 Introduction 215
; w2 Q- J. C1 |1 v( o: A$ \8.2 Introduction to Inheritance 216) t! o0 Y8 c% {4 h3 g
8.3 Factory Patterns 221# C# o, D! L* h0 y- z: T
8.4 Type Casting and Virtual Methods 225
$ p" g- R3 {- R1 F4 k8.5 Composition, Inheritance, and Alternatives 228
; v( E" F0 E' u5 ?* y9 T8.6 Copying an Object 233# a. k: d' C' @$ C5 r0 ?
8.7 Callbacks 236# k6 {( A+ g+ C1 M* d
8.8 Conclusion 240
1 [/ {: z8 o) a' Y( L1 x9. FUNCTIONAL COVERAGE 241
% w* A; a$ N' }6 P. A$ q9.1 Introduction 241
! a$ s+ v- J' |$ S9.2 Coverage Types 2437 W: h% v& i, [# g+ f
9.3 Functional Coverage Strategies 246
+ D, c: j9 p% v6 Z& |9.4 Simple Functional Coverage Example 248
% [3 q8 ?7 c) `8 C# }9.5 Anatomy of a Cover Group 251
9 x* N: T: {, M' ^9.6 Triggering a Cover Group 253, }1 m. @) a& x2 Q5 |; T
9.7 Data Sampling 256# \& i" b1 U, x& G% }% Z
9.8 Cross Coverage 265
; V5 J! Q" A# k& C) Z$ U* y9.9 Coverage Options 272
- P% C5 N- H$ q% f8 }: M9.10 Parameterized Cover Groups 2743 j8 Q. l% X0 q/ C, k
9.11 Analyzing Coverage Data 275
( W# z& ^& v" J0 k; l H9.12 Measuring Coverage Statistics During Simulation 276/ J8 q8 G% ^2 r+ V9 N
9.13 Conclusion 277
! i4 \% }8 U. z& o- x10. ADVANCED INTERFACES 279
8 Q$ i( ^# U, s8 |10.1 Introduction 279 M; @: _$ X; W
10.2 Virtual Interfaces with the ATM Router 279
2 M# o4 X" M" C w10.3 Connecting to Multiple Design Configurations 284
, e2 U! ]. U: ]& H10.4 Procedural Code in an Interface 290! J* D+ d, p: k( K, c. \! k/ z
10.5 Conclusion 294
f" a5 y% }0 J) eReferences 2953 @7 d8 h" e; m6 k* g
Index 297: C" ]8 K) h. T' z- a( A
|
|