1 assertion based verification 2 the design and verification gap the number of transistors on a...

33
1 Assertion Based Verification

Post on 20-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

1

Assertion Based Verification

Page 2: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

2Assertion Based Verification

The Design and Verification GapThe Design and Verification Gap

The number of transistors on a chip increases approximately 58% per year, The number of transistors on a chip increases approximately 58% per year, according to Moore's Law.according to Moore's Law.

The design productivity, facilitated by EDA tool improvements, grows only 21% per The design productivity, facilitated by EDA tool improvements, grows only 21% per year. year.

These numbers have held constant for the last two decades.These numbers have held constant for the last two decades.

Page 3: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

3Assertion Based Verification

What is the hardest challenge in design flow?What is the hardest challenge in design flow?

The main problem in the design flow is to clean on the functional bugs.The main problem in the design flow is to clean on the functional bugs. Functional Logic Error grow to be 72% at 2002, and 75% at 2004.Functional Logic Error grow to be 72% at 2002, and 75% at 2004. Top causes are:Top causes are:

– 12.7% - Goofs (for example, typos)12.7% - Goofs (for example, typos)

– 11.4% - Miscommunication.11.4% - Miscommunication.

– 9.3% - Micro Architecture bugs.9.3% - Micro Architecture bugs.

– 9.3% - Logic and micro changes.9.3% - Logic and micro changes.

Page 4: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

4Assertion Based Verification

AgendaAgendaAgendaAgenda What is verification and coverage driven?What is verification and coverage driven? ABV – Assertion Based VerificationABV – Assertion Based Verification

– What is assertionWhat is assertion

– ExamplesExamples

QuestionsQuestions

Backup – SystemVerilog assertionsBackup – SystemVerilog assertions– SystemVerilog overviewSystemVerilog overview

– Advantages of SystemVerilog assertionsAdvantages of SystemVerilog assertions

– ExamplesExamples

What is verification and coverage driven?What is verification and coverage driven? ABV – Assertion Based VerificationABV – Assertion Based Verification

– What is assertionWhat is assertion

– ExamplesExamples

QuestionsQuestions

Backup – SystemVerilog assertionsBackup – SystemVerilog assertions– SystemVerilog overviewSystemVerilog overview

– Advantages of SystemVerilog assertionsAdvantages of SystemVerilog assertions

– ExamplesExamples

Page 5: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

5Assertion Based Verification

Coverage Driven VerificationCoverage Driven Verification

How to verify that the design meets the verification goals?How to verify that the design meets the verification goals?

Define all the verification goals up front in terms of "functional coverage points.“Define all the verification goals up front in terms of "functional coverage points.“– Each bit of functionality required to be tested in the design is described in terms of Each bit of functionality required to be tested in the design is described in terms of

events, values and combinations.events, values and combinations.

Functional coverage points are coded into the HVL (Hardware Verification Functional coverage points are coded into the HVL (Hardware Verification Language) environment (e.g., Specman ‘e’).Language) environment (e.g., Specman ‘e’).

– The simulation runs can be measured for the coverage they accomplish.The simulation runs can be measured for the coverage they accomplish.

Focus on tests that will accomplishing the coverage ("coverage driven testing“).Focus on tests that will accomplishing the coverage ("coverage driven testing“).– By Fixing bugs, releasing constraints, and improving the test environment.By Fixing bugs, releasing constraints, and improving the test environment.

– In a coverage-driven project, each verification engineer is focused on achieving the In a coverage-driven project, each verification engineer is focused on achieving the tangible results for his features.tangible results for his features.

Page 6: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

6Assertion Based Verification

Common testing schemesCommon testing schemesCommon testing schemesCommon testing schemes Traditional simulation-based functional verification is good at Traditional simulation-based functional verification is good at

validating baseline functionalityvalidating baseline functionality

Disadvantages :Disadvantages : The specification may not be complete The specification may not be complete

– usually describes only the normal operating behaviorusually describes only the normal operating behavior

Hard to set up all specified operations strictly from the chip inputsHard to set up all specified operations strictly from the chip inputs Hard to check all specified behavior strictly from the chip outputsHard to check all specified behavior strictly from the chip outputs Hard to locate the sources of bugs exhibited at the chip outputsHard to locate the sources of bugs exhibited at the chip outputs Certain types of bug behaviors may not propagate all the way to Certain types of bug behaviors may not propagate all the way to

the chip outputsthe chip outputs Certain types of implementation errors are difficult to detect using Certain types of implementation errors are difficult to detect using

functional testsfunctional tests

Traditional simulation-based functional verification is good at Traditional simulation-based functional verification is good at validating baseline functionalityvalidating baseline functionality

Disadvantages :Disadvantages : The specification may not be complete The specification may not be complete

– usually describes only the normal operating behaviorusually describes only the normal operating behavior

Hard to set up all specified operations strictly from the chip inputsHard to set up all specified operations strictly from the chip inputs Hard to check all specified behavior strictly from the chip outputsHard to check all specified behavior strictly from the chip outputs Hard to locate the sources of bugs exhibited at the chip outputsHard to locate the sources of bugs exhibited at the chip outputs Certain types of bug behaviors may not propagate all the way to Certain types of bug behaviors may not propagate all the way to

the chip outputsthe chip outputs Certain types of implementation errors are difficult to detect using Certain types of implementation errors are difficult to detect using

functional testsfunctional tests

Page 7: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

7Assertion Based Verification

Hardware Languages for Design and Verification

Page 8: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

8Assertion Based Verification

Assertions

Assertions capture knowledge about how a design should operateAssertions capture knowledge about how a design should operate

Assertions are vital to increasing both the Assertions are vital to increasing both the observability observability and the and the controllabilitycontrollability of a design of a design

Each assertion specifies both legal and illegal behavior of a circuit Each assertion specifies both legal and illegal behavior of a circuit structure (which can be an RTL element, an interface, a controller, structure (which can be an RTL element, an interface, a controller, etc.) inside the designetc.) inside the design

Assertion in English:Assertion in English:

- The fifo should not overflow- The fifo should not overflow

(i.e., when it is full, write should not happen) (i.e., when it is full, write should not happen) oror

- TDO signal should be less then…- TDO signal should be less then…

Will be used in coverage-driven verification techniques.Will be used in coverage-driven verification techniques.

Page 9: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

9Assertion Based Verification

Page 10: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

10Assertion Based Verification

Page 11: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

11Assertion Based Verification

Page 12: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

12Assertion Based Verification

AutomaticRTL Checks

AssertionCompiler

Standard VerilogSimulator

Standard VerilogSimulator

CoverageReports

CoverageReportsTestbenchTestbench

AssertionLibrary

AssertionLibrary

RTL DesignRTL Design

Assertions

Simulation

FormalVerification

Static FormalVerification

Dynamic FormalVerification

Formal ModelCompiler

FormalMetrics

FormalMetrics

Complete ABV Flow

Page 13: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

13Assertion Based Verification

Performance of the ABV FlowPerformance of the ABV Flow

Assertion based verification flow providesAssertion based verification flow provides– Find bugs faster with assertionsFind bugs faster with assertions

– Find more bugs with verification hot spotsFind more bugs with verification hot spots

– Reduce simulation cycles Reduce simulation cycles

– Adopt the AVB/CDV methodology incrementallyAdopt the AVB/CDV methodology incrementally

% F

un

ctio

nal C

overa

ge

Project Timeline (Increasing $/Bug)

Improvement in Verification Closure(Reduction in total simulation)

Signoff Coverage

Traditional Verification

X

Reduced Risk$/Bug Saving

bug

Page 14: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

14Assertion Based Verification

Conclusion

Assertion-based verification is a shift in verification methodology Traditional functional verification tries to stimulate the design and observe the

responses from the outside observability and controllability are so low that pseudo-random simulation can

no longer exercise the internals of the device sufficiently

ABV technologies and methodologies are developed to :– Zero in to the structure of the design

– Responsibility of verification is also shifting from over-the-wall verification team to involve designers as well

– Design knowledge becomes a critical criterion for successful functional verification

– With assertions, we can detect bugs sooner

– With formal verification, we have more direct control of the verification effort

Page 15: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

15Assertion Based Verification

Thank you for listening !Thank you for listening !

Page 16: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

16

BackupBackup

SystemVerilog Assertions ( SVA )

Page 17: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

17Assertion Based Verification

Four Pillars of ABV Assertions capture the design intent by embedding them in a Assertions capture the design intent by embedding them in a

design and having them monitor design activitiesdesign and having them monitor design activities

Pillar 1: Automatic Assertion CheckPillar 1: Automatic Assertion Check Pillar 2: Static Formal VerificationPillar 2: Static Formal Verification Pillar 3: Simulation with AssertionsPillar 3: Simulation with Assertions Pillar 4: Dynamic Formal VerificationPillar 4: Dynamic Formal Verification

Page 18: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

18Assertion Based Verification

SystemVerilog – assertions overviewSystemVerilog – assertions overview

Key benefits of SVA can be summarized as follows: Key benefits of SVA can be summarized as follows:

Familiar language and syntaxFamiliar language and syntax Less assertion code Less assertion code Simple hookup between assertions and the testSimple hookup between assertions and the test No special interfaces No special interfaces Customized messaging and error severity levelsCustomized messaging and error severity levels Ability to interact with Verilog and C functions Ability to interact with Verilog and C functions No mismatch results between simulation and formal toolsNo mismatch results between simulation and formal tools

Key benefits of SVA can be summarized as follows: Key benefits of SVA can be summarized as follows:

Familiar language and syntaxFamiliar language and syntax Less assertion code Less assertion code Simple hookup between assertions and the testSimple hookup between assertions and the test No special interfaces No special interfaces Customized messaging and error severity levelsCustomized messaging and error severity levels Ability to interact with Verilog and C functions Ability to interact with Verilog and C functions No mismatch results between simulation and formal toolsNo mismatch results between simulation and formal tools

Page 19: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

19Assertion Based Verification

SystemVerilog – assertions overviewSystemVerilog – assertions overview SystemVerilog provides two types of assertions: SystemVerilog provides two types of assertions:

– ImmediateImmediate

– ConcurrentConcurrent

Both intended to convey the intent of the design andBoth intended to convey the intent of the design and

identify the source of a problem as quickly and directly .identify the source of a problem as quickly and directly .

ImmediateImmediate assertions assertions

SystemVerilog provides two types of assertions: SystemVerilog provides two types of assertions:

– ImmediateImmediate

– ConcurrentConcurrent

Both intended to convey the intent of the design andBoth intended to convey the intent of the design and

identify the source of a problem as quickly and directly .identify the source of a problem as quickly and directly .

ImmediateImmediate assertions assertions

Page 20: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

20Assertion Based Verification

Concurrent vs. immediateConcurrent vs. immediate

Concurrent types:

- Boolean expressions

- Sequential expressions

- Property Declarations

- Assertion Directives

Concurrent types:

- Boolean expressions

- Sequential expressions

- Property Declarations

- Assertion Directives

Two important differencesTwo important differences::

- Concurrent assertions allow the specification of a - Concurrent assertions allow the specification of a temporal behaviortemporal behavior to to

be checked vs. combinational condition of immediate.be checked vs. combinational condition of immediate.

- Concurrent assertions can also be instantiated - Concurrent assertions can also be instantiated declarativelydeclaratively as a as a

module-level statement (similar to a continuous assignment).module-level statement (similar to a continuous assignment).

Two important differencesTwo important differences::

- Concurrent assertions allow the specification of a - Concurrent assertions allow the specification of a temporal behaviortemporal behavior to to

be checked vs. combinational condition of immediate.be checked vs. combinational condition of immediate.

- Concurrent assertions can also be instantiated - Concurrent assertions can also be instantiated declarativelydeclaratively as a as a

module-level statement (similar to a continuous assignment).module-level statement (similar to a continuous assignment).

Page 21: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

21Assertion Based Verification

Boolean expressionsBoolean expressions

The Boolean expressions layer is the basic layer. The Boolean expressions layer is the basic layer. Boolean expressions specifies the values of elements at a Boolean expressions specifies the values of elements at a

particular point in time particular point in time

Syntax :Syntax :

The Boolean expressions layer is the basic layer. The Boolean expressions layer is the basic layer. Boolean expressions specifies the values of elements at a Boolean expressions specifies the values of elements at a

particular point in time particular point in time

Syntax :Syntax :

Page 22: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

22Assertion Based Verification

Sequential expressionsSequential expressions

Sequences of Boolean expressions with clear temporal Sequences of Boolean expressions with clear temporal

relationships between themrelationships between them

Sequences of Boolean expressions with clear temporal Sequences of Boolean expressions with clear temporal

relationships between themrelationships between them

Basic sequential expression :"a followed by b on the next clock"

which is represented in SystemVerilog as

a ##1 b

##1 indicates one clock delay

Basic sequential expression :"a followed by b on the next clock"

which is represented in SystemVerilog as

a ##1 b

##1 indicates one clock delay

Page 23: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

23Assertion Based Verification

Important to understand that in SystemVerilog each element Important to understand that in SystemVerilog each element

of a sequence may be either a of a sequence may be either a

Boolean expressionBoolean expression or or another sequenceanother sequence. .

Thus, the expression Thus, the expression

s1 ##1 s2s1 ##1 s2means that sequence s2 begins on the clock after means that sequence s2 begins on the clock after

sequence s1 ends.sequence s1 ends.

Important to understand that in SystemVerilog each element Important to understand that in SystemVerilog each element

of a sequence may be either a of a sequence may be either a

Boolean expressionBoolean expression or or another sequenceanother sequence. .

Thus, the expression Thus, the expression

s1 ##1 s2s1 ##1 s2means that sequence s2 begins on the clock after means that sequence s2 begins on the clock after

sequence s1 ends.sequence s1 ends.

Page 24: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

24Assertion Based Verification

The optional list of arguments allows for specification of sequences The optional list of arguments allows for specification of sequences

as a generic temporal relationship .as a generic temporal relationship .

The optional list of arguments allows for specification of sequences The optional list of arguments allows for specification of sequences

as a generic temporal relationship .as a generic temporal relationship .

- Some operations on sequences : - Some operations on sequences :

Page 25: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

25Assertion Based Verification

Property declarationsProperty declarations More general behaviors to be specified. More general behaviors to be specified. Properties allow you to invert the sense of a sequence Properties allow you to invert the sense of a sequence

- As when the sequence should - As when the sequence should notnot happen. happen. Disable the sequence evaluation.Disable the sequence evaluation. Specify that a sequence be implied by some other occurrence.Specify that a sequence be implied by some other occurrence.

Syntax :Syntax :

More general behaviors to be specified. More general behaviors to be specified. Properties allow you to invert the sense of a sequence Properties allow you to invert the sense of a sequence

- As when the sequence should - As when the sequence should notnot happen. happen. Disable the sequence evaluation.Disable the sequence evaluation. Specify that a sequence be implied by some other occurrence.Specify that a sequence be implied by some other occurrence.

Syntax :Syntax :

"as long as the test signal is low, check that the abort_seq sequence does not occur."

Page 26: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

26Assertion Based Verification

Assertions directives ( Procedural )Assertions directives ( Procedural )Assertions directives ( Procedural )Assertions directives ( Procedural ) System implication - "when this happens, then that will happen“System implication - "when this happens, then that will happen“

thus require the writer to specify the trigger assertion. thus require the writer to specify the trigger assertion. Declarative assertions, require additional work by the designer to use them effectively. Declarative assertions, require additional work by the designer to use them effectively.

Consider a finite state machine design. Consider a finite state machine design.

Assertion Assertion

"when in state ACK, if foo is high, then req should be held low for 5 clocks.""when in state ACK, if foo is high, then req should be held low for 5 clocks."

System implication - "when this happens, then that will happen“System implication - "when this happens, then that will happen“

thus require the writer to specify the trigger assertion. thus require the writer to specify the trigger assertion. Declarative assertions, require additional work by the designer to use them effectively. Declarative assertions, require additional work by the designer to use them effectively.

Consider a finite state machine design. Consider a finite state machine design.

Assertion Assertion

"when in state ACK, if foo is high, then req should be held low for 5 clocks.""when in state ACK, if foo is high, then req should be held low for 5 clocks."

Page 27: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

27Assertion Based Verification

State machine cont’State machine cont’

This assertion could be coded declaratively as: This assertion could be coded declaratively as:

The fact that the assertions are syntactically part of the language allows them to be embedded procedurally in the RTL code and automatically infer this information, as in:

The fact that the assertions are syntactically part of the language allows them to be embedded procedurally in the RTL code and automatically infer this information, as in:

Page 28: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

28Assertion Based Verification

Assertion exampleAssertion example Two blocks A,B exchange data via a common bus : Two blocks A,B exchange data via a common bus :

• A and/or B sends ‘Req’ to the Arbiter.• Arbiter sends ‘Gnt’ back to A or B, making it Master.• Arbiter sets ‘Busy’ while A or B is Master.• Master sets ‘DRdy’ when Data is on the bus.• Master sets ‘Done’ in the last cycle of a grant.

• A and/or B sends ‘Req’ to the Arbiter.• Arbiter sends ‘Gnt’ back to A or B, making it Master.• Arbiter sets ‘Busy’ while A or B is Master.• Master sets ‘DRdy’ when Data is on the bus.• Master sets ‘Done’ in the last cycle of a grant.

Page 29: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

29Assertion Based Verification

Some Assertions to Check :

A Grant never occurs without a Request.

– Assert never GntA && !ReqA If A (B) receives a Grant, then B (A) does not.

– Assert always GntA -> !GntB A (B) never receives a Grant in two successive cycles.

– Assert never GntA && nextGntA A Request is eventually followed by a Grant

– Assert always ReqA -> eventually GntA

A Grant never occurs without a Request.

– Assert never GntA && !ReqA If A (B) receives a Grant, then B (A) does not.

– Assert always GntA -> !GntB A (B) never receives a Grant in two successive cycles.

– Assert never GntA && nextGntA A Request is eventually followed by a Grant

– Assert always ReqA -> eventually GntA

Page 30: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

30Assertion Based Verification

Tool Support

Page 31: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

31Assertion Based Verification

Assertion Debug Environment

Page 32: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

32Assertion Based Verification

ConclusionConclusion SystemVerilog is a unified language that contains design and SystemVerilog is a unified language that contains design and

verification constructsverification constructs Assertions communicate to the test bench and vice-versa. Assertions communicate to the test bench and vice-versa. Customize messaging resulting from the assertionsCustomize messaging resulting from the assertions Create calls to Verilog and C functions dependent on the success Create calls to Verilog and C functions dependent on the success

or failure of the assertionsor failure of the assertions Minimize assertion code by inferring design control structuresMinimize assertion code by inferring design control structures

Furthermore, SystemVerilog assertions will eliminate the Furthermore, SystemVerilog assertions will eliminate the debugging of mismatches between simulation and formal toolsdebugging of mismatches between simulation and formal tools

SystemVerilog is a unified language that contains design and SystemVerilog is a unified language that contains design and verification constructsverification constructs

Assertions communicate to the test bench and vice-versa. Assertions communicate to the test bench and vice-versa. Customize messaging resulting from the assertionsCustomize messaging resulting from the assertions Create calls to Verilog and C functions dependent on the success Create calls to Verilog and C functions dependent on the success

or failure of the assertionsor failure of the assertions Minimize assertion code by inferring design control structuresMinimize assertion code by inferring design control structures

Furthermore, SystemVerilog assertions will eliminate the Furthermore, SystemVerilog assertions will eliminate the debugging of mismatches between simulation and formal toolsdebugging of mismatches between simulation and formal tools

Page 33: 1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according

33Assertion Based Verification

Had Fun ?!....... Come any timeHad Fun ?!....... Come any time

Barak & DanielBarak & Daniel

VLSI SeminarVLSI Seminar

Had Fun ?!....... Come any timeHad Fun ?!....... Come any time

Barak & DanielBarak & Daniel

VLSI SeminarVLSI Seminar