|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
Table of Contents
1.0 Introduction ............................................................................................................................3
2.0 Declaration gotchas ................................................................................................................4
2.1 Case sensitivity ............................................................................................................4
2.2 Implicit net declarations ............................................................................................... 5
2.3 Escaped identifiers in hierarchy paths ......................................................................... 6
2.4 Verification of dynamic data ....................................................................................... 7
2.5 Variables declared in unnamed blocks ........................................................................ 8
2.6 Hierarchical references to declarations imported from packages ................................ 8
2.7 Variables with no hierarchy path are not dumped to VCD files .................................. 9
2.8 Shared variables in modules ........................................................................................ 9
2.9 Shared variables in interfaces, packages, and $unit ................................................... 10
2.10 Shared variables in tasks and functions ..................................................................... 10
2.11 Importing enumerated types from packages .............................................................. 11
2.12 Importing from multiple packages ............................................................................. 11
3.0 Two-state gotchas ................................................................................................................12
3.1 Resetting 2-state models ............................................................................................ 12
3.2 Locked state machines ............................................................................................... 13
3.3 Hidden design problems ............................................................................................ 15
3.4 Out-of-bounds indication lost .................................................................................... 16
4.0 Literal number gotchas ........................................................................................................16
4.1 Signed versus unsigned literal integers ...................................................................... 17
4.2 Default base of literal integers ................................................................................... 17
4.3 Size mismatch in literal integers ................................................................................ 18
4.4 Literal number size mismatch in assignments ........................................................... 20
4.5 Literal number Z and X extension backward compatibility ...................................... 21
4.6 Filling vectors ............................................................................................................ 22
4.7 Passing real (floating point) numbers through ports .................................................. 22
4.8 Port connection rules ................................................................................................. 23
4.9 Back-driven input ports ............................................................................................. 26
5.0 Operator gotchas ..................................................................................................................27
5.1 Self-determined operations versus context-determined operations ........................... 27
5.2 Operation size and sign extension in assignment statements .................................... 30
5.3 Signed arithmetic ....................................................................................................... 32
5.4 Bit select and part select operations ........................................................................... 34
5.5 Increment, decrement and assignment operations ..................................................... 35
5.6 Pre-increment versus post-increment operations ....................................................... 35
5.7 Operations that modify the same variable multiple times in an assignment ............. 36
5.8 Operator evaluation short circuiting .......................................................................... 37
6.0 Programming gotchas ..........................................................................................................38
6.1 Assignments in expressions ....................................................................................... 38
6.2 Procedural block activation ....................................................................................... 38
6.3 Combinational logic sensitivity lists .......................................................................... 40
6.4 Arrays in sensitivity lists ............................................................................................ 41
6.5 Vectors in sequential logic sensitivity lists ................................................................ 42
6.6 Operations in sensitivity lists ..................................................................................... 43
6.7 Sequential blocks with begin...end groups ............................................................... 44
6.8 Sequential blocks with partial resets .......................................................................... 45
6.9 Blocking assignments in sequential procedural blocks ............................................. 45
6.10 Evaluation of true/false on 4-state values .................................................................. 46
6.11 Mixing up the not operator ( ! ) and invert operator ( ~ ) .......................................... 47
6.12 Nested if...else blocks ................................................................................................ 47
6.13 Casez/casex masks in case expressions ..................................................................... 48
6.14 Incomplete or redundant decisions ............................................................................ 49
6.15 Out-of-bounds assignments to enumerated types ...................................................... 50
6.16 Statements that hide design problems ........................................................................ 51
6.17 Simulation versus synthesis mismatches ................................................................... 53
7.0 Testbench gotchas ................................................................................................................53
7.1 Multiple levels of the same virtual method ............................................................... 53
7.2 Event trigger race conditions ..................................................................................... 54
7.3 Using semaphores for synchronization ...................................................................... 56
7.4 Using mailboxes for synchronization ........................................................................ 58
7.5 Coverage reporting .................................................................................................... 59
7.6 $unit declarations ....................................................................................................... 60
7.7 Compiling $unit ......................................................................................................... 61
8.0 References ............................................................................................................................62
9.0 About the authors .................................................................................................................62 |
|