300 likes | 404 Views
Starfish: A Table-Centric Tool for Design Derivation . Alex Tsow The MITRE Corporation.
E N D
Starfish: A Table-Centric Tool for Design Derivation Alex Tsow The MITRE Corporation Affiliation with The MITRE Corporation is provided for identification purposes only, and is not intended to convey or imply MITRE's concurrence with, or support for, the positions, opinions or viewpoints expressed by the author.
Thanks to the NASA Langley Research Center • This work was supported by a 3 year fellowship from the Graduate Student Researchers Program (GSRP). • Sponsorship originated from NASA Langley Formal Methods Group Ricky Butler Paul S. Miner
Design Derivation • Formally generates systems • Transformational algebra • Contrast with post-design formal verification • Synchronous stream networks • Manual interaction • How best to achieve interaction? • How best to deliver a deep transformation space?
Behavior Tables Selector keys Signals Branches Updates Decision Table Action Table
Starfish • Tool for behavior table manipulation • Implements transformation algebra • b.t. display and derivation playback • Explicit type system • Data Refinement • Interactive Serialization Tables • Environment for high-level synthesis • Retiming
Related Work • Transformation systems • Eisenbiegler & Kumar, Formally Embedding Existing High Level Synthesis Algorithms • Teica, Radhakrishnan & Vemuri, An Approach to High Level Synthesis & System Validation Using Formally Verified Transformations • Matthews & Launchbury, ElementaryMicroarchitecture Algebra • Table-Oriented Engineering • Heninger, Kallander, Parnas & Shore, Software Requirements for the A-7 Aircraft • Heitmeyer, Labaw, et.al. SCR* • Leveson et.al., RSML • Algebraic Specification • Goguen, Thatcher, Wagner (ADJ), Initial Algebra Approach to the Specification, Correctness, and Implementation of Abstract Data Types • Gurevich, Evolving Algebras
Behavior Table Semantics StackCalc(inst,a)=res where res = (top s) s = {0} ! (sel (inst-cat instr) (push s a) (pop s) (push (pop (pop s)) (alu (inst->op instr) (top s) (top (pop s))))) Inputs instr = (push, push, add …) a = (5, 22, 2007, …) Internal Signals: res = ( 0, 5, 22, 27 …) s = ({0}, {0,5}, {0,5,22}, {0,27}, …)
Table Algebra • Add/Remove signal • Apply a term-level algebraic identity • Instantiate a “don’t care” subterm • Substitute combinational action for variable • Tuple/Untuple signals • Add/Remove decision key • Instantiate decision branches • Substitute branch value for decision key term • Split a table into multiple tables
Creating Factorization Opportunities • Retiming • Serialization • Data Refinement
Retiming update instr s a {0} top res update instr s a {0} top res 0
Add Tail Signal Expand ‘s’ Combinational identities Simplify ‘res’ and ‘tl’ Eliminate ‘s’ Retiming Retiming ‘res’ and ‘tl’’
High-Level Synthesis pop pop pop top push s alu top instr Data Flow Graph for (push (pop (pop s)) (alu-op instr (top s) (top (pop s))))
High-Level Synthesis pop pop top push s alu top instr
High-Level Synthesis pop pop top push s alu top instr
High-Level Synthesis pop pop top push s alu top instr
High-Level Synthesis pop s s pop top push s s s s s y x alu top x x x instr
Serialization Tables Scheduling Table Evaluation Table Term Eval Actions Evaluation Requirements
Insert schedule into behavior table Propose final step & Confirm requirements Serialization in Starfish
Types in Starfish • Multi-sorted structures with identities • Enforces syntactic correctness • Identity database for term manipulation • Declarative structures • Unbounded types; groups • Enumerated types; booleans, states • Parameterized types; stacks over data • Inter-type functions and identities • Special types and expressions • Polymorphic tuples & selectors, bit vectors, integers
Types in Starfish • Type inferencing is necessary • What’s the type of empty-stack? • Type annotations • Facilities for type translation • One-to-one • One-to-many • Choice of representation contingent on current representation: A,R) R • Stateful refinement, reference-state pattern
Stack to Array Transformation Apply to instances of ‘top’ Apply to ‘s’
Apply to signals ‘s’ and ‘tl’ Apply to instances of ‘top’ Stack to Linked List
Full StackCalc Decomposition Controller Memory ALU
Garbage Collector Derivation Factor out abstract memories Encapsulate memory with function names Apply switch refinement Move sw into DT
SECD Derivation (define secd (letrec ([exec (lambda (s e c d) (case (car c) ('RTN (exec (cons (car s) (car d)) ...)) ('DUM (exec s (cons nil e) (cdr c) d)) ('AP (exec '() (cons (car (cdr s)) (cdr (car s))) (car (car s)) (cons (cdr (cdr s)) (cons e (cons (cdr c) d))))) … ('STOP (exec s e c d))))]) exec ))
Conclusion / Future Work • Starfish expands factorization space • Behavior table viewer and transformer • Explicit type system and data refinement • High Level Synthesis w/ Serialization tables • Retiming • Interface/Transaction Specification • Integration with other tools • DDD / Theorem provers / CASL • Develop backends to synchronous targets • FPGAs • Multicore systems / real-time software