ECE 720T5 Fall 2011 Cyber-Physical Systems Rodolfo Pellizzoni.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

System Integration and Performance
SPL/2010 Test-Driven Development (TDD) 1. SPL/
© 2004 Wayne Wolf Topics Task-level partitioning. Hardware/software partitioning.  Bus-based systems.
CMSC 611: Advanced Computer Architecture
The System-Level Simplex Architecture Stanley Bak Olugbemiga Adekunle Deepti Kumar Chivukula Mu Sun Marco Caccamo Lui Sha.
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
Timed Automata.
Model Checker In-The-Loop Flavio Lerda, Edmund M. Clarke Computer Science Department Jim Kapinski, Bruce H. Krogh Electrical & Computer Engineering MURI.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
ECE 720T5 Fall 2012 Cyber-Physical Systems Rodolfo Pellizzoni.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Fault Detection in a HW/SW CoDesign Environment Prepared by A. Gaye Soykök.
1 Presenter: Chien-Chih Chen. 2 An Assertion Library for On- Chip White-Box Verification at Run-Time On-Chip Verification of NoCs Using Assertion Processors.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Behavioral Design Outline –Design Specification –Behavioral Design –Behavioral Specification –Hardware Description Languages –Behavioral Simulation –Behavioral.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
G Robert Grimm New York University Extensibility: SPIN and exokernels.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Chapter 11 Operating Systems
November 18, 2004 Embedded System Design Flow Arkadeb Ghosal Alessandro Pinto Daniele Gasperini Alberto Sangiovanni-Vincentelli
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Principle of Functional Verification Chapter 1~3 Presenter : Fu-Ching Yang.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Database Management Systems (DBMS)
Copyrighted material John Tullis 8/13/2015 page 1 Blaze Software John Tullis DePaul Instructor
Presenter: Chi-Hung Lu 1. Problems Distributed applications are hard to validate Distribution of application state across many distinct execution environments.
System Design Chapter 8. Objectives  Understand the verification and validation of the analysis models.  Understand the transition from analysis to.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
ECE 720T5 Winter 2014 Cyber-Physical Systems Rodolfo Pellizzoni.
Rodolfo Pellizzoni, Patrick Meredith, Marco Caccamo and Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign Hardware.
A Simple Method for Extracting Models from Protocol Code David Lie, Andy Chou, Dawson Engler and David Dill Computer Systems Laboratory Stanford University.
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
1 Database Systems CS204 Lecture 21 Transaction Processing I Asma Ahmad FAST-NU April 7, 2011.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
Testing -- Part II. Testing The role of testing is to: w Locate errors that can then be fixed to produce a more reliable product w Design tests that systematically.
Dynamic Analysis of Multithreaded Java Programs Dr. Abhik Roychoudhury National University of Singapore.
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
I/O Computer Organization II 1 Interconnecting Components Need interconnections between – CPU, memory, I/O controllers Bus: shared communication channel.
Handling Mixed-Criticality in SoC- based Real-Time Embedded Systems Rodolfo Pellizzoni, Patrick Meredith, Min-Young Nam, Mu Sun, Marco Caccamo, Lui Sha.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
System-level power analysis and estimation September 20, 2006 Chong-Min Kyung.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Title 11/5/2000 eSimplex Architecture Using MaCS Insup Lee Oleg Sokolsky Moonjoo Kim Anirban Majumdar Sampath Kannan Mahesh Viswanathan Insik Shin and.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
IT3002 Computer Architecture
Grigore Rosu Founder, President and CEO Professor of Computer Science, University of Illinois
Dynamic Testing.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Efficient Software-Based Fault Isolation Authors: Robert Wahbe Steven Lucco Thomas E. Anderson Susan L. Graham Presenter: Gregory Netland.
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
Parallel Computing Presented by Justin Reschke
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
The Structuring of Systems Using Upcalls By David D. Clark Presented by Samuel Moffatt.
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Operating System Structure
Module 12: I/O Systems I/O hardware Application I/O Interface
RAID, Programmed I/O, Interrupt Driven I/O, DMA, Operating System
runtime verification Brief Overview Grigore Rosu
QNX Technology Overview
Operating System Concepts
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

ECE 720T5 Fall 2011 Cyber-Physical Systems Rodolfo Pellizzoni

/ 34 Topic Today: Verification and Monitoring Remember verification: ensuring that a subsystem (or step in the design) meets the objectives for that subsystem, i.e. it does what we want it to do. How do verify a system/subsystem? –(Exhaustive) testing –Formal verification 2

/ 34 Formal Verification: Key Issues Modeling –Formal verification verifies a model of the system, not the system implementation! –What happens if a subsystem developer does not provide a model? –How can different models (ex: differential equations and automata) interact? Complexity –Most applicable techniques scale poorly – allows only for verification of limited-scale subsystems. 3

/ 34 An Alternative Solution: Run-Time Monitoring Divide the system is a set of simple, verifiable safety-critical components and a set of complex, untrusted components. A formal requirement specification is attached to each unverified component. The specification acts as a certificate: if the component behaves according to the specification, the system remain safe. At run-time, we monitor (check) the actual component behavior against its requirement specification expressed as a set of properties. If a requirement violation is detected, we perform a recovery action to restore the system to a safe state. Key idea: it is simpler to check the certificate that to verify the inner working of the unverified component. 4

/ 34 The Big Picture: Event-Based Monitoring 5 Event Generator E1 - - E2 E3 E t Monitor Handler (Recovery) Violation / Validation Event Specification Formula 1.The system to be monitored (HW/SW) 2. User specifies a set of events. Ex: a specified variable is modified 3. Event Generator generates a trace of observed events over time. 4. User specifies a formula using defined events. Ex: (E1 E2) * 5. Monitor checks if formula is validated / violated based on event trace. 6. A recovery handler is called if a validation / violation is detected. System

/ 34 Monitoring Overhead Two main issues: 1.How do we generate the events? Answer – architecture specific. 2.Where do we run the monitors? Most available frameworks use software-based solutions. –Event generation hooks are inserted by the compiler into the code. –Monitors are run in SW either on the same processor or a separate processor. Problem: the overhead is typically not predictable – how many events gets generated? 6

/ 34 Predictable Monitoring Solutions Sampling-based monitoring –Instead of running the monitor every time an event is generated, sample the system periodically. –Analysis is required to ensure that the sampling happens often enough to capture the properties of interest. Hardware-base monitoring –Required for HW components with no corresponding SW code –Run both the event generator and the monitors in HW –Potentially zero timing overhead (if done right) 7

Sampling-based Runtime Verification 8

/ 34 Sampling-based Runtime Verification Key ideas: –Build a CFG for the program –To catch a property violation, we need to be able to reconstruct the state of the system (based on variables of interest) at all times. –Solution: set the minimum sampling time as the minimum best-case computation time between writes to variables of interest –If the computed sampling time is too short, then introduce auxiliary variables to store values – equivalent to removing writes from the CFG –Use an ILP formulation to determine minimum number of auxiliary variables to satisfy sampling time constraint. 9

/ 34 Sampling-based Runtime Verification 10 ERROR! We lost the first write. Write X Save X in aux memory. Write X Save X in aux memory. Write X t SAMPLE

/ 34 Sampling-based Runtime Verification 11 Write X Save X in aux memory. Write X Save X in aux memory. Write X Save X in aux memory. Write X Save X in aux memory. Write X t SAMPLE OK! We can recover the first write.

/ 34 CFG and Transformations 12

/ 34 Results: Dijkstra 13

/ 34 Results: Memory Usage and Execution Time 14

Hardware-based Runtime Monitoring 15

/ 34 HW MoP Example: Mixed-criticality design flow for Systems-on-Chip based on the MOP (Monitored-Oriented Programming) Framework (Illinois) –Decouples event specification (architecture specific) from formula specification (formal language specific). –Automatically generated monitors in C, Java, VHDL Main idea: –Designer provides a functional specification detailing communication among functions. –Functional components are mapped on top of architectural components. –The mapping creates the certificate. –HW wrappers enforce the certificate. 16

/ 34 Process Memory SW Processor (CPU) SW Processor (CPU) HW Processor (Custom Logic) HW Processor (Custom Logic) Bus Thread Process Thread Data Mapping

/ 34 Medical Pacemaker. HW/SW partitioning preserves correctness of interaction between base pacing and rate adaptation. S. Bak, M. Caccamo et al.: The System-Level Simplex Architecture for Improved Real-Time Embedded System Safety, RTAS‘09 Case Study

/ 34 Process Logic HW Wrapper Control Module Control Module Communication Scheduler Frame Generator Manually written Designer specified Automatically generated External Memory (SRAM) CPU (uBlaze) Instruction Scratchpad Process Scheduler Monitoring Engine Process 1 Code Process N Code Control Module CPU Scheduler Monitoring Engine.. Power Manager Interface Module Data Scratchpad Interface Module OS Code Memory Controller Communication Interconnection Data Scratchpad CPU Wrapper clk_en Provided IP frame_signal frame_grant Wrappers composed of Interface Module and Control Module. HW Wrappers provided with data scratchpad. CPU Wrappers also provided with instruction scratchpad. Component Implementation

/ 34 All I/O communication by the processor is mediated by the interface module. Provides two types of communication services: –Message passing through FIFO queues –Shared memory through DMA. Processor Interface Data Scratchpad Communication Interface DMA engine Monitoring signals frame_grant Message Path FIFO Queues Completion Queue Request Queue Transmission Queue Reception PathCommand Path communication clock system_clk proc_clk Interface Module

/ 34 The Big Picture, Revisited Event Generator E1 - - E2 E3 E t Monitor Handler (Recovery) Violation / Validation Event Specification Formula 1.All communication goes through the interface module 2. Certificate specifies a set of events. Ex: write in logbuffer value in Event Generator generates a trace of observed events over time. 4. Certificate specifies a formula in ERE or PTLTL using events. Ex: (E1 E2) * 5. Monitor checks if formula is validated / violated based on event trace. 6. User written handler performs recovery if a validation / violation is detected.

/ 34 The Big Picture, Revisited Event Generator E1 - - E2 E3 E t Monitor Handler (Recovery) Violation / Validation Event Specification Formula : specified in certificate : synthesized by tools

/ 34 Monitoring Logic Four possible recovery actions: –Reject a transmission (reads can not cause side effects). –Stop the process. –Reset the process. –Send a word on the bus. 23

/ 34 Case Study: Safe Programmer Behavior Programmer updates critical parameters in both the Pacer and Rate Adapter processes. Parameter updates follows a commit protocol: –Programmer sends parameters followed by check command. –Pacer and Rate Adapter provides success / failure reply. –If both are successful, Programmer sends commit command. Problem: Programmer is an unverified process. It could crash after sending the commit to one process only. Solution: commit sent by monitor. 24

/ 34 SendPacerCommit Property 25 Events capture check/commit commands and success/failure replies at the Programmer. Success received from Pacer and Rate Adapter… … and I have not received 2 Pacer success in a row… … and I have received a Rate Adapter success since last failure. If property becomes true, send commit to Pacer.

Cyberphysical System Runtime Verification 26

/ 34 Simplex Model Run-time verification for Control Systems. Under normal conditions, run a complex controller. If the complex controller fails, switch to a simpler, verified one. 27

/ 34 Model: Hybrid Automata Similar to timed automata + continuous state –Discrete states and transitions –Timers, guards on transitions, invariants on states –New: continuous-state variables (ex: position, velocity, …) –New: dynamic in each state (differential equations) 28

/ 34 Model: Hybrid Automata Similar to timed automata + continuous state –Discrete states and transitions –Timers, guards on transitions, invariants on states –New: continuous-state variables (ex: position, velocity, …) –New: dynamic in each state (differential equations) 29

/ 34 How does it work? Discretize the continuous state space. From each discretized state space, compute the set of all reachable states in Delta time. 30

/ 34 How does it work? Discretize the continuous state space. From each discretized state space, compute the set of all reachable states in Delta time. 31

/ 34 How does it work? Discretize the continuous state space. From each discretized state space, compute the set of all reachable states in Delta time. 32

/ 34 Model Checking the System Result: we reduce the model to a discrete system (automata). –The automata does not need to keep implicit track of time – time is encoded in the transition overapproximation. We can then apply standard model checking to check that safety is guaranteed – the system can never reach an unsafe state. There are some constraints on the modeled dynamics… –Most importantly, no cyclic dependencies among variables in the dynamic of the system modeled by dx/dt = F(x). –Can you think of a case where this is violated? –Follow-up paper solves the problem… 33

/ 34 Case Study Autonomous off-road vehicle. John Deere is largest manufacturer of agricultural machinery. Over 30 parameters in the vehicle model. Goal: avoid roll-over. Automatic generation of Decision Module in VHDL. 34