User guide

ii
2. Modeling Your Design
Avoiding Race Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Using and Setting a Value at the Same Time . . . . . . . . . . . . 2-2
Setting a Value Twice at the Same Time . . . . . . . . . . . . . . . . 2-3
Flip-Flop Race Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Continuous Assignment Evaluation . . . . . . . . . . . . . . . . . . . . 2-5
Counting Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
Time Zero Race Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Optimizing Testbenches for Debugging. . . . . . . . . . . . . . . . . . . . 2-8
Conditional Compilation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Enabling Debugging Features At Runtime. . . . . . . . . . . . . . . 2-10
Combining the Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Avoiding the Debugging Problems From Port Coercion . . . . . . . 2-14
Creating Models That Simulate Faster . . . . . . . . . . . . . . . . . . . . 2-15
Unaccelerated Data Types, Primitives, and Statements . . . . 2-16
Inferring Faster Simulating Sequential Devices. . . . . . . . . . . 2-18
Modeling Faster always Blocks . . . . . . . . . . . . . . . . . . . . . . . 2-22
Using the +v2k Compile-Time Option . . . . . . . . . . . . . . . . . . 2-23
Case Statement Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
Memory Size Limits in VCS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
Using Sparse Memory Models . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
Obtaining Scope Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
Scope Format Specifications . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
Returning Information About the Scope. . . . . . . . . . . . . . . . . 2-30