Model Checking the FlexRay Physical Layer Protocol

Similar documents
Automated Formal Methods for Embedded Systems

FlexRay for Avionics: Automatic Verification with Parametric Physical Layers

Model Checking the FlexRay Physical Layer Protocol

ISO INTERNATIONAL STANDARD. Road vehicles FlexRay communications system Part 2: Data link layer specification

This document is a preview generated by EVS

CAN protocol enhancement

CAN in Space workshop

An Encapsulated Communication System for Integrated Architectures

Direct Link Networks: Building Blocks (2.1), Encoding (2.2), Framing (2.3)

FlexRay International Workshop. Protocol Overview

ECE 353 Lab 4. MIDI Receiver in Verilog. Professor Daniel Holcomb UMass Amherst Fall 2016

FlexRay controller. Author: Martin Paták

Various Emerging Time- Triggered Protocols for Driveby-Wire

Additional Slides (informative)

Links, clocks, optics and radios

Field buses (part 2): time triggered protocols

Distributed Systems (ICE 601) Fault Tolerance

Links. CS125 - mylinks 1 1/22/14

Sequential Circuit Design: Principle

Framing and Stuffing. Advanced Computer Networks

Organization. 5.1 Semiconductor Main Memory. William Stallings Computer Organization and Architecture 6th Edition

CS 43: Computer Networks Switches and LANs. Kevin Webb Swarthmore College December 5, 2017

FlexRay. Requirements Specification. Version 2.1

Lecture 3: Modulation & Layering"

FlexRay and Automotive Networking Future

Communication Networks for the Next-Generation Vehicles

LECTURE # 8. Bad Technology Flow control, error control, addressing is multiple Session and Presentation(EMPTY), Network and DL(Full)

An Introduction to FlexRay as an Industrial Network

Comparison of In-Vehicle Communication Protocols for Critical Applications

16 Time Triggered Protocol

Sequential Circuit Design: Principle

Laboratory Finite State Machines and Serial Communication

Discussion of Failure Mode Assumptions for IEEE 802.1Qbt

DS28CM00. I²C/SMBus Silicon Serial Number

The Timed Asynchronous Distributed System Model By Flaviu Cristian and Christof Fetzer

Simulation based Timing Analysis of FlexRay Communication at System Level. Stefan Buschmann Till Steinbach Franz Korf Thomas C.

Lecture 5: Data Link Layer Basics

SEE Tolerant Self-Calibrating Simple Fractional-N PLL

MicroBlaze TFTP Server User Guide

Chapter 39: Concepts of Time-Triggered Communication. Wenbo Qiao

RTL Power Estimation and Optimization

MMC-2 CD MODEL. Document Number R0 File name MM2-05r0.doc. Content: Clause 5 of SFF CD Model

Data Link Layer Overview

Help Volume Agilent Technologies. All rights reserved. Agilent E2485A Memory Expansion Interface

OUTLINE Introduction Power Components Dynamic Power Optimization Conclusions

Kun Sun, Peng Ning Cliff Wang An Liu, Yuzheng Zhou

The Flooding Time Synchronization Protocol

Tektronix DPO Demo 1 Board Instruction Manual

William Stallings Computer Organization and Architecture 6th Edition. Chapter 5 Internal Memory

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 18

CAN FD with Dynamic Multi-PDU-to-Frame Mapping

Chapter 5 Internal Memory

Embedded Systems. 8. Communication

AVB in Automotive Infotainment Networks

Troubleshooting Ethernet Problems with Your Oscilloscope APPLICATION NOTE

CSCI-1680 Link Layer I Rodrigo Fonseca

Data Link Layer Overview

RPLIDAR. Interface Protocol and Application Notes. Low Cost 360 Degree Laser Range Scanner. Applied to RPLIDAR A1 & A rev.1.

Using UART in radio data transmission with the CDP-02 module By Tomihiko Uchikawa

Today. Last Time. Motivation. CAN Bus. More about CAN. What is CAN?

CE3005: Computer Networks Laboratory 3 SNIFFING AND ANALYSING NETWORK PACKETS

FlexRay Requirements Specification

CS 344/444 Computer Network Fundamentals Final Exam Solutions Spring 2007

Lecture 6 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features

WiMOD LR Base Host Controller Interface

Sharif University of Technology, Tehran, Iran

COMP asynchronous buses April 5, 2016

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

Module 8 - Fault Tolerance

Redundant States in Sequential Circuits

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Serial Port Communication Module No: CS/ES/11 Quadrant 1 e-text

Amrita Vishwa Vidyapeetham. ES623 Networked Embedded Systems Answer Key

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

IP SLAs QFP Time Stamping

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

FlexRay - FlexRay Synchronization with CANoe as Gateway

Basics of UART Communication

CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 4. September 09 CMSC417 Set 4 1

Advantages and disadvantages

CAN with Flexible Data-Rate

Development of a CAN Slave Module with SystemC. Igor Sachs Shang Qihua

DS1676 Total Elapsed Time Recorder, Erasable

Keysight M8070A System Software for M8000 Series of BER Test Solutions

Data Link Layer Overview

ECE 4450:427/527 - Computer Networks Spring 2017

Optical Data Interface ODI-2.1 High Speed Data Formats Preliminary Specification. Revision Date

15-740/ Computer Architecture Lecture 19: Main Memory. Prof. Onur Mutlu Carnegie Mellon University

Distributed IMA with TTEthernet

ProgRock Operating manual _Pr1.01a_

Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their

Troubleshooting Ethernet Problems with Your Oscilloscope APPLICATION NOTE

Data Link Layer. Indian Institute of Technology Madras

CHAPTER 4 DATA COMMUNICATION MODES

Signals and Encoding

Module 6 STILL IMAGE COMPRESSION STANDARDS

Computer Systems Architecture I. CSE 560M Lecture 18 Guest Lecturer: Shakir James

Direct Link Networks. Framing. Lecture - Encoding & Framing 1. Problems. Areas for Discussion

Help Volume Agilent Technologies. All rights reserved. Agilent Technologies 16741A Logic Analyzer

Testing SyncE with Xena s Advanced Timing Test Modules

Transcription:

Model Checking the FlexRay Physical Layer Protocol Michael Gerke Reactive Systems Group Saarland University Germany 25.09.2013

If you hit the brakes...

... and they don t work:

Brakes should work!

Drive-by-Wire FlexRay

Drive-by-Wire FlexRay

FlexRay Bus Protocol FlexRay communication protocol for distributed components in cars used in BMW X 5 and BMW s 7 series for X-by-wire developed by: BMW, Bosch, Daimler, Freescale, General Motors, NXP Semiconductors, Volkswagen, et al.

FlexRay Network Node B Node C Node A Star 1A Star 2A Node D Node E Node F Node G

Focus: Physical Layer

Case Study: FlexRay Physical Layer Protocol Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten

Case Study: FlexRay Physical Layer Protocol Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten The only (but important) source of time in the model: the two oscillators

Why is Non-synchronized Hardware a Challenge? Volt tick sd PMIN high undef low tick sd PMAX Time Figure: Transition between voltage levels takes time.

Register Semantics PMIN HOLD τ PMAX SETUP clock(t) R in (t) X Y R out (t) X Ω Y PMIN SETUP PMAX HOLD Figure: Value of enabled register R over time t τ

Jitter Effects Sender Receiver 1 Tx 0 1 Rxx 0 1 2 3 4 5 6 7 8 wire delay and Rx omitted clock drift asynchronous communication delay variance signal changes take varying amouts of time unstable value during setup / hold error

Error Sources in Communication Scenario Sender Receiver R/S Flip-flop R/S Flip-flop R/S Flip-flop Bus Hardware Model Sources of error: jitter: clock drift variance in delay unstable value in sampling interval (setup/hold) glitches: bits flipped on the bus

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten

Bit Stream Format!!.,5-!! E!!.!.! Michael Gerke Verification Lecture 23 25.09.2013

Bit Stream Format!! E! E!!!.,5-!.!.! Michael Gerke Verification Lecture 23 25.09.2013

Bit Stream Format!! E! E!!!.,5-2 E! 2!.!.! Michael Gerke Verification Lecture 23 25.09.2013

Bit Stream Format!! E! E!!!.,5-2 E! 2 2!.!.! Michael Gerke Verification Lecture 23 25.09.2013

Bit Stream Format!!.,5-!! E! E! 2 E! 2 2 2 E! 2!.!.! Michael Gerke Verification Lecture 23 25.09.2013

Bit Stream Format!!.,5-!! E! E! 2 E! 2 2 2 E! 2 2!.!.! Michael Gerke Verification Lecture 23 25.09.2013

Bit Stream Format!!.,5-!! E! E! 2 E! 2 2 2 E! 2 2! E!!.!.! Michael Gerke Verification Lecture 23 25.09.2013

Bit Stream Format!!.,5-!! E! E! 2 E! 2 2 2 E! 2 2! E!!.!.! Michael Gerke Verification Lecture 23 25.09.2013

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: 1 =Bus: 1 1 1 1 1 1 1 1 Flatten: take majority of last 5 samples (voting window size 5) E.g.:... Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: 10 =Bus: 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 Flatten: take majority of last 5 samples (voting window size 5) E.g.:... Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... 1 1 1 1 1 = 1 Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... 1 1 1 1 1 0 = 1 Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... 1 1 1 1 1 0 0 = 1 Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... 1 1 1 1 1 0 0 0 = 0 Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... 1 1 1 1 1 0 0 0 0 = 0 Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... 1 1 1 1 1 0 0 0 0 1 = 0 Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... 1 1 1 1 1 0 0 0 0 1 0 = 0 Remove redundancy: pick 5 th voted value from each bit cell

Protocol Architecture Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Add redundancy: send each bit for 8 cycles (bit cell) Stream: Flatten: take majority of last 5 samples (voting window size 5) E.g.:... Remove redundancy: pick 5 th voted value from each bit cell

Overview: FlexRay Physical Layer Protocol Sender 1 byte Sent Message... 1 1 0 1 0 1 1 1... Sent Stream... 1 0 1 1 0 1 0 1 1 1 1 0... Bus... 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0... Voted Values... 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0... Strobing... 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8... Received Stream... 1 0 1 1 0 1 0 1 1 1 1 0... Received Message... 1 1 0 1 0 1 1 1... Receiver 1 byte

Why? Jitter and Glitch Correction! Sender 1 Tx 0 1 1 2 3 4 5 6 7 8 wire delay and Rx omitted Rxx glitch Receiver 0 1 voted value 1 2 3 4 5 6 7 8 0

FlexRay Error Resilience FlexRay......

FlexRay Error Resilience FlexRay......?......?......?

Modelling We compose our model from several components. We need to model: the hardware (with jitter) the FlexRay physical layer protocol the bit flips (glitches) W.l.o.g., it suffices to model one sender connected to one receiver.

Modeling Hardware: Parameterized Oscillator x CYCLE_MAX tick, x CYCLE_MIN, x := 0 Stable bus value y PMAX, Bus := new_value tick y PMAX Between thresholds Changing bus value y PMIN tick, y := 0 y PMIN, Bus := undef Figure: Model of the sender s oscillator and the bus, synchronizing on action tick. One clock for the oscillator, one clock for the time to reach the first and the second threshold. Parameterization allows for easy adjustment to different hardware.

Modeling Hardware: Parameterized, Clock Dependencies Stable bus value tick Changing bus value Oscillator tick x PMIN x CYCLE_MAX tick, x CYCLE_MIN, x := 0 x PMAX, Bus := new_value x PMAX x PMIN, Bus := undef Between thresholds Figure: Optimized model of the sender s oscillator and the bus, synchronizing on action tick. Here, we use just the clock needed to generate the tick action of the sender s oscillator, under the assumption that PMIN PMAX CYCLE_MIN holds.

Modeling: Sender / Receiver Partition partition model into sender / receiver just 2 clocks needed

Modeling Message Transfer: Message Format Reserved Bit Payload preamble indicator Null frame indicator Sync frame indicator Startup frame indicator Header CRC covered area Frame ID Payload length Header CRC Cycle count Data 1 Data 2 Data n CRC CRC CRC 11111 11 bits 7 bits Header Segment 11 bits 6 bits 0... 254 bytes Payload Segment 24 bits Trailer Segment Figure: Format of a message frame.

Modeling Message Transfer: The Hard Way payload := guess(), byte := 0, bit := 0, x := 0 x 0 msg := frame(payload) bit = 8 byte < len(msg) 1, bit := 0, byte ++ bit = 8 byte = len(msg) 1 tick, bit < 8, send(msg[byte][bit]), bit ++ Figure: Generating a message payload, encasing it in the frame format, and sending it.

Modeling Message Transfer: Use Nondeterminism tick, bit ++, send(0) bit := 0 bit 8 bit = 8 bit := 0 tick, bit ++, send(1) bit = 8 Figure: Abstracting from its actual length, contents and format.

One-way communication? Freely choose constant delays! Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Sender Receiver 1 Tx 0 1 Rxx 0 1 2 3 4 5 6 7 8 constant delay

One-way communication? Freely choose constant delays! Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten Sender Receiver 1 Tx 0 1 Rxx 0 1 2 3 4 5 6 7 8 constant delay 3

Time only counts at the bus Message Sender Assemble bit stream Add redundancy = Bus Message Receiver Check bit stream Remove redundancy Flatten

Abstract from time using order: Receiver Clock Model ReceiverCLK_0! y CYCLE_MIN y := 0 ReceiverCLK_3! y CYCLE_MAX y 0 ReceiverCLK_0! y := 0 ReceiverCLK_1! y CYCLE_MAX y 0 y 0 ReceiverCLK_2! Component B should be executed after component B: Synchronize B with "ReceiverCLK_i?" if j < i s.t. A synchronizes with "ReceiverCLK_j?".

Sampling from the bus ReceiverCLK_1? RxIn 2 Rx := RxIn WaitForClocktick ReceiverCLK_1? RxIn = 2 Rx := 1 ReceiverCLK_1? RxIn = 2 Rx := 0 2 is nondeterministically resolved to 1 or 0. RxIn: value seen by receiver Rx: value received

Modeling: Sampling at time t The bus should be stable in [t SETUP, t + HOLD]. The bus can be unstable in [tick sd + PMIN, tick sd + PMAX]. tick sd. t [t SETUP, t + HOLD].t / [tick sd + PMIN, tick sd + PMAX] tick sd.(t + HOLD < tick sd + PMIN) (t SETUP > tick sd + PMAX) tick sd.(t < tick sd + PMIN HOLD) (t > tick sd + PMAX + SETUP) tick sd.t / [tick sd + PMIN HOLD, tick sd + PMAX + SETUP] Add WIREDELAY = HOLD PMIN: tick sd.t / [tick sd +PMIN HOLD+WIREDELAY, tick sd +PMAX+SETUP+WIREDELAY] tick sd.t / [tick sd, tick sd + PMAX + SETUP + WIREDELAY]

Modeling: Sampling at time t The bus should be stable in [t SETUP, t + HOLD]. The bus can be unstable in [tick sd + PMIN, tick sd + PMAX]. tick sd. t [t SETUP, t + HOLD].t / [tick sd + PMIN, tick sd + PMAX] tick sd.(t + HOLD < tick sd + PMIN) (t SETUP > tick sd + PMAX) tick sd.(t < tick sd + PMIN HOLD) (t > tick sd + PMAX + SETUP) tick sd.t / [tick sd + PMIN HOLD, tick sd + PMAX + SETUP] Add WIREDELAY = HOLD PMIN: tick sd.t / [tick sd +PMIN HOLD+WIREDELAY, tick sd +PMAX+SETUP+WIREDELAY] tick sd.t / [tick sd, tick sd + PMAX + SETUP + WIREDELAY]

Modeling: Sampling at time t The bus should be stable in [t SETUP, t + HOLD]. The bus can be unstable in [tick sd + PMIN, tick sd + PMAX]. tick sd. t [t SETUP, t + HOLD].t / [tick sd + PMIN, tick sd + PMAX] tick sd.(t + HOLD < tick sd + PMIN) (t SETUP > tick sd + PMAX) tick sd.(t < tick sd + PMIN HOLD) (t > tick sd + PMAX + SETUP) tick sd.t / [tick sd + PMIN HOLD, tick sd + PMAX + SETUP] Add WIREDELAY = HOLD PMIN: tick sd.t / [tick sd +PMIN HOLD+WIREDELAY, tick sd +PMAX+SETUP+WIREDELAY] tick sd.t / [tick sd, tick sd + PMAX + SETUP + WIREDELAY]

Modeling: Sampling at time t The bus should be stable in [t SETUP, t + HOLD]. The bus can be unstable in [tick sd + PMIN, tick sd + PMAX]. tick sd. t [t SETUP, t + HOLD].t / [tick sd + PMIN, tick sd + PMAX] tick sd.(t + HOLD < tick sd + PMIN) (t SETUP > tick sd + PMAX) tick sd.(t < tick sd + PMIN HOLD) (t > tick sd + PMAX + SETUP) tick sd.t / [tick sd + PMIN HOLD, tick sd + PMAX + SETUP] Add WIREDELAY = HOLD PMIN: tick sd.t / [tick sd +PMIN HOLD+WIREDELAY, tick sd +PMAX+SETUP+WIREDELAY] tick sd.t / [tick sd, tick sd + PMAX + SETUP + WIREDELAY]

Modeling: Sampling at time t The bus should be stable in [t SETUP, t + HOLD]. The bus can be unstable in [tick sd + PMIN, tick sd + PMAX]. tick sd. t [t SETUP, t + HOLD].t / [tick sd + PMIN, tick sd + PMAX] tick sd.(t + HOLD < tick sd + PMIN) (t SETUP > tick sd + PMAX) tick sd.(t < tick sd + PMIN HOLD) (t > tick sd + PMAX + SETUP) tick sd.t / [tick sd + PMIN HOLD, tick sd + PMAX + SETUP] Add WIREDELAY = HOLD PMIN: tick sd.t / [tick sd +PMIN HOLD+WIREDELAY, tick sd +PMAX+SETUP+WIREDELAY] tick sd.t / [tick sd, tick sd + PMAX + SETUP + WIREDELAY]

Bus model StableHIGH SenderCLK_1? Tx = 1 SenderCLK_1? Tx = 0 volt := 2 x PMAX + SETUP + WIREDELAY volt := 1 UnstableHIGH x PMAX + SETUP + WIREDELAY SenderCLK_1? Tx = 1 volt := 2 UnstableLOW StableLOW x PMAX + SETUP + WIREDELAY x PMAX + SETUP + WIREDELAY volt := 0 SenderCLK_1? Tx = 0 volt: value of the bus, with 1=HIGH, 0=LOW, and 2=undefined Tx: value sent

Bit flips: Sample Glitch Model: 1 in (ed+1) ReceiverCLK_0? Lerr = ERRDIST s RxIn := volt ReceiverCLK_0? RxIn := volt Lerr++ Normal ReceiverCLK_0? Lerr < ERRDIST s RxIn := volt Lerr++ ReceiverCLK_0? Lerr = ERRDIST s RxIn := 2 Lerr := 0 Glitch ERRDIST s : minimum distance between two glitches Lerr: distance from the last error (if smaller ERRDIST s ) (initialized with ERRDIST s ) volt: value from the bus, with 1=HIGH, 0=LOW, and 2=undefined RxIn: value seen by receiver

Bit flips: Sample Glitch Model: 2 adjacent in (ed+2) Glitch2 ReceiverCLK_0? Lerr = ERRDIST s RxIn := volt ReceiverCLK_0? RxIn := volt Lerr++ ReceiverCLK_0? Normal ReceiverCLK_0? Lerr < ERRDIST s RxIn := volt Lerr++ ReceiverCLK_0? Lerr = ERRDIST s RxIn := 2 Lerr := 0 Glitch1 ERRDIST s : minimum distance between two glitches Lerr: distance from the last error (if smaller ERRDIST s ) (initialized with ERRDIST s ) volt: value from the bus, with 1=HIGH, 0=LOW, and 2=undefined RxIn: value seen by receiver

Bit flips: Sample Glitch Model: 2 arbitrary in (ed+1) ReceiverCLK_0? NLerr < ERRDIST s RxIn := volt Lerr++ NLerr++ ReceiverCLK_0? Lerr = ERRDIST s RxIn := volt Normal ReceiverCLK_0? Lerr < ERRDIST s NLerr = ERRDIST s RxIn := volt Lerr++ ReceiverCLK_0? NLerr < ERRDIST s RxIn := volt Lerr++ NLerr++ ReceiverCLK_0? NLerr = ERRDIST s RxIn := volt Lerr++ ReceiverCLK_0? Lerr = ERRDIST s RxIn := 2 Lerr := 0 ReceiverCLK_0? Lerr < ERRDIST s NLerr = ERRDIST s RxIn := 2 Lerr := 0 NLerr := Lerr + 1 Glitch ReceiverCLK_0? NLerr == ERRDIST s Lerr := 0 NLerr := 1 NLerr: distance from the second to last error (if smaller ERRDIST s ) (initialized with ERRDIST s )

Verifying Message Transfer: Use Nondeterminism tick sd, bit sd ++, send(1) bit sd := 0, pos sd := 0, pos stored := 1 bit sd 8 pos sd ++ pos stored := pos sd, bit stored := 1 bit sd = 8 bit sd := 0 tick sd, bit sd ++, send(0) bit sd 8 bit sd = 8 bit sd := 0 tick sd, bit sd ++, send(0) pos sd ++ tick sd, bit sd ++, send(1) bit sd = 8 bit sd 8 pos stored := pos sd, bit stored := 0 Figure: Sender model: nondeterministically choose a bit to store and store its position as well.

Verifying Message Transfer: Use Nondeterminism pos rc = pos stored, bit stored = 0 bit rc 8 pos rc = pos stored, bit stored = 1 Error tick rc, bit rc ++, received(1) bit rc := 0, pos rc := 0 pos rc pos stored, pos rc ++ bit rc = 8 bit rc := 0 tick rc, bit rc ++, received(0) bit rc 8 bit rc = 8 bit rc := 0 tick rc, bit rc ++, received(0) pos rc pos stored, pos rc ++ tick rc, bit rc ++, received(1) pos rc = pos stored, bit stored = 1 bit rc 8 pos rc = pos stored, bit stored = 0 Figure: Receiver model: check the bit received at the position of the stored bit.

Verifying Message Transfer: Use Nondeterminism bit sd 8 tick sd, bit sd ++, send(1) bit sd := 0, offset := 0, bit stored := 1 offset ++ bit stored := 1 bit sd = 8 bit sd := 0 tick sd, bit sd ++, send(0) bit sd 8 bit sd = 8 bit sd := 0 tick sd, bit sd ++, send(0) offset ++ tick sd, bit sd ++, send(1) bit sd = 8 bit stored := 0 bit sd 8 Figure: Sender model: store the number of bits in transit in offset.

Verifying Message Transfer: Use Nondeterminism offset = 1, bit stored = 0 bit rc 8 offset = 1, bit stored = 1 Error tick rc, bit rc ++, received(1) bit rc := 0 (offset 1 bit stored = 1), offset bit rc = 8 bit rc := 0 tick rc, bit rc ++, received(0) bit rc 8 bit rc = 8 bit rc := 0 tick rc, bit rc ++, received(0) (offset 1 bit stored = 1), offset tick rc, bit rc ++, received(1) offset = 1, bit stored = 1 bit rc 8 offset = 1, bit stored = 0 Figure: Receiver model: if a bit is stored, check the bit received with offset = 1).

Recall:FlexRay Error Resilience FlexRay......?......?......?

Glitch Model: Glitch Patterns The protocol guarantees tolerance for 1 glitch in every sequence of 4 consecutive samples (1 out of 4) 2 glitches in every sequence of 88 consecutive samples (2 out of 88) Note: one message 21.000 samples

Glitch Model: Glitch Patterns The protocol guarantees tolerance for 1 glitch in every sequence of 4 consecutive samples (1 out of 4) E.g.:...... 2 glitches in every sequence of 88 consecutive samples (2 out of 88) Note: one message 21.000 samples

Glitch Model: Glitch Patterns The protocol guarantees tolerance for 1 glitch in every sequence of 4 consecutive samples (1 out of 4) E.g.:...... 2 glitches in every sequence of 88 consecutive samples (2 out of 88) Note: one message 21.000 samples

Glitch Model: Glitch Patterns The protocol guarantees tolerance for 1 glitch in every sequence of 4 consecutive samples (1 out of 4) E.g.:...... 2 glitches in every sequence of 88 consecutive samples (2 out of 88) Note: one message 21.000 samples

Glitch Model: Glitch Patterns The protocol guarantees tolerance for 1 glitch in every sequence of 4 consecutive samples (1 out of 4) E.g.:...... 2 glitches in every sequence of 88 consecutive samples (2 out of 88) Note: one message 21.000 samples

Glitch Model: Glitch Patterns The protocol guarantees tolerance for 1 glitch in every sequence of 4 consecutive samples (1 out of 4) E.g.:...... 2 glitches in every sequence of 88 consecutive samples (2 out of 88) Note: one message 21.000 samples

Glitch Model: Glitch Patterns The protocol guarantees tolerance for 1 glitch in every sequence of 4 consecutive samples (1 out of 4) E.g.:...... 2 glitches in every sequence of 88 consecutive samples (2 out of 88) Note: one message 21.000 samples

Glitch Model: Glitch Patterns The protocol guarantees tolerance for 1 glitch in every sequence of 4 consecutive samples (1 out of 4) 2 glitches in every sequence of 88 consecutive samples (2 out of 88) Note: one message 21.000 samples

Glitch Model: Glitch Patterns The protocol guarantees tolerance for 1 glitch in every sequence of 4 consecutive samples (1 out of 4) 2 glitches in every sequence of 88 consecutive samples (2 out of 88) E.g.:...... Note: one message 21.000 samples

Glitch Tolerance vs. Voting Window Size Voting window size of 3, tolerates 1 glitch in every sequence of 3 consecutive samples. E.g.:...... 5, tolerates 1 glitch in every sequence of 4 consecutive samples. E.g.:...... 7, tolerates 1 glitch in every sequence of 5 consecutive samples. 9, tolerates 1 glitch in every sequence of 6 consecutive samples.

Glitch Tolerance vs. Voting Window Size Voting window size of 3, tolerates 1 glitch in every sequence of 3 consecutive samples. E.g.:...... 5, tolerates 1 glitch in every sequence of 4 consecutive samples. E.g.:...... 7, tolerates 1 glitch in every sequence of 5 consecutive samples. 9, tolerates 1 glitch in every sequence of 6 consecutive samples.

Glitch Tolerance vs. Voting Window Size Voting window size of 3, tolerates 1 glitch in every sequence of 3 consecutive samples. E.g.:...... 5, tolerates 1 glitch in every sequence of 4 consecutive samples. E.g.:...... 7, tolerates 1 glitch in every sequence of 5 consecutive samples. 9, tolerates 1 glitch in every sequence of 6 consecutive samples.

Glitch Tolerance vs. Voting Window Size Voting window size of 3, tolerates 1 glitch in every sequence of 3 consecutive samples. E.g.:...... 5, tolerates 1 glitch in every sequence of 4 consecutive samples. E.g.:...... 7, tolerates 1 glitch in every sequence of 5 consecutive samples. 9, tolerates 1 glitch in every sequence of 6 consecutive samples.

Glitch Tolerance vs. Voting Window Size Voting window size of 3, tolerates 1 glitch in every sequence of 3 consecutive samples. E.g.:...... 5, tolerates 1 glitch in every sequence of 4 consecutive samples. E.g.:...... 7, tolerates 1 glitch in every sequence of 5 consecutive samples. 9, tolerates 1 glitch in every sequence of 6 consecutive samples.

Glitch Tolerance vs. Voting Window Size Voting window size of 3, tolerates 1 glitch in every sequence of 3 consecutive samples. E.g.:...... 5, tolerates 1 glitch in every sequence of 4 consecutive samples. E.g.:...... 7, tolerates 1 glitch in every sequence of 5 consecutive samples. 9, tolerates 1 glitch in every sequence of 6 consecutive samples.

Bit flips: Real-Time Glitch Model: 1*Y during XX ReceiverCLK_0? RxIn = volt a := 0 RxIn := volt ReceiverCLK_0? Normal a > ERRDIST t SETUP HOLD A a := 0 RxIn := 2 A := false Glitch a < ERRDUR + SETUP + HOLD fresh clock a (clocks are always initialised with 0) A: flag saying there was no glitch so far (initialized with true) ERRDIST t : distance from the last error ERRDUR: maximal duration of an disturbance on the bus volt: value from the bus, with 1=HIGH, 0=LOW, and 2=undefined RxIn: value seen by receiver

Bit flips: Real-Time Glitch Model: 2*Y indep. during XX ReceiverCLK_0? RxIn = volt a := 0 RxIn := volt ReceiverCLK_0? Normal a > ERRDIST t SETUP HOLD A a := 0 RxIn := 2 A := false GlitchA a < ERRDUR + SETUP + HOLD b > ERRDIST t SETUP HOLD B b := 0 RxIn := 2 B := false b := 0 RxIn := volt GlitchB b < ERRDUR + SETUP + HOLD ReceiverCLK_0? fresh clocks a and b (clocks are always initialised with 0) A(B): flag saying there was no glitch A (glitch B) so far (initialized with true) ERRDIST t : distance from the last error volt: value from the bus, with 1=HIGH, 0=LOW, and 2=undefined RxIn: value seen by receiver

Parameter Exploration Parameter exploration using binary search: boundaries for variation of a single parameter (Voting window size 5) glitch tolerance delay variance (1 of 4),(2 at most),(short Real-Time Glitch (RTG)) 1.435ns 7.6075ns (2 (adj./ind.) of 88),(long RTG),(2 ind. short RTGs) 1.435ns 7.5700ns (1 at most) 1.435ns 12.020ns deviation of clock glitch tolerance from standard rate (1 of 4),(2 at most),(short RTG) 0.15% 0.46% (2 ind. of 88),(2 ind. short RTGs) 0.15% 0.40% (2 adj. of 88),(long RTG) 0.15% 0.45% (1 at most) 0.15% 1.09% (no glitches) 0.15% 1.74% (RTGs configured to be equivalent to the respective Sample Glitches)

Summary:Our Approach Model the physical layer protocol (it is interfacing with the hardware) To model effects happening in dense time, use extended timed automata. Parameterize the model. (especially hardware) Plug in an error model. (Simulate with UPPAALto debug the model and improve insight) Model check reachability of error state with UPPAAL. ( & Find error scenarios missed by testing very fast ) Explore the effect of changing a parameter.

Summary:Model Design Principles Separate the protocol into components. Abstract from time where order suffices. You need time? Ignore constant delays if communication is one-way only. Reduce the number of clocks by exploiting dependencies. Nondeterminism allows you to forget message information (content, length, format). Use a parameterized hardware model for easy adoption to different hardware.