+ All Categories
Home > Documents > Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research...

Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research...

Date post: 26-Mar-2015
Category:
Upload: anthony-emery
View: 224 times
Download: 3 times
Share this document with a friend
Popular Tags:
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
Transcript
Page 1: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

Sugar 2.0Sugar 2.0

Formal Specification LanguageFormal Specification Language

Sugar 2.0Sugar 2.0

Formal 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

2Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

3Dana FismanCindy Eisner

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

easyeasy to learn, read and write

mathematically 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

4Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

5Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

6Dana FismanCindy Eisner

Structure of Sugar

Boolean layerUsed to reason about statesstates of the design

Temporal layerUsed to reason about behaviorbehavior of the design over timetime

Modeling layerUsed to model auxiliary auxiliary state variables and state machines

Verification layerDirectivesDirectives to the verification tool:

Page 7: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

7Dana FismanCindy Eisner

Structure of Sugar

Boolean layerUsed to reason about statesstates of the design

Temporal layerUsed to reason about behaviorbehavior of the design over timetime

Modeling 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

8Dana FismanCindy Eisner

The Temporal Layer

Boolean ExpressionsBoolean Expressionsexpressions evaluated over a single state

Sugar Extended Regular Expressions (SERE) Sugar Extended Regular Expressions (SERE) expressions evaluated over a bounded sequence ofstates

Sugar Foundation LanguageSugar Foundation Languageexpressions evaluated over finite or infinite sequenceof states

Optional 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

9Dana FismanCindy Eisner

The Temporal Layer

Boolean ExpressionsBoolean Expressions

Sugar Extended Regular Expressions (SERE) Sugar Extended Regular Expressions (SERE) expressions evaluated over a bounded sequence ofstates

Sugar Foundation LanguageSugar Foundation Languageexpressions evaluated over finite or infinite sequenceof states

Optional 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

10Dana FismanCindy Eisner

The Temporal Layer

Boolean ExpressionsBoolean Expressions

Sugar Extended Regular Expressions (SERE)Sugar Extended Regular Expressions (SERE) expressions evaluated over a bounded sequence ofstates

Sugar Foundation LanguageSugar Foundation Languageexpressions evaluated over finite or infinite sequenceof states

Optional 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

11Dana FismanCindy Eisner

The Temporal Layer

Boolean ExpressionsBoolean Expressions

Sugar Extended Regular Expressions (SERE) Sugar Extended Regular Expressions (SERE) expressions evaluated over a bounded sequence ofstates

Sugar Foundation LanguageSugar Foundation Languageexpressions evaluated over finite or infinite sequenceof states

Optional 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

12Dana FismanCindy Eisner

The Temporal Layer

Boolean 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 B

lock

s (a

tom

s)Pro

pert

ies

Page 13: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

13Dana FismanCindy Eisner

The Temporal Layer

Boolean 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 B

lock

s (a

tom

s)Pro

pert

ies

Page 14: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

14Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

15Dana FismanCindy Eisner

SEREs – Example1

This diagram is also described by the

SERE

Page 16: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

16Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

17Dana FismanCindy Eisner

2SEREs – Example

Page 18: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

18Dana FismanCindy Eisner

2SEREs – Example

signal holds 4

times

Page 19: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

19Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

20Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

21Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

22Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

23Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

24Dana FismanCindy Eisner

Properties – Example1

if then

if then

Overlapping is also possible!

Page 25: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

25Dana FismanCindy Eisner

Properties – Example1

if then

ifthen

Page 26: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

26Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

27Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

28Dana FismanCindy Eisner

Properties – Example2

ifthen

Now the property is

evaluated only on the cycles

where the holds

Page 29: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

29Dana FismanCindy Eisner

Properties – Example2

ifthen

Page 30: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

30Dana FismanCindy Eisner

1 3

Properties – Example2

ifthen

2

Page 31: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

31Dana FismanCindy Eisner

Expressiveness

TheoryTheory

At 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 are

concisely and intuitively expressible in Sugar concisely and intuitively expressible in Sugar

Page 32: Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

32Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

33Dana 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 D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.

34Dana FismanCindy Eisner

Sugar Home Page

More information available on the sugar home page at:

Complete definitionTutorialSugar parserFormal syntax and semanticsMore …

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


Recommended