Vous êtes sur la page 1sur 10

PSL: Assertion Based Verification With

Questa - VHDL Flavor


Student Workbook

Copyright Mentor Graphics Corporation 1991 - 2011. All rights reserved. This document contains
information that is proprietary to Mentor Graphics Corporation and may not be duplicated in whole or in
part in any form without written consent from Mentor Graphics. In accepting this document, the recipient
agrees to make every reasonable effort to prevent the unauthorized use of this information.

This document is for information and instruction purposes. Mentor Graphics reserves the right to make
changes in specifications and other information contained in this publication without prior notice, and the
reader should, in all cases, consult Mentor Graphics to determine whether any changes have been
made.
The terms and conditions governing the sale and licensing of Mentor Graphics products are set forth in
written agreements between Mentor Graphics and its customers. No representation or other affirmation
of fact contained in this publication shall be deemed to be a warranty or give rise to any liability of Mentor
Graphics whatsoever.
MENTOR GRAPHICS MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OR MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE.
MENTOR GRAPHICS SHALL NOT BE LIABLE FOR ANY INCIDENTAL, INDIRECT, SPECIAL, OR
CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS)
ARISING OUT OF OR RELATED TO THIS PUBLICATION OR THE INFORMATION CONTAINED IN IT,
EVEN IF MENTOR GRAPHICS CORPORATION HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
RESTRICTED RIGHTS LEGEND 03/97
U.S. Government Restricted Rights. The SOFTWARE and documentation have been developed entirely
at private expense and are commercial computer software provided with restricted rights. Use,
duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the
restrictions set forth in the license agreement provided with the software pursuant to DFARS 227.72023(a) or as set forth in subparagraph (c)(1) and (2) of the Commercial Computer Software - Restricted
Rights clause at FAR 52.227-19, as applicable.
Contractor/manufacturer is:
Mentor Graphics Corporation
8005 S.W. Boeckman Road, Wilsonville, Oregon 97070-7777.
Telephone: 503.685.7000
Toll-Free Telephone: 800.592.2210
Website: www.mentor.com
Supportnet: supportnet.mentor.com/
Send Feedback on Documentation: supportnet.mentor.com/user/feedback_form.cfm
TRADEMARKS: The trademarks, logos and service marks (Marks) used herein are the property of
Mentor Graphics Corporation or other third parties. No one is permitted to use these Marks without the
prior written consent of mentor Graphics or the respective third-party owner. The use herein of a thirdparty mark is not an attempt to indicate mentor Graphics as a source of a product, but is intended to
indicate a product from, or associated with, a particular third party. A current list of Mentor Graphics
trademarks may be viewed at: www.mentor.com/terms_conditions/trademarks.cfm.
End-User License Agreement: TYou can print a copy of the End-User License Agreement from:
www.mentor.com/terms_conditions/enduser.cfm.
Part Number: 071991

Table of Contents

TABLE OF CONTENTS
Module 1
Basics of Assertion Based Verification ..............................................................1-1
Verification Trend ..............................................................................................1-2
Why Traditional Simulation Is Not Sufficient ....................................................1-3
Assertion Based Verification What Is It? ......................................................1-5
Assertion Based Verification Why? ..............................................................1-7
An Example of Assertion Usage .........................................................................1-8
Open Verification Library OVL ..................................................................1-10
Why PSL? .........................................................................................................1-11
Assertion versus Property .................................................................................1-12
What Properties Are Written About .................................................................1-13
PSL Language Structure Pyramid ....................................................................1-15
PSL Language Structure ...................................................................................1-17
PSL Flavors ......................................................................................................1-19
Flavor Differences ............................................................................................1-20
Simple Flavor Examples ...................................................................................1-23
PSL Language Structure Pyramid ....................................................................1-24
Boolean Expressions .........................................................................................1-25
Clock Expressions ............................................................................................1-27
Specifying a Default Clock ...............................................................................1-28
PSL Language Structure Pyramid ....................................................................1-29
Temporal Layer ................................................................................................1-30
Sequences .........................................................................................................1-31
Sequence Time Steps ........................................................................................1-32
Some Sequence Operators ................................................................................1-34
Examples of Sequences ....................................................................................1-36
Short Break and Questions ...............................................................................1-39
Named Sequences .............................................................................................1-40
Some Definitions ..............................................................................................1-41
PSL Language Structure Pyramid ....................................................................1-43
Properties ..........................................................................................................1-44
Logical Implications .........................................................................................1-45

PSL: Assertion Based Verification With Questa - VHDL Flavor

iii

Table of Contents

TABLE OF CONTENTS (Cont.)


Suffix Implications ...........................................................................................1-47
Property Operators ............................................................................................1-49
Property Operator Waveforms ..........................................................................1-51
Property Terminating Operators .......................................................................1-52
Examples of Properties .....................................................................................1-54
So You Understand Properties? ........................................................................1-58
Named Properties ..............................................................................................1-59
PSL Language Structure Pyramid ....................................................................1-60
Verification Layer .............................................................................................1-61
Directives ..........................................................................................................1-62
Directives Defined ............................................................................................1-63
Directives Examples .........................................................................................1-65
Assert Directive ................................................................................................1-66
PSL Language Structure Pyramid ....................................................................1-67
PSL Embedded in VHDL Code ........................................................................1-68
vunits .................................................................................................................1-70
vunit Binding by Name .....................................................................................1-72
Modeling Layer ................................................................................................1-74
PSL Examples ...................................................................................................1-75
Design Block Diagram .....................................................................................1-76
Verify That Reset Occurs .................................................................................1-77
Verify Read & Write Responses .......................................................................1-78
Verify cs De-Asserts After R/W .......................................................................1-79
Module Summary .............................................................................................1-80
Lab 1 .................................................................................................................1-81
Architects ..........................................................................................................1-82
Designer ............................................................................................................1-83
Verification Engineer ........................................................................................1-84
Solutions to Earlier Questions ..........................................................................1-85

iv

PSL: Assertion Based Verification With Questa - VHDL Flavor

Table of Contents

TABLE OF CONTENTS (Cont.)


Module 2
Assertion Based Verification in Questa .............................................................2-1
Questa for PSL and ABV ...................................................................................2-2
Using PSL With Questa ......................................................................................2-3
Compiling PSL for Questa ..................................................................................2-4
Simulating PSL With Questa ..............................................................................2-6
Assertion Controls Requirements ..................................................................2-8
Assertion Observability Requirements ........................................................2-10
Assertion Browser Window ..............................................................................2-12
Assertion Settings .............................................................................................2-15
Configure Selected Assertions Dialog Box ......................................................2-16
Assertions in Wave Window ............................................................................2-18
Assertion Text in Main Window ......................................................................2-20
Enabling the Assertion Thread Viewer (ATV) .................................................2-21
Viewing the ATV .............................................................................................2-22
Debugging Assertions in the ATV ...................................................................2-24
PSL Debug Process ...........................................................................................2-28
Simulator PSL Commands ...............................................................................2-36
Assertion Pass Command .................................................................................2-37
Assertion Fail Command ..................................................................................2-39
Assertion Action Command .............................................................................2-41
Assertion Count Command ...............................................................................2-42
End of Simulation Note ....................................................................................2-43
ATV Commands ...............................................................................................2-44
PSL and Simulator Performance ......................................................................2-45
Questa PSL Support Status ...............................................................................2-47
Module Summary .............................................................................................2-48
Lab 2 .................................................................................................................2-49
Graphic Symbols for ATV ................................................................................2-50

PSL: Assertion Based Verification With Questa - VHDL Flavor

Table of Contents

TABLE OF CONTENTS (Cont.)


Module 3
Functional Coverage With PSL .........................................................................3-1
Code Coverage ....................................................................................................3-2
Functional Coverage ...........................................................................................3-5
Defining Functional Coverage ............................................................................3-7
Functional Coverage Questions ..........................................................................3-8
PSL Cover Directive ...........................................................................................3-9
PSL Cover Directive Examples ........................................................................3-10
Questa PSL Functional Coverage Flow ............................................................3-12
Compiling and Simulating ................................................................................3-13
Opening Functional Coverage Window ...........................................................3-14
Configuring Functional Coverage Directives ...................................................3-15
Recursive Mode ................................................................................................3-17
Configuring Functional Coverage ....................................................................3-18
Weighting .........................................................................................................3-20
Example Weighting Scenario ...........................................................................3-21
AtLeast Counts .................................................................................................3-22
Viewing Statistics .............................................................................................3-23
Viewing Source and Waves ..............................................................................3-25
Count Mode ......................................................................................................3-26
Filtering .............................................................................................................3-27
Clearing .............................................................................................................3-28
Save Functional Coverage ................................................................................3-29
Calculating Total Functional Coverage ............................................................3-30
Functional Coverage Reports ...........................................................................3-33
Understanding Functional Coverage Statistics .................................................3-36
Example Statistics Calculation .........................................................................3-37
Functional Coverage Review ............................................................................3-38
Module Summary .............................................................................................3-39
Lab 3 .................................................................................................................3-40

vi

PSL: Assertion Based Verification With Questa - VHDL Flavor

Table of Contents

TABLE OF CONTENTS (Cont.)


Module 4
More Assertion Techniques and Syntax ............................................................4-1
Clocks .................................................................................................................4-2
Clocked SEREs ...................................................................................................4-4
Named Sequences With Parameters ...................................................................4-5
Named Sequence Example .................................................................................4-6
Sequence Fusion Operator ..................................................................................4-7
Sequence OR Operator .......................................................................................4-8
Sequence OR Operator Example ......................................................................4-10
Sequence Non-Matching AND Operator ..........................................................4-11
Sequence Matching AND Operator ..................................................................4-12
Sequence Within Operator ................................................................................4-13
Named Properties With Parameters ..................................................................4-14
Named Property Example .................................................................................4-15
Strong versus Weak Operators .........................................................................4-17
Example of a Strong Operator ..........................................................................4-18
Example of a Weak Operator ...........................................................................4-19
Choice of Terminating Cycle ............................................................................4-20
Operator Families .............................................................................................4-21
next Family .......................................................................................................4-22
next_a and next_e Families ..............................................................................4-23
next, next_a and next_e Waveforms .................................................................4-24
next, next_a and next_e Examples ....................................................................4-25
before Families .................................................................................................4-26
before and until Waveforms .............................................................................4-28
before and until Examples ................................................................................4-30
Examples of until ..............................................................................................4-31
Logical Property Operators ...............................................................................4-34
Safety versus Liveness ......................................................................................4-35
Examples of Safety and Liveness .....................................................................4-37
Clocked Properties ............................................................................................4-38
Clock Property Examples .................................................................................4-39

PSL: Assertion Based Verification With Questa - VHDL Flavor

vii

Table of Contents

TABLE OF CONTENTS (Cont.)


General PSL Coding Guidelines .......................................................................4-42
Module Summary .............................................................................................4-45
Lab 4 .................................................................................................................4-46
More before and until Waveforms ....................................................................4-47
Module 5
Advanced Features ..............................................................................................5-1
next_event, next_event_a, next_event_e Families .............................................5-2
next_event, next_event_a and next_event_e Waveforms ...................................5-4
next_event, next_event_a and next_event_e Examples ......................................5-5
%for Construct ....................................................................................................5-6
%if Construct ......................................................................................................5-7
Built-In Functions ...............................................................................................5-8
LTL Operators ..................................................................................................5-11
Endpoints ..........................................................................................................5-12
Endpoints With Parameters ..............................................................................5-13
Using Endpoints ................................................................................................5-14
Using Endpoints - Restrictions .........................................................................5-15
Using Endpoints - Examples ............................................................................5-16
Performance Flow .............................................................................................5-17
Performance Flow Features ..............................................................................5-18
Verification Unit Inheritance ............................................................................5-19
Vunit Inheritance Example ...............................................................................5-20
Formal Verification ..........................................................................................5-21
Modeling Layer ................................................................................................5-22
Directives in Formal Verification .....................................................................5-23
vunit, vprop and vmode ....................................................................................5-24
Module Summary .............................................................................................5-25
PSL Summary ...................................................................................................5-26
Questa PSL Support ..........................................................................................5-27
PSL IEEE 1850 Specification ...........................................................................5-29
IEEE 1850 Changes ..........................................................................................5-30

viii

PSL: Assertion Based Verification With Questa - VHDL Flavor

Table of Contents

TABLE OF CONTENTS (Cont.)


Summary of Where to Use Assertions ..............................................................5-36
Course Summary ..............................................................................................5-37
Lab 5 (Optional) ...............................................................................................5-38

PSL: Assertion Based Verification With Questa - VHDL Flavor

ix

Table of Contents

TABLE OF CONTENTS (Cont.)

PSL: Assertion Based Verification With Questa - VHDL Flavor

Vous aimerez peut-être aussi