Penn ESE 535 Spring 2008 -- DeHon 1 ESE535: Electronic Design Automation Day 22: April 23, 2008 FSM Equivalence Checking.

Slides:



Advertisements
Similar presentations
Chapter Three: Closure Properties for Regular Languages
Advertisements

CSE 311 Foundations of Computing I
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
CSE 311: Foundations of Computing Fall 2013 Lecture 23: Finite state machines and minimization.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 13: March 4, 2009 FSM Equivalence Checking.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 7: February 11, 2008 Static Timing Analysis and Multi-Level Speedup.
Computation Engines: BDDs and SAT (part 2) 290N: The Unknown Component Problem Lecture 8.
ECE Synthesis & Verification - L211 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Verification Equivalence checking.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 12: March 2, 2009 Sequential Optimization (FSM Encoding)
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Theory of Computing Lecture 22 MAS 714 Hartmut Klauck.
CS Chapter 2. LanguageMachineGrammar RegularFinite AutomatonRegular Expression, Regular Grammar Context-FreePushdown AutomatonContext-Free Grammar.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 15: March 18, 2009 Static Timing Analysis and Multi-Level Speedup.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
CSCI 3301 Transparency No. 9-1 Chapter #9: Finite State Machine Optimization Contemporary Logic Design.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
State Minimization and Determinization EECS 290A Sequential Logic Synthesis and Verification.
CSE 311: Foundations of Computing Fall 2014 Lecture 23: State Minimization, NFAs.
Tutorial CSC3130 : Formal Languages and Automata Theory Haifeng Wan ( )
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
CSE 311 Foundations of Computing I Lecture 21 Finite State Machines Spring
CALTECH CS137 Spring DeHon CS137: Electronic Design Automation Day 9: May 6, 2002 FSM Equivalence Checking.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 24: April 18, 2011 Covering and Retiming.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 23: April 20, 2015 Static Timing Analysis and Multi-Level Speedup.
ATM, Halting Problem, P vs. NP Chapter 4, 5 & 7. Russel’s Paradox An Index is a book that lists other books in.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
Lexical Analysis: DFA Minimization & Wrap Up. Automating Scanner Construction PREVIOUSLY RE  NFA ( Thompson’s construction ) Build an NFA for each term.
CSCI 2670 Introduction to Theory of Computing September 13.
CS 203: Introduction to Formal Languages and Automata
Regular Expressions Fundamental Data Structures and Algorithms Peter Lee March 13, 2003.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 6: January 26, 2004 Sequential Optimization (FSM Encoding)
Computability and Complexity 2-1 Problems and Languages Computability and Complexity Andrei Bulatov.
Penn ESE534 Spring DeHon 1 ESE534: Computer Organization Day 21: April 4, 2012 Lossless Data Compression.
CSE 311 Foundations of Computing I Lecture 25 Circuits for FSMs, Carry-Look-Ahead Adders Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 24 FSM Limits, Pattern Matching Autumn 2011 CSE 3111.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 17: March 11, 2002 Sequential Optimization (FSM Encoding)
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 20: April 4, 2011 Static Timing Analysis and Multi-Level Speedup.
LECTURE 5 Scanning. SYNTAX ANALYSIS We know from our previous lectures that the process of verifying the syntax of the program is performed in two stages:
Universal Turing Machine
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 25: April 17, 2013 Covering and Retiming.
CS137: Electronic Design Automation
Sequential Flexibility
Formal Language & Automata Theory
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
Instructor: Rajeev Alur
PDAs Accept Context-Free Languages
CS137: Electronic Design Automation
ESE535: Electronic Design Automation
ESE535: Electronic Design Automation
Non-Deterministic Finite Automata
Decidable Languages Costas Busch - LSU.
Intro to Data Structures
Deterministic PDAs - DPDAs
Elementary Questions about Regular Languages
MA/CSSE 474 Theory of Computation
ESE535: Electronic Design Automation
Instructor: Aaron Roth
CSE 370 – Winter Sequential Logic-2 - 1
CS137: Electronic Design Automation
Presentation transcript:

Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 22: April 23, 2008 FSM Equivalence Checking

Penn ESE 535 Spring DeHon 2 Today Sequential Verification –DFA equivalence –Issues Extracting STG Valid state reduction Incomplete Specification –Solutions State PODEM State/path exploration

Penn ESE 535 Spring DeHon 3 Motivation Write at two levels –Java prototype and VHDL implementation –VHDL specification and gate-level implementation Write at high level and synthesize/optimize –Want to verify that synthesis/transforms did not introduce an error

Penn ESE 535 Spring DeHon 4 Cornerstone Result Given two DFA’s, can test their equivalence in finite time N.B.: –Can visit all states in a DFA with finite input strings No longer than number of states Any string longer must have visited some state more than once (by pigeon-hole principle) Cannot distinguish any prefix longer than number of states from some shorter prefix which eliminates cycle (pumping lemma)

Penn ESE 535 Spring DeHon 5 FSM Equivalence Given same sequence of inputs –Returns same sequence of outputs Observation means can reason about finite sequence prefixes and extend to infinite sequences which DFAs (FSMs) are defined over

Penn ESE 535 Spring DeHon 6 Equivalence Brute Force: –Generate all strings of length |state| (for larger DFA) –Feed to both DFAs –Observe any differences? –|Alphabet| states

Penn ESE 535 Spring DeHon 7 Smarter Create composite DFA XOR together acceptance of two DFAs in each composite state Ask if the new machine accepts anything –Anything it accepts is a proof of non- equivalence –Accepts nothing  equivalent

Penn ESE 535 Spring DeHon 8 Composite DFA Assume know start state for each DFA Each state in composite is labeled by the pair {S1 i, S2 j } –At most product of states Start in {S1 0, S2 0 } For each symbol a, create a new edge: –T(a,{S1 0, S2 0 })  {S1 i, S2 j } If T 1 (a, S1 0 )  S1 i, and T 2 (a, S2 0 )  S2 j Repeat for each composite state reached

Penn ESE 535 Spring DeHon 9 Composite DFA At most |alphabet|*|State1|*|State2| edges == work Can group together original edges –i.e. in each state compute intersections of outgoing edges –Really at most |E 1 |*|E 2 |

Penn ESE 535 Spring DeHon 10 Acceptance State {S1 i, S2 j } is an accepting state iff –State S1 i accepts and S2 j does not accept –State S1 i does not accept and S2 j accepts If S1 i and S2 j have the same acceptance for all composite states, it is impossible to distinguish the machines –They are equivalent A state with differing acceptance –Implies a string which is accepted by one machine but not the other

Penn ESE 535 Spring DeHon 11 Empty Language Now that we have a composite state machine, with this acceptance Question: does this composite state machine accept anything? –Is there a reachable state which accepts the input?

Penn ESE 535 Spring DeHon 12 Answering Empty Language Start at composite start state {S1 0, S2 0 } Search for path to an Accepting state Use any search (BFS, DFS) End when find accepting state –Not equivalent OR when have explored entire reachable graph w/out finding –Are equivalent

Penn ESE 535 Spring DeHon 13 Reachability Search Worst: explore all edges at most once –O(|E|)=O(|E 1 |*|E 2 |) Actually, should be able to find during composite construction –If only follow edges which fill-in as search

Penn ESE 535 Spring DeHon 14 Example s3s4 0 s0 s1s q0 q1q = accept state

Penn ESE 535 Spring DeHon 15 Issues to Address Get State-Transition Graph from –RTL, Logic Incompletely specified FSM? Know valid (possible) states? Know start State for Logic? Computing the composite FSM may be large

Penn ESE 535 Spring DeHon 16 Getting STG Verilog/VHDL Gather up logic to wait statement –Make one state Split states (add edges) on if/else, select Backedges with while/for –Branching edges on loop conditions Start state is first state at beginning of code.

Penn ESE 535 Spring DeHon 17 Getting STG from Logic Brute Force –For each state For each input minterm –Simulate/compute output –Add edges –Compute set of states will transition to Smarter –Use modified PODEM to justify outputs and next state Exploit cube grouping, search pruning

Penn ESE 535 Spring DeHon 18 PODEM state extraction Search for all reachable states –Don’t stop once find one output –Keep enumerating and generating possible outputs

Penn ESE 535 Spring DeHon 19 Delay Computation Modification of a testing routine –used to justify an output value for a circuit PODEM –backtracking search to find a suitable input vector associated with some target output –Simply a branching search with implication pruning Heuristic for smart variable ordering Day 7

Penn ESE 535 Spring DeHon 20 Incomplete State Specification Add edge for unspecified transition to –Single, new, terminal state Reachability of this state may indicate problem –Actually, if both transition to this new state for same cases Might say are equivalent Just need to distinguish one machine in this state and other not

Penn ESE 535 Spring DeHon 21 Valid States PODEM justification finds set of possibly reachable states Composite state construction and reachability further show what’s reachable So, end up finding set of valid states –Not all possible states from state bits

Penn ESE 535 Spring DeHon 22 Start State for Logic Start states should output same thing between two FSMs Start search with state set {S1 0, S2 i } for all S2 i with same output as S1 0 Use these for acceptance (contradiction) reachability search

Penn ESE 535 Spring DeHon 23 Memory? Concern for size of search space –Product set of states –Nodes in search space Combine –Generation –Reachability –State justification/enumeration

Penn ESE 535 Spring DeHon 24 Composite Algorithm PathEnumerate(st, path, ValStates) –// st is a state of M1 –ValStates+=st –While !(st.enumerated) Edge=EnumerateStateFanout(st) // PODEM Simulate Edge on M2 –Equivalent result? If not return(FAIL) If (Edge.FaninState(M1),Edge.FaninState(M2) in Path.Spairs) –Return(PATH_OK) ;; already visisted/expanded that state Else –ValStates+=Edge.FaninState(M1) –Path=Path+Edge; Update Path.Spairs –PathEnuemrate(Edge.FaninState(M1),Path,ValStates)

Penn ESE 535 Spring DeHon 25 Start Composite Algorithm PathEnumerate(Start(M1),empty,empty) Succeed if complete path search and not fail –Not encounter contradiction

Penn ESE 535 Spring DeHon 26 Admin Reading Assignment 7

Penn ESE 535 Spring DeHon 27 Big Ideas Equivalence –Same observable behavior –Internal implementation irrelevant Number/organization of states, encoding of state bits… Exploit structure –Finite DFA … necessity of reconvergent paths –Pruning Search – group together cubes –Limit to valid/reachable states Proving invariants vs. empirical verification