CALTECH CS137 Spring2002 -- DeHon CS137: Electronic Design Automation Day 9: May 6, 2002 FSM Equivalence Checking.

Slides:



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

CSE 311 Foundations of Computing I
Reducing DFA’s Section 2.4. Reduction of DFA For any language, there are many DFA’s that accept the language Why would we want to find the smallest? Algorithm:
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 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 13: March 4, 2009 FSM Equivalence Checking.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 22: April 23, 2008 FSM Equivalence Checking.
CS 310 – Fall 2006 Pacific University CS310 Decidability Section 4.1/4.2 November 10, 2006.
Computation Engines: BDDs and SAT (part 2) 290N: The Unknown Component Problem Lecture 8.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
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.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
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.
CSCI 3301 Transparency No. 9-1 Chapter #9: Finite State Machine Optimization Contemporary Logic Design.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA minimization.
State Minimization and Determinization EECS 290A Sequential Logic Synthesis and Verification.
CSE 311: Foundations of Computing Fall 2014 Lecture 23: State Minimization, NFAs.
Lexical Analysis — Part II: Constructing a Scanner from Regular Expressions.
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
Lexical Analysis Constructing a Scanner from Regular Expressions.
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.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
CSCI 2670 Introduction to Theory of Computing September 13.
CS 203: Introduction to Formal Languages and Automata
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
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)
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.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
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:
Nondeterministic Finite State Machines Chapter 5.
Algorithms and Decision Procedures for Regular Languages Chapter 9.
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
Universal Turing Machine
CS137: Electronic Design Automation
Turing’s Thesis Costas Busch - LSU.
Sequential Flexibility
Standard Representations of Regular Languages
PDAs Accept Context-Free Languages
CSE 105 theory of computation
CS137: Electronic Design Automation
Two issues in lexical analysis
Turing Machines Acceptors; Enumerators
ESE535: Electronic Design Automation
CSE 105 theory of computation
ESE535: Electronic Design Automation
Non-Deterministic Finite Automata
Decidable Languages Costas Busch - LSU.
Elementary Questions about Regular Languages
ESE535: Electronic Design Automation
Instructor: Aaron Roth
Decidability continued….
CSE 105 theory of computation
CS137: Electronic Design Automation
CSE 105 theory of computation
Presentation transcript:

CALTECH CS137 Spring DeHon CS137: Electronic Design Automation Day 9: May 6, 2002 FSM Equivalence Checking

CALTECH CS137 Spring DeHon Today Sequential Verification –DFA equivalence –Issues Extracting STG Valid state reduction Incomplete Specification –Solutions State PODEM State/path exploration

CALTECH CS137 Spring DeHon FYI PODEM –Path Oriented Decision Making

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon Equivalence Brute Force: –Generate all strings of length |state| (for smaller DFA) –Feed to both DFAs –Observe any differences? –|Alphabet| states

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon 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 |

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon 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?

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon 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, fill-in as search

CALTECH CS137 Spring DeHon Example s3s4 0 s0 s1s q0 q1q = accept state

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon 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.

CALTECH CS137 Spring DeHon 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

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

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon 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

CALTECH CS137 Spring DeHon Memory? Concern for size of search space –Product set of states –Nodes in search space Combine –Generation –Reachability –State justification/enumeration

CALTECH CS137 Spring DeHon Composite Algorithm PathEnumerate(st, path, ValStates) –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)

CALTECH CS137 Spring DeHon Start Composite Algorithm PathEnumerate(Start(M1),empty,empty) Succeed if complete path search and not fail –Not encounter contradiction

CALTECH CS137 Spring DeHon 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