More on PSL some examples, some pitfalls. start idlep1p2p3 continue done cancel FSM.

Slides:



Advertisements
Similar presentations
IEEE 1284 I/O. IEEE 1284 Overview Four parallel port interfaces through ENI 40 pins Uses external latching transceivers Host-side only No IEEE negotiation.
Advertisements

Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
Homework Reading Machine Projects Labs
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
Algorithmic Software Verification VII. Computation tree logic and bisimulations.
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
1 MODULE name (parameters) “Ontology” “Program” “Properties” The NuSMV language A module can contain modules Top level: parameters less module Lower level.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar.
Presenter: PCLee VLSI Design, Automatic and Test, (VLSI-TSA-DAT).
Transaction Based Modeling and Verification of Hardware Protocols Xiaofang Chen, Steven M. German and Ganesh Gopalakrishnan Supported in part by SRC Contract.
Transaction Based Modeling and Verification of Hardware Protocols Xiaofang Chen, Steven M. German and Ganesh Gopalakrishnan Supported in part by Intel.
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
 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.
Reporter:PCLee With a significant increase in the design complexity of cores and associated communication among them, post-silicon validation.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
1 Lecture 22: Fault Tolerance Papers: Token Coherence: Decoupling Performance and Correctness, ISCA’03, Wisconsin A Low Overhead Fault Tolerant Coherence.
Mahapatra-A&M-Fall'001 Design Interface and Verification-I Introduction to a model of interfacing components in a design; and its verification.
Fundamentals of Simulation-Based Verification 1.Structure of a Testbench - stimulus, checkers, etc. 2.Observation and Assertions - automatic checking of.
EECS 470 Cache and Memory Systems Lecture 14 Coverage: Chapter 5.
Transaction Based Modeling and Verification of Hardware Protocols Xiaofang Chen, Steven M. German and Ganesh Gopalakrishnan Supported in part by SRC Contract.
Principle of Functional Verification Chapter 1~3 Presenter : Fu-Ching Yang.
1 Carnegie Mellon UniversitySPINFlavio Lerda Bug Catching SPIN An explicit state model checker.
System Design Chapter 8. Objectives  Understand the verification and validation of the analysis models.  Understand the transition from analysis to.
Institute for Applied Information Processing and Communications 1 Karin Greimel Semmering, Open Implication.
Roza Ghamari Bogazici University April Outline Introduction SystemC Language Formal Verification Techniques for SystemC Design and Verification.
Using Mathematica for modeling, simulation and property checking of hardware systems Ghiath AL SAMMANE VDS group : Verification & Modeling of Digital systems.
Reconfigurable Computing - VHDL - Types John Morris Chung-Ang University The University of Auckland.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Specifying circuit properties in PSL. Formal methods Mathematical and logical methods used in system development Aim to increase confidence in riktighet.
Property Specification Language PSL. Hardware Verification Example.
Chapter 5 Peer-to-Peer Protocols and Data Link Layer PART I: Peer-to-Peer Protocols ARQ Protocols and Reliable Data Transfer Flow Control.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
IEEE MEDIA INDEPENDENT HANDOVER DCN: Title: Clarification for Handover Primitives Date Submitted: February,
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
1 Lecture 24: Fault Tolerance Papers: Token Coherence: Decoupling Performance and Correctness, ISCA’03, Wisconsin A Low Overhead Fault Tolerant Coherence.
Assertions Jean-Michel Chabloz. Assertions basic Idea We assert that a certain “thing” should be true. –If it is true, fine –If it is false, then we get.
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Examples: Simple BIR-Lite Examples Copyright 2004, Matt Dwyer, John Hatcliff,
VIS Technology Transfer Course Session 7 Fairness Constraints and Monitors Serdar Tasiran.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Verification Technologies IBM Haifa Labs Formal Specification Using Sugar 2.0 Cindy Eisner September 2002.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Principles of reliable data transfer 0.
ECE DIGITAL LOGIC LECTURE 21: FINITE STATE MACHINE Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/24/2015.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 18: More Complex Interfaces Spring 2009.
Project Management Methodology Project Closing. Project closing stage Must be performed for all projects, successfully completed or shut off by management.
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
VHDL Models For Memory And Busses 구 본 진.
OPERATORS IN C CHAPTER 3. Expressions can be built up from literals, variables and operators. The operators define how the variables and literals in the.
Specifying circuit properties in PSL / Sugar. But first some background…
Interconnection Structures
Propositional Calculus: Boolean Functions and Expressions
Written Description of Algorithms
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Formal Methods in software development
Specifying circuit properties in PSL / Sugar
Course: CS60030 FORMAL SYSTEMS
ECE 352 Digital System Fundamentals
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
ECE 352 Digital System Fundamentals
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

More on PSL some examples, some pitfalls

start idlep1p2p3 continue done cancel FSM

Low level assertions assert always ((state = idle and start) -> next (state = p1)); assert always ((state = idle and not start) -> next (state = idle)); assert always ((state = p1 and continue) -> next (state = p2)); and so on… one for each transition good, but very localised

Low level assertions assert always ((state = idle and start) -> next (state = p1)); assert always ((state = idle and not start) -> next (state = idle)); assert always ((state = p1 and continue) -> next (state = p2)); and so on… one for each transition good, but very localised Bit-vector

Low level assertions assert always ((state = idle and start) -> next (state = p1)); assert always ((state = idle and not start) -> next (state = idle)); assert always ((state = p1 and continue) -> next (state = p2)); and so on… one for each transition good, but very localised constant

Low level assertions assert always ((state = idle and start) -> next (state = p1)); assert always ((state = idle and not start) -> next (state = idle)); assert always ((state = p1 and continue) -> next (state = p2)); and so on… one for each transition good, but very localised Implicit self-loop

Higher level assertion assert always (not (state = idle) -> eventually! (state = idle) Note: not a safety property! Will also likely need to link the state machine to the system that it is controlling and check that the desired functionality is achieved Message: try to raise level of abstraction of properties (while keeping them short and simple)

Example: simple bus interface spec (1) 1. 2 commands, read and write (with corresponding signals) 2. Command can be issued only after requesting the bus, indicated by a pulsed assertion of signal bus_req, and receiving a grant, indicated by the assertion of signal gnt one cycle after the assertion of bus_req 3. If the bus was not requested, it shouldn’t be granted 4. Command is issued the cycle following receipt of grant 5. Either a read or a write can be issued, not both simultaneously

Example: simple bus interface spec (2) 6. Reads and writes come with an address, on addr[7 downto 0], that should be valid in the following cycle 7. Address validity is indicated by signal addr_valid 8. If a read is issued, then one pulse of data on data_in[63 downto 0] is expected the following cycle 9. If a write is issued, then one pulse of data on data_out[63 downto 0] is expected the following cycle 10. Valid read data is indicated by data_in_valid and valid write data by data_out_valid

Example: simple bus interface low level checks 2, 4. assert always ((read or write) -> ended(bus_req; gnt; true)) Built in function Returns true when the SERE has just ended

Example: simple bus interface low level checks 3. assert always (not bus_req -> next (not gnt))

Example: simple bus interface low level checks 5. assert never (read and write)

Example: simple bus interface low level checks part of 6,7. assert always ((read or write) -> next addr_valid) assert always (not (read or write) -> next (not addr_valid))

Example: simple bus interface low level checks 10. assert always (read -> next data_in_valid) assert always (not read -> next (not data_in_valid)) assert always (write -> next data_out_valid) assert always (not write -> next (not data_out_valid))

Example: simple bus interface low level checks Have checked the protocol but not mentioned the addr, data_in or data_out buses Need to think about overall functionality as well as low level details

Example: simple bus interface high level checks Let’s assume two input signals get_data and put_data indicating that a read or write is needed Assume also we have a way to recognise, at the assertion of get_data or put_data, the data that needs to be read or written (from address get_addr[7 downto 0] to read_buffer[63 downto 0] or from write_buffer[63 downto 0] to address put_addr[7 downto 0]) Assume also a suitable memory

Example: simple bus interface high level checks assert forall ADR[7 downto 0] in boolean: always ((get_data and get_adr[7 downto 0] = ADR[7 downto 0]) -> eventually! (read_buffer[63 downto 0] = mem[ADR[7 downto 0]])) Notes: have made some assumptions e.g. about memory not changing after read included to show some of the fancier PSL constructs and use of bus structures

Main message Write both low level and high level checks Low level checks will be easier to write – often transcribed from spec. High level specs consider desired functionality, which may be implicit in the spec. Hard to write but high pay-off For one approach to a methodology for use of PSL, see the Prosyd Eu project web page ( Contains many interesting examples both small and large (including the following example)

Common PSL errors Mixing up logical implication and suffix implication assert always {req; ack} -> {start;busy[*]; end} Source: the PSL book (Eisner and Fisman) Probably didn’t mean start to coincide with req

if then Probably meant assert always {req; ack} |=> {start; busy[*]; end}

Confusing and with implication Every high priority request (req and high_pri) should be followed immediately by an ack and then by a gnt assert always (req and high_pri) -> next (ack -> next gnt) or assert always (req and high_pri) -> next (ack and next gnt) or assert always (req and high_pri) |=> {ack; gnt} Which? Why?

Confusing concatentation with implication Are these equivalent? assert always {a; b; c} assert always ( a -> next b -> next[2] c)

Confusing concatentation with suffix implication Are these equivalent? assert always {a; b[+]; c} |=> {d} assert always {a; b[+]; c; d}

Exercise Figure out from the standard what {SERE} (FL_property) means

Using never with implication assert always (req -> next ack) req is always followed by ack Two consecutive reqs are not allowed assert never (req -> next req) ?

Using never with implication assert always (req -> next ack) req is always followed by ack Two consecutive reqs are not allowed assert never (req -> next req) ?? or assert always (req -> next (not req)) or assert never {req; req} Which? Why? (And similarly for suffix implication)

Negating implications assert always ((high_pri and req) -> ack) High priority req gives an immediate ack Low priority request does not give an immediate ack assert always not ((low_pri and req) -> ack) ?? Ex: What should it be? Check all three assertions on the following traces (And similarly for suffix implication)

req high_pri ack low_pri

req high_pri ack low_pri

Incorrect nesting of implications (1) If a request (assertion of req) is acknowledged (assertion of ack the following cycle), then it must receive a grant (assertion of gnt) the cycle following ack assert always ((req -> next ack) -> next gnt) Faults? What should it be? (Write in both LTL and SERE style) Check on following trace

req ack gnt

Incorrect nesting of implications (2) If there is a granted read request (assertion of req followed by ack followed by gnt), then if there follows a complete data transfer {start; data[*], end}, then the whole thing should be followed by an assertion of signal read_complete. assert always ({req; gnt; ack} |=> {start; data[*]; end}) | => {read_complete} ?? Fault? What should it be? (Write with two suffix implications and with one) In the latter case, think about how moving the position of the suffix implication changes the meaning of the property

Thinking you are missing a ”first match” operator On the cycle after the first ack following a request, a data transfer should begin assert always ({req; [*]; ack} |=> {start; data[*]; end}) ?? Wrong: Demands a transfer after every assertion of ack after the req.

Thinking you are missing a ”first match” operator On the cycle after the first ack following a request, a data transfer should begin assert always ({req; [*]; ack} |=> {start; data[*]; end}) ?? Wrong: Demands a transfer after every assertion of ack after the req. Answer: use ack[->]

”Extraneous” assertions of signals assert always {ack} |=> {start ; busy[*] ; done} ack start busy done

May wish to rule out some behaviours assert always (ack -> not (start or busy or done)) assert always {ack} | => {start and not busy and not done ; {not start and busy and not done}[*]; not start and not busy and done}

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 (or IEEE standard) and also the paper in FMCAD 2004 In larger examples, one uses the modelling layer (in VHDL) to augment specs, ending up with small and readable PSL properties