sugar 2.0 formal specification language

34
Sugar 2.0 Sugar 2.0 Formal Specification Formal Specification Language Language D D ana ana F F isman isman 1,2 1,2 Cindy Eisner Cindy Eisner 1 1 1 IBM Haifa Research Laboratory IBM Haifa Research Laboratory 2 Weizmann Institute of Science Weizmann Institute of Science

Upload: naasir

Post on 23-Feb-2016

49 views

Category:

Documents


0 download

DESCRIPTION

Sugar 2.0 Formal Specification Language. D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 2 Weizmann Institute of Science . Sugar2.0. Sugar 2.0 is a formalism to reason about behavior over time Uses of Sugar: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Sugar 2.0 Formal Specification Language

Sugar 2.0Sugar 2.0Formal Specification LanguageFormal Specification Language

DDana ana FFismanisman1,21,2 Cindy EisnerCindy Eisner1 1

11IBM Haifa Research Laboratory IBM Haifa Research Laboratory

22Weizmann Institute of Science Weizmann Institute of Science

Page 2: Sugar 2.0 Formal Specification Language

2

Dana FismanCindy Eisner

Sugar2.0

Sugar 2.0Sugar 2.0 is a formalism to is a formalism to reason about reason about behavior over timebehavior over timeUses of Sugar:

For documentation: easy to read, yet precise specificationInput to formal verification tools (model checker, theorem prover)Input to simulation tools (source of automatically generated monitors )

Page 3: Sugar 2.0 Formal Specification Language

3

Dana FismanCindy Eisner

GoalsGoals (in designing the language)(in designing the language)

easyeasy to learn, read and writemathematically precisemathematically precise rigorously well defined formal syntax and semantics

sufficiently expressiveexpressive permitting the specification of a large class of “real” worlddesign properties

known efficient underlying algorithmsalgorithms in simulationin model checking (with reasonable complexity)

Page 4: Sugar 2.0 Formal Specification Language

4

Dana FismanCindy Eisner

History1994

Syntactic sugaring of CTL for RuleBase model checker1995

Addition of regular expressions1997

Automatic generation of simulation monitors

2001Move to linear (LTL-based) semantics

2002Selected by Accellera for IEEE standardization

Sugar 1.0

Sugar 2.0

Page 5: Sugar 2.0 Formal Specification Language

5

Dana FismanCindy Eisner

Track RecordTrack Record (Sugar 1.0)

IBM products:Main Frame line (S/390)Mid-range line (AS/400)Workstation line (RS/6000)PC line (Netfinity)Super Computers (ASCI)ASIC/OEM business

External licenseesUniversity program

Page 6: Sugar 2.0 Formal Specification Language

6

Dana FismanCindy Eisner

Structure of SugarBoolean layerUsed to reason about statesstates of the design

Temporal layerUsed to reason about behaviorbehavior of the design over timetimeModeling layerUsed to model auxiliary auxiliary state variables and state machines Verification layerDirectivesDirectives to the verification tool:

Page 7: Sugar 2.0 Formal Specification Language

7

Dana FismanCindy Eisner

Structure of SugarBoolean layerUsed to reason about statesstates of the design

Temporal layerUsed to reason about behaviorbehavior of the design over timetimeModeling layerUsed to model auxiliary auxiliary state variables and state machines Verification layerDirectivesDirectives to the verification tool:

Sugar comes in three flavors:

Verilog/VHDL/EDL

Page 8: Sugar 2.0 Formal Specification Language

8

Dana FismanCindy Eisner

The Temporal LayerBoolean ExpressionsBoolean Expressionsexpressions evaluated over a single stateSugar Extended Regular Expressions (SERE) Sugar Extended Regular Expressions (SERE) expressions evaluated over a bounded sequence ofstatesSugar Foundation LanguageSugar Foundation Languageexpressions evaluated over finite or infinite sequenceof statesOptional Branching Extension (OBE)Optional Branching Extension (OBE)expression evaluated over infinite trees of states(relevant for formal verification only)

s

s1 s2 s3 s4

s1 s2 s3 s4 …s5 s6 s7

Page 9: Sugar 2.0 Formal Specification Language

9

Dana FismanCindy Eisner

The Temporal LayerBoolean ExpressionsBoolean Expressions Sugar Extended Regular Expressions (SERE) Sugar Extended Regular Expressions (SERE) expressions evaluated over a bounded sequence ofstatesSugar Foundation LanguageSugar Foundation Languageexpressions evaluated over finite or infinite sequenceof statesOptional Branching Extension (OBE)Optional Branching Extension (OBE)expression evaluated over infinite trees of states(relevant for formal verification only)

s

s1 s2 s3 s4

s1 s2 s3 s4 …s5 s6 s7

Page 10: Sugar 2.0 Formal Specification Language

10

Dana FismanCindy Eisner

The Temporal LayerBoolean ExpressionsBoolean Expressions Sugar Extended Regular Expressions (SERE)Sugar Extended Regular Expressions (SERE) expressions evaluated over a bounded sequence ofstatesSugar Foundation LanguageSugar Foundation Languageexpressions evaluated over finite or infinite sequenceof statesOptional Branching Extension (OBE)Optional Branching Extension (OBE)expression evaluated over infinite trees of states(relevant for formal verification only)

s

s1 s2 s3 s4

s1 s2 s3 s4 …s5 s6 s7

Page 11: Sugar 2.0 Formal Specification Language

11

Dana FismanCindy Eisner

The Temporal LayerBoolean ExpressionsBoolean Expressions Sugar Extended Regular Expressions (SERE) Sugar Extended Regular Expressions (SERE) expressions evaluated over a bounded sequence ofstatesSugar Foundation LanguageSugar Foundation Languageexpressions evaluated over finite or infinite sequenceof statesOptional Branching Extension (OBE)Optional Branching Extension (OBE)expression evaluated over infinite trees of states(relevant for formal verification only)

s

s1 s2 s3 s4

s1 s2 s3 s4 …s5 s6 s7

……

… ……

Page 12: Sugar 2.0 Formal Specification Language

12

Dana FismanCindy Eisner

The Temporal LayerBoolean ExpressionsBoolean Expressions

Sugar Extended Regular Expressions (SERE) Sugar Extended Regular Expressions (SERE)

Sugar Foundation LanguageSugar Foundation Language

Optional Branching Extension (OBE)Optional Branching Extension (OBE)

s

s1 s2 s3 s4

s1 s2 s3 s4 …s5 s6 s7

……

… ……

Build

ing

Bloc

ks

(ato

ms)

Prop

ertie

s

Page 13: Sugar 2.0 Formal Specification Language

13

Dana FismanCindy Eisner

The Temporal LayerBoolean ExpressionsBoolean Expressions

Sugar Extended Regular Expressions (SERE) Sugar Extended Regular Expressions (SERE)

Sugar Foundation LanguageSugar Foundation LanguageTemporal formulas where the atoms are atoms are BooleansBooleansTemporal formulas where the atoms are atoms are SEREsSEREsTemporal formulas where the atoms are atoms are BooleansBooleans and/or and/or SEREsSEREs

Optional Branching Extension (OBE)Optional Branching Extension (OBE)

Build

ing

Bloc

ks

(ato

ms)

Prop

ertie

s

Page 14: Sugar 2.0 Formal Specification Language

14

Dana FismanCindy Eisner

SEREs – Example1

A SERE describes a set of sequences of

states (which we represent using timing

diagrams)

This diagram is described by

the SERE

Page 15: Sugar 2.0 Formal Specification Language

15

Dana FismanCindy Eisner

SEREs – Example1

This diagram is also described by the

SERE

Page 16: Sugar 2.0 Formal Specification Language

16

Dana FismanCindy Eisner

SEREs – Example1

If we want to describe only this diagram we have to change the

SERE

Page 17: Sugar 2.0 Formal Specification Language

17

Dana FismanCindy Eisner

2SEREs – Example

Page 18: Sugar 2.0 Formal Specification Language

18

Dana FismanCindy Eisner

2SEREs – Example

signal holds 4

times

Page 19: Sugar 2.0 Formal Specification Language

19

Dana FismanCindy Eisner

3SEREs – Example

signal holds any number of

times between 3 to 5

signal holds any number of

times

Page 20: Sugar 2.0 Formal Specification Language

20

Dana FismanCindy Eisner

Examples

Until now we saw examples for SEREs, which are not properties on their own, but rather building blocks of propertiesWe will now see examples of properties composed from the SERE building blocks

Page 21: Sugar 2.0 Formal Specification Language

21

Dana FismanCindy Eisner

Examples – Properties

The suffixsuffix implicationimplication operator

ifif the path starting nowstarting now matches thenthen its continuationcontinuation should match

Page 22: Sugar 2.0 Formal Specification Language

22

Dana FismanCindy Eisner

Properties – Example1

if then

But the property makes a requirement only for that holds at the very first cycle

Add to the beginning of the first SERE

Page 23: Sugar 2.0 Formal Specification Language

23

Dana FismanCindy Eisner

Properties – Example1

Now the property makes a requirement

for every no matter the cycles

where it holds

Note that the requirement is made

for more than one (the first) if then

Page 24: Sugar 2.0 Formal Specification Language

24

Dana FismanCindy Eisner

Properties – Example1

if then

if then

Overlapping is also possible!

Page 25: Sugar 2.0 Formal Specification Language

25

Dana FismanCindy Eisner

Properties – Example1

if then

if then

Page 26: Sugar 2.0 Formal Specification Language

26

Dana FismanCindy Eisner

Properties – Example2

if then

But what if data does not

hold in contiguous

cycles?

Use instead of

Page 27: Sugar 2.0 Formal Specification Language

27

Dana FismanCindy Eisner

Properties – Example2

if then

1 2 3 4 5 6 7 8

But what if the signals are only sampled when

holds?

Apply to the entire

property

Page 28: Sugar 2.0 Formal Specification Language

28

Dana FismanCindy Eisner

Properties – Example2

if then

Now the property is

evaluated only on the cycles

where the holds

Page 29: Sugar 2.0 Formal Specification Language

29

Dana FismanCindy Eisner

Properties – Example2

if then

Page 30: Sugar 2.0 Formal Specification Language

30

Dana FismanCindy Eisner

1 3

Properties – Example2

if then

2

Page 31: Sugar 2.0 Formal Specification Language

31

Dana FismanCindy Eisner

Expressiveness

TheoryTheoryAt least as expressive as At least as expressive as

LTL CTL regular expressions

PracticePracticeAll properties suggested by FVTC of Accellera areAll properties suggested by FVTC of Accellera areconcisely and intuitively expressible in Sugar concisely and intuitively expressible in Sugar

Page 32: Sugar 2.0 Formal Specification Language

32

Dana FismanCindy Eisner

Implementation Sugar has a core of operators which determine its expressive powerOther operators are syntactic sugaring (abbreviations) of the core operatorsA tool needs to implement

Only the core operatorsMacro expansion of the syntactic sugaring operators

Page 33: Sugar 2.0 Formal Specification Language

33

Dana FismanCindy Eisner

Implementation (of the core)

Any SugarSugar property can be reduced to an LTLLTL or CTLCTL property using auxiliary state state machinesmachines.CTLCTL and LTLLTL have known model checking algorithms.For simulation we consider the subset that can be verified on-the-flyon-the-fly. For this subset there are simple transformation rulessimple transformation rules that transform the formula to a state machinestate machine describing all possible counter examples.

Page 34: Sugar 2.0 Formal Specification Language

34

Dana FismanCindy Eisner

Sugar Home PageMore information available on the sugar home page at:

Complete definitionTutorialSugar parserFormal syntax and semanticsMore …

www.haifa.il.ibm.com/projects/verification/sugar/index.html