A Formal Model of Clock Domain Crossing and Automated Verification of Time-Triggered Hardware

Similar documents
Verification of clock synchronization algorithm (Original Welch-Lynch algorithm and adaptation to TTA)

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

Formalization of Normal Random Variables

Embedded Systems Design: Optimization Challenges. Paul Pop Embedded Systems Lab (ESLAB) Linköping University, Sweden

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

L10 State Machine Design Topics

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

TTA and PALS: Formally Verified Design Patterns for Distributed Cyber-Physical

Agreement Protocols. CS60002: Distributed Systems. Pallab Dasgupta Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

State & Finite State Machines

Modeling 8N1 Protocol with Uppaal

Failure detectors Introduction CHAPTER

State & Finite State Machines

Time. To do. q Physical clocks q Logical clocks

Digital Control of Electric Drives

Stop Watch (System Controller Approach)

Time. Lakshmi Ganesh. (slides borrowed from Maya Haridasan, Michael George)

Proving Safety Properties of the Steam Boiler Controller. Abstract

Motors Automation Energy Transmission & Distribution Coatings. Servo Drive SCA06 V1.5X. Addendum to the Programming Manual SCA06 V1.

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Chapter 7. Sequential Circuits Registers, Counters, RAM

CSE140L: Components and Design Techniques for Digital Systems Lab. FSMs. Instructor: Mohsen Imani. Slides from Tajana Simunic Rosing

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Sequential Circuits Sequential circuits combinational circuits state gate delay

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

ECE 448 Lecture 6. Finite State Machines. State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code. George Mason University

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

Andrew Morton University of Waterloo Canada

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

6. Finite State Machines

Logic Design II (17.342) Spring Lecture Outline

A Brief Introduction to Model Checking

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?

Adders allow computers to add numbers 2-bit ripple-carry adder

Time. Today. l Physical clocks l Logical clocks

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

Timing Issues. Digital Integrated Circuits A Design Perspective. Jan M. Rabaey Anantha Chandrakasan Borivoje Nikolić. January 2003

ELECTROMAGNETIC FAULT INJECTION: TOWARDS A FAULT MODEL ON A 32-BIT MICROCONTROLLER

GMU, ECE 680 Physical VLSI Design 1

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Example: vending machine

Ch 9. Sequential Logic Technologies. IX - Sequential Logic Technology Contemporary Logic Design 1

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Distributed Systems. Time, Clocks, and Ordering of Events

Digital Circuits ECS 371

CSEE W3827 Fundamentals of Computer Systems Homework Assignment 3

Synchronous Sequential Circuit Design. Digital Computer Design

ECE 3060 VLSI and Advanced Digital Design. Testing

The Quasi-Synchronous Approach to Distributed Control Systems

From Sequential Circuits to Real Computers

MSL RAD EVIL L2 trigger FPGA code review

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

State and Finite State Machines

Formal Verification of Systems-on-Chip

Counters. We ll look at different kinds of counters and discuss how to build them

Preparation of Examination Questions and Exercises: Solutions

Chapter 6. Synchronous Sequential Circuits

FSM Examples. Young Won Lim 11/6/15

Chapter 3. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 3 <1>

Generalized FSM model: Moore and Mealy

Combinational vs. Sequential. Summary of Combinational Logic. Combinational device/circuit: any circuit built using the basic gates Expressed as

Time Synchronization

CSEE W3827 Fundamentals of Computer Systems Homework Assignment 3 Solutions

ESE 570: Digital Integrated Circuits and VLSI Fundamentals

EECS150 - Digital Design Lecture 16 Counters. Announcements

Menu. Excitation Tables (Bonus Slide) EEL3701 EEL3701. Registers, RALU, Asynch, Synch

ELCT201: DIGITAL LOGIC DESIGN

ELCT201: DIGITAL LOGIC DESIGN

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Consensus. One Reason: Impossibility of Consensus. Let s Consider This

EE241 - Spring 2006 Advanced Digital Integrated Circuits

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

Issues on Timing and Clocking

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

Satisfiability Modulo Theories Applications and Challenges

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

The Leader Election Protocol (IEEE 1394)

EECS150 - Digital Design Lecture 15 SIFT2 + FSM. Recap and Outline

Analysis of a Boost Converter Circuit Using Linear Hybrid Automata

Learning to work with SPS Structured Beam. (June 14-21, 2004) Lev Uvarov

Digital Electronics Final Examination. Part A

EXPERIMENT Bit Binary Sequential Multiplier

Easy Parameterized Verification of Biphase Mark and 8N1 Protocols

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

CSE 123: Computer Networks

Digital Design. Sequential Logic

CMP 338: Third Class

Cosmic Ray Detector Software

ALU, Latches and Flip-Flops

Programmable Logic Devices II

Modeling and Simulation NETW 707

Sequential Circuit Timing. Young Won Lim 11/6/15

Models for representing sequential circuits

Special Nodes for Interface

Transcription:

A Formal Model of Clock Domain Crossing and Automated Verification of Time-Triggered Hardware Julien Schmaltz Institute for Computing and Information Sciences Radboud University Nijmegen The Netherlands julien@cs.ru.nl Part of this work funded by the Verisoft Project, Uni. Saarbrücken, Germany and the Marie Curie project TAROT FMCAD 2007, Nov. 11 14

ecall: Safety-Critical Automotive Application Automatic emergency call system A phone call is automatically emitted when car sensors detect an accident 4 distributed components Sensors: severity Navigation System: position Mobile Phone: send information ecall: central application

The Verisoft Project CLI: original work on stack proof (Moore et al.) Verisoft: Pervasive verification of distributed systems Formal Proofs of Applications Operating systems Compilers Processors FlexRay bus Asynchronous communications

Asynchronous Communications Clock imperfections drift: different clocks with different rates jitter: clocks without constant rates Metastability Metastable states: register output undefined Resolution: output stabilized non-deterministically to 1 or 0

FlexRay Architecture: Schedule Overview A B C FlexRay bus Time divided into rounds Each round divided into slots t k t l slot 0 slot 1... slot j slot n 1 Every unit owns one slot slot0 A slot1 B slotj C round i Clock synchronization algorithm

FlexRay Verification: Overview t k t l slot 0 slot 1... slot j slot n 1 round i Clock synchronization correctness All units agree on global timing Schedule correctness Unit C starts sending m at time tk at the earliest Unit C stops sending at time tl at the latest Transmission correctness At time tl, all units have received m Functional correctness + timing analysis

Related Work Physical layer protocol analysis First work by Moore (1993) Biphase mark protocol Theorem proving (Nqthm) Contemporary work by Bosscher, Polak and Vaandrager (1994) Philips audio control protocol Recent work by Brown and Pike (2006) Biphase mark and 8N1 protocols k-induction (SAL) Recent work by Vaandrager and de Groot (2007) Biphase mark protocol Real-time model checking (Uppaal) All works on abstract models, no real hardware

Contribution General formal model of clock domain crossing Metastability Clock drift/jitter Detailed timing parameters Realization in Isabelle/HOL Mixed with gate-level hardware designs Combination of theorem proving with automatic tools Proof of a FlexRay-like hardware interface Basis theorem for pervasive verification of distributed systems Functional correctness and timing analysis Bounds on crucial parameter of the bit clock synchronization algorithm

Outline Overall Verification Approach FlexRay Hardware Interface Clock Domain Crossing Model Mixing Digital and Analog Final Correctness Proof

Verification Method CDC Model Mixed A/D World ANALOG DIGITAL Digital Properties (NuSMV) HW Design Correctness Theorem Arbitrary long messages Timing analysis Complex Inductive Proof FPGA Automatic Translation

Verification Method: CDC Model CDC Model Model relevant phenomena - Metastability - Clock drift/jitter Main Theorem - Bit transfer correctness Mixed A/D World ANALOG DIGITAL Digital Properties (NuSMV) HW Design Correctness Theorem Arbitrary long messages Timing analysis Complex Inductive Proof FPGA Automatic Translation

Verification Method: Mixed A/D World Mixed A/D World CDC Model ANALOG DIGITAL Link between - CDC model (dense time) - Hardware models (discrete time) Main Theorem - Bit transfer correctness - Mixed A/D conclusion Automatic tools apply - NuSMV in Isabelle (Tverdyshev) Digital Properties (NuSMV) HW Design Correctness Theorem Arbitrary long messages Timing analysis Complex Inductive Proof FPGA Automatic Translation

Verification Method: HW Design CDC Model FlexRay Hardware - Isabelle model - FPGA model Mixed A/D World ANALOG DIGITAL Digital Properties (NuSMV) HW Design Correctness Theorem Arbitrary long messages Timing analysis Complex Inductive Proof FPGA Automatic Translation

Verification Method: Final Inductive Proof Mixed A/D World Correctness Theorem Arbitrary long messages Timing analysis Complex Inductive Proof CDC Model ANALOG DIGITAL Digital Properties (NuSMV) Induction - Message length (byte number) Property about - (1) State machine - (2) Synchronization hardware - (1) and (2) not independent HW Design FPGA Automatic Translation

Outline: HW Design CDC Model FlexRay Hardware - Isabelle model - FPGA model Mixed A/D World ANALOG DIGITAL Digital Properties (NuSMV) HW Design Correctness Theorem Arbitrary long messages Timing analysis Complex Inductive Proof FPGA Automatic Translation

FlexRay Architecture: Protocol Overview start TSS FSS BSS[0] BSS[1] done = 0 b[0] b[1] b[2] idle FES[0] FES[1] done = 1 b[7] b[6] b[5] b[4] b[3] Receiver and sender implements the same control automaton Frames follow the following format f (m) = TSS,FSS,BSS,m[0],...,BSS,m[l 1],FES Byte synchronization sequence BSS = 10 Each bit sent 8 times + majority voting

FlexRay Architecture: Bit Clock Synchronization BSS[0] BSS[1] byte BSS[0] BSS[1] VotedVal Sample count cnt 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 reset... 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 6 7 8 1 2 3 4 5 6 2 3 4 5 6 7 8 1... 1 2 3 4 5 6 7 8 1 2 2 3 4 5 6 7 8 1 Strobe when cnt = 5 cnt reset to 2 at synchronization edges Values 5 and 2 fixed by specification document (Figure 3-8 page 243 of Protocol Specification v2.1) reset

Bit Clock Synchronization and Metastability VotedVal Sample count cnt BSS[0] 1 1 1 1 1 1 1 1 0 reset BSS[1] byte BSS[0] BSS[1] 0 0 0 0 0 0 0 6 7 8 1 2 3 4 5 6 2 3 4 5 6 7 8 1... drift... 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 1 2 2 3 4 5 6 7 8 reset metastability Objective: always sample (roughly) in the middle Potential metastability when sampling around falling or rising edges Misalignment due to clock drift Spikes (ignored) Roughly in the middle = 8 bits - first - last = 6 bits

Receiver Input Stage inp r R R SH[3:0] 1 v 5-Maj v t? v t 1 idle BSS[1] sync cnt =? xxx BYTE[7:0] rb.we R b7 strobe 1

Receiver Input Stage inp r R R SH[3:0] 2-stage synchronizer (metastability) 1 v 5-Maj v t? v t 1 idle BSS[1] sync cnt =? xxx Reg. 2 never metastable Non-det. to 0 or 1 BYTE[7:0] rb.we R b7 strobe 1

Receiver Input Stage inp r R R SH[3:0] 5-majority voting 1 v 5-Maj v t? v t 1 idle BSS[1] sync cnt =? xxx BYTE[7:0] rb.we R b7 strobe 1

Receiver Input Stage inp r R R SH[3:0] 1 5-Maj v t? v t 1 v idle BSS[1] sync cnt =? xxx BYTE[7:0] bit clock synchronization sync high on falling edges only if state idle or BSS[1] disable strobing reset counter (to yyy) rb.we R b7 strobe 1

Receiver Input Stage inp r R R SH[3:0] 1 v 5-Maj v t? v t 1 idle BSS[1] sync cnt =? xxx strobe high when cnt = xxx Store v in BYTE clock control automaton BYTE[7:0] rb.we R b7 strobe strobing mechanism 1

Outline: CDC Model CDC Model Model relevant phenomena - Metastability - Clock drift/jitter Main Theorem - Bit transfer correctness Mixed A/D World ANALOG DIGITAL Digital Properties (NuSMV) HW Design Correctness Theorem Arbitrary long messages Timing analysis Complex Inductive Proof FPGA Automatic Translation

General Assumptions 3-valued logic: 0, 1 for low and high voltages Ω for any other voltage Time represented by nonnegative reals (R 0 ) Signals are functions from time to {0,1,Ω} Transition from low (high) to high (low) via Ω In particular, output signal of registers Consequence: metastable states when sampling Ω Clocks represented by their period τ Date of edge c on unit u noted eu (c) = c τ u Edges have no width

Relating Senders and Receivers FES TSS FSS e s(c) synchronization sequence BSS[0] BSS[1] e s(c + 16) sender side sender output Ω x receiver side (clock edges) cy(ξ, c) Sender put x on bus at time e s (c) ξ first affected (receiver) cycle (to sample x or Ω)

Metastability FES TSS FSS synchronization sequence BSS[0] BSS[1] e s(c) e s(c + 16) sender side sender output Ω x receiver side (clock edges) cy(ξ, c) +β ξ c Metastable state when sampling Ω, If cy(ξ,c) on Ω, then metastable state we may look one cycle later, at cy(ξ,c) + β ξ c: β ξ c = 0 if no metastable state at cy(ξ, c) β ξ c = 1 otherwise

Main Analog Theorem: Bit Transfer Correctness sender receiver β = 0 β = 1 c c + 8 0 0 0 0 0 0 0? 1 0 0 0 0 0 0 0 From sender cycle c Bit sent 8 times First affected cycle given: cy(ξ, c) Theorem At least 7 samples on receiver side Possible shift of 1 cycle due to metastability

Clock Drift and Jitter Clocks not constant over time Drift bounded by percentage δ of reference period Lemma 1 δ τ u τ ref 1 + δ Within π cycles, clocks cannot drift by more than 1 cycle From one known mark, next marks have 3 possible positions cy(ξ, c) +α cy(ξ + α + χ,c + α) sender receiver +α + χ α π χ { 1, 0,1}

Outline: Mixed A/D World Mixed A/D World CDC Model ANALOG DIGITAL Link between - CDC model (dense time) - Hardware models (discrete time) Main Theorem - Bit transfer correctness - Mixed A/D conclusion Automatic tools apply - NuSMV in Isabelle (Tverdyshev) Digital Properties (NuSMV) HW Design Correctness Theorem Arbitrary long messages Timing analysis Complex Inductive Proof FPGA Automatic Translation

CDC Model and Hardware Designs sender receiver clk s x R s ce s 1 out s Bus inp r R r y clk r Goal: insert CDC model without modifying designs

CDC Model and Hardware Designs sender receiver clk s x R s ce s 1 out s Bus inp r R r y clk r Goal: insert CDC model without modifying designs 2 digital transitions to move x to y

CDC Model and Hardware Designs sender receiver clk s x R s ce s 1 out s Bus inp r 1 R r y clk r ar s a R r 2 digital transitions to move x to y One analog register function matched to one digital transition Designs not modified

Example: Majority Voting x R s R r inp r R v 5-Maj SH[3:0] Using NuSMV In Isabelle inp t+[0:6] r = x implies v t+[4:10] = x Insert CDC model for sender cycle c and cy(ξ, c) inp c+[0:7] s = x implies inp ξ+βξ c r +[0:6] = x then we insert NuSMV result inp c+[0:7] s = x implies v ξ+βξ c +[4:10] = x

Example: Majority Voting x R s R r inp r R v 5-Maj SH[3:0] Using NuSMV In Isabelle inp t+[0:6] r = x implies v t+[4:10] = x Insert CDC model for sender cycle c and cy(ξ, c) inp c+[0:7] s = x implies inp ξ+βξ c r +[0:6] = x then we insert NuSMV result inp c+[0:7] s = x implies v ξ+βξ c +[4:10] = x

Example: Majority Voting x R s R r inp r R v 5-Maj SH[3:0] Using NuSMV In Isabelle inp t+[0:6] r = x implies v t+[4:10] = x Insert CDC model for sender cycle c and cy(ξ, c) inp c+[0:7] s = x implies inp ξ+βξ c r +[0:6] = x then we insert NuSMV result inp c+[0:7] s = x implies v ξ+βξ c +[4:10] = x

Example: Majority Voting x R s R r inp r R v 5-Maj SH[3:0] Using NuSMV In Isabelle inp t+[0:6] r = x implies v t+[4:10] = x Insert CDC model for sender cycle c and cy(ξ, c) inp c+[0:7] s = x implies inp ξ+βξ c r +[0:6] = x then we insert NuSMV result inp c+[0:7] s = x implies v ξ+βξ c +[4:10] = x

Example: Majority Voting x R s R r inp r R v 5-Maj SH[3:0] Using NuSMV In Isabelle inp t+[0:6] r = x implies v t+[4:10] = x Insert CDC model for sender cycle c and cy(ξ, c) inp c+[0:7] s = x implies inp ξ+βξ c r +[0:6] = x then we insert NuSMV result inp c+[0:7] s = x implies v ξ+βξ c +[4:10] = x

Example: Majority Voting x R s R r inp r R v 5-Maj SH[3:0] Using NuSMV In Isabelle inp t+[0:6] r = x implies v t+[4:10] = x Insert CDC model for sender cycle c and cy(ξ, c) inp c+[0:7] s = x implies inp ξ+βξ c r +[0:6] = x then we insert NuSMV result inp c+[0:7] s = x implies v ξ+βξ c +[4:10] = x

Outline: Final Correctness Proof Mixed A/D World Correctness Theorem Arbitrary long messages Timing analysis Complex Inductive Proof CDC Model ANALOG DIGITAL Digital Properties (NuSMV) Induction - Message length (byte number) Property about - (1) State machine - (2) Synchronization hardware - (1) and (2) not independent HW Design FPGA Automatic Translation

Correctness Theorem: Overview Functional Correctness For each byte, there exists one receiver cycle from which the byte is correctly sampled This takes 79 to 82 cycles Factor χ { 1, 0,+1} Factor β {0, +1} Valid counter values: 1 (strobe - reset) 3 Timing Analysis Derived from functional correctness when receiver affected by first bit of last byte number of cycles to finish transmission Bounded drift used to bound transmission time

Functional Correctness: Proof Overview Lemma 1: Traversing synchronization edges Transition from BSS[0] to end of BSS[1] Synchronization actually takes place Lemma 2: Sampling expected values Synchronization is good enough Proof Method CDC model: number of unknown inputs (systematic) Unknown inputs are assumptions for NuSMV (automatic)

Conclusion(1) General model of clock domain crossing Isabelle/HOL (Isar) theory (1,000 loc) Reusable for other proofs (e.g. scheduler) Fully parameterized Formal correctness proof of a hardware FlexRay-like interface First detailed gate-level proof: functionality + timing Valid values for crucial parameter Basis theorem for the verification of distributed stacks Theorem proving and automatic tools (like model checking)

Conclusion (2) Practical experience of hybrid verification Automatic tools were crucial Automatic tools must be extremely fast (seconds not minutes) Easy interaction with tactic based theorem prover (Isabelle/Isar) Automatic tools are just new tactics Developing the model was the main effort Understanding of the details Deciding between wrong implementation or incomplete model Model can still be improved (spikes, faults) From the model the proof of the hardware is systematic General model: exactly where automatic tools apply From first proofs: systematic proof techniques Similar design verification effort would take few weeks... but tedious: receiver proof > 8,000 loc

THANK YOU!!

Functional Correctness: Proof Overview Show counter-example for the following configuration Counter reset to 000 Strobe at 100 Strobing distance = 4-0 = 4 FlexRay specifications Counter reset to 010 Strobe at 101 Strobing distance = 5-2 = 3 Lemma 1: Traversing synchronization edges Transition from BSS[0] to end of BSS[1] Synchronization actually takes place Lemma 2: Sampling expected values Synchronization is good enough

Traversing Synchronization Edges Sender Ouput out s VotedVal v z = BSS[0] cnt = 101 cy(t, BSS[0]) BSS[0] 1 1 1 1 1 1 1 1 Majority voting 4 cycles cy(t + 8, BSS[1]) BSS[1] 0 0 0 0 0 0 0 0 1 1 1 1 1 1? 0 0 0 cy(t + 16, b[0]) b b b 0 0 0? out s = sender output, v = voted bit, z = receiver state Delay of 4 cycles from majority voting

Traversing Synchronization Edges Sender Ouput out s VotedVal v cy(t, BSS[0]) BSS[0] 1 1 1 1 1 1 1 1 Majority voting 4 cycles cy(t + 8, BSS[1]) BSS[1] 0 0 0 0 0 0 0 0 1 1 1 1 1 1? 0 0 0 cy(t + 16, b[0]) b b b 0 0 0? z = BSS[0] cnt = 101 cnt = 100 out s = sender output, v = voted bit, z = receiver state Delay of 4 cycles from majority voting Strobe at 100

Traversing Synchronization Edges Sender Ouput out s VotedVal v cy(t, BSS[0]) BSS[0] 1 1 1 1 1 1 1 1 Majority voting 4 cycles cy(t + 8, BSS[1]) BSS[1] 0 0 0 0 0 0 0 0 1 1 1 1 1 1? 0 0 0 cy(t + 16, b[0]) b b b 0 0 0? z = BSS[0] cnt = 101 cnt = 100 sync cnt = 011 cnt = 000 cnt = 100 At t + 13, sync is high (falling edge detected) Counter cnt reset to 000 Strobe at t + 18

Traversing Synchronization Edges Sender Ouput out s VotedVal v cy(t, BSS[0]) BSS[0] 1 1 1 1 1 1 1 1 Majority voting 4 cycles cy(t + 8, BSS[1]) BSS[1] 0 0 0 0 0 0 0 0 1 1 1 1 1 1? 0 0 0 cy(t + 16, b[0]) b b b 0 0 0? z = BSS[0] cnt = 101 cnt = 100 sync cnt = 011 cnt = 000 cnt = 100 At t + 13, sync is high (falling edge detected) Counter cnt reset to 000 Strobe at t + 18 Lemma 1: 15 to 18 cycles from t to second strobing point Assuming drift, jitter and metastability Proof by NuSMV and Isabelle/HOL CDC model: 1 or 2 unknown inputs (systematic) Unknown inputs are assumptions for NuSMV proof (automatic)

Sampling Good Values: Counter-Example Sender Ouput out s VotedVal v cy(t, BSS[0]) BSS[0] 1 1 1 1 1 1 1 1 Majority voting 4 cycles cy(t + 8, BSS[1]) 0 BSS[1] 0 0 0 0 0 0 0 1 1 1 1 1 1? 0 0 0 cy(t + 16, b[0]) b b b 0 0 0? z = BSS[0] cnt = 101 cnt = 100 sync cnt = 011 cnt = 000 cnt = 100 cy(t + 16, b[0]) b b b b b b b b b b b 0 0 0? b b b b b b? cnt = 100 cnt = 100

Sampling Good Values: Counter-Example Sender Ouput out s VotedVal v cy(t, BSS[0]) BSS[0] 1 1 1 1 1 1 1 1 Majority voting 4 cycles cy(t + 8, BSS[1]) BSS[1] 0 0 0 0 0 0 0 0 1 1 1 1 1 1? 0 0 0 cy(t + 16, b[0]) b b b 0 0 0? z = BSS[0] cnt = 101 cnt = 100 sync cnt = 011 cnt = 000 cnt = 100 cy(t + 16, b[0]) b b b b b b b b b b b 0 0 0 b b b b b b? Slow receiver One sample is missing cnt = 100 cnt = 100

Timing Correctness t k t l slot 0 slot 1... slot j slot n 1 c round i TSS FSS BSS byte... BSS byte FES 80 (m 1) + 16 82 + 16 + ǫ ν Transmission correctness theorem: For all bytes b, there exists a receiver cycle ν from which b is correctly sampled after 79 to 82 (receiver) cycles. Note: we have cy(ν, c + 80 (m 1) + 16) Timing theorem easily follows: Number of transmission cycles t = 32 + 80 (m 1) + 82 + ǫ Bound on maximum length of clock periods τ max = (1 + δ) τ ref Transmission time bounded by the following: idle (32 + 80 m + 2 + ǫ) (1 + δ) τ ref