Specifying circuit properties in PSL. Formal methods Mathematical and logical methods used in system development Aim to increase confidence in riktighet.

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

The Quest for Correctness Joseph Sifakis VERIMAG Laboratory 2nd Sogeti Testing Academy April 29th 2009.
Model Checking Lecture 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.
Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
Model Checking Lecture 2. Three important decisions when choosing system properties: 1automata vs. logic 2branching vs. linear time 3safety vs. liveness.
CS 267: Automated Verification Lecture 2: Linear vs. Branching time. Temporal Logics: CTL, CTL*. CTL model checking algorithm. Counter-example generation.
M ODEL CHECKING -Vasvi Kakkad University of Sydney.
Algorithmic Software Verification VII. Computation tree logic and bisimulations.
Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
Temporal Logic and the NuSMV Model Checker CS 680 Formal Methods Jeremy Johnson.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar.
Presenter: PCLee VLSI Design, Automatic and Test, (VLSI-TSA-DAT).
Formal Methods in Hardware Design Mary Sheeran, Chalmers
 2012 Bert Molenkamp, Jan Kuper, University of Twente, PSL Introduction to Assertion Based Verification with PSL (VHDL flavor) Bert Molenkamp Jan Kuper.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar D D.
Presenter: PCLee – This paper outlines the MBAC tool for the generation of assertion checkers in hardware. We begin with a high-level presentation.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
More on PSL some examples, some pitfalls. start idlep1p2p3 continue done cancel FSM.
CSEP590 – Model Checking and Software Verification University of Washington Department of Computer Science and Engineering Summer 2003.
© Katz, 2007CS Formal SpecificationsLecture - Temporal logic 1 Temporal Logic Formal Specifications CS Shmuel Katz The Technion.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
Review of the automata-theoretic approach to model-checking.
Presenter: PCLee Design Automation Conference, ASP-DAC '07. Asia and South Pacific.
A logic for reasoning about digital rights Riccardo Pucella, Vicky Weissman Cornell University.
ESE601: Hybrid Systems Introduction to verification Spring 2006.
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Abstract Verification is traditionally done by determining the truth of a temporal formula (the specification) with respect to a timed transition system.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
Using Mathematica for modeling, simulation and property checking of hardware systems Ghiath AL SAMMANE VDS group : Verification & Modeling of Digital systems.
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
CIS 842: Specification and Verification of Reactive Systems Lecture Specifications: Sequencing Properties Copyright , Matt Dwyer, John Hatcliff,
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Validation - Formal verification -
Verification & Validation By: Amir Masoud Gharehbaghi
Jasper Design Automation© PSL Property Specification Language Jasper Design Automation.
Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used.
Verification Technologies IBM Haifa Labs Formal Specification Using Sugar 2.0 Cindy Eisner September 2002.
March 20, Sugar 2.0 – Proposal Presented to Accellera FVTC Cindy Eisner Joint Work with Dana Fisman IBM Research Laboratory in Haifa.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 9, 2003.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
Introduction to Hardware Verification ECE 598 SV Prof. Shobha Vasudevan.
Model Checking Lecture 1. Model checking, narrowly interpreted: Decision procedures for checking if a given Kripke structure is a model for a given formula.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
Sugar Advantages Cindy Eisner IBM Research Laboratory in Haifa.
Model Checking Lecture 1: Specification Tom Henzinger.
Writing, Verifying and Exploiting Formal Specifications for Hardware Designs Chapter 3: Verifying a Specification Presenter: Scott Crosby.
Week 13 - Wednesday.  What did we talk about last time?  Exam 3  Before review:  Graphing functions  Rules for manipulating asymptotic bounds  Computing.
6/12/20161 a.a.2015/2016 Prof. Anna Labella Formal Methods in software development.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Model Checking Lecture 2. Model-Checking Problem I |= S System modelSystem property.
CS5270 Lecture 41 Timed Automata I CS 5270 Lecture 4.
Model Checking Lecture 2 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
Specifying circuit properties in PSL / Sugar. But first some background…
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
CIS 842: Specification and Verification of Reactive Systems
Automatic Verification of Industrial Designs
Specifying circuit properties in PSL / Sugar
Formal Methods in software development
A Coverage Analysis for Safety Property Lists
Translating Linear Temporal Logic into Büchi Automata
Introduction to verification
Formal Methods in software development
CSE 503 – Software Engineering
Presentation transcript:

Specifying circuit properties in PSL

Formal methods Mathematical and logical methods used in system development Aim to increase confidence in riktighet of system Apply to both hardware and software

Formal methods Complement other analysis methods Are good at finding bugs Reduce development (and test) time (Verification time is often 70% of total time in hardware design projects)

Some fundamental facts Low level of abstraction, Finite state systems => automatic proofs possible High level of abstraction, Fancy data types, general programs => automatic proofs IMPOSSIBLE

Two main approaches Squeeze the problem down into one that can be handled automatically –industrial success of model checkers –automatic proof-based methods very hot Use powerful interactive theorem provers and highly trained staff –for example Harrison’s work at Intel on floating point algorithms (

Model Checking MC G(p -> F q) yes no p q p q property finite-state model algorithm counterexample (Ken McMillan)

Again two main approaches Linear-time Temporal Logic (LTL) –must properties, safety and liveness –Pnueli, 1977 Computation Tree Logic (CTL) –branching time, may properties, safety and liveness –Clarke and Emerson, Queille and Sifakis, 1981 Linear time conceptually simplier (words vs trees) Branching time computationally more efficient We will return to this in a later lecture

But temporal logics hard to read and write!

Computation Tree Logic A sequence beginning with the assertion of signal strt, and containing two not necessarily consecutive assertions of signal get, during which signal kill is not asserted, must be followed by a sequence containing two assertions of signal put before signal end can be asserted AG~(strt & EX E[~get & ~kill U get & ~kill & EX E[~get & ~kill U get & ~kill & E[~put U end] | E[~put & ~end U (put & ~end & EX E[~put U end])]]])

Basis of PSL was Sugar (IBM, Haifa) Grew out of CTL (I believe) Added lots of syntactic sugar Engineer friendly, used in many projects Used in the industrial strength MC RuleBase

Assertion Based Verification (ABV) can be done in two ways During simulation –(dynamic, at runtime, called semi-formal verification, checks only those runs) As a static check – (formal verification, covers all possible runs, more comprehensive, harder to do, restricted to a subset of the property language ) (Note: this duality has been important for PSL’s practical success, but it also complicates the semantics!)

Properties always (p) states that p (a boolean expression made from signal names, constants and operators) is true on every cycle always (! (gr1 & gr2))

Properties always (a -> b) If a is true, then b is true a implies b a -> b not a or b always ((rd=’0’) -> next (prev(dout)=dout) )

Safety Properties always (p) ”Nothing bad will ever happen” Most common type of property checked in practice Easy to check (more later) Disproved by a finite run of the system

Observer: a second approach Observer written in same language as circuit Safety properties only Used in verification of control programs (and in Lava later) F Prop ok

Back to PSL always (p) Talks about one cycle at a time Sequential Extended Regular Expressions (SEREs) allow us to talk about spans of time A SERE describes a set of traces It is a building block for a property

SERE examples {req; busy; grnt} All sequences of states, or traces, in which req is high on the first cycle, busy on the second, and grnt on the third. (source Sugar 2.0 presentation from IBM’s Dana Fisman and Cindy Eisner, with thanks)

SERE examples {req; busy; grnt} req busy grnt is in the set of traces

SERE examples {req; busy; grnt} req busy grnt This too

SERE examples {req; busy; grnt} req busy grnt and this

SERE examples {req; busy; grnt} req busy grnt but not this Why?

SERE examples How can we specify ONLY those traces that start like this? req busy grnt

SERE examples req busy grnt {req & !busy & !grnt; !req & busy & !grnt; !req & !busy & grnt}

SERE examples How do we say that the {req,busy,grnt} sequence can start anywhere? req busy grnt

SERE examples {[*]; req; busy; grnt} req busy grnt [*] means skip zero or more cycles

SERE examples {[*]; req; busy; grnt} req busy grnt so our original trace is still in the set described

SERE examples {true; req; busy; grnt} req busy grnt says that the req, busy, grnt sequence starts exactly in the second cycle. It constrains only cycles 2,3,4

{true[*4]; req; busy; grnt} rbg sequence must start at cycle 5 {true[+]; req; busy; grnt} true[+] = [+] one or more trues true[*] = [*]

{[*]; req; busy[*3..5]; grnt} at least 3 and at most 5 busys {[*]; req; {b1,b2}[*]; grnt} {[*]; req; {b1,b2,b3}[*7]; grnt} subsequences can also be repeated

&& Simultaneous subsequences Same length, start and end together {start; a[*]; end} && {!abort[*]}

|| One of the subsequences should be matched Don’t need to be the same length {request; {rd; !cncl_r; !dne[*]} || {wr;!cncl_w;!dne[*]}; dne}

Fancier properties at last! SEREs are themselves properties (in the latest version of PSL). Properties are also built from subproperties. {SERE1} |=> {SERE2} is a property If a trace matches SERE1, then its continuation should match SERE2

if then {true[*]; req; ack} |=> {start; busy[*]; end}

Not just the first req, ack {true[*]; req; ack} => {start; busy[*]; end} if then if then

Overlap also possible! {true[*]; req; ack} => {start; busy[*]; end} if then if then

if then {true[*]; req; ack} => {start; data[*]; end}

{true[*]; req; ack} => {start; data[=8]; end} if then Can check for data in non-consecutive cycles

A form of implication {SERE1} |=> {SERE2} If a trace matches SERE1, then its continuation should match SERE2

Another form of implication {SERE1} |-> {SERE2} If a trace matches SERE1, then SERE2 should be matched, starting from the last element of the trace matching SERE1 So there is one cycle of overlap in the middle

Example {[*]; start; busy[*]; end} |-> {success; done} If signal start is asserted, signal end is asserted at the next cycle or later, and in the meantime signal busy holds, then success is asserted at the same time as end is, and in the next cycle done is asserted

Example {[*]; {start; c[*]; end}&&{!abort[*]}} |-> {success} If there is no abort during {start,c[*],end}, success will be asserted with end

{SERE1} |=> {SERE2} = {SERE1} |-> {true, SERE2} Both are formulas of the linear fragment (which is based on LTL) In Jasper Gold, we use this linear part. There is also an optional branching extension (which is where CTL comes back in)

PSL has a small core and the rest is syntactic sugar, for example b[=i] = {not b[*]; b}[*i] ; not b[*] See formal semantics in LRM

PSL Regular expressions (plus some operators) + Linear temporal logic (LTL) + Lots of syntactic sugar + (optional) Computation tree logic (CTL)

Example revisited A sequence beginning with the assertion of signal strt, and containing two not necessarily consecutive assertions of signal get, during which signal kill is not asserted, must be followed by a sequence containing two assertions of signal put before signal end can be asserted AG~(strt & EX E[~get & ~kill U get & ~kill & EX E[~get & ~kill U get & ~kill & E[~put U end] | E[~put & ~end U (put & ~end & EX E[~put U end])]]])

In PSL (with 8 for 2) A sequence beginning with the assertion of signal strt, and containing eight not necessarily consecutive assertions of signal get, during which signal kill is not asserted, must be followed by a sequence containing eight assertions of signal put before signal end can be asserted always({strt; {get[=8]}&&{kill[=0]}} |=> {{put[=8]}&&{end[=0]}})

From PSL to CTL? always {a;b[*];c} -> {d;e[*];f} (source, lecture notes by Mike Gordon, question asked by PSL/Sugar designers)

PSL Seems to be reasonably simple, elegant and concise! Jasper’s Göteborg based team have helped to define and simplify the formal semantics. See the LRM and also the paper in FMCAD 2004 (on course home page)

Friday’s lecture By Jiri Gaisler on his two process method of using VHDL Do NOT miss this lecture. It is brilliant! Next week, I will return to LTL, CTL and how to model check them